Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
quadrige
quadrige3-app
Commits
87abe92e
Commit
87abe92e
authored
Dec 10, 2020
by
PECQUOT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] use account, person, department models and service of sumaris-lib
[enh] add resizable capability for a table
parent
dab5996e
Changes
48
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
1707 additions
and
1839 deletions
+1707
-1839
.eslintrc.js
.eslintrc.js
+165
-0
angular.json
angular.json
+1
-2
package.json
package.json
+10
-4
src/app/app-routing.module.ts
src/app/app-routing.module.ts
+22
-24
src/app/app.component.ts
src/app/app.component.ts
+17
-11
src/app/app.module.ts
src/app/app.module.ts
+61
-54
src/app/core/auth/form/form-auth.ts
src/app/core/auth/form/form-auth.ts
+13
-14
src/app/core/auth/modal/modal-auth.html
src/app/core/auth/modal/modal-auth.html
+2
-2
src/app/core/auth/modal/modal-auth.ts
src/app/core/auth/modal/modal-auth.ts
+1
-2
src/app/core/core.module.ts
src/app/core/core.module.ts
+0
-101
src/app/core/home/home.html
src/app/core/home/home.html
+205
-0
src/app/core/home/home.scss
src/app/core/home/home.scss
+242
-0
src/app/core/home/home.ts
src/app/core/home/home.ts
+338
-0
src/app/core/model/account.model.ts
src/app/core/model/account.model.ts
+0
-56
src/app/core/model/department.model.ts
src/app/core/model/department.model.ts
+0
-38
src/app/core/model/user.model.ts
src/app/core/model/user.model.ts
+0
-117
src/app/core/quadrige.core.module.ts
src/app/core/quadrige.core.module.ts
+95
-0
src/app/core/services/account.service.ts
src/app/core/services/account.service.ts
+0
-1078
src/app/core/services/auth-guard.service.ts
src/app/core/services/auth-guard.service.ts
+0
-69
src/app/referential/form/referential.form.ts
src/app/referential/form/referential.form.ts
+4
-4
src/app/referential/list/referential-ref.table.ts
src/app/referential/list/referential-ref.table.ts
+6
-6
src/app/referential/list/referential.table.html
src/app/referential/list/referential.table.html
+7
-5
src/app/referential/list/referential.table.ts
src/app/referential/list/referential.table.ts
+8
-18
src/app/referential/list/referentials.ts
src/app/referential/list/referentials.ts
+24
-17
src/app/referential/list/select-referential.modal.ts
src/app/referential/list/select-referential.modal.ts
+5
-5
src/app/referential/list/testing/referential.table.test.html
src/app/referential/list/testing/referential.table.test.html
+19
-0
src/app/referential/list/testing/referential.table.test.ts
src/app/referential/list/testing/referential.table.test.ts
+38
-0
src/app/referential/referential-routing.module.ts
src/app/referential/referential-routing.module.ts
+2
-1
src/app/referential/referential.module.ts
src/app/referential/referential.module.ts
+8
-27
src/app/referential/services/model/model.enum.ts
src/app/referential/services/model/model.enum.ts
+1
-1
src/app/referential/services/model/model.utils.ts
src/app/referential/services/model/model.utils.ts
+0
-0
src/app/referential/services/pipes/referential-to-string.pipe.ts
.../referential/services/pipes/referential-to-string.pipe.ts
+1
-1
src/app/referential/services/referential-ref.service.ts
src/app/referential/services/referential-ref.service.ts
+32
-27
src/app/referential/services/referential.service.ts
src/app/referential/services/referential.service.ts
+21
-14
src/app/referential/services/validator/referential.validator.ts
...p/referential/services/validator/referential.validator.ts
+2
-2
src/app/shared/directive/resizable-column.directive.ts
src/app/shared/directive/resizable-column.directive.ts
+30
-0
src/app/shared/directive/resizable-table.directive.ts
src/app/shared/directive/resizable-table.directive.ts
+174
-0
src/app/shared/quadrige.shared.module.ts
src/app/shared/quadrige.shared.module.ts
+26
-0
src/app/shared/shared-routing.module.ts
src/app/shared/shared-routing.module.ts
+0
-51
src/app/testing/quadrige.testing.module.ts
src/app/testing/quadrige.testing.module.ts
+14
-0
src/app/testing/table.testing.module.ts
src/app/testing/table.testing.module.ts
+39
-0
src/environments/environment.class.ts
src/environments/environment.class.ts
+2
-2
src/environments/environment.prod.ts
src/environments/environment.prod.ts
+1
-1
src/global.scss
src/global.scss
+52
-3
src/lib/base58.js
src/lib/base58.js
+0
-78
src/main.ts
src/main.ts
+4
-4
src/schema.graphql
src/schema.graphql
+6
-0
tsconfig.json
tsconfig.json
+9
-0
No files found.
.eslintrc.js
0 → 100644
View file @
87abe92e
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module
.
exports
=
{
"
env
"
:
{
"
browser
"
:
true
,
"
es6
"
:
true
,
"
node
"
:
true
},
"
parser
"
:
"
@typescript-eslint/parser
"
,
"
parserOptions
"
:
{
"
project
"
:
"
tsconfig.json
"
,
"
sourceType
"
:
"
module
"
},
"
plugins
"
:
[
"
eslint-plugin-import
"
,
"
@angular-eslint/eslint-plugin
"
,
"
@typescript-eslint
"
,
"
@typescript-eslint/tslint
"
],
"
rules
"
:
{
"
@angular-eslint/directive-class-suffix
"
:
"
error
"
,
"
@angular-eslint/no-input-rename
"
:
"
error
"
,
"
@angular-eslint/no-output-on-prefix
"
:
"
error
"
,
"
@angular-eslint/no-output-rename
"
:
"
error
"
,
"
@angular-eslint/use-pipe-transform-interface
"
:
"
error
"
,
"
@typescript-eslint/consistent-type-definitions
"
:
"
error
"
,
"
@typescript-eslint/dot-notation
"
:
"
off
"
,
"
@typescript-eslint/explicit-member-accessibility
"
:
[
"
off
"
,
{
"
accessibility
"
:
"
explicit
"
}
],
"
@typescript-eslint/member-delimiter-style
"
:
[
"
error
"
,
{
"
multiline
"
:
{
"
delimiter
"
:
"
semi
"
,
"
requireLast
"
:
true
},
"
singleline
"
:
{
"
delimiter
"
:
"
semi
"
,
"
requireLast
"
:
false
}
}
],
"
@typescript-eslint/naming-convention
"
:
"
error
"
,
"
@typescript-eslint/no-empty-function
"
:
"
off
"
,
"
@typescript-eslint/no-empty-interface
"
:
"
error
"
,
"
@typescript-eslint/no-inferrable-types
"
:
[
"
error
"
,
{
"
ignoreParameters
"
:
true
}
],
"
@typescript-eslint/no-misused-new
"
:
"
error
"
,
"
@typescript-eslint/no-non-null-assertion
"
:
"
error
"
,
"
@typescript-eslint/no-unused-expressions
"
:
"
error
"
,
"
@typescript-eslint/no-use-before-define
"
:
"
off
"
,
"
@typescript-eslint/prefer-function-type
"
:
"
error
"
,
"
@typescript-eslint/semi
"
:
[
"
error
"
,
"
always
"
],
"
@typescript-eslint/type-annotation-spacing
"
:
"
error
"
,
"
@typescript-eslint/unified-signatures
"
:
"
error
"
,
"
arrow-body-style
"
:
"
error
"
,
"
brace-style
"
:
[
"
off
"
,
"
off
"
],
"
constructor-super
"
:
"
error
"
,
"
curly
"
:
"
off
"
,
"
eol-last
"
:
"
error
"
,
"
eqeqeq
"
:
[
"
error
"
,
"
smart
"
],
"
guard-for-in
"
:
"
error
"
,
"
id-blacklist
"
:
"
off
"
,
"
id-match
"
:
"
off
"
,
"
import/no-deprecated
"
:
"
warn
"
,
"
no-bitwise
"
:
"
error
"
,
"
no-caller
"
:
"
error
"
,
"
no-console
"
:
[
"
error
"
,
{
"
allow
"
:
[
"
warn
"
,
"
dir
"
,
"
timeLog
"
,
"
assert
"
,
"
clear
"
,
"
count
"
,
"
countReset
"
,
"
group
"
,
"
groupEnd
"
,
"
table
"
,
"
debug
"
,
"
info
"
,
"
dirxml
"
,
"
error
"
,
"
groupCollapsed
"
,
"
Console
"
,
"
profile
"
,
"
profileEnd
"
,
"
timeStamp
"
,
"
context
"
]
}
],
"
no-debugger
"
:
"
error
"
,
"
no-empty
"
:
"
off
"
,
"
no-eval
"
:
"
error
"
,
"
no-fallthrough
"
:
"
error
"
,
"
no-new-wrappers
"
:
"
error
"
,
"
no-restricted-imports
"
:
[
"
error
"
,
"
rxjs/Rx
"
],
"
no-shadow
"
:
[
"
off
"
,
{
"
hoist
"
:
"
all
"
}
],
"
no-throw-literal
"
:
"
error
"
,
"
no-trailing-spaces
"
:
"
off
"
,
"
no-undef-init
"
:
"
off
"
,
"
no-underscore-dangle
"
:
"
off
"
,
"
no-var
"
:
"
error
"
,
"
prefer-const
"
:
"
error
"
,
"
radix
"
:
"
off
"
,
"
@typescript-eslint/tslint/config
"
:
[
"
error
"
,
{
"
rules
"
:
{
"
use-host-property-decorator
"
:
true
,
"
use-input-property-decorator
"
:
true
,
"
use-life-cycle-interface
"
:
true
,
"
use-output-property-decorator
"
:
true
,
"
whitespace
"
:
[
true
,
"
check-branch
"
,
"
check-decl
"
,
"
check-operator
"
,
"
check-separator
"
,
"
check-type
"
]
}
}
]
}
};
angular.json
View file @
87abe92e
...
...
@@ -101,8 +101,7 @@
"includePaths"
:
[
"src/theme"
]
},
"preserveSymlinks"
:
true
}
},
"configurations"
:
{
"production"
:
{
...
...
package.json
View file @
87abe92e
...
...
@@ -20,6 +20,7 @@
"e2e"
:
"npm run ng e2e"
},
"dependencies"
:
{
"
sumaris-lib
"
:
"
file:/home/ludovic/dev/sumaris/sumaris-app/dist
"
,
"
@angular/animations
"
:
"
^11.0.2
"
,
"
@angular/cdk
"
:
"
^11.0.1
"
,
"
@angular/common
"
:
"
^11.0.2
"
,
...
...
@@ -95,8 +96,8 @@
"
zone.js
"
:
"
~0.10.3
"
},
"devDependencies"
:
{
"
sumaris-lib
"
:
"
file:/home/ludovic/dev/sumaris/sumaris-app/dist
"
,
"
@angular-devkit/build-angular
"
:
"
~0.1100.2
"
,
"
@angular-eslint/eslint-plugin
"
:
"
^0.8.0-beta.3
"
,
"
@angular/cli
"
:
"
^11.0.2
"
,
"
@angular/compiler
"
:
"
^11.0.2
"
,
"
@angular/compiler-cli
"
:
"
^11.0.2
"
,
...
...
@@ -108,9 +109,13 @@
"
@types/leaflet
"
:
"
^1.5.19
"
,
"
@types/node
"
:
"
^12.19.1
"
,
"
@types/uuid
"
:
"
^3.4.9
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.9.0
"
,
"
@typescript-eslint/eslint-plugin-tslint
"
:
"
^4.9.0
"
,
"
@typescript-eslint/parser
"
:
"
^4.9.0
"
,
"
acorn
"
:
"
^7.3.1
"
,
"
codelyzer
"
:
"
^6.0.1
"
,
"
react
"
:
"
^17.0.1
"
,
"
eslint
"
:
"
^7.15.0
"
,
"
eslint-plugin-import
"
:
"
^2.22.1
"
,
"
jasmine-core
"
:
"
~3.6.0
"
,
"
jasmine-spec-reporter
"
:
"
~5.0.2
"
,
"
karma
"
:
"
~5.2.3
"
,
...
...
@@ -119,13 +124,14 @@
"
karma-jasmine
"
:
"
~4.0.1
"
,
"
karma-jasmine-html-reporter
"
:
"
^1.5.4
"
,
"
protractor
"
:
"
~7.0.0
"
,
"
react
"
:
"
^17.0.1
"
,
"
sass
"
:
"
^1.29.0
"
,
"
sass-loader
"
:
"
^10.1.0
"
,
"
tar
"
:
"
^5.0.5
"
,
"
ts-node
"
:
"
^8.10.2
"
,
"
tslint
"
:
"
^6.1.3
"
,
"
typescript
"
:
"
~4.0.5
"
,
"
webpack
"
:
"
^4.6.0
"
,
"
tslint
"
:
"
^6.1.3
"
"
webpack
"
:
"
^4.6.0
"
},
"repository"
:
{
"type"
:
"git"
,
...
...
src/app/app-routing.module.ts
View file @
87abe92e
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
RouterModule
,
Routes
}
from
'
@angular/router
'
;
import
{
HomePage
}
from
"
sumaris-lib/app/core/home/home
"
;
import
{
AuthGuardService
}
from
"
./core/services/auth-guard.service
"
;
import
{
SHARED_ROUTE_OPTIONS
,
SharedRoutingModule
}
from
"
./shared/shared-routing.module
"
;
// import {HomePage} from 'sumaris-lib';
// import {RegisterConfirmPage} from './core/register/confirm/confirm';
// import {AccountPage} from './core/account/account';
// import {SettingsPage} from "./core/settings/settings.page";
// import {AuthGuardService} from "./core/services/auth-guard.service";
// import {SHARED_ROUTE_OPTIONS, SharedRoutingModule} from "./shared/shared-routing.module";
import
{
AuthGuardService
,
SHARED_ROUTE_OPTIONS
,
SharedRoutingModule
}
from
"
sumaris-lib
"
;
import
{
HomePage
}
from
"
@app/core/home/home
"
;
const
routes
:
Routes
=
[
// Core path
...
...
@@ -48,21 +41,26 @@ const routes: Routes = [
},
// Test module (disable in menu, by default - can be enable by the Pod configuration page)
// {
// path: 'testing',
// children: [
// {
// path: '',
// pathMatch: 'full',
// redirectTo: 'shared',
// },
// // Shared module
// {
// path: 'shared',
// loadChildren: () => import('./shared/shared.testing.module').then(m => m.SharedTestingModule)
// },
// ]
// },
{
path
:
'
testing
'
,
children
:
[
{
path
:
''
,
pathMatch
:
'
full
'
,
redirectTo
:
'
shared
'
,
},
// Shared module
{
path
:
'
shared
'
,
loadChildren
:
()
=>
import
(
'
./testing/quadrige.testing.module
'
).
then
(
m
=>
m
.
QuadrigeTestingModule
)
},
// Table
{
path
:
'
table
'
,
loadChildren
:
()
=>
import
(
'
./testing/table.testing.module
'
).
then
(
m
=>
m
.
WrappingTestingModule
)
}
]
},
// Other route redirection (should at the end of the array)
{
...
...
src/app/app.component.ts
View file @
87abe92e
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
DOCUMENT
}
from
"
@angular/common
"
;
import
{
throttleTime
}
from
"
rxjs/operators
"
;
import
{
AccountService
}
from
"
./core/services/account.service
"
;
import
{
ReferentialRefService
}
from
"
./referential/services/referential-ref.service
"
;
import
{
MatIconRegistry
}
from
"
@angular/material/icon
"
;
import
{
DomSanitizer
}
from
"
@angular/platform-browser
"
;
import
{
PlatformService
}
from
"
sumaris-lib/app/core/services/platform.service
"
;
import
{
LocalSettingsService
}
from
"
sumaris-lib/app/core/services/local-settings.service
"
;
import
{
getColorContrast
,
getColorShade
,
getColorTint
,
hexToRgbArray
,
mixHex
}
from
"
sumaris-lib/app/shared/graph/colors.utils
"
;
import
{
changeCaseToUnderscore
,
isNotNil
,
joinPropertiesPath
}
from
"
sumaris-lib/app/shared/functions
"
;
import
{
FormFieldDefinition
}
from
"
sumaris-lib/app/shared/form/field.model
"
;
import
{
AccountService
,
changeCaseToUnderscore
,
FormFieldDefinition
,
getColorContrast
,
getColorShade
,
getColorTint
,
hexToRgbArray
,
isNotNil
,
joinPropertiesPath
,
LocalSettingsService
,
mixHex
,
PlatformService
}
from
"
sumaris-lib
"
;
@
Component
({
selector
:
'
app-root
'
,
...
...
@@ -96,7 +104,7 @@ export class AppComponent {
// }
// }
protected
updateTheme
(
options
:
{
colors
?:
{
[
color
:
string
]:
string
;
}
})
{
protected
updateTheme
(
options
:
{
colors
?:
{
[
color
:
string
]:
string
}
})
{
if
(
!
options
)
return
;
...
...
@@ -194,8 +202,7 @@ export class AppComponent {
// Configurable fields, with label and name
[
'
department
'
,
'
location
'
,
'
qualitativeValue
'
,
'
taxonGroup
'
,
'
taxonName
'
,
'
gear
'
]
// Map into option definition
.
map
(
fieldName
=>
{
return
{
.
map
(
fieldName
=>
({
key
:
`quadrige3.field.
${
fieldName
}
.attributes`
,
label
:
`SETTINGS.FIELDS.
${
changeCaseToUnderscore
(
fieldName
).
toUpperCase
()}
`
,
type
:
'
enum
'
,
...
...
@@ -205,8 +212,7 @@ export class AppComponent {
{
key
:
'
name,label
'
,
value
:
'
SETTINGS.FIELDS.ATTRIBUTES.NAME_LABEL
'
},
{
key
:
'
label
'
,
value
:
'
SETTINGS.FIELDS.ATTRIBUTES.LABEL
'
}
]
}
as
FormFieldDefinition
;
}));
}
as
FormFieldDefinition
)));
this
.
settings
.
registerAdditionalField
({
key
:
'
quadrige3.field.vesselSnapshot.attributes
'
,
...
...
src/app/app.module.ts
View file @
87abe92e
import
"
./vendor
"
;
import
{
APP_BASE_HREF
}
from
"
@angular/common
"
;
import
{
BrowserModule
,
HammerModule
}
from
"
@angular/platform-browser
"
;
import
{
BrowserModule
,
HAMMER_GESTURE_CONFIG
,
HammerModule
}
from
"
@angular/platform-browser
"
;
import
{
CUSTOM_ELEMENTS_SCHEMA
,
NgModule
,
SecurityContext
}
from
"
@angular/core
"
;
import
{
DateAdapter
,
MAT_DATE_FORMATS
,
MAT_DATE_LOCALE
}
from
"
@angular/material/core
"
;
import
{
MomentDateAdapter
}
from
'
@angular/material-moment-adapter
'
;
...
...
@@ -13,7 +13,6 @@ import {Vibration} from '@ionic-native/vibration/ngx';
// App modules
import
{
AppComponent
}
from
"
./app.component
"
;
import
{
AppRoutingModule
}
from
"
./app-routing.module
"
;
import
{
environment
}
from
"
../environments/environment
"
;
import
{
HttpClient
,
HttpClientModule
}
from
"
@angular/common/http
"
;
import
{
Camera
}
from
"
@ionic-native/camera/ngx
"
;
import
{
Network
}
from
"
@ionic-native/network/ngx
"
;
...
...
@@ -25,11 +24,25 @@ import {IonicModule} from "@ionic/angular";
import
{
CacheModule
}
from
"
ionic-cache
"
;
import
{
TranslateLoader
,
TranslateModule
}
from
"
@ngx-translate/core
"
;
import
{
MarkdownModule
,
MarkedOptions
}
from
"
ngx-markdown
"
;
import
{
SharedModule
}
from
"
sumaris-lib
"
;
import
{
HttpTranslateLoaderFactory
,
DATE_ISO_PATTERN
}
from
"
sumaris-lib
"
;
import
{
APP_HOME_BUTTONS
}
from
"
sumaris-lib/app/core/home/home
"
;
import
{
APP_MENU_ITEMS
}
from
"
sumaris-lib/app/core/menu/menu.component
"
;
import
{
CoreModule
}
from
"
./core/core.module
"
;
import
{
QuadrigeCoreModule
}
from
"
./core/quadrige.core.module
"
;
import
{
APP_CONFIG_OPTIONS
,
APP_GRAPHQL_TYPE_POLICIES
,
APP_HOME_BUTTONS
,
APP_LOCAL_SETTINGS_OPTIONS
,
APP_MENU_ITEMS
,
APP_TESTING_PAGES
,
AppGestureConfig
,
ConfigOptions
,
DATE_ISO_PATTERN
,
LocalSettings
,
SocialModule
,
TestingPage
}
from
"
sumaris-lib
"
;
import
{
TypePolicies
}
from
"
@apollo/client
"
;
import
{
QuadrigeSharedModule
}
from
"
./shared/quadrige.shared.module
"
;
import
{
TranslateHttpLoader
}
from
"
@ngx-translate/http-loader
"
;
import
{
environment
}
from
"
@environments/environment
"
;
@
NgModule
({
...
...
@@ -49,7 +62,13 @@ import {CoreModule} from "./core/core.module";
TranslateModule
.
forRoot
({
loader
:
{
provide
:
TranslateLoader
,
useFactory
:
HttpTranslateLoaderFactory
,
useFactory
:
(
httpClient
)
=>
{
if
(
environment
.
production
)
{
// This is need to force a reload, after an app update
return
new
TranslateHttpLoader
(
httpClient
,
'
./assets/i18n/
'
,
`-
${
environment
.
version
}
.json`
);
}
return
new
TranslateHttpLoader
(
httpClient
,
'
./assets/i18n/
'
,
`.json`
);
},
deps
:
[
HttpClient
]
}
}),
...
...
@@ -69,8 +88,9 @@ import {CoreModule} from "./core/core.module";
}),
// functional modules
CoreModule
.
forRoot
(),
SharedModule
.
forRoot
(),
QuadrigeCoreModule
.
forRoot
(),
QuadrigeSharedModule
,
SocialModule
.
forRoot
(),
HammerModule
,
AppRoutingModule
],
...
...
@@ -104,15 +124,15 @@ import {CoreModule} from "./core/core.module";
{
provide
:
DateAdapter
,
useClass
:
MomentDateAdapter
,
deps
:
[
MAT_DATE_LOCALE
,
MAT_DATE_FORMATS
]},
// Configure hammer gesture
//
{provide: HAMMER_GESTURE_CONFIG, useClass: AppGestureConfig},
{
provide
:
HAMMER_GESTURE_CONFIG
,
useClass
:
AppGestureConfig
},
//
{ provide: APP_LOCAL_SETTINGS_OPTIONS, useValue: {
//
pageHistoryMaxSize: 3
//
} as LocalSettings
//
},
{
provide
:
APP_LOCAL_SETTINGS_OPTIONS
,
useValue
:
{
pageHistoryMaxSize
:
3
}
as
LocalSettings
},
// Config options (Core + trip)
//
{ provide: APP_CONFIG_OPTIONS, useValue: {...ConfigOptions}},
{
provide
:
APP_CONFIG_OPTIONS
,
useValue
:
{...
ConfigOptions
}},
// Menu items
{
provide
:
APP_MENU_ITEMS
,
useValue
:
[
...
...
@@ -179,46 +199,33 @@ import {CoreModule} from "./core/core.module";
]
},
// // Entities Apollo cache options
// { provide: APP_GRAPHQL_TYPE_POLICIES, useValue: <TypePolicies>{
// 'MetierVO': {
// keyFields: ['entityName', 'id']
// },
// 'PmfmVO': {
// keyFields: ['entityName', 'id']
// },
// 'TaxonGroupVO': {
// keyFields: ['entityName', 'id']
// },
// 'TaxonNameVO': {
// keyFields: ['entityName', 'id']
// },
// 'LocationVO': {
// keyFields: ['entityName', 'id']
// },
// 'ReferentialVO': {
// keyFields: ['entityName', 'id']
// },
// 'MeasurementVO': {
// keyFields: ['entityName', 'id']
// },
// 'TaxonGroupStrategyVO': {
// keyFields: ['__typename', 'strategyId', 'taxonGroup', ['entityName', 'id']]
// },
// 'TaxonNameStrategyVO': {
// keyFields: ['__typename', 'strategyId', 'taxonName', ['entityName', 'id']]
// }
// }
// },
//
// // Entities options
// { provide: APP_LOCAL_STORAGE_TYPE_POLICIES, useValue: { ...TRIP_STORAGE_TYPE_POLICIES}},
// Entities Apollo cache options
{
provide
:
APP_GRAPHQL_TYPE_POLICIES
,
useValue
:
<
TypePolicies
>
{
// 'PmfmVO': {
// keyFields: ['entityName', 'id']
// },
// 'TaxonGroupVO': {
// keyFields: ['entityName', 'id']
// },
// 'TaxonNameVO': {
// keyFields: ['entityName', 'id']
// },
// 'LocationVO': {
// keyFields: ['entityName', 'id']
// },
'
ReferentialVO
'
:
{
keyFields
:
[
'
entityName
'
,
'
id
'
]
}
}
},
// Entities options
// { provide: APP_LOCAL_STORAGE_TYPE_POLICIES, useValue: { ...TRIP_STORAGE_TYPE_POLICIES}},
// Test pages
//
{ provide: APP_TESTING_PAGES, useValue: <TestingPage[]>[
//
{label: 'Batch tree', page: '/testing/trip/batchTree'}
//
]},
// Test pages
link
{
provide
:
APP_TESTING_PAGES
,
useValue
:
<
TestingPage
[]
>
[
{
label
:
'
Batch tree
'
,
page
:
'
/testing/trip/batchTree
'
}
]},
],
bootstrap
:
[
AppComponent
],
schemas
:
[
CUSTOM_ELEMENTS_SCHEMA
]
...
...
src/app/core/auth/form/form-auth.ts
View file @
87abe92e
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
EventEmitter
,
OnInit
,
Output
}
from
"
@angular/core
"
;
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
EventEmitter
,
Inject
,
OnInit
,
Output
}
from
"
@angular/core
"
;
import
{
FormBuilder
,
Validators
}
from
"
@angular/forms
"
;
import
{
ModalController
}
from
"
@ionic/angular
"
;
import
{
AuthData
}
from
"
../../services/account.service
"
;
import
{
environment
}
from
"
../../../../environments/environment
"
;
import
{
DateAdapter
}
from
"
@angular/material/core
"
;
import
{
Moment
}
from
"
moment
"
;
import
{
debounceTime
}
from
"
rxjs/operators
"
;
import
{
slideUpDownAnimation
}
from
"
sumaris-lib
/app/shared/material/material.animations
"
;
import
{
AppForm
}
from
"
sumaris-lib
/app/core/form/form.class
"
;
import
{
PlatformService
}
from
"
sumaris-lib
/app/core/services/platform.service
"
;
import
{
LocalSettingsService
}
from
"
sumaris-lib
/app/core/services/local-settings.service
"
;
import
{
NetworkService
}
from
"
sumaris-lib
/app/core/services/network.service
"
;
import
{
AuthData
,
EnvironmentService
,
slideUpDownAnimation
}
from
"
sumaris-lib
"
;
import
{
AppForm
}
from
"
sumaris-lib
"
;
import
{
PlatformService
}
from
"
sumaris-lib
"
;
import
{
LocalSettingsService
}
from
"
sumaris-lib
"
;
import
{
NetworkService
}
from
"
sumaris-lib
"
;
@
Component
({
selector
:
'
app-form-auth
'
,
selector
:
'
app-
quadrige-
form-auth
'
,
templateUrl
:
'
form-auth.html
'
,
styleUrls
:
[
'
./form-auth.scss
'
],
animations
:
[
slideUpDownAnimation
],
...
...
@@ -45,11 +43,12 @@ export class AuthForm extends AppForm<AuthData> implements OnInit {
settings
:
LocalSettingsService
,
private
modalCtrl
:
ModalController
,
public
network
:
NetworkService
,
private
cd
:
ChangeDetectorRef
private
cd
:
ChangeDetectorRef
,
@
Inject
(
EnvironmentService
)
protected
environment
)
{
super
(
dateAdapter
,
formBuilder
.
group
({
username
:
[
null
,
Validators
.
compose
([
Validators
.
required
,
Validators
.
email
])
],
username
:
[
null
,
Validators
.
required
],
password
:
[
null
,
Validators
.
required
],
offline
:
[
network
.
offline
]
}),
settings
);
...
...
@@ -62,10 +61,10 @@ export class AuthForm extends AppForm<AuthData> implements OnInit {
ngOnInit
()
{
super
.
ngOnInit
();
// For DEV only
if
(
environment
.
production
===
false
)
{
if
(
this
.
environment
.
production
===
false
)
{
this
.
form
.
patchValue
({
username
:
'
admin@sumaris.net
'
,
password
:
'
admin
'
username
:
'
tstq2
'
,
password
:
'
q22006
'
});
}
}
...
...
src/app/core/auth/modal/modal-auth.html
View file @
87abe92e
...
...
@@ -23,8 +23,8 @@
</ion-header>
<ion-content>
<app-form-auth
(onSubmit)=
"doSubmit()"
(onCancel)=
"cancel()"
#form
>
</app-form-auth>
<app-
quadrige-
form-auth
(onSubmit)=
"doSubmit()"
(onCancel)=
"cancel()"
#form
>
</app-
quadrige-
form-auth>
</ion-content>
<ion-footer
hidden-xs
hidden-sm
hidden-mobile
>
...
...
src/app/core/auth/modal/modal-auth.ts
View file @
87abe92e
import
{
Component
,
ViewChild
}
from
'
@angular/core
'
;
import
{
ModalController
}
from
'
@ionic/angular
'
;
import
{
AccountService
}
from
"
../../services/account.service
"
;
import
{
AuthForm
}
from
'
../form/form-auth
'
;
import
{
firstNotNilPromise
}
from
"
sumaris-lib
/app/shared/observables
"
;
import
{
AccountService
,
firstNotNilPromise
}
from
"
sumaris-lib
"
;
@
Component
({
templateUrl
:
'
modal-auth.html
'
,
...
...
src/app/core/core.module.ts
deleted
100644 → 0
View file @
dab5996e
import
{
ModuleWithProviders
,
NgModule
}
from
'
@angular/core
'
;
import
{
RouterModule
}
from
'
@angular/router
'
;
import
{
AuthForm
}
from
'
./auth/form/form-auth
'
;
import
{
AuthModal
}
from
'
./auth/modal/modal-auth
'
;
import
{
IonicStorageModule
}
from
'
@ionic/storage
'
;
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;