Skip to content

Commit

Permalink
119915: Extracted the authority/controlled vocabulary logic out of Ds…
Browse files Browse the repository at this point in the history
…oEditMetadataValueComponent

Also:
- Converted the code to the standalone structure
- Made DsoEditMetadataValueFieldLoaderComponent extend AbstractComponentLoaderComponent
  • Loading branch information
alexandrevryghem committed Oct 31, 2024
1 parent 017e49a commit 3f1a236
Show file tree
Hide file tree
Showing 22 changed files with 900 additions and 843 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<ds-dso-edit-metadata-value *ngFor="let mdValue of form.fields[mdField]; let idx = index" role="presentation"
[dso]="dso"
[context]="Context.EditMetadata"
[mdField]="mdField"
[mdValue]="mdValue"
[mdField]="mdField"
[dsoType]="dsoType"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<ds-dynamic-scrollable-dropdown *ngIf="mdValue.editing && (isScrollableVocabulary$ | async)"
[bindId]="mdField"
[group]="group"
[model]="getModel()"
(change)="onChangeAuthorityField($event)">
</ds-dynamic-scrollable-dropdown>
<ds-dynamic-onebox
*ngIf="mdValue.editing && ((isHierarchicalVocabulary$ | async) || (isSuggesterVocabulary$ | async))"
[group]="group"
[model]="getModel()"
(change)="onChangeAuthorityField($event)">
</ds-dynamic-onebox>
<div class="mt-2" *ngIf=" mdValue.editing && (isAuthorityControlled$ | async) && (isSuggesterVocabulary$ | async)">
<div class="btn-group w-75">
<i dsAuthorityConfidenceState
class="fas fa-fw p-0 mr-1 mt-auto mb-auto"
aria-hidden="true"
[authorityValue]="mdValue.newValue.confidence"
[iconMode]="true"
></i>
<input class="form-control form-outline" data-test="authority-input" [(ngModel)]="mdValue.newValue.authority"
[disabled]="!editingAuthority"
[attr.aria-label]="(dsoType + '.edit.metadata.edit.authority.key') | translate"
(change)="onChangeAuthorityKey()"/>
<button class="btn btn-outline-secondary btn-sm ng-star-inserted" id="metadata-confirm-btn"
*ngIf="!editingAuthority"
[title]="dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate"
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate }}"
(click)="onChangeEditingAuthorityStatus(true)">
<i class="fas fa-lock fa-fw"></i>
</button>
<button class="btn btn-outline-success btn-sm ng-star-inserted" id="metadata-confirm-btn" *ngIf="editingAuthority"
[title]="dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate"
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate }}"
(click)="onChangeEditingAuthorityStatus(false)">
<i class="fas fa-lock-open fa-fw"></i>
</button>
</div>
</div>
Loading

0 comments on commit 3f1a236

Please sign in to comment.