Commit c69c1be5 authored by LAVENIER's avatar LAVENIER
Browse files

[enh] Update to @sumaris-net/ngx-components v0.11.0

[enh] Add configuration page
[fix] Rename entity CoastalStructure
parent 7e74f852
......@@ -17,6 +17,8 @@ insert_final_newline = true
[*.ts]
indent_style = space
indent_size = 2
ij_typescript_use_double_quotes = false
ij_typescript_force_quote_style = true
[*.md]
trim_trailing_whitespace = false
......@@ -6,12 +6,11 @@
"overrides": [
{
"files": [
"**/*.ts"
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
"tsconfig.json"
],
"createDefaultProgram": true
},
......@@ -22,7 +21,9 @@
],
"rules": {
"@angular-eslint/component-class-suffix": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
......@@ -30,23 +31,29 @@
"accessibility": "explicit"
}
],
"@typescript-eslint/no-shadow": [
"off",
{
"hoist": "all"
}
],
"brace-style": [
"off",
"off"
],
"curly": "off",
"dot-notation": "off",
"id-blacklist": "off",
"id-match": "off",
"no-shadow": [
"off",
{
"hoist": "all"
}
],
"no-empty-function": "off",
"no-shadow": "off",
"no-trailing-spaces": "off",
"no-undef-init": "off",
"no-underscore-dangle": "off",
"no-unused-expressions": "error",
"no-use-before-define": "off",
"radix": "off",
"semi": "error",
"no-console": "off",
"max-len": "off"
}
......
[submodule "ngx-sumaris-components"]
path = ngx-sumaris-components
url = https://gitlab.ifremer.fr/sih-public/sumaris/ngx-sumaris-components.git
.local
dist
doc
node_modules
resources
scripts
www
src/schema.graphql
{
"trailingComma": "es5",
"semi": true,
"singleQuote": true,
"printWidth": 150,
"tabWidth": 2,
"overrides": [
{
"files": "src/app/**/*.html",
"options": {
"parser": "angular",
"htmlWhitespaceSensitivity": "ignore",
"printWidth": 120
}
}
]
}
......@@ -36,7 +36,8 @@
"apollo-link-logger",
"zen-observable",
"subscriptions-transport-ws",
"chart.js"
"chart.js",
"react"
],
"assets": [
{
......@@ -61,7 +62,7 @@
},
{
"glob": "**/*.*",
"input": "node_modules/material-design-icons/iconfont",
"input": "node_modules/material-design-icons-iconfont/dist/fonts",
"output": "/"
},
{
......@@ -96,20 +97,15 @@
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"aot": true,
"buildOptimizer": true,
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"aot": true,
"serviceWorker": false,
"budgets": [
{
"type": "initial",
......@@ -122,24 +118,27 @@
"maximumError": "10kb"
}
],
"serviceWorker": false,
"ngswConfigPath": "ngsw-config.json"
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"dev": {
"development": {
"buildOptimizer": false,
"optimization": false,
"outputHashing": "none",
"sourceMap": true,
"namedChunks": true,
"extractLicenses": false,
"vendorChunk": true,
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"buildOptimizer": true,
"aot": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": true,
"extractLicenses": true,
"vendorChunk": false
]
},
"ci": {
"budgets": [
......@@ -150,7 +149,8 @@
],
"progress": false
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
......@@ -161,7 +161,11 @@
"production": {
"browserTarget": "app:build:production"
},
"development": {
"browserTarget": "app:build:development"
},
"ci": {
"browserTarget": "app:build:production",
"progress": false
}
}
......@@ -179,7 +183,6 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
......@@ -200,6 +203,7 @@
"src/theme"
]
},
"scripts": [],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
......@@ -215,7 +219,7 @@
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"builder": "@angular-devkit/build-angular:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
......@@ -223,21 +227,6 @@
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
},
"ionic-cordova-build": {
"builder": "@ionic/angular-toolkit:cordova-build",
"options": {
......
......@@ -15,8 +15,8 @@ module.exports = {
/@apollo\//,
/apollo-angular\//,
/moment\//,
/ngx-material-table\//,
/ngx-material-table\//
]
},
}
}
};
This diff is collapsed.
......@@ -7,17 +7,16 @@
"readmeFilename": "README.md",
"scripts": {
"postinstall": "ngcc",
"ng": "ng",
"start": "ng serve",
"serve.aot": "ng serve --aot",
"start.dev": "ng serve --configuration development",
"start.prod": "ng serve --configuration production",
"build": "ng build",
"build.aot": "ng build --aot",
"build.prod": "ng build --prod --aot && npm run build.i18n",
"deploy.prod": "npm run build.prod && scripts/deploy-nexus.sh",
"build.dev": "ng build --configuration=dev && lite-server --baseDir=\"www\"",
"build.dev": "ng build --configuration development",
"build.prod": "ng build --configuration production && npm run build.i18n",
"build.i18n": "node scripts/build-i18n.js",
"test": "npm run ng test",
"lint": "npm run ng lint",
"e2e": "npm run ng e2e"
"test": "ng test",
"lint": "ng lint"
},
"dependencies": {
"@angular/animations": "^11.2.14",
......@@ -30,48 +29,48 @@
"@angular/platform-browser": "^11.2.14",
"@angular/platform-browser-dynamic": "^11.2.14",
"@angular/router": "^11.2.14",
"@apollo/client": "^3.3.19",
"@apollo/client": "^3.4.11",
"@e-is/ngx-material-table": "^0.11.9",
"@ionic-native/audio-management": "^5.33.0",
"@ionic-native/camera": "^5.33.1",
"@ionic-native/core": "^5.33.1",
"@ionic-native/downloader": "^5.33.1",
"@ionic-native/geolocation": "^5.33.1",
"@ionic-native/in-app-browser": "^5.33.1",
"@ionic-native/keyboard": "^5.33.1",
"@ionic-native/native-audio": "^5.33.1",
"@ionic-native/network": "^5.33.1",
"@ionic-native/splash-screen": "^5.33.1",
"@ionic-native/status-bar": "^5.33.1",
"@ionic-native/vibration": "^5.33.1",
"@ionic/angular": "^5.6.9",
"@ionic/core": "^5.6.9",
"@ionic-native/audio-management": "^5.36.0",
"@ionic-native/camera": "^5.36.0",
"@ionic-native/core": "^5.36.0",
"@ionic-native/downloader": "^5.36.0",
"@ionic-native/geolocation": "^5.36.0",
"@ionic-native/in-app-browser": "^5.36.0",
"@ionic-native/keyboard": "^5.36.0",
"@ionic-native/native-audio": "^5.36.0",
"@ionic-native/network": "^5.36.0",
"@ionic-native/splash-screen": "^5.36.0",
"@ionic-native/status-bar": "^5.36.0",
"@ionic-native/vibration": "^5.36.0",
"@ionic/angular": "^5.6.14",
"@ionic/core": "^5.6.14",
"@ionic/pwa-elements": "^3.0.2",
"@ionic/storage": "^2.3.1",
"@ngtools/webpack": "^11.2.14",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@sumaris-net/ngx-components": "^0.0.18",
"@sumaris-net/ngx-components": "^0.11.0",
"angular-split": "^5.0.0",
"angular2-text-mask": "^9.0.0",
"apollo-angular": "^2.6.0",
"apollo-link-logger": "^2.0.0",
"apollo-link-queue": "^3.1.0",
"apollo-link-serialize": "^3.1.2",
"apollo3-cache-persist": "^0.9.1",
"apollo3-cache-persist": "^0.10.0",
"chart.js": "^2.9.4",
"clovelced-plugin-audiomanagement": "^1.0.2",
"core-js": "^3.13.1",
"cors": "^2.8.5",
"ember-cli-roboto-fontface": "^2.0.5",
"geojson": "^0.5.0",
"graphql": "^15.5.0",
"graphql-tag": "^2.12.4",
"graphql": "^15.5.2",
"graphql-tag": "^2.12.5",
"hammer-timejs": "^1.1.0",
"hammerjs": "^2.0.8",
"ionic-cache": "^5.2.0",
"ionicons": "^5.5.1",
"jdenticon": "^3.1.0",
"ionicons": "^5.5.3",
"jdenticon": "^3.1.1",
"localforage": "1.7.4",
"lodash.clonedeep": "^4.5.0",
"luxon": "^1.25.0",
......@@ -86,7 +85,7 @@
"rxjs": "^6.6.7",
"scrypt-async": "^2.0.1",
"seedrandom": "^3.0.5",
"subscriptions-transport-ws": "^0.9.18",
"subscriptions-transport-ws": "^0.9.19",
"tslib": "^2.2.0",
"tweetnacl": "^1.0.3",
"tweetnacl-util": "^0.15.1",
......@@ -97,44 +96,48 @@
"@angular-devkit/build-angular": "~0.1102.14",
"@angular-devkit/core": "^11.2.14",
"@angular-devkit/schematics": "^11.2.14",
"@angular-eslint/builder": "4.2.1",
"@angular-eslint/eslint-plugin": "4.2.1",
"@angular-eslint/eslint-plugin-template": "4.2.1",
"@angular-eslint/schematics": "4.2.1",
"@angular-eslint/template-parser": "^4.2.1",
"@angular-eslint/builder": "4.3.0",
"@angular-eslint/eslint-plugin": "4.3.0",
"@angular-eslint/eslint-plugin-template": "4.3.0",
"@angular-eslint/schematics": "4.3.0",
"@angular-eslint/template-parser": "4.3.0",
"@angular/cli": "^11.2.14",
"@angular/compiler": "^11.1.2",
"@angular/compiler-cli": "^11.1.2",
"@angular/compiler": "^11.2.14",
"@angular/compiler-cli": "^11.2.14",
"@angular/language-service": "^11.2.14",
"@ionic/angular-toolkit": "^3.1.1",
"@ionic/cli": "^6.16.3",
"@schematics/angular": "^11.2.14",
"@types/jasmine": "^3.7.1",
"@types/jasmine": "~3.7.8",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^12.20.15",
"@types/uuid": "^3.4.9",
"@types/node": "^12.20.16",
"@types/uuid": "^3.4.10",
"@typescript-eslint/eslint-plugin": "4.22.1",
"@typescript-eslint/parser": "4.22.1",
"acorn": "^8.2.4",
"codelyzer": "^6.0.1",
"eslint": "^7.27.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-jsdoc": "33.3.0",
"eslint-plugin-prefer-arrow": "1.2.3",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsdoc": "^36.0.8",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^3.4.1",
"jasmine-core": "~3.7.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.2",
"karma": "~6.3.4",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"postcss": "^8.3.0",
"prettier": "2.3.2",
"protractor": "~7.0.0",
"react": "^17.0.1",
"sass": "^1.35.1",
"postcss": "^8.3.0",
"sass": "^1.35.2",
"sass-loader": "^10.2.0",
"tar": "^5.0.5",
"ts-node": "^8.10.2",
"typescript": "~4.1.5",
"typescript": "~4.1.6",
"webpack": "^4.46.0"
},
"repository": {
......@@ -146,7 +149,7 @@
"url": "https://gitlab.ifremer.fr/simm/sar-app/-/issues"
},
"engines": {
"node": ">= 12.20.15",
"node": ">= 12.20.0",
"npm": ">= 6.14.4"
}
}
import {RouterModule, Routes} from '@angular/router';
import {NgModule} from '@angular/core';
import {AuthGuardService, UsersPage} from '@sumaris-net/ngx-components';
import {AuthGuardService, SharedRoutingModule, UsersPage} from '@sumaris-net/ngx-components';
import {AppAdminModule} from '@app/admin/admin.module';
import {ConfigurationPage} from '@app/admin/config/configuration.page';
const routes: Routes = [
{
......@@ -12,11 +13,21 @@ const routes: Routes = [
data: {
profile: 'ADMIN'
}
},
{
path: 'config',
pathMatch: 'full',
component: ConfigurationPage,
canActivate: [AuthGuardService],
data: {
profile: 'ADMIN'
}
}
];
@NgModule({
imports: [
SharedRoutingModule,
AppAdminModule,
RouterModule.forChild(routes)
],
......
import {ModuleWithProviders, NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {IonicStorageModule} from '@ionic/storage';
import {HttpClientModule} from '@angular/common/http';
import {CacheModule} from 'ionic-cache';
import {TranslateModule} from '@ngx-translate/core';
import {AdminModule, AdminRoutingModule, AppGraphQLModule, AuthGuardService, CoreModule, PlatformService, UsersPage} from '@sumaris-net/ngx-components';
import {AppSharedModule} from '@app/shared/shared.module';
import {CommonModule} from "@angular/common";
import {AppCoreModule} from "@app/core/core.module";
import {NgModule} from '@angular/core';
import {AdminModule, SocialModule} from '@sumaris-net/ngx-components';
import {CommonModule} from '@angular/common';
import {AppCoreModule} from '@app/core/core.module';
import {NgxJdenticonModule} from 'ngx-jdenticon';
import {AppReferentialModule} from '@app/referential/referential.module';
import {ConfigurationPage} from '@app/admin/config/configuration.page';
@NgModule({
imports: [
CommonModule,
SocialModule,
NgxJdenticonModule,
// App modules
AdminModule,
AppCoreModule
AppCoreModule,
AppReferentialModule
],
declarations: [
ConfigurationPage
],
exports: [
AdminModule
AdminModule,
ConfigurationPage
]
})
export class AppAdminModule {
......
<app-toolbar [title]="$title | async" color="primary"
[hasValidate]="!loading"
(onValidate)="save($event)"
[canGoBack]="false">
<ion-spinner slot="end" *ngIf="loading"></ion-spinner>
<ion-buttons slot="end">
<!-- Options -->
<ion-button [matMenuTriggerFor]="optionsMenu">
<mat-icon slot="icon-only">more_vert</mat-icon>
</ion-button>
</ion-buttons>
</app-toolbar>
<!-- Options menu -->
<mat-menu #optionsMenu="matMenu" xPosition="after">
<button mat-menu-item *ngIf="network.online" (click)="clearCache($event)">
<ion-label translate>CONFIGURATION.BTN_CLEAR_CACHE</ion-label>
</button>
</mat-menu>
<ion-content>
<mat-tab-group #tabGroup
[(selectedIndex)]="selectedTabIndex"
(selectedTabChange)="onTabChange($event)"
[animationDuration]="tabGroupAnimationDuration"
dynamicHeight>
<!-- TAB: general -->
<mat-tab label="{{'CONFIGURATION.TAB_GENERAL'|translate}}">
<ng-template mat-tab-label>
<mat-icon>information-circle</mat-icon>
<ion-label translate>CONFIGURATION.TAB_GENERAL</ion-label>
<ion-icon slot="end" name="alert-circle" color="danger" *ngIf="submitted && referentialForm.invalid"></ion-icon>
</ng-template>
<div class="ion-padding">
<!-- error -->
<ion-item *ngIf="referentialForm.error || error" visible-xs visible-sm visible-mobile lines="none">
<ion-icon color="danger" slot="start" name="alert-circle"></ion-icon>
<ion-label color="danger" class="error"
[innerHTML]="(referentialForm.error || error) | translate"></ion-label>
</ion-item>
<ion-grid class="ion-no-padding">
<ion-row class="ion-no-padding">
<ion-col class="ion-no-padding ion-padding-top">
<!-- base form-->
<app-referential-form #referentialForm
[form]="form"
[showError]="false"
[showDescription]="false"
[showComments]="true"
[debug]="debug"
(onSubmit)="save($event)">
<!-- About -->
<ion-row>
<ion-col>
<mat-form-field>
<textarea matInput #description
matTextareaAutosize="true"
matAutosizeMinRows="4"
rows="1"
maxlength="2000"
[placeholder]="'ABOUT.TITLE'|translate"
[formControl]="form.controls.description">
</textarea>
<mat-hint align="end">{{description.value.length}} / 255</mat-hint>
<mat-error *ngIf="form.controls.description.hasError('required')" translate>ERROR.FIELD_REQUIRED</mat-error>
<mat-error *ngIf="form.controls.description.hasError('maxLength')">{{'ERROR.FIELD_MAX_LENGTH'|translate: {maxLength: 255} }}</mat-error>
</mat-form-field>
</ion-col>
</ion-row>
<h3 *ngIf="config?.smallLogo || config?.largeLogo || (partners | async | isNotEmptyArray)">