diff --git a/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.html b/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.html index b6a3160b..64ad1961 100644 --- a/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.html +++ b/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.html @@ -16,7 +16,7 @@

{{ "GATEWAY.CHANGE-ORGANIZATION.TITLE" | translate }}

-
+
diff --git a/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.scss b/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.scss index 6d9e23f4..35565688 100644 --- a/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.scss +++ b/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.scss @@ -1,3 +1,8 @@ .gateway-change-organization-dialog { width: 50vw; } + +.mat-dialog-actions { + margin-left: 13px; + margin-bottom: 13px; +} diff --git a/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.ts b/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.ts index 0f685632..fb423109 100644 --- a/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.ts +++ b/src/app/gateway/gateway-change-organization-dialog/gateway-change-organization-dialog.component.ts @@ -43,7 +43,7 @@ export class GatewayChangeOrganizationDialogComponent implements OnInit { getOrganizations() { this.organizationsSubscription = this.organizationService.getMultipleWithGatewayAdmin().subscribe(res => { - this.organizations = res.data; + this.organizations = res.data.sort((a, b) => a.name.localeCompare(b.name, "da-DK", { numeric: true })); this.filteredOrganizations.next(this.organizations.slice()); }); } @@ -61,12 +61,13 @@ export class GatewayChangeOrganizationDialogComponent implements OnInit { gatewayName: gateway.name, organizationName: gateway.organization.name, }), - "", + this.translate.instant("DIALOG.OK"), { duration: 10000, } ); this.dialog.close(true); + this.snackBar._openedSnackBarRef.afterDismissed().subscribe(() => location.reload()); }); } } diff --git a/src/app/gateway/gateway-detail/gateway-detail.component.ts b/src/app/gateway/gateway-detail/gateway-detail.component.ts index e20a77b0..3995818a 100644 --- a/src/app/gateway/gateway-detail/gateway-detail.component.ts +++ b/src/app/gateway/gateway-detail/gateway-detail.component.ts @@ -202,18 +202,12 @@ export class GatewayDetailComponent implements OnInit, OnDestroy, AfterViewInit } onOpenChangeOrganizationDialog() { - const dialog = this.changeOrganizationDialog.open(GatewayChangeOrganizationDialogComponent, { + this.changeOrganizationDialog.open(GatewayChangeOrganizationDialogComponent, { data: { gatewayDbId: this.gateway.id, organizationId: this.gateway.organizationId, } as GatewayDialogModel, }); - - dialog.afterClosed().subscribe(res => { - if (!res) return; - - location.reload(); - }); } ngOnDestroy() { diff --git a/src/app/gateway/gateway-table/gateway-table.component.ts b/src/app/gateway/gateway-table/gateway-table.component.ts index bfc00650..c5b8ceeb 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.ts +++ b/src/app/gateway/gateway-table/gateway-table.component.ts @@ -259,17 +259,11 @@ export class GatewayTableComponent implements AfterViewInit, OnDestroy, OnInit { } onOpenChangeOrganizationDialog(id: number) { - const dialog = this.changeOrganizationDialog.open(GatewayChangeOrganizationDialogComponent, { + this.changeOrganizationDialog.open(GatewayChangeOrganizationDialogComponent, { data: { gatewayDbId: id, } as GatewayDialogModel, }); - - dialog.afterClosed().subscribe(res => { - if (!res) return; - - location.reload(); - }); } protected readonly columnDefinitions = columnDefinitions;