Commit 6d174e63 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.5.1'

parents 040e5953 343d10e4
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="10500" id="net.sumaris.app" version="1.5.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="10501" id="net.sumaris.app" version="1.5.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>SUMARiS</name>
<description>Halieutic data capture</description>
<author email="contact@e-is.pro" href="http://www.e-is.pro">Environmental Information Systems</author>
......
......@@ -15,7 +15,7 @@ if [[ "_$INSTALL_DIR" == "_" ]]; then
fi
latest_version() {
echo "1.5.0" #lastest
echo "1.5.1" #lastest
}
api_release_url() {
......
{
"name": "sumaris-app",
"description": "SUMARiS app",
"version": "1.5.0",
"version": "1.5.1",
"author": "contact@e-is.pro",
"license": "AGPL-3.0",
"readmeFilename": "README.md",
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit} from '@angular/core';
import {ModalController} from '@ionic/angular';
import {Subscription, timer} from 'rxjs';
import {Subscription} from 'rxjs';
import {Configuration} from '../services/model/config.model';
import {ConfigService} from '../services/config.service';
import {fadeInAnimation, isNotEmptyArray, isNotNilOrBlank, slideUpDownAnimation} from "../../shared/shared.module";
import {
fadeInAnimation,
isNilOrBlank,
isNotEmptyArray,
isNotNilOrBlank,
slideUpDownAnimation
} from "../../shared/shared.module";
import {PlatformService} from "../services/platform.service";
import {distinctUntilChanged, filter, map, mergeMap, tap} from "rxjs/operators";
import {distinctUntilChanged, map} from "rxjs/operators";
import {environment} from "../../../environments/environment";
import {NetworkService} from "../services/network.service";
import {ConfigOptions} from "../services/config/core.config";
......@@ -69,11 +75,13 @@ export class NetworkStatusCard implements OnInit, OnDestroy {
.subscribe(config => {
console.info("[network-status] Checking if upgrade or install is need...");
const installLinks = this.getAllInstallLinks(config);
// Check for upgrade
this.updateLinks = this.getCompatibleUpgradeLinks(config);
this.updateLinks = this.getCompatibleUpgradeLinks(installLinks, config);
// Check for install links (if no upgrade need)
this.installLinks = !this.updateLinks && this.getCompatibleInstallLinks(config);
this.installLinks = !this.updateLinks && this.getCompatibleInstallLinks(installLinks);
setTimeout(() => {
this.loading = false;
......@@ -140,20 +148,20 @@ export class NetworkStatusCard implements OnInit, OnDestroy {
/* -- protected method -- */
private getCompatibleInstallLinks(config: Configuration): InstallAppLink[] {
const links = this.getAllInstallLinks(config)
private getCompatibleInstallLinks(installLinks: InstallAppLink[]): InstallAppLink[] {
const links = installLinks
.filter(link => this.platform.is('mobileweb') || (!link.platform ||  this.platform.is(link.platform)));
return isNotEmptyArray(links) ? links : undefined;
}
private getCompatibleUpgradeLinks(config: Configuration): InstallAppLink[] {
private getCompatibleUpgradeLinks(installLinks: InstallAppLink[], config: Configuration): InstallAppLink[] {
const appMinVersion = config.getProperty(ConfigOptions.APP_MIN_VERSION);
const needUpgrade = appMinVersion && !VersionUtils.isCompatible(appMinVersion, environment.version);
if (!needUpgrade) return undefined;
const upgradeLinks = this.getAllInstallLinks(config)
const upgradeLinks = installLinks
.filter(link => this.platform.is('mobileweb') || (link.platform &&  this.platform.is(link.platform)));
// Use min version as default version
......@@ -172,7 +180,7 @@ export class NetworkStatusCard implements OnInit, OnDestroy {
let url = config.getProperty(ConfigOptions.ANDROID_INSTALL_URL);
const name: string = isNotNilOrBlank(url) && config.label || environment.defaultAppName || 'SUMARiS';
let version;
if (isNotNilOrBlank(url)) {
if (isNilOrBlank(url)) {
url = environment.defaultAndroidInstallUrl || null;
}
result.push({ name, url, platform: 'android', version });
......
......@@ -2,7 +2,7 @@
"name": "ADAP",
"short_name": "ADAP",
"manifest_version": 1,
"version": "1.5.0",
"version": "1.5.1",
"default_locale": "fr",
"description": "ADAP App.",
"icons": [{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment