vc-create-dashboard 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3799,31 +3799,37 @@ class CreateDashboardComponent {
3799
3799
  }
3800
3800
  }
3801
3801
  populateDashboardForm(data) {
3802
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3803
- this.dashboardForm.dashboardName = data === null || data === void 0 ? void 0 : data.dashboard_name,
3804
- this.dashboardForm.dashboardDescriptionText = (_b = (_a = data === null || data === void 0 ? void 0 : data.description[0]) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : "",
3805
- this.dashboardForm.selectedViewers = this.setList(this.usersList, data === null || data === void 0 ? void 0 : data.visible_to_users, 'member_id');
3806
- this.listDetails.selectedUsersList = this.dashboardForm.selectedViewers;
3807
- data.visible_to_groups = ((data === null || data === void 0 ? void 0 : data.visible_to_groups) && (data === null || data === void 0 ? void 0 : data.visible_to_groups.length)) ? data === null || data === void 0 ? void 0 : data.visible_to_groups : [];
3808
- this.dashboardForm.selectedGroup = this.setList(this.groupList, data === null || data === void 0 ? void 0 : data.visible_to_groups, 'group_id');
3809
- this.listDetails.selectedGroupList = this.dashboardForm.selectedGroup;
3810
- this.dashboardForm.selectedResponsibilityCenters = this.setList(this.responsibilityCentersList, data === null || data === void 0 ? void 0 : data.responsibility_center, 'item_id');
3811
- this.dashboardForm.selectedResponsibilityCategories = this.setList(this.allComplianceCategories, data === null || data === void 0 ? void 0 : data.responsibility_category, 'category_id');
3812
- this.dashboardForm.selectedRiskCategories = this.setList(this.allRiskCategories, data === null || data === void 0 ? void 0 : data.risk_category, 'category_id');
3813
- this.dashboardForm.displayCriteria = ((data === null || data === void 0 ? void 0 : data.display_criteria) === "BOTH_RC_AND_CATEGORY") ? 'and' : 'or';
3814
- this.dashboardForm.selectedFromDate = ((_c = data === null || data === void 0 ? void 0 : data.timeframe) === null || _c === void 0 ? void 0 : _c.start_date) ? (_e = dayjs((_d = data === null || data === void 0 ? void 0 : data.timeframe) === null || _d === void 0 ? void 0 : _d.start_date)) === null || _e === void 0 ? void 0 : _e.toDate() : undefined;
3815
- this.dashboardForm.selectedToDate = ((_f = data === null || data === void 0 ? void 0 : data.timeframe) === null || _f === void 0 ? void 0 : _f.end_date) ? (_h = dayjs((_g = data === null || data === void 0 ? void 0 : data.timeframe) === null || _g === void 0 ? void 0 : _g.end_date)) === null || _h === void 0 ? void 0 : _h.toDate() : undefined;
3816
- this.vLoader = false;
3817
- this.dashboardForm.configureWidget = data.widget_details;
3818
- this.selectedWidgets = data.widget_details.length > 0 ? [...new Set(data.widget_details)] : [];
3819
- this.displayedWidgets = data.all_widgets.length > 0 ? [...new Set(data.all_widgets)] : [];
3820
- this.setFrequency(data === null || data === void 0 ? void 0 : data.email_summary, 'import');
3821
- let minToDate = this.setToDate((_j = data === null || data === void 0 ? void 0 : data.timeframe) === null || _j === void 0 ? void 0 : _j.start_date);
3822
- this.toDatePickerConfig = { min: minToDate };
3823
- this.hideToDate = true;
3824
- setTimeout(() => {
3825
- this.hideToDate = false;
3826
- }, 20);
3802
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3803
+ try {
3804
+ console.log("datattttta ===>", data, this.groupList);
3805
+ this.dashboardForm.dashboardName = data === null || data === void 0 ? void 0 : data.dashboard_name,
3806
+ this.dashboardForm.dashboardDescriptionText = (_b = (_a = data === null || data === void 0 ? void 0 : data.description[0]) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : "",
3807
+ this.dashboardForm.selectedViewers = this.setList(this.usersList, data === null || data === void 0 ? void 0 : data.visible_to_users, 'member_id');
3808
+ this.listDetails.selectedUsersList = this.dashboardForm.selectedViewers;
3809
+ data.visible_to_groups = ((data === null || data === void 0 ? void 0 : data.visible_to_groups) && (data === null || data === void 0 ? void 0 : data.visible_to_groups.length)) ? data === null || data === void 0 ? void 0 : data.visible_to_groups : [];
3810
+ this.dashboardForm.selectedGroup = this.setList(this.groupList, (_c = data === null || data === void 0 ? void 0 : data.visible_to_groups) !== null && _c !== void 0 ? _c : [], 'group_id');
3811
+ this.listDetails.selectedGroupList = this.dashboardForm.selectedGroup;
3812
+ this.dashboardForm.selectedResponsibilityCenters = this.setList(this.responsibilityCentersList, data === null || data === void 0 ? void 0 : data.responsibility_center, 'item_id');
3813
+ this.dashboardForm.selectedResponsibilityCategories = this.setList(this.allComplianceCategories, data === null || data === void 0 ? void 0 : data.responsibility_category, 'category_id');
3814
+ this.dashboardForm.selectedRiskCategories = this.setList(this.allRiskCategories, data === null || data === void 0 ? void 0 : data.risk_category, 'category_id');
3815
+ this.dashboardForm.displayCriteria = ((data === null || data === void 0 ? void 0 : data.display_criteria) === "BOTH_RC_AND_CATEGORY") ? 'and' : 'or';
3816
+ this.dashboardForm.selectedFromDate = ((_d = data === null || data === void 0 ? void 0 : data.timeframe) === null || _d === void 0 ? void 0 : _d.start_date) ? (_f = dayjs((_e = data === null || data === void 0 ? void 0 : data.timeframe) === null || _e === void 0 ? void 0 : _e.start_date)) === null || _f === void 0 ? void 0 : _f.toDate() : undefined;
3817
+ this.dashboardForm.selectedToDate = ((_g = data === null || data === void 0 ? void 0 : data.timeframe) === null || _g === void 0 ? void 0 : _g.end_date) ? (_j = dayjs((_h = data === null || data === void 0 ? void 0 : data.timeframe) === null || _h === void 0 ? void 0 : _h.end_date)) === null || _j === void 0 ? void 0 : _j.toDate() : undefined;
3818
+ this.vLoader = false;
3819
+ this.dashboardForm.configureWidget = data.widget_details;
3820
+ this.selectedWidgets = data.widget_details.length > 0 ? [...new Set(data.widget_details)] : [];
3821
+ this.displayedWidgets = data.all_widgets.length > 0 ? [...new Set(data.all_widgets)] : [];
3822
+ this.setFrequency(data === null || data === void 0 ? void 0 : data.email_summary, 'import');
3823
+ let minToDate = this.setToDate((_k = data === null || data === void 0 ? void 0 : data.timeframe) === null || _k === void 0 ? void 0 : _k.start_date);
3824
+ this.toDatePickerConfig = { min: minToDate };
3825
+ this.hideToDate = true;
3826
+ setTimeout(() => {
3827
+ this.hideToDate = false;
3828
+ }, 20);
3829
+ }
3830
+ catch (error) {
3831
+ console.log("populate dashboard error ==>", error);
3832
+ }
3827
3833
  }
3828
3834
  setFrequency(event, mode) {
3829
3835
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;