mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
Fixed previous cherry pick
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { IntegrationModel } from './integration.model';
|
||||
import { autoserialize } from 'cerialize';
|
||||
import { isNotEmpty } from '../../../shared/empty.util';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../../shared/form/builder/ds-dynamic-form-ui/models/dynamic-group/dynamic-group.model';
|
||||
|
||||
export class AuthorityValue extends IntegrationModel {
|
||||
|
||||
@@ -19,12 +20,23 @@ export class AuthorityValue extends IntegrationModel {
|
||||
@autoserialize
|
||||
language: string;
|
||||
|
||||
@autoserialize
|
||||
hasAuthority(): boolean {
|
||||
return isNotEmpty(this.id);
|
||||
}
|
||||
|
||||
@autoserialize
|
||||
hasValue(): boolean {
|
||||
return isNotEmpty(this.value);
|
||||
}
|
||||
|
||||
@autoserialize
|
||||
hasOtherInformation(): boolean {
|
||||
return isNotEmpty(this.otherInformation);
|
||||
}
|
||||
|
||||
@autoserialize
|
||||
hasPlaceholder() {
|
||||
return this.hasValue() && this.value === PLACEHOLDER_PARENT_METADATA;
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ import { hasValue, isNotEmpty } from '../../empty.util';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/models/dynamic-group/dynamic-group.model';
|
||||
import { MetadataIconConfig } from '../../../../config/submission-config.interface';
|
||||
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
|
||||
import { AuthorityValueModel } from '../../../core/integration/models/authority-value.model';
|
||||
import { AuthorityValue } from '../../../core/integration/models/authority.value';
|
||||
|
||||
export class Chips {
|
||||
chipsItems: BehaviorSubject<ChipsItem[]>;
|
||||
@@ -102,7 +102,7 @@ export class Chips {
|
||||
|
||||
private getChipsIcons(item) {
|
||||
const icons = [];
|
||||
if (item instanceof FormFieldMetadataValueObject || item instanceof AuthorityValueModel) {
|
||||
if (typeof item === 'string' || item instanceof FormFieldMetadataValueObject || item instanceof AuthorityValue) {
|
||||
return icons;
|
||||
}
|
||||
|
||||
|
@@ -50,13 +50,22 @@
|
||||
<button ngbDropdownAnchor
|
||||
class="btn btn-secondary"
|
||||
type="button"
|
||||
ngbTooltip="{{'form.search-help' | translate}}"
|
||||
placement="top"
|
||||
[disabled]="model.readOnly || isSearchDisabled()"
|
||||
[hidden]="isInputDisabled()"
|
||||
(click)="sdRef.open(); search(); $event.stopPropagation();">{{'form.search' | translate}}
|
||||
</button>
|
||||
<button *ngIf="isInputDisabled()" class="btn btn-secondary"
|
||||
type="button"
|
||||
ngbTooltip="{{'form.clear-help' | translate}}"
|
||||
placement="top"
|
||||
[disabled]="model.readOnly"
|
||||
(click)="remove($event)">{{'form.clear' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="isInputDisabled()" class="col-auto text-center">
|
||||
<button class="btn btn-secondary"
|
||||
<div class="col-auto text-center">
|
||||
<button *ngIf="!editMode" class="btn btn-secondary"
|
||||
type="button"
|
||||
ngbTooltip="{{'form.edit-help' | translate}}"
|
||||
placement="top"
|
||||
|
Reference in New Issue
Block a user