Skip to content

Commit

Permalink
feat(edition): allow absolute url if config is not defined (#1127)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeLafreniere18 committed Nov 7, 2022
1 parent a787d00 commit 27bd2fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -613,7 +616,8 @@ export class EditionWorkspaceService {
getDomainValues(relation: RelationOptions): Observable<any> {
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<any>(url).pipe(
Expand Down
12 changes: 7 additions & 5 deletions packages/geo/src/lib/workspace/shared/edition-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 27bd2fe

Please sign in to comment.