| .. | .. |
|---|
| 8 | 8 | <button md-icon-button (click)="save()"><md-icon>save</md-icon></button> |
|---|
| 9 | 9 | </md-toolbar> |
|---|
| 10 | 10 | <!-- |
|---|
| 11 | | - code: 'CICS', |
|---|
| 12 | | - creation_timestamp: 1418384439000, |
|---|
| 13 | | - description: 'Wellbore integrity analysis software', |
|---|
| 14 | | - id: 1, |
|---|
| 15 | | - license_filename: 'config_server.lic', |
|---|
| 16 | | - name: 'CurisIntegrity', |
|---|
| 17 | | - metadata: |
|---|
| 18 | | - [ { key: 'max_docs', |
|---|
| 19 | | - value: '250000', |
|---|
| 20 | | - readonly: true, |
|---|
| 21 | | - mandatory: true } ] |
|---|
| 11 | + username: 'rym', |
|---|
| 12 | + roles: [ 1 ], |
|---|
| 13 | + lastLogin: 1488885433000, |
|---|
| 14 | + modificationTimestamp: 1479898458000, |
|---|
| 15 | + email: 'rbouchair@curistec.com', |
|---|
| 16 | + first_name: 'Rym', |
|---|
| 17 | + last_name: 'Bouchair', |
|---|
| 18 | + creation_timestamp: 1479898458000, |
|---|
| 19 | + organizations_ids: [ 1, 2, 5, 6, 7, 8 ] |
|---|
| 22 | 20 | } |
|---|
| 23 | 21 | --> |
|---|
| 24 | 22 | <div class="margin" layout-align-gt-xs="center start" layout-fill="" layout-gt-xs="row"> |
|---|
| .. | .. |
|---|
| 31 | 29 | <form #form="ngForm" class="inset"> |
|---|
| 32 | 30 | <div layout="column" layout-align="start center"> |
|---|
| 33 | 31 | <div layout="row" layout-fill layout-padding> |
|---|
| 34 | | - <field-readonly [value]="data.id" label="field.id" flex="15" *ngIf="!isNew"></field-readonly> |
|---|
| 35 | 32 | <div layout="column" layout-fill flex> |
|---|
| 36 | 33 | <md-input-container> |
|---|
| 37 | | - <input #firstField mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required [readonly]="!isNew" /> |
|---|
| 34 | + <input #firstField mdInput maxLength="50" type="text" [(ngModel)]="data.username" name="username" required [readonly]="!isNew" /> |
|---|
| 38 | 35 | <md-placeholder> |
|---|
| 39 | | - <span i18n="field.code"></span> |
|---|
| 36 | + <span i18n="field.username"></span> |
|---|
| 40 | 37 | </md-placeholder> |
|---|
| 41 | 38 | </md-input-container> |
|---|
| 42 | | - <error-checker [fieldName]="getFieldName('code')" [formField]="form.controls.code"></error-checker> |
|---|
| 39 | + <error-checker [fieldName]="getFieldName('username')" [formField]="form.controls.username"></error-checker> |
|---|
| 40 | + </div> |
|---|
| 41 | + <div layout="column" layout-fill flex> |
|---|
| 42 | + <md-input-container flex> |
|---|
| 43 | + <input mdInput type="password" [(ngModel)]="data.password" name="password" [required]="isNew" /> |
|---|
| 44 | + <md-placeholder> |
|---|
| 45 | + <span i18n="field.password"></span> |
|---|
| 46 | + </md-placeholder> |
|---|
| 47 | + </md-input-container> |
|---|
| 48 | + <error-checker [fieldName]="getFieldName('password')" [formField]="form.controls.password"></error-checker> |
|---|
| 43 | 49 | </div> |
|---|
| 44 | 50 | </div> |
|---|
| 45 | 51 | <div layout="row" layout-fill layout-padding> |
|---|
| 46 | 52 | <div layout="column" layout-fill flex> |
|---|
| 47 | 53 | <md-input-container flex> |
|---|
| 48 | | - <input mdInput type="text" [(ngModel)]="data.name" name="name" required /> |
|---|
| 54 | + <input mdInput type="text" [(ngModel)]="data.first_name" name="first_name" required /> |
|---|
| 49 | 55 | <md-placeholder> |
|---|
| 50 | | - <span i18n="field.name"></span> |
|---|
| 56 | + <span i18n="field.first_name"></span> |
|---|
| 51 | 57 | </md-placeholder> |
|---|
| 52 | 58 | </md-input-container> |
|---|
| 53 | | - <error-checker [fieldName]="getFieldName('name')" [formField]="form.controls.name"></error-checker> |
|---|
| 59 | + <error-checker [fieldName]="getFieldName('first_name')" [formField]="form.controls.first_name"></error-checker> |
|---|
| 54 | 60 | </div> |
|---|
| 55 | 61 | <div layout="column" layout-fill flex> |
|---|
| 56 | 62 | <md-input-container flex> |
|---|
| 57 | | - <input mdInput type="text" [(ngModel)]="data.license_filename" name="license_filename" required /> |
|---|
| 63 | + <input mdInput type="text" [(ngModel)]="data.last_name" name="last_name" /> |
|---|
| 58 | 64 | <md-placeholder> |
|---|
| 59 | | - <span i18n="field.license_filename"></span> |
|---|
| 65 | + <span i18n="field.last_name"></span> |
|---|
| 60 | 66 | </md-placeholder> |
|---|
| 61 | 67 | </md-input-container> |
|---|
| 62 | | - <error-checker [fieldName]="getFieldName('license_filename')" [formField]="form.controls.license_filename"></error-checker> |
|---|
| 68 | + <error-checker [fieldName]="getFieldName('last_name')" [formField]="form.controls.last_name"></error-checker> |
|---|
| 63 | 69 | </div> |
|---|
| 64 | 70 | </div> |
|---|
| 65 | 71 | <div layout="row" layout-fill layout-padding> |
|---|
| 66 | 72 | <div layout="column" layout-fill flex> |
|---|
| 67 | 73 | <md-input-container flex> |
|---|
| 68 | | - <textarea mdInput type="text" type="text" [(ngModel)]="data.description" name="description" maxlength="1024"></textarea> |
|---|
| 74 | + <input mdInput type="email" [(ngModel)]="data.email" name="email" required maxlength="200" /> |
|---|
| 69 | 75 | <md-placeholder> |
|---|
| 70 | | - <span i18n="field.description"></span> |
|---|
| 76 | + <span i18n="field.email"></span> |
|---|
| 71 | 77 | </md-placeholder> |
|---|
| 72 | | - <md-hint align="end">(max 1024)</md-hint> |
|---|
| 73 | 78 | </md-input-container> |
|---|
| 79 | + <error-checker [fieldName]="$L.get('field.email')" [formField]="form.controls.email"></error-checker> |
|---|
| 80 | + </div> |
|---|
| 81 | + </div> |
|---|
| 82 | + <div layout="row" layout-fill layout-padding > |
|---|
| 83 | + <td-chips flex [mdTooltip]="$L.get('Organizations that user can access')" [placeholder]="$L.get('Select organizations')" |
|---|
| 84 | + [items]="orgNames" [(ngModel)]="user_orgs" name="user_orgs" requireMatch> |
|---|
| 85 | + </td-chips> |
|---|
| 86 | + <div layout="column" layout-fill flex="25"> |
|---|
| 87 | + <md-checkbox [(ngModel)]="user_roles.advance" name="advance_role" [mdTooltip]="$L.get('Role {}', 'advance')"> |
|---|
| 88 | + <span i18n>Advance</span> |
|---|
| 89 | + </md-checkbox> |
|---|
| 90 | + <md-checkbox [(ngModel)]="user_roles.admin" name="admin_role" [mdTooltip]="$L.get('Role {}', 'admin')"> |
|---|
| 91 | + <span i18n>Admin</span> |
|---|
| 92 | + </md-checkbox> |
|---|
| 74 | 93 | </div> |
|---|
| 75 | 94 | </div> |
|---|
| 76 | 95 | <div layout="row" layout-fill layout-padding *ngIf="!isNew"> |
|---|
| 96 | + <field-readonly [value]="data.lastLogin || '' | timeAgo" label="field.lastLogin" flex></field-readonly> |
|---|
| 77 | 97 | <field-readonly [value]="data.creation_timestamp | date: 'medium'" label="field.creation_timestamp" flex></field-readonly> |
|---|
| 78 | 98 | </div> |
|---|
| 79 | | - <metadata-manager addOrDelete="true" editKeys="true" [metadata]="data.metadata" ></metadata-manager> |
|---|
| 80 | 99 | </div> |
|---|
| 81 | 100 | </form> |
|---|
| 82 | 101 | </md-card-content> |
|---|
| 83 | 102 | <md-divider></md-divider> |
|---|
| 84 | 103 | <md-card-actions> |
|---|
| 85 | 104 | <div layout="row" layout-align="start center" class="margin"> |
|---|
| 86 | | - <button *ngIf="!isNew" md-raised-button color="warn" (click)="delete(data.id)">Delete</button> |
|---|
| 105 | + <button *ngIf="!isNew" [disabled]="!canBeDeleted()" md-raised-button color="warn" (click)="delete(data.username)">Delete</button> |
|---|
| 87 | 106 | <span flex></span> |
|---|
| 88 | 107 | <button [disabled]="!form.form.valid" md-raised-button color="primary" (click)="save()">Save</button> |
|---|
| 89 | 108 | <button md-button (click)="goBack()">Cancel</button> |
|---|