Skip to content

Commit 33bdb69

Browse files
119915: Extracted the authority/controlled vocabulary logic out of DsoEditMetadataValueComponent
Also: - Converted the code to the standalone structure - Made DsoEditMetadataValueFieldLoaderComponent extend AbstractComponentLoaderComponent
1 parent 017e49a commit 33bdb69

22 files changed

Lines changed: 905 additions & 846 deletions

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ds-dso-edit-metadata-value *ngFor="let mdValue of form.fields[mdField]; let idx = index" role="presentation"
44
[dso]="dso"
55
[context]="Context.EditMetadata"
6-
[mdField]="mdField"
76
[mdValue]="mdValue"
87
[mdField]="mdField"
98
[dsoType]="dsoType"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<ds-dynamic-scrollable-dropdown *ngIf="mdValue.editing && (isScrollableVocabulary$ | async)"
2+
[bindId]="mdField"
3+
[group]="group"
4+
[model]="getModel()"
5+
(change)="onChangeAuthorityField($event)">
6+
</ds-dynamic-scrollable-dropdown>
7+
<ds-dynamic-onebox
8+
*ngIf="mdValue.editing && ((isHierarchicalVocabulary$ | async) || (isSuggesterVocabulary$ | async))"
9+
[group]="group"
10+
[model]="getModel()"
11+
(change)="onChangeAuthorityField($event)">
12+
</ds-dynamic-onebox>
13+
<div class="mt-2" *ngIf=" mdValue.editing && (isAuthorityControlled$ | async) && (isSuggesterVocabulary$ | async)">
14+
<div class="btn-group w-75">
15+
<i dsAuthorityConfidenceState
16+
class="fas fa-fw p-0 mr-1 mt-auto mb-auto"
17+
aria-hidden="true"
18+
[authorityValue]="mdValue.newValue.confidence"
19+
[iconMode]="true"
20+
></i>
21+
<input class="form-control form-outline" data-test="authority-input" [(ngModel)]="mdValue.newValue.authority"
22+
[disabled]="!editingAuthority"
23+
[attr.aria-label]="(dsoType + '.edit.metadata.edit.authority.key') | translate"
24+
(change)="onChangeAuthorityKey()"/>
25+
<button class="btn btn-outline-secondary btn-sm ng-star-inserted" id="metadata-confirm-btn"
26+
*ngIf="!editingAuthority"
27+
[title]="dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate"
28+
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate }}"
29+
(click)="onChangeEditingAuthorityStatus(true)">
30+
<i class="fas fa-lock fa-fw"></i>
31+
</button>
32+
<button class="btn btn-outline-success btn-sm ng-star-inserted" id="metadata-confirm-btn" *ngIf="editingAuthority"
33+
[title]="dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate"
34+
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate }}"
35+
(click)="onChangeEditingAuthorityStatus(false)">
36+
<i class="fas fa-lock-open fa-fw"></i>
37+
</button>
38+
</div>
39+
</div>

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-authority-field/dso-edit-metadata-authority-field.component.scss

Whitespace-only changes.

0 commit comments

Comments
 (0)