mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
Removed label of a repeatable field when is added a new value.
This commit is contained in:
@@ -86,7 +86,14 @@ export const FORM_GROUP_TEST_GROUP = new FormGroup({
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('DsDynamicGroupComponent test suite', () => {
|
describe('DsDynamicGroupComponent test suite', () => {
|
||||||
|
const config = {
|
||||||
|
form: {
|
||||||
|
validatorMap: {
|
||||||
|
required: 'required',
|
||||||
|
regex: 'pattern'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} as any;
|
||||||
let testComp: TestComponent;
|
let testComp: TestComponent;
|
||||||
let groupComp: DsDynamicGroupComponent;
|
let groupComp: DsDynamicGroupComponent;
|
||||||
let testFixture: ComponentFixture<TestComponent>;
|
let testFixture: ComponentFixture<TestComponent>;
|
||||||
@@ -126,7 +133,7 @@ describe('DsDynamicGroupComponent test suite', () => {
|
|||||||
FormBuilderService,
|
FormBuilderService,
|
||||||
FormComponent,
|
FormComponent,
|
||||||
FormService,
|
FormService,
|
||||||
{provide: GLOBAL_CONFIG, useValue: {} as GlobalConfig},
|
{provide: GLOBAL_CONFIG, useValue: config},
|
||||||
{provide: Store, useValue: store},
|
{provide: Store, useValue: store},
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
|
@@ -70,7 +70,12 @@ export class DsDynamicGroupComponent implements OnDestroy, OnInit {
|
|||||||
this.formCollapsed = Observable.of(true);
|
this.formCollapsed = Observable.of(true);
|
||||||
}
|
}
|
||||||
this.model.valueUpdates.subscribe((value: any[]) => {
|
this.model.valueUpdates.subscribe((value: any[]) => {
|
||||||
this.formCollapsed = (isNotEmpty(value) && !(value.length === 1 && hasOnlyEmptyProperties(value[0]))) ? Observable.of(true) : Observable.of(false);
|
if ((isNotEmpty(value) && !(value.length === 1 && hasOnlyEmptyProperties(value[0])))) {
|
||||||
|
this.collapseForm();
|
||||||
|
} else {
|
||||||
|
this.expandForm();
|
||||||
|
}
|
||||||
|
// this.formCollapsed = (isNotEmpty(value) && !(value.length === 1 && hasOnlyEmptyProperties(value[0]))) ? Observable.of(true) : Observable.of(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.formId = this.formService.getUniqueId(this.model.id);
|
this.formId = this.formService.getUniqueId(this.model.id);
|
||||||
@@ -213,8 +218,10 @@ export class DsDynamicGroupComponent implements OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private resetForm() {
|
private resetForm() {
|
||||||
|
if (this.formRef) {
|
||||||
this.formService.resetForm(this.formRef.formGroup, this.formModel, this.formId);
|
this.formService.resetForm(this.formRef.formGroup, this.formModel, this.formId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.subs
|
this.subs
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
class="border-0 form-control-plaintext tag-input flex-grow-1 mt-1 mb-1 chips-sort-ignore"
|
class="border-0 form-control-plaintext tag-input flex-grow-1 mt-1 mb-1 chips-sort-ignore"
|
||||||
type="text"
|
type="text"
|
||||||
[class.pl-3]="chips.hasItems()"
|
[class.pl-3]="chips.hasItems()"
|
||||||
[placeholder]="model.label"
|
[placeholder]="model.placeholder"
|
||||||
[readonly]="model.readOnly"
|
[readonly]="model.readOnly"
|
||||||
[(ngModel)]="currentValue"
|
[(ngModel)]="currentValue"
|
||||||
(blur)="onBlur($event)"
|
(blur)="onBlur($event)"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
[inputFormatter]="formatter"
|
[inputFormatter]="formatter"
|
||||||
[name]="model.name"
|
[name]="model.name"
|
||||||
[ngbTypeahead]="search"
|
[ngbTypeahead]="search"
|
||||||
[placeholder]="model.label"
|
[placeholder]="model.placeholder"
|
||||||
[readonly]="model.readOnly"
|
[readonly]="model.readOnly"
|
||||||
[resultTemplate]="rt"
|
[resultTemplate]="rt"
|
||||||
[type]="model.inputType"
|
[type]="model.inputType"
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
[inputFormatter]="formatter"
|
[inputFormatter]="formatter"
|
||||||
[name]="model.name"
|
[name]="model.name"
|
||||||
[ngbTypeahead]="search"
|
[ngbTypeahead]="search"
|
||||||
[placeholder]="model.label"
|
[placeholder]="model.placeholder"
|
||||||
[readonly]="model.readOnly"
|
[readonly]="model.readOnly"
|
||||||
[resultTemplate]="rt"
|
[resultTemplate]="rt"
|
||||||
[type]="model.inputType"
|
[type]="model.inputType"
|
||||||
|
@@ -27,7 +27,7 @@ export class ConcatFieldParser extends FieldParser {
|
|||||||
this.secondPlaceholder = secondPlaceholder;
|
this.secondPlaceholder = secondPlaceholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject | any): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
|
|
||||||
let clsGroup: DynamicFormControlLayout;
|
let clsGroup: DynamicFormControlLayout;
|
||||||
let clsInput: DynamicFormControlLayout;
|
let clsInput: DynamicFormControlLayout;
|
||||||
@@ -54,8 +54,8 @@ export class ConcatFieldParser extends FieldParser {
|
|||||||
concatGroup.group = [];
|
concatGroup.group = [];
|
||||||
concatGroup.separator = this.separator;
|
concatGroup.separator = this.separator;
|
||||||
|
|
||||||
const input1ModelConfig: DynamicInputModelConfig = this.initModel(newId + CONCAT_FIRST_INPUT_SUFFIX, true, false, false);
|
const input1ModelConfig: DynamicInputModelConfig = this.initModel(newId + CONCAT_FIRST_INPUT_SUFFIX, label, false, false);
|
||||||
const input2ModelConfig: DynamicInputModelConfig = this.initModel(newId + CONCAT_SECOND_INPUT_SUFFIX, true, true, false);
|
const input2ModelConfig: DynamicInputModelConfig = this.initModel(newId + CONCAT_SECOND_INPUT_SUFFIX, label, true, false);
|
||||||
|
|
||||||
if (this.configData.mandatory) {
|
if (this.configData.mandatory) {
|
||||||
input1ModelConfig.required = true;
|
input1ModelConfig.required = true;
|
||||||
|
@@ -7,9 +7,9 @@ import { FormFieldMetadataValueObject } from '../models/form-field-metadata-valu
|
|||||||
|
|
||||||
export class DateFieldParser extends FieldParser {
|
export class DateFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
let malformedDate = false;
|
let malformedDate = false;
|
||||||
const inputDateModelConfig: DynamicDatePickerModelConfig = this.initModel();
|
const inputDateModelConfig: DynamicDatePickerModelConfig = this.initModel(null, label);
|
||||||
|
|
||||||
inputDateModelConfig.toggleIcon = 'fa fa-calendar';
|
inputDateModelConfig.toggleIcon = 'fa fa-calendar';
|
||||||
this.setValues(inputDateModelConfig as any, fieldValue);
|
this.setValues(inputDateModelConfig as any, fieldValue);
|
||||||
|
@@ -9,8 +9,8 @@ import { FormFieldMetadataValueObject } from '../models/form-field-metadata-valu
|
|||||||
|
|
||||||
export class DropdownFieldParser extends FieldParser {
|
export class DropdownFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
const dropdownModelConfig: DynamicScrollableDropdownModelConfig = this.initModel();
|
const dropdownModelConfig: DynamicScrollableDropdownModelConfig = this.initModel(null, label);
|
||||||
let layout: DynamicFormControlLayout;
|
let layout: DynamicFormControlLayout;
|
||||||
|
|
||||||
if (isNotEmpty(this.configData.selectableMetadata[0].authority)) {
|
if (isNotEmpty(this.configData.selectableMetadata[0].authority)) {
|
||||||
|
@@ -20,7 +20,7 @@ export abstract class FieldParser {
|
|||||||
constructor(protected configData: FormFieldModel, protected initFormValues, protected parserOptions: ParserOptions) {
|
constructor(protected configData: FormFieldModel, protected initFormValues, protected parserOptions: ParserOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract modelFactory(fieldValue?: FormFieldMetadataValueObject): any;
|
public abstract modelFactory(fieldValue?: FormFieldMetadataValueObject, label?: boolean): any;
|
||||||
|
|
||||||
public parse() {
|
public parse() {
|
||||||
if (((this.getInitValueCount() > 1 && !this.configData.repeatable) || (this.configData.repeatable))
|
if (((this.getInitValueCount() > 1 && !this.configData.repeatable) || (this.configData.repeatable))
|
||||||
@@ -33,6 +33,7 @@ export abstract class FieldParser {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
id: uniqueId() + '_array',
|
id: uniqueId() + '_array',
|
||||||
|
label: this.configData.label,
|
||||||
initialCount: this.getInitArrayIndex(),
|
initialCount: this.getInitArrayIndex(),
|
||||||
notRepeteable: !this.configData.repeatable,
|
notRepeteable: !this.configData.repeatable,
|
||||||
groupFactory: () => {
|
groupFactory: () => {
|
||||||
@@ -50,7 +51,7 @@ export abstract class FieldParser {
|
|||||||
arrayCounter++;
|
arrayCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model = this.modelFactory(fieldValue);
|
model = this.modelFactory(fieldValue, false);
|
||||||
}
|
}
|
||||||
setLayout(model, 'element', 'host', 'col');
|
setLayout(model, 'element', 'host', 'col');
|
||||||
if (model.hasLanguages) {
|
if (model.hasLanguages) {
|
||||||
@@ -184,9 +185,8 @@ export abstract class FieldParser {
|
|||||||
controlModel.readOnly = this.parserOptions.readOnly;
|
controlModel.readOnly = this.parserOptions.readOnly;
|
||||||
controlModel.disabled = this.parserOptions.readOnly;
|
controlModel.disabled = this.parserOptions.readOnly;
|
||||||
|
|
||||||
if (label) {
|
// Set label
|
||||||
controlModel.label = (labelEmpty) ? ' ' : this.configData.label;
|
this.setLabel(controlModel, label, labelEmpty);
|
||||||
}
|
|
||||||
|
|
||||||
controlModel.placeholder = this.configData.label;
|
controlModel.placeholder = this.configData.label;
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ export abstract class FieldParser {
|
|||||||
controlModel.errorMessages = Object.assign(
|
controlModel.errorMessages = Object.assign(
|
||||||
{},
|
{},
|
||||||
controlModel.errorMessages,
|
controlModel.errorMessages,
|
||||||
{pattern: 'form.error.validation.pattern', regex: 'form.error.validation.pattern'});
|
{pattern: 'form.error.validation.pattern'});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,6 +229,12 @@ export abstract class FieldParser {
|
|||||||
{required: this.configData.mandatoryMessage});
|
{required: this.configData.mandatoryMessage});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected setLabel(controlModel, label = true, labelEmpty = false) {
|
||||||
|
if (label) {
|
||||||
|
controlModel.label = (labelEmpty) ? ' ' : this.configData.label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected setOptions(controlModel) {
|
protected setOptions(controlModel) {
|
||||||
// Checks if field has multiple values and sets options available
|
// Checks if field has multiple values and sets options available
|
||||||
if (isNotUndefined(this.configData.selectableMetadata) && this.configData.selectableMetadata.length > 1) {
|
if (isNotUndefined(this.configData.selectableMetadata) && this.configData.selectableMetadata.length > 1) {
|
||||||
|
@@ -11,8 +11,8 @@ import { FormRowModel } from '../../../../core/shared/config/config-submission-f
|
|||||||
|
|
||||||
export class GroupFieldParser extends FieldParser {
|
export class GroupFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject) {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean) {
|
||||||
const modelConfiguration: DynamicGroupModelConfig = this.initModel();
|
const modelConfiguration: DynamicGroupModelConfig = this.initModel(null, label);
|
||||||
|
|
||||||
modelConfiguration.scopeUUID = this.parserOptions.authorityUuid;
|
modelConfiguration.scopeUUID = this.parserOptions.authorityUuid;
|
||||||
modelConfiguration.submissionScope = this.parserOptions.submissionScope;
|
modelConfiguration.submissionScope = this.parserOptions.submissionScope;
|
||||||
|
@@ -8,8 +8,8 @@ import { DynamicListRadioGroupModel } from '../ds-dynamic-form-ui/models/list/dy
|
|||||||
export class ListFieldParser extends FieldParser {
|
export class ListFieldParser extends FieldParser {
|
||||||
searchOptions: IntegrationSearchOptions;
|
searchOptions: IntegrationSearchOptions;
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
const listModelConfig = this.initModel();
|
const listModelConfig = this.initModel(null, label);
|
||||||
listModelConfig.repeatable = this.configData.repeatable;
|
listModelConfig.repeatable = this.configData.repeatable;
|
||||||
|
|
||||||
if (this.configData.selectableMetadata[0].authority
|
if (this.configData.selectableMetadata[0].authority
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
import { FieldParser } from './field-parser';
|
import { FieldParser } from './field-parser';
|
||||||
import { DynamicLookupModel, DynamicLookupModelConfig } from '../ds-dynamic-form-ui/models/lookup/dynamic-lookup.model';
|
import { DynamicLookupModel, DynamicLookupModelConfig } from '../ds-dynamic-form-ui/models/lookup/dynamic-lookup.model';
|
||||||
|
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
|
||||||
|
|
||||||
export class LookupFieldParser extends FieldParser {
|
export class LookupFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: any): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
if (this.configData.selectableMetadata[0].authority) {
|
if (this.configData.selectableMetadata[0].authority) {
|
||||||
const lookupModelConfig: DynamicLookupModelConfig = this.initModel();
|
const lookupModelConfig: DynamicLookupModelConfig = this.initModel(null, label);
|
||||||
|
|
||||||
this.setAuthorityOptions(lookupModelConfig, this.parserOptions.authorityUuid);
|
this.setAuthorityOptions(lookupModelConfig, this.parserOptions.authorityUuid);
|
||||||
|
|
||||||
|
@@ -3,12 +3,13 @@ import {
|
|||||||
DynamicLookupNameModel,
|
DynamicLookupNameModel,
|
||||||
DynamicLookupNameModelConfig
|
DynamicLookupNameModelConfig
|
||||||
} from '../ds-dynamic-form-ui/models/lookup/dynamic-lookup-name.model';
|
} from '../ds-dynamic-form-ui/models/lookup/dynamic-lookup-name.model';
|
||||||
|
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
|
||||||
|
|
||||||
export class LookupNameFieldParser extends FieldParser {
|
export class LookupNameFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: any): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
if (this.configData.selectableMetadata[0].authority) {
|
if (this.configData.selectableMetadata[0].authority) {
|
||||||
const lookupModelConfig: DynamicLookupNameModelConfig = this.initModel();
|
const lookupModelConfig: DynamicLookupNameModelConfig = this.initModel(null, label);
|
||||||
|
|
||||||
this.setAuthorityOptions(lookupModelConfig, this.parserOptions.authorityUuid);
|
this.setAuthorityOptions(lookupModelConfig, this.parserOptions.authorityUuid);
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ import {
|
|||||||
|
|
||||||
export class OneboxFieldParser extends FieldParser {
|
export class OneboxFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
if (this.configData.selectableMetadata.length > 1) {
|
if (this.configData.selectableMetadata.length > 1) {
|
||||||
// Case ComboBox
|
// Case ComboBox
|
||||||
const clsGroup = {
|
const clsGroup = {
|
||||||
@@ -55,14 +55,14 @@ export class OneboxFieldParser extends FieldParser {
|
|||||||
inputSelectGroup.group = [];
|
inputSelectGroup.group = [];
|
||||||
inputSelectGroup.legend = this.configData.label;
|
inputSelectGroup.legend = this.configData.label;
|
||||||
|
|
||||||
const selectModelConfig: DynamicSelectModelConfig<any> = this.initModel(newId + QUALDROP_METADATA_SUFFIX);
|
const selectModelConfig: DynamicSelectModelConfig<any> = this.initModel(newId + QUALDROP_METADATA_SUFFIX, label);
|
||||||
this.setOptions(selectModelConfig);
|
this.setOptions(selectModelConfig);
|
||||||
if (isNotEmpty(fieldValue)) {
|
if (isNotEmpty(fieldValue)) {
|
||||||
selectModelConfig.value = fieldValue.metadata;
|
selectModelConfig.value = fieldValue.metadata;
|
||||||
}
|
}
|
||||||
inputSelectGroup.group.push(new DynamicSelectModel(selectModelConfig, clsSelect));
|
inputSelectGroup.group.push(new DynamicSelectModel(selectModelConfig, clsSelect));
|
||||||
|
|
||||||
const inputModelConfig: DsDynamicInputModelConfig = this.initModel(newId + QUALDROP_VALUE_SUFFIX, true, true);
|
const inputModelConfig: DsDynamicInputModelConfig = this.initModel(newId + QUALDROP_VALUE_SUFFIX, label, true);
|
||||||
this.setValues(inputModelConfig, fieldValue);
|
this.setValues(inputModelConfig, fieldValue);
|
||||||
|
|
||||||
inputSelectGroup.readOnly = selectModelConfig.disabled && inputModelConfig.readOnly;
|
inputSelectGroup.readOnly = selectModelConfig.disabled && inputModelConfig.readOnly;
|
||||||
@@ -70,13 +70,13 @@ export class OneboxFieldParser extends FieldParser {
|
|||||||
|
|
||||||
return new DynamicQualdropModel(inputSelectGroup, clsGroup);
|
return new DynamicQualdropModel(inputSelectGroup, clsGroup);
|
||||||
} else if (this.configData.selectableMetadata[0].authority) {
|
} else if (this.configData.selectableMetadata[0].authority) {
|
||||||
const typeaheadModelConfig: DsDynamicTypeaheadModelConfig = this.initModel();
|
const typeaheadModelConfig: DsDynamicTypeaheadModelConfig = this.initModel(null, label);
|
||||||
this.setAuthorityOptions(typeaheadModelConfig, this.parserOptions.authorityUuid);
|
this.setAuthorityOptions(typeaheadModelConfig, this.parserOptions.authorityUuid);
|
||||||
this.setValues(typeaheadModelConfig, fieldValue, true);
|
this.setValues(typeaheadModelConfig, fieldValue, true);
|
||||||
const typeaheadModel = new DynamicTypeaheadModel(typeaheadModelConfig);
|
const typeaheadModel = new DynamicTypeaheadModel(typeaheadModelConfig);
|
||||||
return typeaheadModel;
|
return typeaheadModel;
|
||||||
} else {
|
} else {
|
||||||
const inputModelConfig: DsDynamicInputModelConfig = this.initModel();
|
const inputModelConfig: DsDynamicInputModelConfig = this.initModel(null, label);
|
||||||
this.setValues(inputModelConfig, fieldValue);
|
this.setValues(inputModelConfig, fieldValue);
|
||||||
const inputModel = new DsDynamicInputModel(inputModelConfig);
|
const inputModel = new DsDynamicInputModel(inputModelConfig);
|
||||||
return inputModel;
|
return inputModel;
|
||||||
|
@@ -4,8 +4,8 @@ import { DynamicTagModel, DynamicTagModelConfig } from '../ds-dynamic-form-ui/mo
|
|||||||
|
|
||||||
export class TagFieldParser extends FieldParser {
|
export class TagFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
const tagModelConfig: DynamicTagModelConfig = this.initModel();
|
const tagModelConfig: DynamicTagModelConfig = this.initModel(null, label);
|
||||||
if (this.configData.selectableMetadata[0].authority
|
if (this.configData.selectableMetadata[0].authority
|
||||||
&& this.configData.selectableMetadata[0].authority.length > 0) {
|
&& this.configData.selectableMetadata[0].authority.length > 0) {
|
||||||
this.setAuthorityOptions(tagModelConfig, this.parserOptions.authorityUuid);
|
this.setAuthorityOptions(tagModelConfig, this.parserOptions.authorityUuid);
|
||||||
|
@@ -8,8 +8,8 @@ import {
|
|||||||
|
|
||||||
export class TextareaFieldParser extends FieldParser {
|
export class TextareaFieldParser extends FieldParser {
|
||||||
|
|
||||||
public modelFactory(fieldValue: FormFieldMetadataValueObject | any): any {
|
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
|
||||||
const textAreaModelConfig: DsDynamicTextAreaModelConfig = this.initModel();
|
const textAreaModelConfig: DsDynamicTextAreaModelConfig = this.initModel(null, label);
|
||||||
|
|
||||||
let layout: DynamicFormControlLayout;
|
let layout: DynamicFormControlLayout;
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<!--Array with repeteable items-->
|
<!--Array with repeteable items-->
|
||||||
<div *ngIf="!context.notRepeteable"
|
<div *ngIf="!context.notRepeteable"
|
||||||
class="col-xs-2 d-flex flex-column justify-content-sm-center align-items-end mt-3">
|
class="col-xs-2 d-flex flex-column justify-content-sm-start align-items-end">
|
||||||
<div class="btn-group" role="group" aria-label="Basic example">
|
<div class="btn-group" role="group" aria-label="Basic example">
|
||||||
<button type="button" class="btn btn-secondary"
|
<button type="button" class="btn btn-secondary"
|
||||||
[disabled]="isItemReadOnly(context, index)"
|
[disabled]="isItemReadOnly(context, index)"
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<!--Array with non repeteable items - Only delete button-->
|
<!--Array with non repeteable items - Only delete button-->
|
||||||
<div *ngIf="context.notRepeteable && group.context.groups.length > 1"
|
<div *ngIf="context.notRepeteable && group.context.groups.length > 1"
|
||||||
class="col-xs-2 d-flex flex-column justify-content-sm-center align-items-end mt-3">
|
class="col-xs-2 d-flex flex-column justify-content-sm-start align-items-end">
|
||||||
<div class="btn-group" role="group" aria-label="Basic example">
|
<div class="btn-group" role="group" aria-label="Basic example">
|
||||||
<button type="button" class="btn btn-secondary"
|
<button type="button" class="btn btn-secondary"
|
||||||
(click)="removeItem($event, context, index)"
|
(click)="removeItem($event, context, index)"
|
||||||
|
@@ -5,7 +5,8 @@ import {
|
|||||||
DynamicFormArrayModel,
|
DynamicFormArrayModel,
|
||||||
DynamicFormControlEvent,
|
DynamicFormControlEvent,
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
DynamicFormGroupModel, DynamicFormLayout,
|
DynamicFormGroupModel,
|
||||||
|
DynamicFormLayout,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { findIndex } from 'lodash';
|
import { findIndex } from 'lodash';
|
||||||
@@ -25,7 +26,6 @@ import { hasValue, isNotEmpty, isNotNull, isNull } from '../empty.util';
|
|||||||
import { FormService } from './form.service';
|
import { FormService } from './form.service';
|
||||||
import { formObjectFromIdSelector } from './selectors';
|
import { formObjectFromIdSelector } from './selectors';
|
||||||
import { FormEntry, FormError } from './form.reducer';
|
import { FormEntry, FormError } from './form.reducer';
|
||||||
import { isEmpty } from 'lodash';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default form component.
|
* The default form component.
|
||||||
|
Reference in New Issue
Block a user