42 Commits

Author SHA1 Message Date
9e3f6010c3 Merge branch 'master' into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
# Conflicts:
#	package-lock.json
#	package.json
2023-10-05 16:27:20 +02:00
e6a637b866 AW-5467 - Refresh geeft leeg scherm
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2023-10-05 11:23:18 +02:00
Willem Dantuma
ccf77805a0 AW-5495
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-09-11 21:59:34 +02:00
2b2e1bfafa Layout
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-25 11:07:21 +02:00
3fd4ac2f94 error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-25 09:53:36 +02:00
9849eaf1e7 AW1873 Labels -> show below zoom, overflow + format centroid
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
2023-08-25 09:50:38 +02:00
b516cc07e2 AW1873Bouwplanlabels
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-24 09:05:42 +02:00
c9c9a2ddbf AW1873Bouwplanlabels
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-23 16:34:18 +02:00
1d0f3b958d AW1873Bouwplanlabels generalize
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-23 15:17:38 +02:00
45537cb2e9 ------------------------------------------------------------------------------
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
Building entry point '@farmmaps/common-map'
------------------------------------------------------------------------------
- Compiling with Angular sources in Ivy partial compilation mode.
Processing legacy "View Engine" libraries:
- ngx-openlayers [es2015/esm2015] ()
Encourage the library authors to publish an Ivy distribution.
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
✖ Compiling with Angular sources in Ivy partial compilation mode.
projects/common-map/src/fm-map/components/map/map.component.ts:371:83 - error TS2339: Property 'replaceUrl' does not exist on type '{ mapState: IMapState; queryState: IQueryState; }'.

371           this.replaceUrl(newUrlState.mapState,newUrlState.queryState,newUrlState.replaceUrl);
2023-08-22 18:55:16 +02:00
652ddc0cdc AW1873Bouwplanlabels
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
2023-08-22 18:45:46 +02:00
fd3b331cc0 AW-5419 RxJs => versie 7.x
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
2023-08-22 13:37:16 +02:00
9facbe76c8 AW1873Bouwplanlabels
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-22 13:16:37 +02:00
20dff38cf7 AW1873 labels -> undefined/null fixes
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-21 16:59:54 +02:00
e374bb8a73 AW1873 labels
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-21 16:28:32 +02:00
294b9c6dd3 kick version
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-09 10:17:50 +02:00
d92bf54c8d Revert "AW-2924 Cache codelists"
This reverts commit 914e272fc2.
2023-08-09 10:17:32 +02:00
914e272fc2 AW-2924 Cache codelists
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2023-08-07 14:49:04 +02:00
Willem Dantuma
b182b7fda6 Change select color
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-08-01 09:18:11 +02:00
Willem Dantuma
22040b43b3 fix selector naam
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-07-31 20:25:29 +02:00
Willem Dantuma
50170cf599 Fix selector name
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-07-31 20:19:47 +02:00
Willem Dantuma
2deff46a7e AW-5365 add selectViewGetExtent
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-07-31 20:07:22 +02:00
Willem Dantuma
e939a787ba AW-5365 add tags parameter
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-07-31 19:36:57 +02:00
Willem Dantuma
4ae9562ce1 Kick version
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-07-31 19:22:14 +02:00
Willem Dantuma
288e507e6c AW-5365 add crs parameter
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-07-31 19:14:13 +02:00
d9848a8ba3 AW-5371 Release 2023.08 libraries
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
2023-07-30 10:53:08 +02:00
a9d42484cc jenkins
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2023-07-26 17:52:01 +02:00
a276593c7f Merge branch 'develop' 2023-07-26 17:45:32 +02:00
ff50650c28 fix jenkins
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-06-27 16:30:49 +02:00
d7efeb8d59 fix build
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-06-27 16:27:18 +02:00
fd71d1f38e no message
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-06-27 16:02:52 +02:00
bc8c9f8bf9 no message
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
2023-06-27 15:56:17 +02:00
0865ca1a93 upped version
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-05-30 21:16:53 +02:00
1bc3983f55 AW-5071 refactor some parts 2023-05-30 21:16:20 +02:00
945d88839f AW-5036 404../api/v1/items/xxx:USER_SETTINGS (new environ)
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-05-08 09:12:37 +02:00
7c06343909 Aw4951 Non-fatal error if no viewer defined for itemtype
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-04-21 09:08:38 +02:00
b8f8f27794 Comment logging
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-04-11 11:33:11 +02:00
2a31771ac6 v3.1.0
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-03-28 13:38:35 +02:00
3f17341b2e Revert "++version"
Some checks failed
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
This reverts commit 6165f523cc.
2023-03-28 13:37:50 +02:00
6165f523cc ++version
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2023-03-28 13:30:16 +02:00
19dce51a28 Removed logging
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-03-28 13:26:37 +02:00
b29cd8e4c9 AW-4929 Add agrirouter font
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2023-03-28 12:20:27 +02:00
28 changed files with 566 additions and 220 deletions

