mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-152] refactored concatenated fields visibility
This commit is contained in:
@@ -46,6 +46,7 @@ export class DynamicConcatModel extends DynamicFormGroupModel {
|
||||
@serializable() submissionId: string;
|
||||
@serializable() hasSelectableMetadata: boolean;
|
||||
@serializable() metadataValue: MetadataValue;
|
||||
@serializable() readOnly?: boolean;
|
||||
|
||||
isCustomGroup = true;
|
||||
valueUpdates: Subject<string>;
|
||||
@@ -65,6 +66,7 @@ export class DynamicConcatModel extends DynamicFormGroupModel {
|
||||
this.valueUpdates = new Subject<string>();
|
||||
this.valueUpdates.subscribe((value: string) => this.value = value);
|
||||
this.typeBindRelations = config.typeBindRelations ? config.typeBindRelations : [];
|
||||
this.readOnly = config.disabled;
|
||||
}
|
||||
|
||||
get value() {
|
||||
|
@@ -19,8 +19,6 @@ import {
|
||||
SUBMISSION_ID
|
||||
} from './field-parser';
|
||||
import { DsDynamicInputModel, DsDynamicInputModelConfig } from '../ds-dynamic-form-ui/models/ds-dynamic-input.model';
|
||||
import { VisibilityType } from '../../../../submission/sections/visibility-type';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
|
||||
export class ConcatFieldParser extends FieldParser {
|
||||
|
||||
@@ -85,9 +83,7 @@ export class ConcatFieldParser extends FieldParser {
|
||||
input1ModelConfig.required = true;
|
||||
}
|
||||
|
||||
if (isNotEmpty(this.configData.visibility) && isEqual(this.configData.visibility.main, VisibilityType.READONLY)) {
|
||||
concatGroup.disabled = true;
|
||||
}
|
||||
concatGroup.disabled = input1ModelConfig.readOnly;
|
||||
|
||||
if (isNotEmpty(this.firstPlaceholder)) {
|
||||
input1ModelConfig.placeholder = this.firstPlaceholder;
|
||||
|
Reference in New Issue
Block a user