From df4f48fc97559483cac9f1d2156d5f1c2ef1c366 Mon Sep 17 00:00:00 2001 From: Devesh <mailme.devmehta@gmail.com> Date: Mon, 16 Mar 2020 20:38:01 +0530 Subject: [PATCH] Issue #SB-18246 fix:subject filter values to be aligned to class --- ...content-creation-default-template.component.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/client/src/app/modules/workspace/components/content-creation-default-template/content-creation-default-template.component.ts b/src/app/client/src/app/modules/workspace/components/content-creation-default-template/content-creation-default-template.component.ts index b1109a1dbc..27f3faa9d9 100644 --- a/src/app/client/src/app/modules/workspace/components/content-creation-default-template/content-creation-default-template.component.ts +++ b/src/app/client/src/app/modules/workspace/components/content-creation-default-template/content-creation-default-template.component.ts @@ -222,16 +222,15 @@ export class DefaultTemplateComponent implements OnInit { } dependedValues = _.map(associations, i => _.pick(i, ['name', 'category'])); if (dependedValues.length) { - groupdFields = _.chain(dependedValues) - .groupBy('category') - .map((name, category) => ({ name, category })) - .value(); + groupdFields = _.groupBy(dependedValues, 'category'); this.updateDropDownList(id, dependedValues); } - if (groupdFields.length) { - _.forEach(groupdFields, (value, key) => { - this.updateDropDownList(value.category, _.map(value.name, i => _.pick(i, 'name'))); - }); + if (groupdFields) { + for (const key in groupdFields) { + if (groupdFields.hasOwnProperty(key)) { + this.updateDropDownList(key, groupdFields[key]); + } + } } else { this.updateDropDownList(id, []); } -- GitLab