54
Jenkinsfile vendored
View File

@@ -1,54 +1,24 @@
@Library('farmmaps-shared-library') _
pipeline {
agent any
environment {
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX}"
agent any;
options {
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
disableConcurrentBuilds abortPrevious: true;
}
stages {
stage('npm install'){
stage('FarmmapsLibBuildAll') {
steps {
sh '''rm -rf node_modules/
npm install --legacy-peer-deps
cd projects/common
npm install --legacy-peer-deps
cd ../common-map
npm install --legacy-peer-deps
cd ../common-map3d
npm install --legacy-peer-deps
'''
stepFarmmapsLibBuildAll();
}
}
stage('build'){
steps {
sh '''ng build common --configuration production
ng build common-map --configuration production
ng build common-map3d --configuration production'''
}
}
stage('npm publish'){
steps {
sh '''cd dist/common
npm version ${PACKAGE_VERSION} --allow-same-version
npm publish
cd ../common-map
npm version ${PACKAGE_VERSION} --allow-same-version
npm publish
cd ../common-map3d
npm version ${PACKAGE_VERSION} --allow-same-version
npm publish'''
}
}
}
post {
success {
postSuccess();
}
always {
emailext (
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
postAlways();
}
}
}

View File

@@ -1,54 +1,24 @@
@Library('farmmaps-shared-library') _
pipeline {
agent any
environment {
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}"
agent any;
options {
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
disableConcurrentBuilds abortPrevious: true;
}
stages {
stage('npm install'){
stage('FarmmapsLibBuildAll') {
steps {
sh '''rm -rf node_modules/
npm install --legacy-peer-deps
cd projects/common
npm install --legacy-peer-deps
cd ../common-map
npm install --legacy-peer-deps
cd ../common-map3d
npm install --legacy-peer-deps
'''
stepFarmmapsLibBuildAll();
}
}
stage('build'){
steps {
sh '''ng build common --configuration production
ng build common-map --configuration production
ng build common-map3d --configuration production'''
}
}
stage('npm publish'){
steps {
sh '''cd dist/common
npm version ${PACKAGE_VERSION}
npm publish
cd ../common-map
npm version ${PACKAGE_VERSION}
npm publish
cd ../common-map3d
npm version ${PACKAGE_VERSION}
npm publish'''
}
}
}
post {
success {
postSuccess();
}
always {
emailext (
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
postAlways();
}
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -51,7 +51,17 @@
content: "i";
}
hallo
.fm-carbon:before {
content: "j";
}
.fm-bo-akkerbouw:before {
content: "k";
}
.fm-grass:before {
content: "l";
}
@font-face {
font-family: "FarmMaps";

246
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "farmmaps-lib-app",
"version": "3.0.1",
"version": "3.5.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "farmmaps-lib-app",
"version": "3.0.1",
"version": "3.5.0",
"dependencies": {
"@angular-eslint/eslint-plugin": "^15.2.1",
"@angular/animations": "^14.1.3",
@@ -44,7 +44,7 @@
"ol": "6.14.1",
"olcs": "^2.13.1",
"resumablejs": "^1.1.0",
"rxjs": "^6.6.7",
"rxjs": "^7.8.1",
"stream": "^0.0.2",
"stream-http": "^3.2.0",
"tassign": "^1.0.0",
@@ -182,6 +182,24 @@
"yarn": ">= 1.13.0"
}
},
"node_modules/@angular-devkit/architect/node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"dependencies": {
"tslib": "^1.9.0"
},
"engines": {
"npm": ">=2.0.0"
}
},
"node_modules/@angular-devkit/architect/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@angular-devkit/build-angular": {
"version": "14.2.10",
"resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-14.2.10.tgz",
@@ -331,6 +349,24 @@
}
}
},
"node_modules/@angular-devkit/build-angular/node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"dependencies": {
"tslib": "^1.9.0"
},
"engines": {
"npm": ">=2.0.0"
}
},
"node_modules/@angular-devkit/build-angular/node_modules/rxjs/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@angular-devkit/build-webpack": {
"version": "0.1402.10",
"resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1402.10.tgz",
@@ -391,6 +427,24 @@
}
}
},
"node_modules/@angular-devkit/build-webpack/node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"dependencies": {
"tslib": "^1.9.0"
},
"engines": {
"npm": ">=2.0.0"
}
},
"node_modules/@angular-devkit/build-webpack/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@angular-devkit/core": {
"version": "14.2.1",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-14.2.1.tgz",
@@ -417,6 +471,24 @@
}
}
},
"node_modules/@angular-devkit/core/node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"dependencies": {
"tslib": "^1.9.0"
},
"engines": {
"npm": ">=2.0.0"
}
},
"node_modules/@angular-devkit/core/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@angular-devkit/schematics": {
"version": "14.2.1",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-14.2.1.tgz",
@@ -435,6 +507,24 @@
"yarn": ">= 1.13.0"
}
},
"node_modules/@angular-devkit/schematics/node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"dependencies": {
"tslib": "^1.9.0"
},
"engines": {
"npm": ">=2.0.0"
}
},
"node_modules/@angular-devkit/schematics/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@angular-eslint/bundled-angular-compiler": {
"version": "15.2.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-15.2.1.tgz",
@@ -9491,15 +9581,6 @@
"node": ">=8"
}
},
"node_modules/inquirer/node_modules/rxjs": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz",
"integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==",
"dev": true,
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/inquirer/node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -11627,15 +11708,6 @@
"node": "^12.20.0 || >=14"
}
},
"node_modules/ng-packagr/node_modules/rxjs": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz",
"integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==",
"dev": true,
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/ngrx-store-localstorage": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/ngrx-store-localstorage/-/ngrx-store-localstorage-14.0.0.tgz",
@@ -14488,21 +14560,13 @@
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
},
"node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"dependencies": {
"tslib": "^1.9.0"
},
"engines": {
"npm": ">=2.0.0"
"tslib": "^2.1.0"
}
},
"node_modules/rxjs/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
@@ -17133,6 +17197,23 @@
"requires": {
"@angular-devkit/core": "14.2.1",
"rxjs": "6.6.7"
},
"dependencies": {
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@angular-devkit/build-angular": {
@@ -17228,6 +17309,23 @@
"rxjs": "6.6.7",
"source-map": "0.7.4"
}
},
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
}
}
},
@@ -17263,6 +17361,21 @@
"rxjs": "6.6.7",
"source-map": "0.7.4"
}
},
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
@@ -17277,6 +17390,23 @@
"jsonc-parser": "3.1.0",
"rxjs": "6.6.7",
"source-map": "0.7.4"
},
"dependencies": {
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@angular-devkit/schematics": {
@@ -17290,6 +17420,23 @@
"magic-string": "0.26.2",
"ora": "5.4.1",
"rxjs": "6.6.7"
},
"dependencies": {
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@angular-eslint/bundled-angular-compiler": {
@@ -23816,15 +23963,6 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"rxjs": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz",
"integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==",
"dev": true,
"requires": {
"tslib": "^2.1.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -25424,15 +25562,6 @@
"resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz",
"integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==",
"dev": true
},
"rxjs": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz",
"integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==",
"dev": true,
"requires": {
"tslib": "^2.1.0"
}
}
}
},
@@ -27452,18 +27581,11 @@
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
},
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"requires": {
"tslib": "^1.9.0"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
"tslib": "^2.1.0"
}
},
"safe-buffer": {

View File

@@ -1,6 +1,6 @@
{
"name": "farmmaps-lib-app",
"version": "3.0.2",
"version": "3.5.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
@@ -47,7 +47,7 @@
"ol": "6.14.1",
"olcs": "^2.13.1",
"resumablejs": "^1.1.0",
"rxjs": "^6.6.7",
"rxjs": "^7.8.1",
"stream": "^0.0.2",
"stream-http": "^3.2.0",
"tassign": "^1.0.0",
@@ -86,4 +86,4 @@
"ts-node": "^8.8.1",
"typescript": "~4.6.4"
}
}
}

