From 27bd2fed8a4cb0740cd7052e28df28943ec4cb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Lafreni=C3=A8re?= <53181414+PhilippeLafreniere18@users.noreply.github.com> Date: Mon, 7 Nov 2022 08:59:40 -0500 Subject: [PATCH] feat(edition): allow absolute url if config is not defined (#1127) --- .../workspace/shared/edition-workspace.service.ts | 10 +++++++--- .../src/lib/workspace/shared/edition-workspace.ts | 12 +++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts b/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts index 069c3399bb..4ee82e9114 100644 --- a/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts @@ -389,10 +389,13 @@ export class EditionWorkspaceService { this.sanitizeParameter(feature, workspace); + const baseUrl = workspace.layer.dataSource.options.edition.baseUrl; let url = this.configService.getConfig('edition.url'); - if (workspace.layer.dataSource.options.edition.baseUrl) { - url += workspace.layer.dataSource.options.edition.baseUrl; + if (!url) { + url = baseUrl; + } else { + url += baseUrl ? baseUrl : ''; } if (feature.newFeature) { @@ -613,7 +616,8 @@ export class EditionWorkspaceService { getDomainValues(relation: RelationOptions): Observable { let url = relation.url; if (!url) { - url = this.configService.getConfig('edition.url') + relation.table; + url = this.configService.getConfig('edition.url') ? + this.configService.getConfig('edition.url') + relation.table : relation.table; } return this.http.get(url).pipe( diff --git a/packages/geo/src/lib/workspace/shared/edition-workspace.ts b/packages/geo/src/lib/workspace/shared/edition-workspace.ts index bd2f630bc6..dec2e651ab 100644 --- a/packages/geo/src/lib/workspace/shared/edition-workspace.ts +++ b/packages/geo/src/lib/workspace/shared/edition-workspace.ts @@ -123,14 +123,16 @@ export class EditionWorkspace extends Workspace { dialogRef.afterClosed().subscribe(result => { if (result === false) { + let id, url; const baseUrl = workspace.layer.dataSource.options.edition.baseUrl; const deleteUrl = workspace.layer.dataSource.options.edition.deleteUrl; - let id; - let url; - if (baseUrl) { - url = this.configService.getConfig('edition.url') + baseUrl + '?' + deleteUrl; + if (baseUrl.length) { + url = this.configService.getConfig('edition.url') ? + this.configService.getConfig('edition.url') + baseUrl + '?' + deleteUrl : + baseUrl + '?' + deleteUrl; } else { - url = this.configService.getConfig('edition.url') + deleteUrl; + url = this.configService.getConfig('edition.url') ? + this.configService.getConfig('edition.url') + deleteUrl : deleteUrl; } for (const column of workspace.meta.tableTemplate.columns) {