mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Added a check to null value
This commit is contained in:
@@ -29,7 +29,7 @@ import { SubmissionFormsModel } from '../../../../../../core/config/models/confi
|
|||||||
import { FormService } from '../../../../form.service';
|
import { FormService } from '../../../../form.service';
|
||||||
import { FormComponent } from '../../../../form.component';
|
import { FormComponent } from '../../../../form.component';
|
||||||
import { Chips } from '../../../../../chips/models/chips.model';
|
import { Chips } from '../../../../../chips/models/chips.model';
|
||||||
import { hasValue, isEmpty, isNotEmpty } from '../../../../../empty.util';
|
import { hasValue, isEmpty, isNotEmpty, isNotNull } from '../../../../../empty.util';
|
||||||
import { shrinkInOut } from '../../../../../animations/shrink';
|
import { shrinkInOut } from '../../../../../animations/shrink';
|
||||||
import { ChipsItem } from '../../../../../chips/models/chips-item.model';
|
import { ChipsItem } from '../../../../../chips/models/chips-item.model';
|
||||||
import { GlobalConfig } from '../../../../../../../config/global-config.interface';
|
import { GlobalConfig } from '../../../../../../../config/global-config.interface';
|
||||||
@@ -129,7 +129,9 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
|
|||||||
|| this.selectedChipItem.item[model.name].value === PLACEHOLDER_PARENT_METADATA)
|
|| this.selectedChipItem.item[model.name].value === PLACEHOLDER_PARENT_METADATA)
|
||||||
? null
|
? null
|
||||||
: this.selectedChipItem.item[model.name];
|
: this.selectedChipItem.item[model.name];
|
||||||
|
if (isNotNull(value)) {
|
||||||
model.valueUpdates.next(this.formBuilderService.isInputModel(model) ? value.value : value);
|
model.valueUpdates.next(this.formBuilderService.isInputModel(model) ? value.value : value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -227,8 +229,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
|
|||||||
flatMap((valueModel) => {
|
flatMap((valueModel) => {
|
||||||
const returnList: Array<Observable<any>> = [];
|
const returnList: Array<Observable<any>> = [];
|
||||||
valueModel.forEach((valueObj) => {
|
valueModel.forEach((valueObj) => {
|
||||||
let returnObj = Object.create({});
|
const returnObj = Object.keys(valueObj).map((fieldName) => {
|
||||||
returnObj = Object.keys(valueObj).map((fieldName) => {
|
|
||||||
let return$: Observable<any>;
|
let return$: Observable<any>;
|
||||||
if (isObject(valueObj[fieldName]) && valueObj[fieldName].hasAuthority() && isNotEmpty(valueObj[fieldName].authority)) {
|
if (isObject(valueObj[fieldName]) && valueObj[fieldName].hasAuthority() && isNotEmpty(valueObj[fieldName].authority)) {
|
||||||
const fieldId = fieldName.replace(/\./g, '_');
|
const fieldId = fieldName.replace(/\./g, '_');
|
||||||
@@ -294,7 +295,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
|
|||||||
this.EnvConfig.submission.icons.metadata);
|
this.EnvConfig.submission.icons.metadata);
|
||||||
this.subs.push(
|
this.subs.push(
|
||||||
this.chips.chipsItems
|
this.chips.chipsItems
|
||||||
.subscribe((subItems: any[]) => {
|
.subscribe(() => {
|
||||||
const items = this.chips.getChipsItems();
|
const items = this.chips.getChipsItems();
|
||||||
// Does not emit change if model value is equal to the current value
|
// Does not emit change if model value is equal to the current value
|
||||||
if (!isEqual(items, this.model.value)) {
|
if (!isEqual(items, this.model.value)) {
|
||||||
|
Reference in New Issue
Block a user