-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: integration with backend * fix: update user page --------- Co-authored-by: Aleksei Moiseev <[email protected]>
- Loading branch information
1 parent
f093832
commit e0a2994
Showing
13 changed files
with
221 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 23 additions & 19 deletions
42
...ui/src/app/shared/components/grant-permissoin-modal/grant-permission-modal.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
<h2 mat-dialog-title>"User name" permissions for model/experiment "name"</h2> | ||
<mat-dialog-content> | ||
<p>Permissions</p> | ||
<mat-form-field> | ||
<mat-label>Exp</mat-label> | ||
<select matNativeControl required> | ||
<option value="manage">Exp 1</option> | ||
</select> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Permissions</mat-label> | ||
<select matNativeControl required> | ||
<option value="manage">Manage</option> | ||
<option value="read">Read</option> | ||
<option value="edit">Edit</option> | ||
</select> | ||
</mat-form-field> | ||
<h2 mat-dialog-title>Add {{data.type}} permissions for {{data.userName}}</h2> | ||
<mat-dialog-content [formGroup]="form"> | ||
<div class="d-flex flex-column"> | ||
<mat-form-field> | ||
<mat-label>{{data.type | titlecase}}</mat-label> | ||
<select matNativeControl formControlName="entity"> | ||
<ng-container *ngFor="let entity of data.entities"> | ||
<option value="{{entity}}">{{entity}}</option> | ||
</ng-container> | ||
</select> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Permissions</mat-label> | ||
<select matNativeControl formControlName="permission"> | ||
<option value="MANAGE">Manage</option> | ||
<option value="READ">Read</option> | ||
<option value="EDIT">Edit</option> | ||
</select> | ||
</mat-form-field> | ||
</div> | ||
|
||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button (click)="onNoClick()">Cancel</button> | ||
<button mat-button [mat-dialog-close]="null" cdkFocusInitial>Ok</button> | ||
<button mat-button [mat-dialog-close]="null">Cancel</button> | ||
<button mat-button [mat-dialog-close]="form.value" cdkFocusInitial [disabled]="form.invalid">Ok</button> | ||
</mat-dialog-actions> |
27 changes: 21 additions & 6 deletions
27
web-ui/src/app/shared/components/grant-permissoin-modal/grant-permission-modal.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Component, Inject, OnInit } from '@angular/core'; | ||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | ||
|
||
export interface GrantPermissionModalData { | ||
userName: string; | ||
type: 'model' | 'experiment'; | ||
entities: string[]; | ||
} | ||
|
||
@Component({ | ||
selector: 'ml-grant-permission-modal', | ||
templateUrl: './grant-permission-modal.component.html', | ||
styleUrls: ['./grant-permission-modal.component.scss'] | ||
}) | ||
export class GrantPermissionModalComponent implements OnInit { | ||
form!: FormGroup; | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
constructor( | ||
@Inject(MAT_DIALOG_DATA) public data: GrantPermissionModalData, | ||
private readonly fb: FormBuilder, | ||
) { | ||
} | ||
|
||
onNoClick() { | ||
|
||
ngOnInit(): void { | ||
this.form = this.fb.group({ | ||
user: this.data.userName, | ||
type: this.data.type, | ||
permission: [null, Validators.required], | ||
entity: [null, Validators.required], | ||
}) | ||
} | ||
} |
Oops, something went wrong.