View File

@@ -250,8 +250,8 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
return new style.Style(
{
stroke: new style.Stroke({
color: 'red',
width: 2
color: '#0d6efd',
width: 3
})
}
);
@@ -466,7 +466,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
mapEventHandler = (event) => {
// select only when having observers
if(event.type === 'click' && !this.onFeatureSelected.observers.length) return;
if(event.type === 'pointermove' && !this.onFeatureHover.observers.length) return;
if(event.type === 'pointermove' && !this.onFeatureHover.observers.length) return;
const itemLayer= this.getItemlayer(this.itemLayer);
if(itemLayer && itemLayer.layer) {
this.selectedFeatures = {};

View File

@@ -1,6 +1,6 @@
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken } from '@angular/core';
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken, OnDestroy, LOCALE_ID } from '@angular/core';
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ngx-openlayers';
import { ItemService, ItemTypeService, IItem, IItemType } from '@farmmaps/common';
import { ItemService, ItemTypeService, IItem, IItemType, FolderService } from '@farmmaps/common';
import { Feature } from 'ol';
import { Point, Geometry } from 'ol/geom';
@@ -17,6 +17,9 @@ import { GeoJSON } from 'ol/format';
import { Select } from 'ol/interaction';
import { IStyles } from '../../../models/style.cache';
import { FeatureIconService } from '../../../services/feature-icon.service';
import { Subscription } from 'rxjs';
import { getCenter } from 'ol/extent';
import { formatNumber } from '@angular/common';
@Component({
selector: 'fm-map-item-source-vector',
@@ -25,7 +28,7 @@ import { FeatureIconService } from '../../../services/feature-icon.service';
{ provide: SourceVectorComponent, useExisting: forwardRef(() => ItemVectorSourceComponent) }
]
})
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnChanges {
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnDestroy, OnChanges {
instance: Vector<Geometry>;
private _format: GeoJSON;
private _select: Select;
@@ -38,8 +41,10 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
@Output() onFeatureSelected: EventEmitter<Feature<Geometry>> = new EventEmitter<Feature<Geometry>>();
@Output() onFeatureHover: EventEmitter<Feature<Geometry>> = new EventEmitter<Feature<Geometry>>();
private stylesCache: IStyles = {};
private sub: Subscription;
private displayMapFeatureSettings: { [code: string]: string[] } = defaultDisplayMapFeatureSettings();
constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService, private featureIconService$: FeatureIconService) {
constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService, private featureIconService$: FeatureIconService, private folderService: FolderService, @Inject(LOCALE_ID) private locale: string) {
super(layer);
this._format = new GeoJSON();
}
@@ -76,6 +81,17 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
}
ngOnInit() {
this.sub = this.folderService.getFolder('my_settings').subscribe(
userSettingsRoot => {
this.itemService.getChildItemList(userSettingsRoot.code, 'vnd.farmmaps.itemtype.settings.general').subscribe(
items => {
if (items && items.length > 0 && items[0].data?.displayMapFeatureSettings) {
this.displayMapFeatureSettings = items[0].data?.displayMapFeatureSettings;
}
}
)
}
);
this.strategy = loadingstrategy.bbox;
this.format = new GeoJSON();
this._select = new Select({
@@ -133,7 +149,8 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
fill: new style.Fill({
color: fillColor
}),
geometry: (feature: Feature<Geometry>) => this.geometry(feature)
geometry: (feature: Feature<Geometry>) => this.geometry(feature),
text: this.getDisplayTextForFeature(feature, this.map.instance.getView().getZoom())
});
} else {
key = 'file';
@@ -153,6 +170,10 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
});
}
ngOnDestroy(): void {
if (this.sub) this.sub.unsubscribe();
}
ngOnChanges(changes: SimpleChanges) {
if (changes["features"] && this.instance) {
this.instance.clear(true);
@@ -188,4 +209,51 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
}
}
}
getDisplayTextForFeature(feature: Feature<Geometry>, zoom: number, overrule?: style.Text) {
if (!feature) return null;
const propertiesToShow: string[] = this.displayMapFeatureSettings[feature.get('itemType')];
if (!propertiesToShow) return null;
if (propertiesToShow.length <= 0) return null;
if (zoom < 14) return null;
let displayText = '';
for (let i = 0; i < propertiesToShow.length; i++) {
let value = feature.get(propertiesToShow[i]);
switch (propertiesToShow[i]) {
case "area": value = formatNumber(value, this.locale, '0.1-2') + ' ha'; break;
case "centroid": {
if (feature.getGeometry()) {
const centroid = getCenter(feature.getGeometry().getExtent());
value = Math.round(centroid[0]) + ',' + Math.round(centroid[1]);
}
}
if (value) {
displayText += value + (i < propertiesToShow.length ? '\n' : '');
}
}
const styleText = new style.Text({
font: '13px Calibri,sans-serif',
fill: new style.Fill({ color: '#ffffff' }),
stroke: new style.Stroke({ color: '#000000', width: 2 }),
text: displayText
});
if (overrule) {
if (overrule.getFont()) styleText.setFont(overrule.getFont());
if (overrule.getFill()) styleText.setFill(overrule.getFill());
if (overrule.getStroke()) styleText.setStroke(overrule.getStroke());
}
return styleText;
}
}
}
function defaultDisplayMapFeatureSettings() {
return {
'vnd.farmmaps.itemtype.cropfield': ['name', 'cropTypeName', 'area']
};
}

