|
1 | 1 | <div class="d-flex flex-row ds-value-row" *ngVar="mdValue.newValue.isVirtual as isVirtual" role="row" |
2 | 2 | cdkDrag (cdkDragStarted)="dragging.emit(true)" (cdkDragEnded)="dragging.emit(false)" |
3 | 3 | [ngClass]="{ 'ds-warning': mdValue.reordered || mdValue.change === DsoEditMetadataChangeTypeEnum.UPDATE, 'ds-danger': mdValue.change === DsoEditMetadataChangeTypeEnum.REMOVE, 'ds-success': mdValue.change === DsoEditMetadataChangeTypeEnum.ADD, 'h-100': isOnlyValue }"> |
4 | | - <div class="flex-grow-1 ds-flex-cell ds-value-cell d-flex align-items-center" *ngVar="(mdRepresentation$ | async) as mdRepresentation" role="cell"> |
| 4 | + <div class="flex-grow-1 ds-flex-cell ds-value-cell d-flex flex-column" *ngVar="(mdRepresentation$ | async) as mdRepresentation" role="cell"> |
5 | 5 | <div class="dont-break-out preserve-line-breaks" *ngIf="!mdValue.editing && !mdRepresentation">{{ mdValue.newValue.value }}</div> |
6 | | - <textarea class="form-control" rows="5" *ngIf="mdValue.editing && !mdRepresentation" [(ngModel)]="mdValue.newValue.value" |
| 6 | + <textarea class="form-control" rows="5" *ngIf="mdValue.editing && !mdRepresentation && !(isAuthorityControlled() | async)" [(ngModel)]="mdValue.newValue.value" |
7 | 7 | [attr.aria-label]="(dsoType + '.edit.metadata.edit.value') | translate" |
8 | 8 | [dsDebounce]="300" (onDebounce)="confirm.emit(false)"></textarea> |
| 9 | + <ds-dynamic-scrollable-dropdown *ngIf="mdValue.editing && (isScrollableVocabulary() | async)" |
| 10 | + [bindId]="mdField" |
| 11 | + [group]="group" |
| 12 | + [model]="getModel() | async" |
| 13 | + (change)="onChangeAuthorityField($event)"> |
| 14 | + </ds-dynamic-scrollable-dropdown> |
| 15 | + <ds-dynamic-onebox *ngIf="mdValue.editing && ((isHierarchicalVocabulary() | async) || (isSuggesterVocabulary() | async))" |
| 16 | + [group]="group" |
| 17 | + [model]="getModel() | async" |
| 18 | + (change)="onChangeAuthorityField($event)"> |
| 19 | + </ds-dynamic-onebox> |
| 20 | + <div *ngIf="!isVirtual && !mdValue.editing && mdValue.newValue.authority"> |
| 21 | + <span class="badge badge-light border" > |
| 22 | + <i dsAuthorityConfidenceState |
| 23 | + class="far fa-circle fa-fw p-0" |
| 24 | + aria-hidden="true" |
| 25 | + [authorityValue]="mdValue.newValue" |
| 26 | + ></i> |
| 27 | + {{ dsoType + '.edit.metadata.authority.label' | translate }} {{ mdValue.newValue.authority }} |
| 28 | + </span> |
| 29 | + </div> |
| 30 | + <div class="mt-2" *ngIf=" mdValue.editing && (isAuthorityControlled() | async) && (isSuggesterVocabulary() | async)"> |
| 31 | + <div class="btn-group w-75"> |
| 32 | + <input class="form-control form-outline" [(ngModel)]="mdValue.newValue.authority" [disabled]="!editingAuthority" |
| 33 | + [attr.aria-label]="(dsoType + '.edit.metadata.edit.authority.key') | translate" |
| 34 | + (change)="onChangeAuthorityKey()" /> |
| 35 | + <button class="btn btn-outline-secondary btn-sm ng-star-inserted" id="metadata-confirm-btn" *ngIf="!editingAuthority" |
| 36 | + [title]="dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate" |
| 37 | + ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate }}" |
| 38 | + (click)="onChangeEditingAuthorityStatus(true)"> |
| 39 | + <i class="fas fa-lock fa-fw"></i> |
| 40 | + </button> |
| 41 | + <button class="btn btn-outline-success btn-sm ng-star-inserted" id="metadata-confirm-btn" *ngIf="editingAuthority" |
| 42 | + [title]="dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate" |
| 43 | + ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate }}" |
| 44 | + (click)="onChangeEditingAuthorityStatus(false)"> |
| 45 | + <i class="fas fa-lock-open fa-fw"></i> |
| 46 | + </button> |
| 47 | + </div> |
| 48 | + </div> |
9 | 49 | <div class="d-flex" *ngIf="mdRepresentation"> |
10 | 50 | <a class="mr-2" target="_blank" [routerLink]="mdRepresentationItemRoute$ | async">{{ mdRepresentationName$ | async }}</a> |
11 | 51 | <ds-themed-type-badge [object]="mdRepresentation"></ds-themed-type-badge> |
|
45 | 85 | [disabled]="isVirtual || (!mdValue.change && mdValue.reordered) || (!mdValue.change && !mdValue.editing) || (saving$ | async)" (click)="undo.emit()"> |
46 | 86 | <i class="fas fa-undo-alt fa-fw"></i> |
47 | 87 | </button> |
| 88 | + <button class="btn btn-outline-secondary ds-drag-handle btn-sm" data-test="metadata-drag-btn" *ngVar="(isOnlyValue || (saving$ | async)) as disabled" |
| 89 | + cdkDragHandle [cdkDragHandleDisabled]="disabled" [ngClass]="{'disabled': disabled}" [disabled]="disabled" |
| 90 | + [title]="dsoType + '.edit.metadata.edit.buttons.drag' | translate" |
| 91 | + ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.drag' | translate }}"> |
| 92 | + <i class="fas fa-grip-vertical fa-fw"></i> |
| 93 | + </button> |
48 | 94 | </div> |
49 | 95 | </div> |
50 | | - <button class="btn btn-outline-secondary ds-drag-handle btn-sm" data-test="metadata-drag-btn" *ngVar="(isOnlyValue || (saving$ | async)) as disabled" |
51 | | - cdkDragHandle [cdkDragHandleDisabled]="disabled" [ngClass]="{'disabled': disabled}" [disabled]="disabled" |
52 | | - [title]="dsoType + '.edit.metadata.edit.buttons.drag' | translate" |
53 | | - ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.drag' | translate }}"> |
54 | | - <i class="fas fa-grip-vertical fa-fw"></i> |
55 | | - </button> |
56 | 96 | </div> |
57 | 97 | </div> |
58 | 98 | </div> |
0 commit comments