Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1 mat-dialog-title>{{ "GATEWAY.CHANGE-ORGANIZATION.TITLE" | translate }}</h1>
</mat-option>
</mat-select>
</div>
<div mat-dialog-actions class="d-flex flex-row">
<div mat-dialog-actions class="d-flex flex-row mat-dialog-actions">
<button (click)="onSubmit()" class="btn btn-primary">
{{ "GEN.SAVE" | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.gateway-change-organization-dialog {
width: 50vw;
}

.mat-dialog-actions {
margin-left: 13px;
margin-bottom: 13px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
Expand All @@ -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());
});
}
}
8 changes: 1 addition & 7 deletions src/app/gateway/gateway-detail/gateway-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 1 addition & 7 deletions src/app/gateway/gateway-table/gateway-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down