View File

@@ -119,7 +119,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$)).subscribe(([query,mapState]) =>{
if(query && query.querystate) {
let newQueryState = tassign(mapReducers.initialQueryState);
console.debug(`Do Query`);
//console.debug(`Do Query`);
const urlparts=[];
if (query.querystate.itemCode && query.querystate.itemCode != "") {
if(query.querystate.itemType && query.querystate.itemType!= "") {
@@ -242,7 +242,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
ngOnInit() {
this.initialized = false;
console.debug("Init");
//console.debug("Init");
this.store.dispatch(new mapActions.Clear());
this.selectedFeatures$.next({x:0,y:0,features:[]});
this.selectedFeatures$.next(null);
@@ -314,7 +314,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
}
ngAfterViewInit() {
console.debug("View init");
//console.debug("View init");
this.noContent=true;
this.route.children.forEach((entry) => {
if(entry.outlet=="primary") {
@@ -348,7 +348,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
})).subscribe((action) => {
if(action) {
this.zone.run(() => {
console.debug("Url to state");
//console.debug("Url to state");
this.store.dispatch(action);
});
}
@@ -365,9 +365,9 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
else {
return of(null);
}
})).subscribe((newUrlState) =>{
})).subscribe((newUrlState: any) => {
if(newUrlState) {
console.debug(`State to url`);
//console.debug(`State to url`);
this.replaceUrl(newUrlState.mapState,newUrlState.queryState,newUrlState.replaceUrl);
}
});
@@ -425,7 +425,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
parts.push(mapState.baseLayerCode);
parts.push( this.serializeService.serialize(queryState));
console.debug("Replace url",parts);
//console.debug("Replace url",parts);
this.router.navigate(parts, { replaceUrl: replace,relativeTo:this.route.parent });
}
}
@@ -434,7 +434,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
handleOnMoveEnd(event) {
if(this.initialized && this.viewEnabled) {
this.zone.run(() =>{
console.debug("Move end");
//console.debug("Move end");
const map = event.map;
const view = map.getView();
const rotation = view.getRotation();
@@ -443,7 +443,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
const viewExtent = view.calculateExtent(this.map.instance.getSize());
const mapState: IMapState = { xCenter: center[0], yCenter: center[1], zoom: zoom, rotation: rotation, baseLayerCode: null };
const state = { mapState: mapState, viewExtent: viewExtent };
console.debug("Center: ",center[0],center[1] );
//console.debug("Center: ",center[0],center[1] );
const source = from([state]);
source.pipe(withLatestFrom(this.selectedBaseLayer$)).subscribe(([state, baselayer]) => {
if (mapState && baselayer) { // do not react on first move

View File

@@ -25,6 +25,7 @@
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-plus" aria-hidden="true" i18n-title title="Add as layer"></i>&nbsp;<span i18n>Add as overlay</span></a></li>
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i>&nbsp;<span i18n>Remove overlay</span></a></li>
</ng-container>
<li><fm-item-link class="text-primary p-0" [itemCode]="item.code" pathSuffix="data" [showText]="true"></fm-item-link></li>
</ul>
</div>
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>

View File

@@ -588,6 +588,7 @@ export const getClearEnabled = (state: State) => state.clearEnabled;
export const getSearchCollapsed = (state: State) => state.searchCollapsed;
export const getSearchMinified = (state: State) => state.searchMinified;
export const getExtent = (state: State) => state.extent;
export const getViewExtent = (state: State) => state.viewExtent;
export const getOverlayLayers = (state: State) => state.overlayLayers;
export const getBaseLayers = (state: State) => state.baseLayers;
export const getProjection = (state: State) => state.projection;
@@ -622,6 +623,7 @@ export const selectGetClearEnabled = createSelector(selectMapState, getClearEnab
export const selectGetSearchCollapsed = createSelector(selectMapState, getSearchCollapsed);
export const selectGetSearchMinified = createSelector(selectMapState, getSearchMinified);
export const selectGetExtent = createSelector(selectMapState, getExtent);
export const selectGetViewExtent = createSelector(selectMapState, getViewExtent);
export const selectGetOverlayLayers = createSelector(selectMapState, getOverlayLayers);
export const selectGetBaseLayers = createSelector(selectMapState, getBaseLayers);
export const selectGetProjection = createSelector(selectMapState, getProjection);

View File

@@ -126,7 +126,7 @@ export class InitUserSettingsRoot implements Action {
export class InitUserSettingsRootSuccess implements Action {
readonly type = INITUSERSETTINGSROOTSUCCESS;
constructor(public item: IItem ) { }
constructor(public item: IListItem ) { }
}
export class InitRoot implements Action {

View File

@@ -42,6 +42,8 @@ import { IEventMessage } from './models/event.message';
import { IItem, Item } from './models/item';
import { WeatherCurrentObservation } from './models/weatherCurrentObservation';
import { IItemType } from './models/item.type';
import { IItemLinkType} from './models/itemlink.type';
import {IUrlType} from './models/url.type';
import { IItemTypes } from './models/item.types';
import { IItemTask, ItemTask } from './models/itemTask';
import { IListItem } from './models/list.item';
@@ -65,6 +67,7 @@ import { HelpMenuComponent} from './components/help-menu/help-menu.component';
import { BackButtonComponent } from './components/back-button/back-button.component';
import { EditImageModalComponent } from './components/edit-image-modal/edit-image-modal.component';
import { AvatarComponent } from './components/avatar/avatar.component';
import { ItemLinkComponent } from './components/item-link/item-link.component';
import { AvatarModule } from 'ngx-avatar';
import { ImageCropperModule } from 'ngx-image-cropper';
@@ -92,6 +95,8 @@ export {
IItem,
Item,
IItemType,
IItemLinkType,
IUrlType,
IItemTypes,
IItemTask,
ItemTask,
@@ -115,6 +120,7 @@ export {
IGradientstop,
BackButtonComponent,
AvatarComponent,
ItemLinkComponent,
EditImageModalComponent,
GradientComponent,
GradientSelectComponent
@@ -160,7 +166,8 @@ export {
BackButtonComponent,
ThumbnailComponent,
EditImageModalComponent,
AvatarComponent
AvatarComponent,
ItemLinkComponent
],
exports: [
NgbModule,
@@ -189,6 +196,7 @@ export {
BackButtonComponent,
ThumbnailComponent,
AvatarComponent,
ItemLinkComponent,
EditImageModalComponent
]
})

View File

@@ -69,7 +69,7 @@ export class AppComponent implements OnInit, OnDestroy {
getActionFromEvent(event: IEventMessage): Action {
let action: Action = null;
console.debug(`${event.eventType} Event received`);
//console.debug(`${event.eventType} Event received`);
switch (event.eventType) {
case "ItemChanged": {
action = new commonActions.ItemChangedEvent(event.itemCode, event.attributes);
@@ -115,18 +115,11 @@ export class AppComponent implements OnInit, OnDestroy {
return action;
}
async loadItemTypes() {
await this.itemTypeService$.load(this.appConfig$)
}
ngOnInit() {
this.InstallRouteEventHandler();
this.InstallEventServiceEventHandler();
this.InstallAuthenticationEventHandler();
this.InstallHealthCheck();
//load item types
this.loadItemTypes();
}
@HostListener('document:keyup', ['$event'])
@@ -146,12 +139,12 @@ export class AppComponent implements OnInit, OnDestroy {
private InstallAuthenticationEventHandler() {
// auth event handler
this.oauthService$.events.subscribe((event) => {
console.debug(event.type);
//console.debug(event.type);
if (event.type == 'token_error' || event.type == 'silent_refresh_timeout' || event.type == 'logout') {
const e = event as OAuthErrorEvent;
const p = e.params as any;
if (event.type == 'silent_refresh_timeout' || event.type == 'logout' || (p.error && p.error == 'login_required')) {
console.debug("Session expired");
//console.debug("Session expired");
this.router.navigate(['loggedout'], { queryParams: { redirectTo: this.router.url } });
}
}

View File

@@ -0,0 +1 @@
<span class="item-link" (click)="copylink(copiedtt)" triggers="manual" ngbTooltip="Link copied" #copiedtt="ngbTooltip" ><i ngbTooltip='Copy link' class="fa-solid fa-link"></i> <span *ngIf="showText" i18n>Copy link</span></span>

View File

@@ -0,0 +1,44 @@
import { Component, Input, OnDestroy} from '@angular/core';
import { IItemLinkType} from '../../models/itemlink.type'
import { IUrlType } from '../../models/url.type';
import { ItemService } from '../../common-service.module';
import { Subscription } from 'rxjs';
import { ClipboardService } from 'ngx-clipboard'
@Component({
selector: 'fm-item-link',
templateUrl: './item-link.component.html'
})
export class ItemLinkComponent implements OnDestroy {
@Input() itemCode:string;
@Input() pathSuffix:string;
@Input() query:string;
@Input() validMinutes:number;
@Input() showText:boolean;
private sub : Subscription = null;
constructor(private itemService:ItemService,private clipboardService$: ClipboardService) { }
copylink(tooltip) {
if(this.sub) {
this.sub.unsubscribe();
}
let link: IItemLinkType = {itemcode:this.itemCode,pathsuffix:this.pathSuffix,query:this.query,validminutes:this.validMinutes}
this.sub = this.itemService.getItemLink(link).subscribe((url:IUrlType) => {
this.clipboardService$.copy(url.url);
tooltip.open();
setTimeout(() => {
tooltip.close();
}, 2000);
})
}
ngOnDestroy(): void {
if(this.sub) {
this.sub.unsubscribe();
}
}
}

View File

@@ -85,9 +85,8 @@ export class AppCommonEffects {
initUserSettingsRoot$ = createEffect(() => this.actions$.pipe(
ofType(appCommonActions.INITUSERSETTINGSROOT),
withLatestFrom(this.store$.select(appCommonReducers.SelectGetUser)),
switchMap(([, user]) => {
return this.itemService$.getItem(user.code + ':USER_SETTINGS').pipe(
switchMap(_ => {
return this.folderService$.getFolder('my_settings').pipe(
switchMap((item) => of(new appCommonActions.InitUserSettingsRootSuccess(item))),
catchError(error => of(new appCommonActions.Fail(error)))
)
@@ -170,7 +169,7 @@ export class AppCommonEffects {
this.router$.navigate(['/map', query ])
}else if(viewer == 'edit_in_editor') {
this.router$.navigate(['/editor', editor, 'item', a.item.code])
} else {
} else if(viewer) {
this.router$.navigate(['/viewer', viewer, 'item', a.item.code])
}
return [];
@@ -182,18 +181,18 @@ export class AppCommonEffects {
ofType(appCommonActions.FAIL),
map((action) => {
const failAction = action as appCommonActions.Fail;
console.debug(failAction.payload)
//console.debug(failAction.payload)
return null;
})),{dispatch:false});
online$ = createEffect(() => this.actions$.pipe(
ofType(appCommonActions.ONLINE),
switchMap((action) => {
console.debug("Online: Check token");
//console.debug("Online: Check token");
if(!this.oauthService$.hasValidAccessToken()) {
console.debug("No valid token, try to refresh");
//console.debug("No valid token, try to refresh");
if(this.oauthService$.getRefreshToken() != null ) {
console.debug("We have a refresh token");
//console.debug("We have a refresh token");
this.oauthService$.refreshToken();
}
}

View File

@@ -0,0 +1,6 @@
export interface IItemLinkType {
itemcode: string;
pathsuffix?: string;
query?: string;
validminutes?: number;
}

View File

@@ -0,0 +1,3 @@
export interface IUrlType {
url: string;
}

View File

@@ -24,44 +24,53 @@ export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
constructor(private oauthService: OAuthService, private router: Router, private store: Store<appCommonReducer.State>) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
console.debug("AuthGuard->canActivate", route, state);
//console.debug("AuthGuard->canActivate", route, state);
const url: string = state.url;
return this.checkLogin(url, route);
}
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
console.debug("AuthGuard->canActivateChild", childRoute, state);
//console.debug("AuthGuard->canActivateChild", childRoute, state);
const url: string = state.url;
return this.checkLogin(url, childRoute);
}
canLoad(route: Route, segments: UrlSegment[]): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
console.debug("AuthGuard->canLoad", route, segments);
//console.debug("AuthGuard->canLoad", route, segments);
return this.checkLogin(route.path, null);
}
checkLogin(url: string, route: ActivatedRouteSnapshot): boolean {
console.debug("AuthGuard->checkLogin", url, route);
//console.debug("AuthGuard->checkLogin", url, route);
if (!this.oauthService.hasValidAccessToken()) {
console.debug("No valid token");
//console.debug("No valid token");
this.oauthService.initCodeFlow(url);
return false;
} else {
const requiredRoleClaim = route.data.role;
if (!requiredRoleClaim) { return true; }
const ownedClaims = this.oauthService.getIdentityClaims();
if (!ownedClaims) { console.debug("No owned claims"); return false; }
if (!ownedClaims) {
//console.debug("No owned claims");
return false;
}
const ownedRoleClaims: string[] = ownedClaims['role'];
if (!ownedRoleClaims) { console.debug("No owned role claims"); return false; }
if (!ownedRoleClaims) {
// console.debug("No owned role claims");
return false;
}
if (Array.isArray(ownedRoleClaims)) {
if (ownedRoleClaims.findIndex(r => r === requiredRoleClaim) <= -1) { console.debug("No required role claim", ownedRoleClaims, requiredRoleClaim); return false; }
if (ownedRoleClaims.findIndex(r => r === requiredRoleClaim) <= -1) {
//console.debug("No required role claim", ownedRoleClaims, requiredRoleClaim);
return false;
}
}
else {
if (ownedRoleClaims !== requiredRoleClaim) { console.debug("No required role claim", ownedRoleClaims, requiredRoleClaim); return false; }
}
console.debug("Has required role claim", requiredRoleClaim);
//console.debug("Has required role claim", requiredRoleClaim);
return true;
}
}

View File

@@ -1,17 +1,17 @@
import { Injectable } from '@angular/core';
import { Observable , Observer } from 'rxjs';
import {map} from 'rxjs/operators';
import { IListItem } from '../models/list.item';
import { IItem } from '../models/item';
import { HttpClient } from "@angular/common/http";
import { AppConfig } from "../shared/app.config";
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {IListItem} from '../models/list.item';
import {IItem} from '../models/item';
import {HttpClient} from '@angular/common/http';
import {AppConfig} from '../shared/app.config';
import {ItemService} from './item.service';
@Injectable({
providedIn: 'root',
})
export class FolderService {
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
constructor(public httpClient: HttpClient, public appConfig: AppConfig, public itemService: ItemService) {
}
ApiEndpoint() {
@@ -19,23 +19,24 @@ export class FolderService {
}
getFolder(code: string): Observable<IListItem> {
return this.httpClient.get<IListItem>(`${this.ApiEndpoint()}/api/v1/folders/${code}`);
return this.httpClient.get<IListItem>(`${this.ApiEndpoint()}/api/v1/folders/${code}`);
}
getMyRoots(): Observable<IListItem[]> {
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/my_roots`);
}
}
getFolderParents(code: string): Observable<IListItem[]> {
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/parents`);
return this.itemService.getBreadcrumbs(code);
}
getChildFolders(code: string): Observable<IListItem[]> {
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/listfolders`);
const folderItemTypes = "FOLDER,FTP_FOLDER";
return this.itemService.getChildItemList(code, folderItemTypes);
}
getItems(code: string,skip:number, take:number): Observable<IListItem[]> {
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/list?skip=${skip}&take=${take}`);
return this.itemService.getChildItemList(code, null, null, 1, true, null, null, skip, take);
}
moveItem(itemCode: string, newParentCode: string): Observable<IListItem> {

View File

@@ -2,12 +2,15 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { IItemType } from '../models/item.type';
import { IItemLinkType } from '../models/itemlink.type';
import { IUrlType } from '../models/url.type';
import { IItem } from '../models/item';
import { IJsonline } from '../models/json-line';
import { IItemTask } from '../models/itemTask';
import { HttpClient, HttpParams,HttpHeaders } from "@angular/common/http";
import { AppConfig } from "../shared/app.config";
import {ItemTypeService} from './itemtype.service';
import {IListItem} from '../models/list.item';
@Injectable({
providedIn: 'root',
@@ -62,6 +65,10 @@ export class ItemService {
return this.httpClient.get<IItem>(`${this.ApiEndpoint()}/api/v1/items/${code}`);
}
getItemLink(itemLink: IItemLinkType): Observable<any> {
return this.httpClient.post<IItemLinkType>(`${this.ApiEndpoint()}/api/v1/itemlink`,itemLink);
}
getItemData(code: string,start?:number,size?:number): Observable<ArrayBuffer> {
let headers = new HttpHeaders();
if(start !== undefined && size !== undefined) headers=headers.set("Range",`bytes=${start}-${size-1}`);
@@ -72,7 +79,7 @@ export class ItemService {
return this.httpClient.get<IItem>(`${this.ApiEndpoint()}/api/v1/items/${code}/${itemType}`);
}
getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean): Observable<IItem[]> {
getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean,tags?:string,crs?:string): Observable<IItem[]> {
let params = new HttpParams();
if(itemType) params = params.append("it", itemType);
if(dataFilter) params = params.append("df", JSON.stringify(dataFilter));
@@ -80,11 +87,13 @@ export class ItemService {
if(indexed) params = params.append("ind",indexed?"true":"false");
if (level) params = params.append("lvl", level.toFixed());
if (validToday) params = params.append("vt", validToday ? "true" : "false");
if (tags) params = params.append("t", tags);
if (crs) params = params.append("crs", crs);
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params });
}
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level = 1, deep = true,
startDate?: Date, endDate?: Date): Observable<IItem[]> {
startDate?: Date, endDate?: Date, skip?: number, take?: number): Observable<IItem[]> {
let params = new HttpParams();
if(itemType != null) {
params = params.append("it", itemType);
@@ -96,6 +105,9 @@ export class ItemService {
params = params.append("deep", deep.toString());
if (startDate) params = params.append("sDate", startDate.toISOString());
if (endDate) params = params.append("eDate", endDate.toISOString());
if(skip) params = params.append("skip", skip);
if(take) params = params.append("take", take);
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
}
@@ -181,4 +193,8 @@ export class ItemService {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/value/layer/${layerIndex}?c=${x},${y}&crs=${crs}`);
}
getBreadcrumbs(itemCode: string): Observable<IListItem[]> {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/breadcrumbs`);
}
}

View File

@@ -21,7 +21,7 @@ export class PackagePreloadStrategy extends PreloadingStrategy {
}
if(route.data && route.data.package) {
if(this.packageService$.hasPackage(route.data.package)) {
console.debug(`Load module for package ${route.data.package}`)
//console.debug(`Load module for package ${route.data.package}`)
this.loading.add(route);
return load()
}

View File

@@ -11,7 +11,8 @@ import { IAuthconfigFactory } from './authconfigFactory';
export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthService: OAuthService, authconfigFactory:IAuthconfigFactory,authStorage:OAuthStorage,itemtypeService:ItemTypeService): () => Promise<any> {
return (): Promise<any> => {
return new Promise<void>((resolve,reject) => {
appConfig.load().then(() => {
appConfig.load().then(() => {
itemtypeService.load(appConfig);
oauthService.configure(authconfigFactory.getAuthConfig(appConfig));
oauthService.setStorage(authStorage);
oauthService.setupAutomaticSilentRefresh();

View File

@@ -52,8 +52,8 @@ export function provideBootstrapEffects(effects: Type<any>[]) {
// console.log all actions
export function debug(reducer: ActionReducer<any>): ActionReducer<any> {
return function(state, action) {
console.debug('-- State', state);
console.debug('-- Action', action);
//console.debug('-- State', state);
//console.debug('-- Action', action);
return reducer(state, action);
};