Commit b8c1986a authored by PECQUOT's avatar PECQUOT
Browse files

Merge branch 'release/1.3.5-alpha2'

parents 2627e853 a45ae101
......@@ -30,6 +30,7 @@ plugins/
www/
src/app/**/*.js
$RECYCLE.BIN/
scripts/gradle*.zip
.DS_Store
.directory
......
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="10305" id="net.sumaris.app" version="1.3.5-alpha1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="10305" id="net.sumaris.app" version="1.3.5-alpha2" 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.3.5-alpha1" #lastest
echo "1.3.5-alpha2" #lastest
}
api_release_url() {
......
{
"name": "sumaris-app",
"description": "SUMARiS app",
"version": "1.3.5-alpha1",
"version": "1.3.5-alpha2",
"author": "contact@e-is.pro",
"license": "AGPL-3.0",
"readmeFilename": "README.md",
......@@ -17,7 +17,7 @@
"build.prod": "node --max-old-space-size=8192 ./node_modules/@angular/cli/bin/ng build --prod --aot && npm run build.i18n",
"build.android": "ionic cordova build android",
"build.android.prod": "ionic cordova build android --prod --release",
"build.dev": "node --max-old-space-size=8192 ./node_modules/@angular/cli/bin/ng ng build --configuration=dev && lite-server --baseDir=\"www\"",
"build.dev": "node --max-old-space-size=8192 ./node_modules/@angular/cli/bin/ng build --configuration=dev && lite-server --baseDir=\"www\"",
"build.i18n": "node scripts/build-i18n.js",
"test": "npm run ng test",
"lint": "npm run ng lint",
......@@ -192,4 +192,4 @@
"node": ">= 10.20.0",
"npm": ">= 6.14.4"
}
}
}
\ No newline at end of file
......@@ -8,9 +8,7 @@ fi;
# Preparing Android environment
. ${PROJECT_DIR}/scripts/env-android.sh
if [[ $? -ne 0 ]]; then
exit 1
fi
[[ $? -ne 0 ]] && exit 1
cd ${PROJECT_DIR}
......
......@@ -70,14 +70,14 @@ if [[ "_" == "_${JAVA_HOME}" ]]; then
fi
# Check Android SDK root path
if [[ "_" == "_${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then
if [[ -d "${ANDROID_ALTERNATIVE_SDK_ROOT}" ]]; then
export ANDROID_SDK_ROOT="${ANDROID_ALTERNATIVE_SDK_ROOT}"
else
echo "Please set env variable ANDROID_SDK_ROOT to an existing directory"
exit 1
fi
fi
#if [[ "_" == "_${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then
# if [[ -d "${ANDROID_ALTERNATIVE_SDK_ROOT}" ]]; then
# export ANDROID_SDK_ROOT="${ANDROID_ALTERNATIVE_SDK_ROOT}"
# else
# echo "Please set env variable ANDROID_SDK_ROOT to an existing directory"
# exit 1
# fi
#fi
# Add Java, Android SDK tools to path
PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:${GRADLE_HOME}/bin:${JAVA_HOME}/bin$:$PATH
......@@ -100,6 +100,9 @@ if [[ -d "${NVM_DIR}" ]]; then
if [[ $? -ne 0 ]]; then
nvm install ${NODE_VERSION}
[[ $? -ne 0 ]] && exit 1
# Switch to expected version
nvm use ${NODE_VERSION}
[[ $? -ne 0 ]] && exit 1
fi
else
echo "nvm (Node version manager) not found (directory ${NVM_DIR} not found)."
......
......@@ -8,9 +8,7 @@ fi;
# Preparing Android environment
. ${PROJECT_DIR}/scripts/env-global.sh
if [[ $? -ne 0 ]]; then
exit 1
fi
[[ $? -ne 0 ]] && exit 1
cd ${PROJECT_DIR}
......@@ -19,12 +17,8 @@ npm install -g ionic@latest
echo "Updating Cordova..."
npm update -g cordova@latest
if [[ $? -ne 0 ]]; then
exit 1
fi
[[ $? -ne 0 ]] && exit 1
echo "Updating Cordova plugins..."
ionic cordova platform update android --save
if [[ $? -ne 0 ]]; then
exit 1
fi
[[ $? -ne 0 ]] && exit 1
......@@ -8,9 +8,7 @@ fi;
# Preparing Android environment
. ${PROJECT_DIR}/scripts/env-android.sh
if [[ $? -ne 0 ]]; then
exit 1
fi
[[ $? -ne 0 ]] && exit 1
cd ${PROJECT_DIR}
......
......@@ -39,12 +39,13 @@ if [[ ! "_$release_description" == "_" ]]; then
description="$description : $release_description"
fi
# finishing release
cd $PROJECT_DIR
rm src/assets/i18n/*-${version}.json
git add package.json src/assets/manifest.json config.xml install.sh
git commit -m "$description"
git flow release finish -F -p -n "$version"
if [[ $? -ne 0 ]]; then
exit 1
fi
# finishing release with:
# -F: fetch master & develop before
# -n: don't tag (github.sh already do it)
# -m: use default message
# -p: push all tags after finish
git flow release finish -F -p -n -m "$version"
......@@ -18,6 +18,20 @@ version=$2
androidVersion=$3
release_description=$4
# Check version format
if [[ ! $task =~ ^(pre|rel)$ || ! $version =~ ^[0-9]+.[0-9]+.[0-9]+(-(alpha|beta|rc)[0-9]+)?$ || ! $androidVersion =~ ^[0-9]+$ ]]; then
echo "Wrong version format"
echo "Usage:"
echo " > ./release-gitflow.sh [pre|rel] <version> <android-version> <release_description>"
echo "with:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
echo " - version: x.y.z"
echo " - android-version: nnn"
echo " - release_description: a comment on release"
exit 1
fi
### Control that the script is run on `dev` branch
resumeRelease=0
branch=`git rev-parse --abbrev-ref HEAD`
......@@ -51,20 +65,6 @@ if [[ "_$currentAndroid" == "_" ]]; then
fi
echo "Current Android version: $currentAndroid"
# Check version format
if [[ ! $task =~ ^(pre|rel)$ || ! $version =~ ^[0-9]+.[0-9]+.[0-9]+(-(alpha|beta|rc)[0-9]+)?$ || ! $androidVersion =~ ^[0-9]+$ ]]; then
echo "Wrong version format"
echo "Usage:"
echo " > ./release-gitflow.sh [pre|rel] <version> <android-version> <release_description>"
echo "with:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
echo " - version: x.y.z"
echo " - android-version: nnn"
echo " - release_description: a comment on release"
exit 1
fi
echo "**********************************"
if [[ $resumeRelease = 0 ]]
then
......@@ -79,10 +79,11 @@ echo "**********************************"
if [[ $resumeRelease = 0 ]]
then
read -r -p "Is these new versions correct ? [y/N] " response
response=${response,,} # tolower
[[ ! "$response" =~ ^(yes|y)$ ]] && exit 1
git flow release start "$version"
if [[ $? -ne 0 ]]; then
exit 1
fi
[[ $? -ne 0 ]] && exit 1
fi
case "$task" in
......
......@@ -16,6 +16,7 @@ import {PlatformService} from "./platform.service";
import {EntityServiceLoadOptions} from "../../shared/shared.module";
import {ConfigOptions} from "./config/core.config";
import {SoftwareService} from "../../referential/services/software.service";
import {LocationLevelIds} from "../../referential/services/model/model.enum";
const CONFIGURATION_STORAGE_KEY = "configuration";
......@@ -472,6 +473,13 @@ export class ConfigService extends SoftwareService<Configuration> {
private overrideEnums(config: Configuration) {
console.log("[config] Overriding model enumerations...");
// Location Levels
LocationLevelIds.COUNTRY = config.getProperty(ConfigOptions.LOCATION_LEVEL_ID_COUNTRY);
LocationLevelIds.PORT = config.getProperty(ConfigOptions.LOCATION_LEVEL_ID_PORT);
LocationLevelIds.AUCTION = config.getProperty(ConfigOptions.LOCATION_LEVEL_ID_AUCTION);
LocationLevelIds.SEA_AREA = config.getProperty(ConfigOptions.LOCATION_LEVEL_ID_SEA_AREA);
}
}
......
......@@ -5,6 +5,7 @@ import {FormFieldDefinitionMap, FormFieldValue} from "../../../shared/form/field
import {StatusIds} from "../model/model.enum";
import {PRIORITIZED_USER_PROFILES} from "../model/person.model";
import {Locales} from "../model/settings.model";
import {LocationLevelIds} from "../../../referential/services/model/model.enum";
export const ConfigOptions: FormFieldDefinitionMap = Object.freeze({
LOGO: {
......@@ -147,5 +148,29 @@ export const ConfigOptions: FormFieldDefinitionMap = Object.freeze({
key: 'sumaris.android.install.url',
label: 'CONFIGURATION.OPTIONS.ANDROID_INSTALL_URL',
type: 'string'
}
},
LOCATION_LEVEL_ID_COUNTRY: {
key: 'sumaris.locationLevel.country',
label: 'CONFIGURATION.OPTIONS.LOCATION_LEVEL_ID_COUNTRY',
type: 'integer',
defaultValue: LocationLevelIds.COUNTRY
},
LOCATION_LEVEL_ID_PORT: {
key: 'sumaris.locationLevel.port',
label: 'CONFIGURATION.OPTIONS.LOCATION_LEVEL_ID_PORT',
type: 'integer',
defaultValue: LocationLevelIds.PORT
},
LOCATION_LEVEL_ID_AUCTION: {
key: 'sumaris.locationLevel.auction',
label: 'CONFIGURATION.OPTIONS.LOCATION_LEVEL_ID_AUCTION',
type: 'integer',
defaultValue: LocationLevelIds.AUCTION
},
LOCATION_LEVEL_ID_SEA_AREA: {
key: 'sumaris.locationLevel.sea_area',
label: 'CONFIGURATION.OPTIONS.LOCATION_LEVEL_ID_SEA_AREA',
type: 'integer',
defaultValue: LocationLevelIds.SEA_AREA
},
});
import {FormFieldDefinitionMap} from "../../../shared/form/field.model";
import {LocationLevelIds} from "../model/model.enum";
export type LandingEditor = 'landing' | 'control' | 'trip';
export const ProgramProperties: FormFieldDefinitionMap = Object.freeze({
......@@ -199,6 +198,12 @@ export const ProgramProperties: FormFieldDefinitionMap = Object.freeze({
defaultValue: "7",
type: 'integer'
},
OBSERVED_LOCATION_CREATE_VESSEL_ENABLE: {
key: 'sumaris.observedLocation.createVessel.enable',
label: "PROGRAM.OPTIONS.OBSERVED_LOCATION_CREATE_VESSEL_ENABLE",
defaultValue: "false",
type: 'boolean'
},
// Landing
LANDING_EDITOR: {
......
// TODO BL: gérer pour etre dynamique (=6 pour le SIH)
// LP 17/08/2020 : Location level are overridden in ConfigService.overrideEnums
export const LocationLevelIds = {
COUNTRY: 1,
PORT: 2, // TODO SFA=6 | SUMARiS=2
SEA_AREA: 7,
AUCTION: 3
PORT: 2,
AUCTION: 3,
SEA_AREA: 4
};
export const GearLevelIds = {
......
import {Moment} from "moment";
import {ReferentialRef} from "../../../core/services/model/referential.model";
import {ReferentialRef, ReferentialUtils} from "../../../core/services/model/referential.model";
import {
fromDateISOString,
isNil,
isNil, isNilOrBlank,
isNotNil,
isNotNilOrNaN,
joinPropertiesPath,
......@@ -85,4 +85,8 @@ export abstract class PmfmValueUtils {
throw new Error("Unknown pmfm's type: " + pmfm.type);
}
}
static isEmpty(value: PmfmValue | any) {
return isNilOrBlank(value) || ReferentialUtils.isEmpty(value);
}
}
......@@ -28,7 +28,7 @@ export class VesselSnapshot extends Entity<VesselSnapshot> {
return res;
}
static fromVessel(source: Vessel): VesselSnapshot {
static fromVessel(source: Vessel | any): VesselSnapshot {
if (!source) return undefined;
const target = new VesselSnapshot();
target.fromObject({
......
import {
Cloneable,
Department,
Entity,
EntityAsObjectOptions,
entityToString,
EntityUtils,
fromDateISOString,
isNil,
isNotNil,
joinPropertiesPath,
Person,
PropertiesMap,
Referential,
ReferentialRef,
referentialToString,
StatusIds,
toDateISOString
} from "../../../core/core.module";
import {Moment} from "moment/moment";
import {FormFieldDefinition, FormFieldDefinitionMap} from "../../../shared/form/field.model";
import {TaxonGroupRef, TaxonNameRef} from "./taxon.model";
import {isNilOrBlank, isNotNilOrNaN, toNumber} from "../../../shared/functions";
import {PredefinedColors} from "@ionic/core";
import {Pmfm, PmfmType} from "./pmfm.model";
import {IEntity} from "../../../core/services/model/entity.model";
import {isNilOrBlank} from "../../../shared/functions";
import {
MINIFY_OPTIONS, NOT_MINIFY_OPTIONS,
NOT_MINIFY_OPTIONS,
ReferentialAsObjectOptions,
ReferentialUtils
} from "../../../core/services/model/referential.model";
......
......@@ -13,6 +13,7 @@
<div class="slides-container" [class.hidden]="!showSlides">
<ion-slides #slides
[options]="slidesOptions"
(ionSlidesDidLoad)="slidesLoaded()"
(ionSlideReachStart)="reachStart(true)"
(ionSlideReachEnd)="reachEnd(true)"
......
......@@ -54,6 +54,10 @@ export class MatSwipeField implements OnInit, InputElement, OnDestroy, ControlVa
$items = new BehaviorSubject<any[]>(undefined);
$loaded = new BehaviorSubject<boolean>(false);
slidesOptions: {
speed: 100; // FIXME: seems it's not working
};
@Input() logPrefix = "[mat-swipe-field]";
@Input() formControl: FormControl;
......
<form class="form-container" [formGroup]="form" (ngSubmit)="doSubmit($event)">
<ion-item *ngIf="error && showError" hidden-xs hidden-sm hidden-mobile lines="none">
<ion-item *ngIf="error && showError" visible-xs visible-sm visible-mobile lines="none">
<ion-icon color="danger" slot="start" name="alert"></ion-icon>
<ion-label color="danger" [innerHTML]="error|translate"></ion-label>
</ion-item>
<mat-menu #optionsMenu="matMenu" xPosition="after">
<ng-template matMenuContent let-activity="activity" let-index="index">
<button mat-menu-item
[title]="'COMMON.BTN_EDIT'|translate" (click)="openTrip(activity)"
[disabled]="!activity || !activity.tripId"
>
<ion-icon name="boat" slot="icon-only"></ion-icon>
<ion-label translate>AGGREGATED_LANDING.OPEN_TRIP</ion-label>
</button>
<button mat-menu-item
[title]="'COMMON.BTN_DELETE'|translate" (click)="removeActivity(index)">
<mat-icon>delete</mat-icon>
<ion-label translate>COMMON.BTN_DELETE</ion-label>
</button>
</ng-template>
</mat-menu>
<ion-grid class="ion-padding">
<ion-row>
......@@ -23,6 +44,28 @@
<ion-row class="ion-padding-top">
<ion-col>
<ion-card *ngFor="let activityForm of activitiesForm.controls; index as i; first as first">
<ion-card-header>
<mat-toolbar>
<ion-label>{{'AGGREGATED_LANDING.ACTIVITY' | translate: {rankOrder: activityForm.value.rankOrder} }}</ion-label>
<ion-item *ngIf="error && showError" hidden-xs hidden-sm hidden-mobile lines="none">
<ion-icon color="danger" slot="start" name="alert"></ion-icon>
<ion-label color="danger" [innerHTML]="error|translate"></ion-label>
</ion-item>
<div class="toolbar-spacer"></div>
<button mat-icon-button
[title]="'COMMON.BTN_OPTIONS'|translate"
[matMenuTriggerFor]="optionsMenu"
[matMenuTriggerData]="{index: i, activity: activities[i]}"
>
<mat-icon>more_vert</mat-icon>
</button>
</mat-toolbar>
</ion-card-header>
<ion-card-content>
<app-vessel-activity-form #activityForm
[form]="activityForm"
......@@ -30,7 +73,6 @@
[program]="program"
[acquisitionLevel]="acquisitionLevel"
>
</app-vessel-activity-form>
</ion-card-content>
</ion-card>
......
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