Skip to content

Commit

Permalink
fix(ui): use isAdmin func instead of old admin field
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt committed Jan 10, 2020
1 parent 6b76c90 commit 39dccfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/views/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<i class="book icon"></i>{{'navbar_favorites' | translate}}
</a>
</div>
<ng-container *ngIf="user.admin">
<ng-container *ngIf="user.isAdmin()">
<app-home-favorite [bookmarks]="favorites"></app-home-favorite>
</ng-container>
</div>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/views/settings/queue/queue.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ <h2><span *ngIf="!loading && nodeJobRuns && nodeJobRuns.length > 0">({{nodeJobRu
<th class="two wide">by</th>
<th class="one wide">run</th>
<th class="two wide">project/workflow</th>
<th [ngClass]="{'four wide': !user.admin, 'one wide': user.admin}">node</th>
<th [ngClass]="{'four wide': !user.isAdmin(), 'one wide': user.isAdmin()}">node</th>
<th class="two wide">triggered_by</th>
<th class="three wide" *ngIf="user.admin">requirements</th>
<th class="three wide" *ngIf="user.isAdmin()">requirements</th>
<th class="two wide"></th>
</tr>
</thead>
Expand Down Expand Up @@ -66,7 +66,7 @@ <h2><span *ngIf="!loading && nodeJobRuns && nodeJobRuns.length > 0">({{nodeJobRu
parametersMaps[index]['cds.triggered_by.username']}}
</span>
</td>
<td *ngIf="user.admin">
<td *ngIf="user.isAdmin()">
<span *ngIf="wNodeJobRun.job != null && wNodeJobRun.job.action != null && wNodeJobRun.job.action.requirements != null">
{{requirementsList[index]}}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ <h4 *ngIf="workerModel.last_spawn_err_log">{{ 'worker_model_error_log' | transla
<input class="ui input" type="text" name="registry_url"
placeholder="https://index.docker.io/v1/"
[(ngModel)]="workerModel.model_docker.registry"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</div>
<div class="field">
<label>{{'worker_model_username' | translate}}</label>
<input class="ui input" type="text" name="registry_username"
[(ngModel)]="workerModel.model_docker.username"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</div>
<div class="field">
<label>{{'worker_model_password' | translate}}</label>
<input class="ui input" type="password" name="registry_password"
[(ngModel)]="workerModel.model_docker.password"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</div>
</ng-container>
<div class="field" *ngIf="workerModel.editable">
Expand All @@ -191,7 +191,7 @@ <h4 *ngIf="workerModel.last_spawn_err_log">{{ 'worker_model_error_log' | transla
<label>{{'worker_model_shell_docker' | translate}} *</label>
<input class="ui input" type="text" name="shell" placeholder="sh -c"
[(ngModel)]="workerModel.model_docker.shell"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</div>
<div class="field">
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate"
Expand All @@ -200,7 +200,7 @@ <h4 *ngIf="workerModel.last_spawn_err_log">{{ 'worker_model_error_log' | transla
class="fa fa-question-circle"></i>
</label>
<input class="ui input" type="text" name="cmd" [(ngModel)]="workerModel.model_docker.cmd"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</div>
<div class="field">
<label suiPopup [popupText]="'worker_model_env_tooltip' | translate"
Expand Down Expand Up @@ -269,7 +269,7 @@ <h4 *ngIf="workerModel.last_spawn_err_log">{{ 'worker_model_error_log' | transla
<label>{{'worker_model_pre_cmd' | translate}}</label>
<textarea class="ui input" name="pre_cmd"
[(ngModel)]="workerModel.model_virtual_machine.pre_cmd"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</textarea>
</div>
<div class="field">
Expand All @@ -280,13 +280,13 @@ <h4 *ngIf="workerModel.last_spawn_err_log">{{ 'worker_model_error_log' | transla
</label>
<input class="ui input" type="text" name="cmd"
[(ngModel)]="workerModel.model_virtual_machine.cmd"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</div>
<div class="field">
<label>{{'worker_model_post_cmd' | translate}}</label>
<textarea class="ui input" name="post_cmd"
[(ngModel)]="workerModel.model_virtual_machine.post_cmd"
[disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
[disabled]="loading || (!currentUser.isAdmin() && !workerModel.restricted)">
</textarea>
</div>
</ng-container>
Expand Down

0 comments on commit 39dccfe

Please sign in to comment.