Commit 36ba7f80 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.4.0'

parents b8c1986a 034a395a
......@@ -183,11 +183,6 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"./src/global.scss",
"./node_modules/leaflet/dist/leaflet.css"
],
"scripts": [],
"assets": [
{
......@@ -208,7 +203,13 @@
"includePaths": [
"src/theme"
]
}
},
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test.ts"
}
]
},
"configurations": {
"ci": {
......
<?xml version='1.0' encoding='utf-8'?>
<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">
<widget android-versionCode="10400" id="net.sumaris.app" version="1.4.0" 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>
......@@ -95,4 +95,5 @@
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.1" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
<plugin name="cordova-plugin-camera" spec="^4.0.3" />
<plugin name="cordova-sqlite-storage" spec="^3.2.0" />
</widget>
......@@ -15,7 +15,7 @@ if [[ "_$INSTALL_DIR" == "_" ]]; then
fi
latest_version() {
echo "1.3.5-alpha2" #lastest
echo "1.4.0" #lastest
}
api_release_url() {
......
......@@ -25,7 +25,8 @@ module.exports = function (config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
browsers: ['ChromeHeadless'],
browserDisconnectTimeout: 30000,
singleRun: false
});
};
{
"name": "sumaris-app",
"description": "SUMARiS app",
"version": "1.3.5-alpha2",
"version": "1.4.0",
"author": "contact@e-is.pro",
"license": "AGPL-3.0",
"readmeFilename": "README.md",
......@@ -24,38 +24,38 @@
"e2e": "npm run ng e2e"
},
"dependencies": {
"@angular/animations": "~10.0.2",
"@angular/cdk": "~10.0.1",
"@angular/common": "~10.0.2",
"@angular/core": "~10.0.2",
"@angular/forms": "~10.0.2",
"@angular/material": "~10.0.1",
"@angular/material-moment-adapter": "~10.0.1",
"@angular/platform-browser": "~10.0.2",
"@angular/platform-browser-dynamic": "~10.0.2",
"@angular/router": "^10.0.2",
"@angular/animations": "^10.0.2",
"@angular/cdk": "^10.0.2",
"@angular/common": "^10.0.14",
"@angular/core": "^10.0.14",
"@angular/forms": "^10.0.14",
"@angular/material": "^10.0.2",
"@angular/material-moment-adapter": "^10.0.2",
"@angular/platform-browser": "^10.0.14",
"@angular/platform-browser-dynamic": "^10.0.14",
"@angular/router": "^10.0.14",
"@asymmetrik/ngx-leaflet": "^7.0.1",
"@ionic-native/audio-management": "^5.27.0",
"@ionic-native/camera": "^5.27.0",
"@ionic-native/core": "^5.27.0",
"@e-is/ngx-material-table": "0.10.2",
"@ionic-native/audio-management": "^5.28.0",
"@ionic-native/camera": "^5.28.0",
"@ionic-native/core": "^5.28.0",
"@ionic-native/downloader": "^5.27.0",
"@ionic-native/http": "^5.27.0",
"@ionic-native/in-app-browser": "^5.27.0",
"@ionic-native/keyboard": "^5.27.0",
"@ionic-native/native-audio": "^5.27.0",
"@ionic-native/network": "^5.27.0",
"@ionic-native/splash-screen": "^5.27.0",
"@ionic-native/status-bar": "^5.27.0",
"@ionic-native/vibration": "^5.27.0",
"@ionic/angular": "^5.2.3",
"@ionic/core": "^5.2.3",
"@ionic/pwa-elements": "^1.5.2",
"@ionic/storage": "^2.2.0",
"@ngtools/webpack": "^9.1.10",
"@ngx-translate/core": "^12.1.2",
"@ngx-translate/http-loader": "^4.0.0",
"@ionic-native/http": "^5.28.0",
"@ionic-native/in-app-browser": "^5.28.0",
"@ionic-native/keyboard": "^5.28.0",
"@ionic-native/native-audio": "^5.28.0",
"@ionic-native/network": "^5.28.0",
"@ionic-native/splash-screen": "^5.28.0",
"@ionic-native/status-bar": "^5.28.0",
"@ionic-native/vibration": "^5.28.0",
"@ionic/angular": "^5.3.3",
"@ionic/core": "^5.3.3",
"@ionic/pwa-elements": "^3.0.1",
"@ionic/storage": "^2.3.1",
"@ngtools/webpack": "^10.1.2",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"angular2-text-mask": "^9.0.0",
"angular4-material-table": "0.10.0",
"apollo-angular": "^1.9.1",
"apollo-angular-link-http": "^1.10.0",
"apollo-cache-inmemory": "^1.6.6",
......@@ -97,6 +97,7 @@
"moment": "^2.27.0",
"ngx-color-picker": "^9.1.0",
"ngx-material-timepicker": "5.5.3",
"ngx-quicklink": "^0.2.4",
"roboto-fontface": "^0.10.0",
"rxjs": "6.4.0",
"scrypt-async": "^2.0.1",
......@@ -107,19 +108,20 @@
"tweetnacl": "^1.0.3",
"tweetnacl-util": "^0.15.1",
"uuid": "^3.3.3",
"zone.js": "~0.10.3"
"zone.js": "~0.10.3",
"localforage": "1.7.1"
},
"peerDependencies": {
"tar": "^5.0.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.1",
"@angular/cli": "~10.0.1",
"@angular/compiler": "~10.0.2",
"@angular/compiler-cli": "~10.0.2",
"@angular/language-service": "~10.0.2",
"@ionic/angular-toolkit": "^2.2.0",
"@ionic/cli": "^6.10.1",
"@angular-devkit/build-angular": "~0.1000.8",
"@angular/cli": "^10.0.8",
"@angular/compiler": "^10.0.14",
"@angular/compiler-cli": "^10.0.14",
"@angular/language-service": "^10.0.14",
"@ionic/angular-toolkit": "^2.3.3",
"@ionic/cli": "^6.11.8",
"@types/async": "^3.0.8",
"@types/graphql": "14.2.3",
"@types/jasmine": "^3.5.10",
......@@ -138,20 +140,20 @@
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"eslint": "^7.4.0",
"jasmine-core": "~3.5.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.2",
"karma": "~5.0.7",
"karma": "~5.2.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.1",
"karma-jasmine": "~3.0.3",
"karma-jasmine-html-reporter": "^1.4.2",
"node-sass": "^4.12.0",
"protractor": "~5.4.4",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"node-sass": "^4.14.1",
"protractor": "~7.0.0",
"sass-loader": "^7.3.1",
"tar": "^5.0.5",
"ts-node": "^8.3.0",
"typescript": "~3.9.6",
"webpack": "^4.43.0"
"ts-node": "^8.10.2",
"typescript": "~3.9.7",
"webpack": "^4.44.2"
},
"cordova": {
"plugins": {
......
......@@ -48,4 +48,4 @@ git commit -m "$description"
# -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"
git flow release finish -F -p -n "$version"
......@@ -163,8 +163,8 @@ fi
echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
cd $PROJECT_DIR
./github.sh "$task" ''"$description"''
cd $PROJECT_DIR/scripts
./release-to-github.sh "$task" ''"$description"''
[[ $? -ne 0 ]] && exit 1
#echo "----------------------------------"
......
#!/bin/bash
# Get to the root project
if [[ "_" == "_${PROJECT_DIR}" ]]; then
SCRIPT_DIR=$(dirname $0)
PROJECT_DIR=$(cd ${SCRIPT_DIR}/.. && pwd)
export PROJECT_DIR
fi;
# Preparing Android environment
cd ${PROJECT_DIR}
source ${PROJECT_DIR}/scripts/env-global.sh
### Control that the script is run on `dev` branch
branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "master" ]] && [[ ! "$branch" =~ ^release/[0-9]+.[0-9]+.[0-9]+(-(alpha|beta|rc)[0-9]+)?$ ]];
......@@ -9,8 +20,8 @@ then
fi
### Get version to release
current=`grep -P "version\": \"\d+.\d+.\d+(-(\w+)[0-9]+)" package.json | grep -m 1 -oP "\d+.\d+.\d+(-(\w+)[0-9]+)"`
if [[ "_$version" != "_" ]]; then
current=`grep -m1 -P "version\": \"\d+.\d+.\d+(-(\w+)[0-9]+)?" package.json | grep -oP "\d+.\d+.\d+(-(\w+)[0-9]+)?"`
if [[ "_$current" == "_" ]]; then
echo "ERROR: Unable to read 'version' in the file 'package.json'."
echo " - Make sure the file 'package.json' exists and is readable."
exit 1
......
......@@ -138,7 +138,8 @@ echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
./github.sh $1 ''"$description"''
cd $PROJECT_DIR/scripts
./release-to-github.sh $1 ''"$description"''
[[ $? -ne 0 ]] && exit 1
#echo "----------------------------------"
......
#!/bin/bash
# Get to the root project
if [[ "_" == "_${PROJECT_DIR}" ]]; then
SCRIPT_DIR=$(dirname $0)
PROJECT_DIR=$(cd ${SCRIPT_DIR}/.. && pwd)
export PROJECT_DIR
fi;
# Override with a local file, if any
if [[ -f "${PROJECT_DIR}/.local/env.sh" ]]; then
echo "Loading environment variables from: '.local/env.sh'"
source ${PROJECT_DIR}/.local/env.sh
[[ $? -ne 0 ]] && exit 1
else
echo "No file '${PROJECT_DIR}/.local/env.sh' found. Will use defaults"
fi
# launch tests
ng test --browsers=ChromeHeadless --watch=false
......@@ -3,6 +3,8 @@ import {UsersPage} from "./users/list/users";
import {AuthGuardService} from "../core/services/auth-guard.service";
import {NgModule} from "@angular/core";
import {ConfigurationPage} from "./config/configuration.page";
import {SharedRoutingModule} from "../shared/shared-routing.module";
import {AdminModule} from "./admin.module";
const routes: Routes = [
{
......@@ -26,7 +28,11 @@ const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forChild(routes)],
imports: [
SharedRoutingModule,
AdminModule,
RouterModule.forChild(routes)
],
exports: [RouterModule]
})
export class AdminRoutingModule { }
......@@ -13,8 +13,7 @@ import {SocialModule} from "../social/social.module";
CommonModule,
CoreModule,
SocialModule,
ReferentialModule,
AdminRoutingModule
ReferentialModule
],
declarations: [
UsersPage,
......@@ -23,11 +22,11 @@ import {SocialModule} from "../social/social.module";
exports: [
UsersPage,
ConfigurationPage
],
providers: [
// PersonService,
PersonValidatorService
]
})
export class AdminModule {
constructor() {
console.debug('[admin] Creating module');
}
}
import { Injectable } from "@angular/core";
import { ValidatorService } from "angular4-material-table";
import { ValidatorService } from "@e-is/ngx-material-table";
import { FormGroup, FormBuilder } from "@angular/forms";
import { Person } from "../../../core/services/model/person.model";
import { AccountValidatorService } from "../../../core/core.module";
import { Account } from "../../../core/services/model/account.model";
import { SharedValidators } from "../../../shared/validator/validators";
@Injectable()
@Injectable({providedIn: 'root'})
export class PersonValidatorService implements ValidatorService {
constructor(
......
......@@ -10,7 +10,7 @@ import {AccountService} from "../../../core/services/account.service";
import {Location} from '@angular/common';
import {FormBuilder, FormGroup} from "@angular/forms";
import {RESERVED_END_COLUMNS, RESERVED_START_COLUMNS} from "../../../core/table/table.class";
import {ValidatorService} from "angular4-material-table";
import {ValidatorService} from "@e-is/ngx-material-table";
import {FormFieldDefinition} from "../../../shared/form/field.model";
import {PlatformService} from "../../../core/services/platform.service";
import {LocalSettingsService} from "../../../core/services/local-settings.service";
......
import {Injectable, NgModule} from '@angular/core';
import {ActivatedRouteSnapshot, ExtraOptions, RouteReuseStrategy, RouterModule, Routes} from '@angular/router';
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomePage} from './core/home/home';
import {RegisterConfirmPage} from './core/register/confirm/confirm';
import {AccountPage} from './core/account/account';
import {TripPage, TripTable} from './trip/trip.module';
import {OperationPage} from './trip/operation/operation.page';
import {ObservedLocationPage} from "./trip/observedlocation/observed-location.page";
import {ObservedLocationsPage} from "./trip/observedlocation/observed-locations.page";
import {SettingsPage} from "./core/settings/settings.page";
import {LandingPage} from "./trip/landing/landing.page";
import {AuctionControlPage} from "./trip/auctioncontrol/auction-control.page";
import {IonicRouteStrategy} from "@ionic/angular";
import {AuthGuardService} from "./core/services/auth-guard.service";
import {LandedTripPage} from "./trip/landedtrip/landed-trip.page";
const routeOptions: ExtraOptions = {
enableTracing: false,
//enableTracing: !environment.production,
useHash: false
};
import {SHARED_ROUTE_OPTIONS, SharedRoutingModule} from "./shared/shared-routing.module";
const routes: Routes = [
// Core path
......@@ -51,151 +38,34 @@ const routes: Routes = [
{
path: 'admin',
canActivate: [AuthGuardService],
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule)
loadChildren: () => import('./admin/admin-routing.module').then(m => m.AdminRoutingModule)
},
// Referential
{
path: 'referential',
canActivate: [AuthGuardService],
loadChildren: () => import('./referential/referential.module').then(m => m.ReferentialModule)
loadChildren: () => import('./referential/referential-routing.module').then(m => m.ReferentialRoutingModule)
},
// Trip path
// Trips
{
path: 'trips',
canActivate: [AuthGuardService],
data: {
profile: 'USER'
},
children: [
{
path: '',
pathMatch: 'full',
component: TripTable
},
{
path: ':tripId',
runGuardsAndResolvers: 'pathParamsChange',
data: {
pathIdParam: 'tripId'
},
children: [
{
path: '',
pathMatch: 'full',
component: TripPage,
runGuardsAndResolvers: 'pathParamsChange'
},
{
path: 'operations/:operationId',
runGuardsAndResolvers: 'pathParamsChange',
data: {
pathIdParam: 'operationId'
},
children: [
{
path: '',
pathMatch: 'full',
component: OperationPage,
runGuardsAndResolvers: 'pathParamsChange'
}
]
}
]
},
{
path: ':tripId/landing/:landingId',
component: LandingPage,
runGuardsAndResolvers: 'pathParamsChange',
data: {
profile: 'USER',
pathIdParam: 'landingId'
}
}
]
loadChildren: () => import('./trip/trip-routing.module').then(m => m.TripRoutingModule)
},
// Observations path
// Observations
{
path: 'observations',
canActivate: [AuthGuardService],
data: {
profile: 'USER'
},
children: [
{
path: '',
pathMatch: 'full',
component: ObservedLocationsPage
},
{
path: ':observedLocationId',
runGuardsAndResolvers: 'pathParamsChange',
data: {
pathIdParam: 'observedLocationId'
},
children: [
{
path: '',
pathMatch: 'full',
component: ObservedLocationPage,
runGuardsAndResolvers: 'pathParamsChange'
},
// {
// path: 'batches',
// component: SubBatchesModal,
// runGuardsAndResolvers: 'pathParamsChange'
// },
{
path: 'landing/:landingId',
runGuardsAndResolvers: 'pathParamsChange',
data: {
pathIdParam: 'landingId'
},
children: [
{
path: '',
pathMatch: 'full',
component: LandingPage,
runGuardsAndResolvers: 'pathParamsChange'
}
]
},
{
path: 'control/:controlId',
runGuardsAndResolvers: 'pathParamsChange',
data: {
pathIdParam: 'controlId'
},
children: [
{
path: '',
pathMatch: 'full',
component: AuctionControlPage,
runGuardsAndResolvers: 'pathParamsChange'
}
]
},
{
path: 'trip/:tripId',
runGuardsAndResolvers: 'pathParamsChange',
data: {
pathIdParam: 'tripId'
},
children: [
{
path: '',
pathMatch: 'full',
component: LandedTripPage,
runGuardsAndResolvers: 'pathParamsChange'
}
]
}
]
}
]
loadChildren: () => import('./trip/landed-trip-routing.module').then(m => m.LandedTripRoutingModule)
},
// Extraction path
......@@ -235,35 +105,13 @@ const routes: Routes = [
];
@Injectable()
export class CustomReuseStrategy extends IonicRouteStrategy {
shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
const result = super.shouldReuseRoute(future, curr);
// Force to reuse the route if path change from [/new] -> [/:id]
if (!result && future.routeConfig && future.routeConfig === curr.routeConfig) {
const pathIdParam = future.routeConfig.data && future.routeConfig.data.pathIdParam || 'id';
const futureId = future.params[pathIdParam] === 'new' ?
(future.queryParams[pathIdParam] || future.queryParams['id']) : future.params[pathIdParam];
const currId = curr.params[pathIdParam] === 'new' ?
(curr.queryParams[pathIdParam] || curr.queryParams['id']) : curr.params[pathIdParam];
return futureId === currId;
}
return result;
}
}
@NgModule({
imports: [
RouterModule.forRoot(routes, routeOptions)
SharedRoutingModule,
RouterModule.forRoot(routes, SHARED_ROUTE_OPTIONS)
],
exports: [
RouterModule
],
providers: [
{ provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
]
})
export class AppRoutingModule {
......
......@@ -31,16 +31,23 @@ export class AppComponent {
private settings: LocalSettingsService
) {
this.platform.ready().then(() => {
this.start();
}
async start() {
console.info('[app] Starting...');
await this.platform.start();