Users on template editor

This commit is contained in:
Kristian Ntavidi 2021-07-23 14:16:59 +03:00
parent d8a2ad281c
commit 501a7175e8
13 changed files with 90 additions and 61 deletions

View File

@ -76,7 +76,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
}));
const initializerSub = this.initializer
.pipe(
debounceTime(200)
debounceTime(100)
)
.subscribe(() =>{
this.initialize();

View File

@ -181,58 +181,61 @@
</mat-error>
</mat-form-field>
</div>
</div>
<!-- <div class="col-12">
<div class="heading">1.4 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-USERS'| translate}}</div>
<div class="full-width basic-info-input">
<table class="col-12 user-table">
<tr class="row user-table-header">
<th>{{'USERS.LISTING.NAME' | translate}}</th>
<th>{{'USERS.LISTING.EMAIL' | translate}}</th>
<th></th>
</tr>
<tbody class="user-table-body">
<tr *ngFor="let user of userChipList" class="user-table-row">
<td>{{user.name}}</td>
<td >{{user.email}}</td>
<td>
<button mat-button class="delete-btn" (click)="verifyAndRemoveUser(user)" [matTooltip]="'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-REMOVE-USER'| translate"><mat-icon>person_remove</mat-icon></button>
</td>
</tr>
<tr *ngIf="!userChipList || !userChipList.length">
<td style="text-align: end; line-height: 3em;" colspan="2" >
{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NO-USERS-YET' | translate}}
</td>
</tr>
</tbody>
</table>
<div class="col-12">
<div class="heading">1.4 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-USERS'| translate}}</div>
<div class="full-width basic-info-input">
<table class="col-12 user-table">
<thead class="user-table-header">
<tr>
<th>{{'USERS.LISTING.NAME' | translate}}</th>
<th>{{'USERS.LISTING.EMAIL' | translate}}</th>
<th></th>
</tr>
</thead>
<tbody class="user-table-body">
<tr *ngFor="let user of userChipList" class="user-table-row">
<td>{{user.name}}</td>
<td >{{user.email}}</td>
<td>
<button mat-button class="delete-btn" (click)="verifyAndRemoveUser(user)" [matTooltip]="'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-REMOVE-USER'| translate"><mat-icon>person_remove</mat-icon></button>
</td>
</tr>
<tr *ngIf="!userChipList || !userChipList.length">
<td style="text-align: end; line-height: 3em;" colspan="2" >
{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NO-USERS-YET' | translate}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-12">
<div class="row justify-content-end">
<div class="col d-flex justify-content-end" style="overflow: hidden;">
<div style="min-width: 20em;max-width: 25em;" [@add-new-user-field]="inputUserState">
<mat-form-field appearance="legacy">
<input matInput #email placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-USERS'| translate}}" (focus)="onUserFieldFocus()" (blur)="onUserFieldBlur()" (keyup.enter)="addUser(email)">
</mat-form-field>
<div class="col-12">
<div class="row justify-content-end">
<div class="col d-flex justify-content-end" style="overflow: hidden;">
<div style="min-width: 20em;max-width: 25em;" [@add-new-user-field]="inputUserState">
<mat-form-field appearance="legacy">
<input matInput #email placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-USERS'| translate}}" (focus)="onUserFieldFocus()" (blur)="onUserFieldBlur()" (keyup.enter)="addUser(email)">
</mat-form-field>
</div>
</div>
<div class="col-auto">
<button mat-mini-fab color="primary" (click)="addUser(email)" (focus)="onUserButtonFocus()" (blur)="onUserButtonBlur()" [matTooltip]="'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-VALIDATE-AND-ADD-USER'| translate" [disabled]="userFormDisabled">
<ng-container *ngIf="inputUserState === 'untriggered' else triggericon">
<mat-icon>add</mat-icon>
</ng-container>
<ng-template #triggericon>
<mat-icon>person_add</mat-icon>
</ng-template>
</button>
</div>
</div>
<div class="col-auto">
<button mat-mini-fab color="primary" (click)="addUser(email)" (focus)="onUserButtonFocus()" (blur)="onUserButtonBlur()" [matTooltip]="'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-VALIDATE-AND-ADD-USER'| translate" [disabled]="userFormDisabled">
<ng-container *ngIf="inputUserState === 'untriggered' else triggericon">
<mat-icon>add</mat-icon>
</ng-container>
<ng-template #triggericon>
<mat-icon>person_add</mat-icon>
</ng-template>
</button>
</div>
</div>
</div> -->
</div>
<!-- <div class="col-12">
<button mat-button class="full-width" (click)="addPage()"
[disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.NEXT' | translate}}</button>

View File

@ -277,16 +277,18 @@ $blue-color-light: #5cf7f2;
.user-table {
// border: thin solid rgb(179, 173, 173);
border: 1px solid rgba(0, 0, 0, 0.12);
// border: 1px solid rgba(0, 0, 0, 0.12);
background-color: white;
border-radius: 4px;
padding-bottom: 1em;
box-shadow: -1px 1px 11px -3px #00000017;
}
.user-table-header {
text-align: center;
display: revert;
background-color: rgb(243 245 248);
// background-color: #129d9811;
}
.user-table-header th {

View File

@ -1951,7 +1951,7 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
},
error=>{
// console.log(error.message);
this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error);
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.ERRORS.USER-NOT-FOUND'), SnackBarNotificationLevel.Error);
this.userFormDisabled = false;
// this.inputUserState = 'triggered';//when it loses focus(when disabled) it becomes untriggered
// email.focus();

View File

@ -1,7 +1,7 @@
<form class="row user-role-editor" [formGroup]="formGroup" (ngSubmit)="formSubmit()">
<div *ngIf="!this.nowEditing"class="roles col">
<ng-container *ngFor="let role of this.formGroup.get('appRoles').value">
<div *ngIf="role!=3">
<div>
<span class="user-role" [ngClass]="{'user': role == 0, 'manager': role == 1, 'admin': role == 2, 'dataset-template-editor': role == 3}">
{{getPrincipalAppRoleWithLanguage(role)}}
</span>
@ -11,7 +11,7 @@
<mat-form-field *ngIf="this.nowEditing" class="select-role roles-width-180 col-auto">
<mat-select formControlName="appRoles" multiple required>
<ng-container *ngFor="let role of getPrincipalAppRoleValues()">
<mat-option [value]="role" *ngIf="role!=3">{{getPrincipalAppRoleWithLanguage(role)}}</mat-option>
<mat-option [value]="role">{{getPrincipalAppRoleWithLanguage(role)}}</mat-option>
</ng-container>
</mat-select>
<mat-error *ngIf="getFormControl('appRoles').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"User not found."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"User not found."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"User not found."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"Ο χρήστης δεν βρέθηκε."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Descrição do modelo de dados",
"UNTITLED": "Sem título",
"QUESTION": "Questão",
"TEMPLATE-OUTLINE": "Esquema do modelo"
"TEMPLATE-OUTLINE": "Esquema do modelo",
"ERRORS":{
"USER-NOT-FOUND":"Usuário não encontrado."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Nome do capítulo",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"User not found."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"User not found."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",

View File

@ -296,7 +296,10 @@
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
"UNTITLED": "Untitled",
"QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline"
"TEMPLATE-OUTLINE": "Template outline",
"ERRORS":{
"USER-NOT-FOUND":"User not found."
}
},
"PAGE-INFO": {
"PAGE-NAME": "Chapter Name",