Skip to content

Commit ab68dff

Browse files
rushk014xingzhang-suse
authored andcommitted
NVSHAS-10264: Display control is missing in API key page
1 parent 0331f7f commit ab68dff

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

admin/webapp/websrc/app/routes/components/apikeys-grid/apikeys-grid-action-cell/apikeys-grid-action-cell.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<i class="eos-icons text-action">feed</i>
77
</button>
88
<button
9+
*ngIf="params.isWriteUserAuthorized"
910
mat-icon-button
1011
matTooltip="{{ 'apikey.REMOVE' | translate }}"
1112
matTooltipPosition="above"

admin/webapp/websrc/app/routes/components/apikeys-grid/apikeys-grid.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class ApikeysGridComponent implements OnInit {
105105
sortable: false,
106106
cellRenderer: 'actionCellRenderer',
107107
cellRendererParams: {
108+
isWriteUserAuthorized: undefined,
108109
view: event => this.viewApikey(event),
109110
delete: event => this.deleteApikey(event),
110111
},
@@ -127,6 +128,9 @@ export class ApikeysGridComponent implements OnInit {
127128
ngOnInit(): void {
128129
this.isWriteUserAuthorized =
129130
this.authUtilsService.getDisplayFlag('write_users');
131+
let actionCellParams =
132+
this.columnDefs[this.columnDefs.length - 1].cellRendererParams;
133+
actionCellParams.isWriteUserAuthorized = this.isWriteUserAuthorized;
130134
this.gridOptions = this.utils.createGridOptions(this.columnDefs, this.$win);
131135
this.gridOptions = {
132136
...this.gridOptions,
@@ -219,7 +223,7 @@ export class ApikeysGridComponent implements OnInit {
219223
error: ({ error }: { error: ErrorResponse }) => {
220224
this.notificationService.openError(
221225
error,
222-
this.tr.instant('apikey.msg.REMOVE_NG')
226+
this.tr.instant('apikey.msg.REMOVE_ERR')
223227
);
224228
},
225229
});

admin/webapp/websrc/app/routes/network-activities/network-activities.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export class NetworkActivitiesComponent implements OnInit, OnDestroy {
225225
gpuEnabled = JSON.parse(this.localStorage.get('_gpuEnabled'));
226226
if (gpuEnabled !== null) return gpuEnabled;
227227
}
228-
return false
228+
return false;
229229
}
230230

231231
private prepareGraphics(

0 commit comments

Comments
 (0)