Compare commits
No commits in common. "a9d42484cc202d5a025290b36d3a50694f573d5a" and "3f17341b2eec9c6bca96b8acedcf4e306a834d89" have entirely different histories.
a9d42484cc
...
3f17341b2e
53
Jenkinsfile
vendored
53
Jenkinsfile
vendored
@ -1,23 +1,54 @@
|
|||||||
@Library('farmmaps-shared-library') _
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any;
|
agent any
|
||||||
options {
|
environment {
|
||||||
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
|
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
|
||||||
|
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX}"
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('FarmmapsLibBuildAll') {
|
stage('npm install'){
|
||||||
steps {
|
steps {
|
||||||
stepFarmmapsLibBuildAll();
|
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
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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 {
|
post {
|
||||||
success {
|
|
||||||
postSuccess();
|
|
||||||
}
|
|
||||||
always {
|
always {
|
||||||
postAlways();
|
emailext (
|
||||||
|
body: '${DEFAULT_CONTENT}',
|
||||||
|
mimeType: 'text/html',
|
||||||
|
replyTo: '${DEFAULT_REPLYTO}',
|
||||||
|
subject: '${DEFAULT_SUBJECT}',
|
||||||
|
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,23 +1,54 @@
|
|||||||
@Library('farmmaps-shared-library') _
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any;
|
agent any
|
||||||
options {
|
environment {
|
||||||
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
|
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
|
||||||
|
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}"
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('FarmmapsLibBuildAll') {
|
stage('npm install'){
|
||||||
steps {
|
steps {
|
||||||
stepFarmmapsLibBuildAll();
|
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
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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 {
|
post {
|
||||||
success {
|
|
||||||
postSuccess();
|
|
||||||
}
|
|
||||||
always {
|
always {
|
||||||
postAlways();
|
emailext (
|
||||||
|
body: '${DEFAULT_CONTENT}',
|
||||||
|
mimeType: 'text/html',
|
||||||
|
replyTo: '${DEFAULT_REPLYTO}',
|
||||||
|
subject: '${DEFAULT_SUBJECT}',
|
||||||
|
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 73 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -51,17 +51,7 @@
|
|||||||
content: "i";
|
content: "i";
|
||||||
}
|
}
|
||||||
|
|
||||||
.fm-carbon:before {
|
hallo
|
||||||
content: "j";
|
|
||||||
}
|
|
||||||
|
|
||||||
.fm-bo-akkerbouw:before {
|
|
||||||
content: "k";
|
|
||||||
}
|
|
||||||
|
|
||||||
.fm-grass:before {
|
|
||||||
content: "l";
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "FarmMaps";
|
font-family: "FarmMaps";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "farmmaps-lib-app",
|
"name": "farmmaps-lib-app",
|
||||||
"version": "3.2.99",
|
"version": "3.0.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
@ -119,7 +119,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$)).subscribe(([query,mapState]) =>{
|
this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$)).subscribe(([query,mapState]) =>{
|
||||||
if(query && query.querystate) {
|
if(query && query.querystate) {
|
||||||
let newQueryState = tassign(mapReducers.initialQueryState);
|
let newQueryState = tassign(mapReducers.initialQueryState);
|
||||||
//console.debug(`Do Query`);
|
console.debug(`Do Query`);
|
||||||
const urlparts=[];
|
const urlparts=[];
|
||||||
if (query.querystate.itemCode && query.querystate.itemCode != "") {
|
if (query.querystate.itemCode && query.querystate.itemCode != "") {
|
||||||
if(query.querystate.itemType && query.querystate.itemType!= "") {
|
if(query.querystate.itemType && query.querystate.itemType!= "") {
|
||||||
@ -242,7 +242,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.initialized = false;
|
this.initialized = false;
|
||||||
//console.debug("Init");
|
console.debug("Init");
|
||||||
this.store.dispatch(new mapActions.Clear());
|
this.store.dispatch(new mapActions.Clear());
|
||||||
this.selectedFeatures$.next({x:0,y:0,features:[]});
|
this.selectedFeatures$.next({x:0,y:0,features:[]});
|
||||||
this.selectedFeatures$.next(null);
|
this.selectedFeatures$.next(null);
|
||||||
@ -314,7 +314,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
//console.debug("View init");
|
console.debug("View init");
|
||||||
this.noContent=true;
|
this.noContent=true;
|
||||||
this.route.children.forEach((entry) => {
|
this.route.children.forEach((entry) => {
|
||||||
if(entry.outlet=="primary") {
|
if(entry.outlet=="primary") {
|
||||||
@ -348,7 +348,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
})).subscribe((action) => {
|
})).subscribe((action) => {
|
||||||
if(action) {
|
if(action) {
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
//console.debug("Url to state");
|
console.debug("Url to state");
|
||||||
this.store.dispatch(action);
|
this.store.dispatch(action);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
}
|
}
|
||||||
})).subscribe((newUrlState) =>{
|
})).subscribe((newUrlState) =>{
|
||||||
if(newUrlState) {
|
if(newUrlState) {
|
||||||
//console.debug(`State to url`);
|
console.debug(`State to url`);
|
||||||
this.replaceUrl(newUrlState.mapState,newUrlState.queryState,newUrlState.replaceUrl);
|
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(mapState.baseLayerCode);
|
||||||
parts.push( this.serializeService.serialize(queryState));
|
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 });
|
this.router.navigate(parts, { replaceUrl: replace,relativeTo:this.route.parent });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -434,7 +434,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
handleOnMoveEnd(event) {
|
handleOnMoveEnd(event) {
|
||||||
if(this.initialized && this.viewEnabled) {
|
if(this.initialized && this.viewEnabled) {
|
||||||
this.zone.run(() =>{
|
this.zone.run(() =>{
|
||||||
//console.debug("Move end");
|
console.debug("Move end");
|
||||||
const map = event.map;
|
const map = event.map;
|
||||||
const view = map.getView();
|
const view = map.getView();
|
||||||
const rotation = view.getRotation();
|
const rotation = view.getRotation();
|
||||||
@ -443,7 +443,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
const viewExtent = view.calculateExtent(this.map.instance.getSize());
|
const viewExtent = view.calculateExtent(this.map.instance.getSize());
|
||||||
const mapState: IMapState = { xCenter: center[0], yCenter: center[1], zoom: zoom, rotation: rotation, baseLayerCode: null };
|
const mapState: IMapState = { xCenter: center[0], yCenter: center[1], zoom: zoom, rotation: rotation, baseLayerCode: null };
|
||||||
const state = { mapState: mapState, viewExtent: viewExtent };
|
const state = { mapState: mapState, viewExtent: viewExtent };
|
||||||
//console.debug("Center: ",center[0],center[1] );
|
console.debug("Center: ",center[0],center[1] );
|
||||||
const source = from([state]);
|
const source = from([state]);
|
||||||
source.pipe(withLatestFrom(this.selectedBaseLayer$)).subscribe(([state, baselayer]) => {
|
source.pipe(withLatestFrom(this.selectedBaseLayer$)).subscribe(([state, baselayer]) => {
|
||||||
if (mapState && baselayer) { // do not react on first move
|
if (mapState && baselayer) { // do not react on first move
|
||||||
|
@ -126,7 +126,7 @@ export class InitUserSettingsRoot implements Action {
|
|||||||
export class InitUserSettingsRootSuccess implements Action {
|
export class InitUserSettingsRootSuccess implements Action {
|
||||||
readonly type = INITUSERSETTINGSROOTSUCCESS;
|
readonly type = INITUSERSETTINGSROOTSUCCESS;
|
||||||
|
|
||||||
constructor(public item: IListItem ) { }
|
constructor(public item: IItem ) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class InitRoot implements Action {
|
export class InitRoot implements Action {
|
||||||
|
@ -69,7 +69,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
getActionFromEvent(event: IEventMessage): Action {
|
getActionFromEvent(event: IEventMessage): Action {
|
||||||
let action: Action = null;
|
let action: Action = null;
|
||||||
//console.debug(`${event.eventType} Event received`);
|
console.debug(`${event.eventType} Event received`);
|
||||||
switch (event.eventType) {
|
switch (event.eventType) {
|
||||||
case "ItemChanged": {
|
case "ItemChanged": {
|
||||||
action = new commonActions.ItemChangedEvent(event.itemCode, event.attributes);
|
action = new commonActions.ItemChangedEvent(event.itemCode, event.attributes);
|
||||||
@ -146,12 +146,12 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
private InstallAuthenticationEventHandler() {
|
private InstallAuthenticationEventHandler() {
|
||||||
// auth event handler
|
// auth event handler
|
||||||
this.oauthService$.events.subscribe((event) => {
|
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') {
|
if (event.type == 'token_error' || event.type == 'silent_refresh_timeout' || event.type == 'logout') {
|
||||||
const e = event as OAuthErrorEvent;
|
const e = event as OAuthErrorEvent;
|
||||||
const p = e.params as any;
|
const p = e.params as any;
|
||||||
if (event.type == 'silent_refresh_timeout' || event.type == 'logout' || (p.error && p.error == 'login_required')) {
|
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 } });
|
this.router.navigate(['loggedout'], { queryParams: { redirectTo: this.router.url } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,9 @@ export class AppCommonEffects {
|
|||||||
|
|
||||||
initUserSettingsRoot$ = createEffect(() => this.actions$.pipe(
|
initUserSettingsRoot$ = createEffect(() => this.actions$.pipe(
|
||||||
ofType(appCommonActions.INITUSERSETTINGSROOT),
|
ofType(appCommonActions.INITUSERSETTINGSROOT),
|
||||||
switchMap(_ => {
|
withLatestFrom(this.store$.select(appCommonReducers.SelectGetUser)),
|
||||||
return this.folderService$.getFolder('my_settings').pipe(
|
switchMap(([, user]) => {
|
||||||
|
return this.itemService$.getItem(user.code + ':USER_SETTINGS').pipe(
|
||||||
switchMap((item) => of(new appCommonActions.InitUserSettingsRootSuccess(item))),
|
switchMap((item) => of(new appCommonActions.InitUserSettingsRootSuccess(item))),
|
||||||
catchError(error => of(new appCommonActions.Fail(error)))
|
catchError(error => of(new appCommonActions.Fail(error)))
|
||||||
)
|
)
|
||||||
@ -169,7 +170,7 @@ export class AppCommonEffects {
|
|||||||
this.router$.navigate(['/map', query ])
|
this.router$.navigate(['/map', query ])
|
||||||
}else if(viewer == 'edit_in_editor') {
|
}else if(viewer == 'edit_in_editor') {
|
||||||
this.router$.navigate(['/editor', editor, 'item', a.item.code])
|
this.router$.navigate(['/editor', editor, 'item', a.item.code])
|
||||||
} else if(viewer) {
|
} else {
|
||||||
this.router$.navigate(['/viewer', viewer, 'item', a.item.code])
|
this.router$.navigate(['/viewer', viewer, 'item', a.item.code])
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
@ -181,18 +182,18 @@ export class AppCommonEffects {
|
|||||||
ofType(appCommonActions.FAIL),
|
ofType(appCommonActions.FAIL),
|
||||||
map((action) => {
|
map((action) => {
|
||||||
const failAction = action as appCommonActions.Fail;
|
const failAction = action as appCommonActions.Fail;
|
||||||
//console.debug(failAction.payload)
|
console.debug(failAction.payload)
|
||||||
return null;
|
return null;
|
||||||
})),{dispatch:false});
|
})),{dispatch:false});
|
||||||
|
|
||||||
online$ = createEffect(() => this.actions$.pipe(
|
online$ = createEffect(() => this.actions$.pipe(
|
||||||
ofType(appCommonActions.ONLINE),
|
ofType(appCommonActions.ONLINE),
|
||||||
switchMap((action) => {
|
switchMap((action) => {
|
||||||
//console.debug("Online: Check token");
|
console.debug("Online: Check token");
|
||||||
if(!this.oauthService$.hasValidAccessToken()) {
|
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 ) {
|
if(this.oauthService$.getRefreshToken() != null ) {
|
||||||
//console.debug("We have a refresh token");
|
console.debug("We have a refresh token");
|
||||||
this.oauthService$.refreshToken();
|
this.oauthService$.refreshToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,53 +24,44 @@ export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
|
|||||||
constructor(private oauthService: OAuthService, private router: Router, private store: Store<appCommonReducer.State>) { }
|
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> {
|
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;
|
const url: string = state.url;
|
||||||
|
|
||||||
return this.checkLogin(url, route);
|
return this.checkLogin(url, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
|
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;
|
const url: string = state.url;
|
||||||
|
|
||||||
return this.checkLogin(url, childRoute);
|
return this.checkLogin(url, childRoute);
|
||||||
}
|
}
|
||||||
|
|
||||||
canLoad(route: Route, segments: UrlSegment[]): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
|
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);
|
return this.checkLogin(route.path, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkLogin(url: string, route: ActivatedRouteSnapshot): boolean {
|
checkLogin(url: string, route: ActivatedRouteSnapshot): boolean {
|
||||||
//console.debug("AuthGuard->checkLogin", url, route);
|
console.debug("AuthGuard->checkLogin", url, route);
|
||||||
if (!this.oauthService.hasValidAccessToken()) {
|
if (!this.oauthService.hasValidAccessToken()) {
|
||||||
//console.debug("No valid token");
|
console.debug("No valid token");
|
||||||
this.oauthService.initCodeFlow(url);
|
this.oauthService.initCodeFlow(url);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const requiredRoleClaim = route.data.role;
|
const requiredRoleClaim = route.data.role;
|
||||||
if (!requiredRoleClaim) { return true; }
|
if (!requiredRoleClaim) { return true; }
|
||||||
const ownedClaims = this.oauthService.getIdentityClaims();
|
const ownedClaims = this.oauthService.getIdentityClaims();
|
||||||
if (!ownedClaims) {
|
if (!ownedClaims) { console.debug("No owned claims"); return false; }
|
||||||
//console.debug("No owned claims");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const ownedRoleClaims: string[] = ownedClaims['role'];
|
const ownedRoleClaims: string[] = ownedClaims['role'];
|
||||||
if (!ownedRoleClaims) {
|
if (!ownedRoleClaims) { console.debug("No owned role claims"); return false; }
|
||||||
// console.debug("No owned role claims");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (Array.isArray(ownedRoleClaims)) {
|
if (Array.isArray(ownedRoleClaims)) {
|
||||||
if (ownedRoleClaims.findIndex(r => r === requiredRoleClaim) <= -1) {
|
if (ownedRoleClaims.findIndex(r => r === requiredRoleClaim) <= -1) { console.debug("No required role claim", ownedRoleClaims, requiredRoleClaim); return false; }
|
||||||
//console.debug("No required role claim", ownedRoleClaims, requiredRoleClaim);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (ownedRoleClaims !== requiredRoleClaim) { console.debug("No required role claim", ownedRoleClaims, requiredRoleClaim); return false; }
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Observable} from 'rxjs';
|
import { Observable , Observer } from 'rxjs';
|
||||||
import {IListItem} from '../models/list.item';
|
import {map} from 'rxjs/operators';
|
||||||
import {IItem} from '../models/item';
|
import { IListItem } from '../models/list.item';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import { IItem } from '../models/item';
|
||||||
import {AppConfig} from '../shared/app.config';
|
import { HttpClient } from "@angular/common/http";
|
||||||
import {ItemService} from './item.service';
|
import { AppConfig } from "../shared/app.config";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class FolderService {
|
export class FolderService {
|
||||||
|
|
||||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig, public itemService: ItemService) {
|
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiEndpoint() {
|
ApiEndpoint() {
|
||||||
@ -27,16 +27,15 @@ export class FolderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getFolderParents(code: string): Observable<IListItem[]> {
|
getFolderParents(code: string): Observable<IListItem[]> {
|
||||||
return this.itemService.getBreadcrumbs(code);
|
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/parents`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getChildFolders(code: string): Observable<IListItem[]> {
|
getChildFolders(code: string): Observable<IListItem[]> {
|
||||||
const folderItemTypes = "FOLDER,FTP_FOLDER";
|
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/listfolders`);
|
||||||
return this.itemService.getChildItemList(code, folderItemTypes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getItems(code: string,skip:number, take:number): Observable<IListItem[]> {
|
getItems(code: string,skip:number, take:number): Observable<IListItem[]> {
|
||||||
return this.itemService.getChildItemList(code, null, null, 1, true, null, null, skip, take);
|
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/list?skip=${skip}&take=${take}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
moveItem(itemCode: string, newParentCode: string): Observable<IListItem> {
|
moveItem(itemCode: string, newParentCode: string): Observable<IListItem> {
|
||||||
|
@ -8,7 +8,6 @@ import { IItemTask } from '../models/itemTask';
|
|||||||
import { HttpClient, HttpParams,HttpHeaders } from "@angular/common/http";
|
import { HttpClient, HttpParams,HttpHeaders } from "@angular/common/http";
|
||||||
import { AppConfig } from "../shared/app.config";
|
import { AppConfig } from "../shared/app.config";
|
||||||
import {ItemTypeService} from './itemtype.service';
|
import {ItemTypeService} from './itemtype.service';
|
||||||
import {IListItem} from '../models/list.item';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@ -85,7 +84,7 @@ export class ItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level = 1, deep = true,
|
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level = 1, deep = true,
|
||||||
startDate?: Date, endDate?: Date, skip?: number, take?: number): Observable<IItem[]> {
|
startDate?: Date, endDate?: Date): Observable<IItem[]> {
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
if(itemType != null) {
|
if(itemType != null) {
|
||||||
params = params.append("it", itemType);
|
params = params.append("it", itemType);
|
||||||
@ -97,9 +96,6 @@ export class ItemService {
|
|||||||
params = params.append("deep", deep.toString());
|
params = params.append("deep", deep.toString());
|
||||||
if (startDate) params = params.append("sDate", startDate.toISOString());
|
if (startDate) params = params.append("sDate", startDate.toISOString());
|
||||||
if (endDate) params = params.append("eDate", endDate.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 });
|
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,8 +181,4 @@ export class ItemService {
|
|||||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/value/layer/${layerIndex}?c=${x},${y}&crs=${crs}`);
|
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`);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ export class PackagePreloadStrategy extends PreloadingStrategy {
|
|||||||
}
|
}
|
||||||
if(route.data && route.data.package) {
|
if(route.data && route.data.package) {
|
||||||
if(this.packageService$.hasPackage(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);
|
this.loading.add(route);
|
||||||
return load()
|
return load()
|
||||||
}
|
}
|
||||||
|
@ -52,8 +52,8 @@ export function provideBootstrapEffects(effects: Type<any>[]) {
|
|||||||
// console.log all actions
|
// console.log all actions
|
||||||
export function debug(reducer: ActionReducer<any>): ActionReducer<any> {
|
export function debug(reducer: ActionReducer<any>): ActionReducer<any> {
|
||||||
return function(state, action) {
|
return function(state, action) {
|
||||||
//console.debug('-- State', state);
|
console.debug('-- State', state);
|
||||||
//console.debug('-- Action', action);
|
console.debug('-- Action', action);
|
||||||
|
|
||||||
return reducer(state, action);
|
return reducer(state, action);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user