vc-create-dashboard 3.0.80 → 3.0.82

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.
Files changed (45) hide show
  1. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.mjs +79 -290
  2. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.mjs +1 -1
  3. package/esm2022/lib/create-dashboard-container/constants/assets.constant.mjs +1 -1
  4. package/esm2022/lib/create-dashboard-container/create-dashboard.component.mjs +826 -404
  5. package/esm2022/lib/create-dashboard-container/create-dashboard.module.mjs +7 -3
  6. package/esm2022/lib/create-dashboard-container/pipes/search-program.pipe.mjs +37 -0
  7. package/esm2022/lib/create-dashboard-container/program-list/constant.mjs +31 -0
  8. package/esm2022/lib/create-dashboard-container/program-list/information-block/information-block.component.mjs +13 -0
  9. package/esm2022/lib/create-dashboard-container/program-list/interfaces/list-item.interface.mjs +2 -0
  10. package/esm2022/lib/create-dashboard-container/program-list/list-container/list-container.component.mjs +50 -0
  11. package/esm2022/lib/create-dashboard-container/program-list/pipes/check-selected-items.pipes.mjs +23 -0
  12. package/esm2022/lib/create-dashboard-container/program-list/program-list/program-list.component.mjs +294 -0
  13. package/esm2022/lib/create-dashboard-container/program-list/program-list.module.mjs +60 -0
  14. package/esm2022/lib/create-dashboard-container/program-list/services/list-utils.service.mjs +27 -0
  15. package/esm2022/lib/create-dashboard-container/program-list/services/program-list-api.service.mjs +35 -0
  16. package/esm2022/lib/create-dashboard-container/services/configure-widgets.service.mjs +80 -72
  17. package/esm2022/lib/create-dashboard-container/services/create-dashboard.service.mjs +87 -4
  18. package/esm2022/lib/create-dashboard-container/utils/dashboard-edit.utils.mjs +181 -0
  19. package/esm2022/lib/ui-kit/dialog/dialog.component.mjs +8 -11
  20. package/esm2022/lib/ui-kit/loaders/loaders.module.mjs +24 -0
  21. package/esm2022/lib/ui-kit/loaders/table-loader/table-loader.component.mjs +18 -0
  22. package/fesm2022/vc-create-dashboard.mjs +3555 -2515
  23. package/fesm2022/vc-create-dashboard.mjs.map +1 -1
  24. package/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.d.ts +6 -16
  25. package/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.d.ts +1 -1
  26. package/lib/create-dashboard-container/create-dashboard.component.d.ts +62 -23
  27. package/lib/create-dashboard-container/create-dashboard.module.d.ts +2 -1
  28. package/lib/create-dashboard-container/pipes/search-program.pipe.d.ts +7 -0
  29. package/lib/create-dashboard-container/program-list/constant.d.ts +24 -0
  30. package/lib/create-dashboard-container/program-list/information-block/information-block.component.d.ts +6 -0
  31. package/lib/create-dashboard-container/program-list/interfaces/list-item.interface.d.ts +5 -0
  32. package/lib/create-dashboard-container/program-list/list-container/list-container.component.d.ts +9 -0
  33. package/lib/create-dashboard-container/program-list/pipes/check-selected-items.pipes.d.ts +7 -0
  34. package/lib/create-dashboard-container/program-list/program-list/program-list.component.d.ts +119 -0
  35. package/lib/create-dashboard-container/program-list/program-list.module.d.ts +17 -0
  36. package/lib/create-dashboard-container/program-list/services/list-utils.service.d.ts +7 -0
  37. package/lib/create-dashboard-container/program-list/services/program-list-api.service.d.ts +14 -0
  38. package/lib/create-dashboard-container/services/configure-widgets.service.d.ts +1 -16
  39. package/lib/create-dashboard-container/services/create-dashboard.service.d.ts +38 -1
  40. package/lib/create-dashboard-container/utils/dashboard-edit.utils.d.ts +16 -0
  41. package/lib/ui-kit/loaders/loaders.module.d.ts +8 -0
  42. package/lib/ui-kit/loaders/table-loader/table-loader.component.d.ts +9 -0
  43. package/package.json +1 -1
  44. package/esm2022/lib/create-dashboard-container/services/urlConfig.service.mjs +0 -29
  45. package/lib/create-dashboard-container/services/urlConfig.service.d.ts +0 -10
@@ -68,6 +68,11 @@ export declare class ConfigureWidgetsComponent implements OnInit, OnChanges {
68
68
  riskWidgetsDisplayCount: number;
69
69
  constructor(dialog: DialogRef, configureWidgetsService: ConfigureWidgetsService, snackBar: SnackBarService);
70
70
  ngOnChanges(): void;
71
+ /** EDIT: show full widget catalog; check items present in getWidgets widgetArr. */
72
+ private applyEditModeWidgetCatalog;
73
+ /** CREATE: limit visible tiles to displayedWidgets when provided. */
74
+ private applyCreateModeWidgetVisibility;
75
+ private applySavedWidgetSelection;
71
76
  ngOnInit(): void;
72
77
  widgetsList: {
73
78
  COMPLIANCE: ({
@@ -96,23 +101,8 @@ export declare class ConfigureWidgetsComponent implements OnInit, OnChanges {
96
101
  visibility: boolean;
97
102
  }[];
98
103
  })[];
99
- RISK: {
100
- title: string;
101
- id: string;
102
- description: string;
103
- widgetImage: string;
104
- value: boolean;
105
- visibility: boolean;
106
- module: string;
107
- subWidgets: {
108
- title: string;
109
- id: string;
110
- value: boolean;
111
- visibility: boolean;
112
- }[];
113
- }[];
114
104
  };
115
- selectWidget(event: any, module: 'COMPLIANCE' | 'RISK', widgetId: string, subWidgetId?: string): void;
105
+ selectWidget(event: any, module: 'COMPLIANCE', widgetId: string, subWidgetId?: string): void;
116
106
  setSelectedWidgets(): void;
117
107
  removeWidget(widget: widgetConfig): void;
118
108
  onNextClick(): void;
@@ -4,6 +4,6 @@ export interface widgetConfig {
4
4
  description: string;
5
5
  widgetImage: string;
6
6
  value: boolean;
7
- module: 'COMPLIANCE' | 'RISK';
7
+ module: 'COMPLIANCE';
8
8
  subWidgets: [];
9
9
  }
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { EditorConfig } from '@vcomply/editor';
3
3
  import { DatePickerComponent, IDatePickerConfig } from 'ng2-date-picker';
4
4
  import { CreateDashboardService } from './services/create-dashboard.service';
@@ -6,9 +6,9 @@ import { PaginationService } from './services/pagination.service';
6
6
  import { UserListConfiguration } from './user-list/user-list.config';
7
7
  import { CreateDashboardForm } from './create-dashboard-config';
8
8
  import { SnackBarService } from '../ui-kit/snack-bar/snack-bar.service';
9
- import { ConfigureWidgetsService } from './services/configure-widgets.service';
10
9
  import { PopoverService } from '../ui-kit/popover/popover.service';
11
10
  import { TextCountPipe } from './pipes/text-count.pipe';
11
+ import { ListItem } from './program-list/interfaces/list-item.interface';
12
12
  import * as i0 from "@angular/core";
13
13
  export declare class CreateDashboardComponent implements OnInit, OnChanges {
14
14
  private createDashboardService;
@@ -16,13 +16,15 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
16
16
  private cdr;
17
17
  private snackBar;
18
18
  popoverService: PopoverService;
19
- private configureWidgetsService;
20
19
  private textCount;
21
20
  feature: any;
22
21
  activeSelector: string;
23
22
  disabled: boolean;
24
23
  mode: string;
25
24
  dashboardId: string;
25
+ dashboardDetails: any;
26
+ /** API dashboard object from createDashboard response (used when navigating after create). */
27
+ private createdDashboard;
26
28
  close: EventEmitter<any>;
27
29
  createdBy: number;
28
30
  fromDatePicker: DatePickerComponent;
@@ -35,9 +37,8 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
35
37
  usersList: any[];
36
38
  vLoader: boolean;
37
39
  userListLoaded: boolean;
40
+ groupListLoaded: boolean;
38
41
  rcListLoaded: boolean;
39
- complianceCategoriesListLoaded: boolean;
40
- riskCategoryListLoaded: boolean;
41
42
  hideToDate: boolean;
42
43
  listDetails: UserListConfiguration;
43
44
  dashboardDescription: EditorConfig;
@@ -50,12 +51,11 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
50
51
  openConfigureWidgets: boolean;
51
52
  selectedWidgets: any;
52
53
  displayedWidgets: any;
53
- responsibilityCentersList: never[];
54
+ responsibilityCentersList: any[];
54
55
  datePickerOverlay: boolean;
55
56
  dayNames: string[];
56
57
  monthNames: string[];
57
58
  quarters: string[];
58
- categoryListLoaded: boolean;
59
59
  showRiskWidgets: boolean;
60
60
  showComplianceWidgets: boolean;
61
61
  isManageRisk: boolean;
@@ -77,6 +77,7 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
77
77
  selectedList: never[];
78
78
  };
79
79
  };
80
+ programListUrl: any;
80
81
  fromDatePickerConfig: IDatePickerConfig;
81
82
  toDatePickerConfig: IDatePickerConfig;
82
83
  isSmiley: boolean;
@@ -87,16 +88,33 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
87
88
  fromDatePickerPopup: ElementRef;
88
89
  toDatePickerPopup: ElementRef;
89
90
  openedDatePicker: string;
90
- constructor(createDashboardService: CreateDashboardService, paginationService: PaginationService, cdr: ChangeDetectorRef, snackBar: SnackBarService, popoverService: PopoverService, configureWidgetsService: ConfigureWidgetsService, textCount: TextCountPipe);
91
- ngOnChanges(): void;
91
+ selectedPrograms: any;
92
+ allProgamSelected: any[];
93
+ private pendingEditRcIds;
94
+ private pendingEditRcEntries;
95
+ private editFormHydrated;
96
+ /** Tracks in-flight EDIT hydration HTTP calls; loader stays on until zero. */
97
+ private editHydrationCount;
98
+ constructor(createDashboardService: CreateDashboardService, paginationService: PaginationService, cdr: ChangeDetectorRef, snackBar: SnackBarService, popoverService: PopoverService, textCount: TextCountPipe);
99
+ ngOnChanges(changes: SimpleChanges): void;
92
100
  onKeydownHandler(event: KeyboardEvent): void;
93
101
  ngOnInit(): void;
102
+ animateContainer(): void;
103
+ getUserInfo(): void;
94
104
  /**
95
105
  * Displays the listing pages the left side of policy form to set and edit the dropdown fields values
96
106
  * @param type holds name of particular list is to be displayed
97
107
  * @param event contains boolean value to display the list or not
98
108
  */
99
109
  activateSelector(type: any, event: boolean): void;
110
+ onProgramSelectionChange(items: ListItem[]): void;
111
+ selectCategory(): void;
112
+ checkDefaultProgramOnRemove(event: any): void;
113
+ removeProgram(program: any): void;
114
+ private syncProgramSelectionMapFromForm;
115
+ private hydrateProgramsFromDashboardData;
116
+ private applyFlatProgramCategories;
117
+ private applyResponsibilityCategoryWidgetFilters;
100
118
  openFromDatePicker(): void;
101
119
  openToDatePicker(): void;
102
120
  closeFromDatePicker(): void;
@@ -107,25 +125,17 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
107
125
  setToDate(data: string): string;
108
126
  getFromDate(data: string): string;
109
127
  /**
110
- * It takes a string, converts it to a date, then returns a string in the format of YYYY-MM-DD.
111
- * @param {string} data - the date you want to format
112
- * @returns A string in the format of YYYY-MM-DD
128
+ * @param data - the date you want to format
129
+ * @returns Date string in YYYY-MM-DD format, e.g. 2026-05-19
113
130
  */
114
131
  getDateFormate(data: string): string;
115
132
  configureDashboard(): void;
116
- /**
117
- * Fetches organization users count api to get total number of pages
118
- * @param Url contains prams
119
- */
120
- getOrganizationUsersCount(Url: any): void;
121
133
  /**
122
134
  * Get users list by making api call and pre selects all admins by adding to viewers
123
135
  * @param url contains query params for organization users api
124
136
  */
125
137
  getUsersList(url: any): void;
126
138
  getGroupList(): void;
127
- getComplianceCategoryList(): void;
128
- getCategoryList(): void;
129
139
  /**
130
140
  * It is to ensure whether all required lists on Policy from is loaded from the api call or not
131
141
  */
@@ -150,7 +160,29 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
150
160
  uniqueByProp(array: any, key: string): unknown[];
151
161
  saveSelectedList(type: string, selectedItems: any): void;
152
162
  remove(type: any, event: any, removeIndex?: any): void;
153
- setList(list: any[], ids: any[], key: string): any;
163
+ setList(list: any[], ids: any[], key: string): any[];
164
+ private setListByIds;
165
+ private flattenRcTree;
166
+ private normalizeRcList;
167
+ private resolveRcFromTree;
168
+ private applyPreresolvedRcEntries;
169
+ private applyPendingResponsibilityCenters;
170
+ private beginEditHydration;
171
+ private finishEditHydration;
172
+ private tryCompleteEditHydration;
173
+ private wrapEditRequest;
174
+ private loadCustomDashboardDetailForEdit;
175
+ private mergeEditDashboardDetails;
176
+ private patchDashboardMetaFromDetail;
177
+ private syncProgramsForEdit;
178
+ private applyProgramsFromDashboardIds;
179
+ private ensureProgramSelectionMapForList;
180
+ private applyProgramSelectionMap;
181
+ private categoryMatchesId;
182
+ private loadProgramsForEdit;
183
+ /** Custom dashboards often store program ids only — resolve names for form chips. */
184
+ private resolveProgramIdsForEdit;
185
+ private buildEditDashboardData;
154
186
  submitted: boolean;
155
187
  /**
156
188
  * Returns id's from a particular list elements
@@ -163,18 +195,25 @@ export declare class CreateDashboardComponent implements OnInit, OnChanges {
163
195
  */
164
196
  validateDashboard(): boolean;
165
197
  /**
166
- * Makes an api call to create a policy
198
+ * Makes an api call to create a dashboad
167
199
  * @param dashboard contains dashboardForm data
168
200
  */
169
201
  submitDashboard(): false | undefined;
202
+ closeContainer(message: string): void;
203
+ onSubmitDashboard(): void;
204
+ saveDashboard(payload: any): void;
205
+ private getCreatedDashboardCdid;
206
+ private hydrateEditForm;
207
+ private applyWidgetsFromGetWidgetsResponse;
208
+ /** EDIT mode only: GET getWidgets?dashboardId={cdid} */
209
+ private loadEditModeWidgets;
170
210
  editDashboard(): void;
171
211
  populateDashboardForm(data: any): void;
172
- setFrequency(event: any, mode: any): string | undefined;
173
212
  ngAfterViewChecked(): void;
174
213
  setPermission(roleActions: any): void;
175
214
  getElementClassName(el: any): string;
176
215
  documentClick(event: any): void;
177
216
  documentClickListener(target: any, openedElements: ElementRef, selectedDatePicker: any): void;
178
217
  static ɵfac: i0.ɵɵFactoryDeclaration<CreateDashboardComponent, never>;
179
- static ɵcmp: i0.ɵɵComponentDeclaration<CreateDashboardComponent, "app-create-dashboard", never, { "feature": { "alias": "feature"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "dashboardId": { "alias": "dashboardId"; "required": false; }; "createdBy": { "alias": "createdBy"; "required": false; }; "configureWidget": { "alias": "configureWidget"; "required": false; }; }, { "close": "close"; }, never, never, false, never>;
218
+ static ɵcmp: i0.ɵɵComponentDeclaration<CreateDashboardComponent, "app-create-dashboard", never, { "feature": { "alias": "feature"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "dashboardId": { "alias": "dashboardId"; "required": false; }; "dashboardDetails": { "alias": "dashboardDetails"; "required": false; }; "createdBy": { "alias": "createdBy"; "required": false; }; "configureWidget": { "alias": "configureWidget"; "required": false; }; }, { "close": "close"; }, never, never, false, never>;
180
219
  }
@@ -28,9 +28,10 @@ import * as i24 from "../ui-kit/no-data/no-data.module";
28
28
  import * as i25 from "./directives/directives.module";
29
29
  import * as i26 from "../ui-kit/smiley-dialog/smiley-dialog.module";
30
30
  import * as i27 from "ng2-date-picker";
31
+ import * as i28 from "./program-list/program-list.module";
31
32
  export declare class CreateDashboardModule {
32
33
  static forRoot(environmentConfig: Configurations): ModuleWithProviders<CreateDashboardModule>;
33
34
  static ɵfac: i0.ɵɵFactoryDeclaration<CreateDashboardModule, never>;
34
- static ɵmod: i0.ɵɵNgModuleDeclaration<CreateDashboardModule, [typeof i1.CreateDashboardComponent, typeof i2.UserListComponent, typeof i3.FormGroupComponent, typeof i4.ResponsibilityCenterComponent, typeof i5.CategoriesComponent, typeof i6.RiskCategoriesComponent, typeof i7.FrequencyComponent, typeof i8.FilterPipe, typeof i9.TextCountPipe], [typeof i10.CommonModule, typeof i11.VcomplyEditorModule, typeof i12.FormgroupModule, typeof i13.FormsModule, typeof i14.TooltipModule, typeof i15.SelectModule, typeof i16.DashboardFooterModule, typeof i17.PaginationModule, typeof i18.FloatingBarModule, typeof i19.DialogModule, typeof i20.ConfigureWidgetsModule, typeof i21.PopoverModule, typeof i22.VLoaderModule, typeof i23.SnackBarModule, typeof i24.NoDataModule, typeof i25.DirectivesModule, typeof i26.SmileyDialogModule, typeof i27.DpDatePickerModule, typeof i10.NgOptimizedImage], [typeof i1.CreateDashboardComponent]>;
35
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CreateDashboardModule, [typeof i1.CreateDashboardComponent, typeof i2.UserListComponent, typeof i3.FormGroupComponent, typeof i4.ResponsibilityCenterComponent, typeof i5.CategoriesComponent, typeof i6.RiskCategoriesComponent, typeof i7.FrequencyComponent, typeof i8.FilterPipe, typeof i9.TextCountPipe], [typeof i10.CommonModule, typeof i11.VcomplyEditorModule, typeof i12.FormgroupModule, typeof i13.FormsModule, typeof i14.TooltipModule, typeof i15.SelectModule, typeof i16.DashboardFooterModule, typeof i17.PaginationModule, typeof i18.FloatingBarModule, typeof i19.DialogModule, typeof i20.ConfigureWidgetsModule, typeof i21.PopoverModule, typeof i22.VLoaderModule, typeof i23.SnackBarModule, typeof i24.NoDataModule, typeof i25.DirectivesModule, typeof i26.SmileyDialogModule, typeof i27.DpDatePickerModule, typeof i10.NgOptimizedImage, typeof i28.ProgramListModule], [typeof i1.CreateDashboardComponent]>;
35
36
  static ɵinj: i0.ɵɵInjectorDeclaration<CreateDashboardModule>;
36
37
  }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SearchProgramPipe implements PipeTransform {
4
+ transform(items: any[], ...args: any[]): any[];
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchProgramPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<SearchProgramPipe, "searchProgram", false>;
7
+ }
@@ -0,0 +1,24 @@
1
+ export declare const PROGRAM_TABLE_HEADERS: string[];
2
+ export declare const PAGINATION_OPTIONS: {
3
+ PAGE_SIZE: number;
4
+ DEFAULT_CURRENT_PAGE: number;
5
+ };
6
+ export declare const PROGRAM_TYPE_LIST: {
7
+ name: string;
8
+ id: string;
9
+ }[];
10
+ export declare const PROGRAM_OBJECT: {
11
+ regulations: number;
12
+ standards: number;
13
+ internal_controls: number;
14
+ others: number;
15
+ };
16
+ export declare const PROGRAM_NO_DATA: {
17
+ programList: string;
18
+ categoryList: string;
19
+ search: string;
20
+ };
21
+ export declare const PROGRAM_LIST_API: {
22
+ programList: string;
23
+ categoryList: string;
24
+ };
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class InformationBlockComponent {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<InformationBlockComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<InformationBlockComponent, "app-information-block", never, {}, {}, never, never, false, never>;
6
+ }
@@ -0,0 +1,5 @@
1
+ export interface ListItem {
2
+ id: string;
3
+ name: string;
4
+ type: "regulations" | "standards" | "internal_controls" | "others";
5
+ }
@@ -0,0 +1,9 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ListContainerComponent {
4
+ heading: string;
5
+ close: EventEmitter<void>;
6
+ onClose(): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListContainerComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListContainerComponent, "app-list-container", never, { "heading": { "alias": "heading"; "required": false; }; }, { "close": "close"; }, never, ["[body]", "[footer]"], false, never>;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class CheckSelectedItemsPipe implements PipeTransform {
4
+ transform(id: string, selectedItems: any): boolean;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckSelectedItemsPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<CheckSelectedItemsPipe, "checkSelectedItems", false>;
7
+ }
@@ -0,0 +1,119 @@
1
+ import { EventEmitter, OnInit, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
2
+ import { ListItem } from '../interfaces/list-item.interface';
3
+ import { ListUtilsService } from '../services/list-utils.service';
4
+ import { ProgramListApiService } from '../services/program-list-api.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ProgramListComponent<T extends ListItem> implements OnInit, OnChanges, OnDestroy {
7
+ private listUtils;
8
+ private programListApiService;
9
+ /** Array of items to be displayed in the list */
10
+ items: T[];
11
+ /** Object containing selected items, keyed by program ID */
12
+ selectedItems: any | null;
13
+ /** URL configuration object for API endpoints */
14
+ url: any;
15
+ /** Event emitted when an item is selected */
16
+ itemSelected: EventEmitter<T>;
17
+ /** Event emitted when an item is deselected */
18
+ itemDeselected: EventEmitter<T>;
19
+ /** Event emitted when the selection changes */
20
+ itemsSelectedChange: EventEmitter<T[]>;
21
+ tableHeaders: string[];
22
+ currentPage: number;
23
+ pageSize: number;
24
+ totalPages: number;
25
+ searchTerm: string;
26
+ paginatedItems: T[];
27
+ activeProgram: any | null;
28
+ categoryList: any;
29
+ programTypeList: any[];
30
+ selectedProgramType: any[];
31
+ loaderState: any;
32
+ appliedProgramType: any[];
33
+ PROGRAM_NO_DATA: any;
34
+ ASSETS: any;
35
+ programCategoryList: any;
36
+ /** Subject for handling debounced search */
37
+ private searchSubject;
38
+ /** Subject for cleanup subscriptions */
39
+ private destroy$;
40
+ constructor(listUtils: ListUtilsService, programListApiService: ProgramListApiService);
41
+ /** Initialize component by fetching program list */
42
+ ngOnInit(): void;
43
+ /** Handle changes to inputs */
44
+ ngOnChanges(changes: SimpleChanges): void;
45
+ private focusFirstProgramWithSelections;
46
+ /** Fetch program list from API */
47
+ getProgramList(): void;
48
+ /**
49
+ * Load data and initialize pagination
50
+ * @param data Array of items to load
51
+ */
52
+ loadData(data: any): void;
53
+ /**
54
+ * Handle item selection/deselection
55
+ * @param event Selection event
56
+ * @param item Item being selected/deselected
57
+ */
58
+ selectItem(event: any, item: any): void;
59
+ /**
60
+ * Deselect a specific item
61
+ * @param item Item to deselect
62
+ */
63
+ deselectItem(item: T): void;
64
+ /**
65
+ * Check if an item is selected
66
+ * @param item Item to check
67
+ * @returns Boolean indicating if item is selected
68
+ */
69
+ isSelected(item: T): boolean;
70
+ /**
71
+ * Navigate to specific page
72
+ * @param page Page number to navigate to
73
+ * @param data Data to paginate
74
+ */
75
+ goToPage(page: number, data: any): void;
76
+ /**
77
+ * Get array of page numbers for pagination
78
+ * @returns Array of page numbers
79
+ */
80
+ getPageNumbers(): number[];
81
+ /**
82
+ * Paginate items and update view
83
+ * @param data Data to paginate
84
+ */
85
+ paginateItems(data: any): void;
86
+ /**
87
+ * View categories for a selected program
88
+ * @param item Program to view categories for
89
+ */
90
+ viewCategory(item?: any): void;
91
+ checkProgramCategoryExists(id: string): void;
92
+ fetchProgramCategoryList(id: string): void;
93
+ /**
94
+ * Add parent tree information to categories
95
+ * @param categories Array of categories
96
+ * @returns Categories with parent tree information
97
+ */
98
+ addParentTreeToCategories(categories: any[]): any[];
99
+ /**
100
+ * Handle program type filter selection
101
+ * @param event Selection event
102
+ * @param item Program type being selected/deselected
103
+ */
104
+ selectFilter(event: any, item: any): void;
105
+ /** Reset all applied filters */
106
+ resetFilter(): void;
107
+ /** Apply selected filters to the program list */
108
+ onFilterChange(): void;
109
+ checkCategoryAvailbility(): void;
110
+ /** Trigger debounced search */
111
+ search(): void;
112
+ /** Perform search on items */
113
+ private performSearch;
114
+ /** Cleanup subscriptions on component destruction */
115
+ ngOnDestroy(): void;
116
+ closePopover(event: any): void;
117
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProgramListComponent<any>, never>;
118
+ static ɵcmp: i0.ɵɵComponentDeclaration<ProgramListComponent<any>, "app-program-list", never, { "items": { "alias": "items"; "required": false; }; "selectedItems": { "alias": "selectedItems"; "required": false; }; "url": { "alias": "url"; "required": false; }; }, { "itemSelected": "itemSelected"; "itemDeselected": "itemDeselected"; "itemsSelectedChange": "itemsSelectedChange"; }, never, never, false, never>;
119
+ }
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./program-list/program-list.component";
3
+ import * as i2 from "./pipes/check-selected-items.pipes";
4
+ import * as i3 from "./list-container/list-container.component";
5
+ import * as i4 from "../pipes/search-program.pipe";
6
+ import * as i5 from "./information-block/information-block.component";
7
+ import * as i6 from "@angular/common";
8
+ import * as i7 from "@angular/forms";
9
+ import * as i8 from "../../ui-kit/formgroup/formgroup.module";
10
+ import * as i9 from "../../ui-kit/no-data/no-data.module";
11
+ import * as i10 from "../../ui-kit/popover/popover.module";
12
+ import * as i11 from "../../ui-kit/loaders/loaders.module";
13
+ export declare class ProgramListModule {
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProgramListModule, never>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ProgramListModule, [typeof i1.ProgramListComponent, typeof i2.CheckSelectedItemsPipe, typeof i3.ListContainerComponent, typeof i4.SearchProgramPipe, typeof i5.InformationBlockComponent], [typeof i6.CommonModule, typeof i7.FormsModule, typeof i8.FormgroupModule, typeof i9.NoDataModule, typeof i10.PopoverModule, typeof i11.LoadersModule], [typeof i1.ProgramListComponent, typeof i3.ListContainerComponent, typeof i5.InformationBlockComponent]>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<ProgramListModule>;
17
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ListUtilsService {
3
+ paginate<T>(items: T[], currentPage: number, pageSize: number): T[];
4
+ getPageNumbers(totalItems: number, pageSize: number): number[];
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListUtilsService, never>;
6
+ static ɵprov: i0.ɵɵInjectableDeclaration<ListUtilsService>;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { Configurations } from '../../../configurations';
4
+ import { AuthService } from '../../services/auth.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ProgramListApiService {
7
+ private http;
8
+ private authService;
9
+ env: any;
10
+ constructor(http: HttpClient, authService: AuthService, config?: Configurations);
11
+ getProgramList(apiUrl: string): Observable<any>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProgramListApiService, [null, null, { optional: true; }]>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ProgramListApiService>;
14
+ }
@@ -7,21 +7,6 @@ export declare class ConfigureWidgetsService {
7
7
  private authService;
8
8
  env: any;
9
9
  constructor(http: HttpClient, authService: AuthService, config?: Configurations);
10
- complianceWidgetsData: ({
11
- title: string;
12
- id: string;
13
- description: string;
14
- widgetImage: string;
15
- value: number;
16
- tabOption?: undefined;
17
- } | {
18
- title: string;
19
- id: string;
20
- description: string;
21
- widgetImage: string;
22
- tabOption: boolean;
23
- value: number;
24
- })[];
25
10
  riskWidgetsData: {
26
11
  title: string;
27
12
  id: string;
@@ -32,7 +17,7 @@ export declare class ConfigureWidgetsService {
32
17
  auditWidgetsData: never[];
33
18
  policyWidgetsData: never[];
34
19
  dashBoardWidgetUpdate(widGetJson: any): import("rxjs").Observable<Object>;
35
- moduleType(identifier: string): "COMPLIANCE" | "RISK" | undefined;
20
+ moduleType(identifier: string): "RISK" | undefined;
36
21
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfigureWidgetsService, [null, null, { optional: true; }]>;
37
22
  static ɵprov: i0.ɵɵInjectableDeclaration<ConfigureWidgetsService>;
38
23
  }
@@ -35,11 +35,48 @@ export declare class CreateDashboardService {
35
35
  * Fetches the Dashboard details for data population to Edit the dashboard
36
36
  * @param id
37
37
  */
38
+ /** @deprecated Legacy Global-Dashboard edit fetch; custom dashboards use fetchCustomDashboardById + getWidgets. */
38
39
  fetchDashboard(id: any): import("rxjs").Observable<ArrayBuffer>;
39
- updateDashboard(id: any, payload: any): import("rxjs").Observable<ArrayBuffer>;
40
+ /**
41
+ * Edit mode only — GET Global-Dashboard/getWidgets?dashboardId={cdid}
42
+ * @param cdid Custom dashboard id (e.g. 438F8KSK22), not numeric record id
43
+ */
44
+ fetchCustomDashboardWidgetDetails(cdid: string): import("rxjs").Observable<{
45
+ widgetArr: any[];
46
+ allWidgetsArray: any[];
47
+ activeWidgetArr: any[];
48
+ }>;
49
+ normalizeWidgetDetailsResponse(res: any): {
50
+ widgetArr: any[];
51
+ allWidgetsArray: any[];
52
+ activeWidgetArr: any[];
53
+ };
54
+ getSailsProgramList(): import("rxjs").Observable<ArrayBuffer>;
55
+ getProgramCategories(programId: string | number): import("rxjs").Observable<ArrayBuffer>;
56
+ /** Full custom dashboard payload (includes responsibilityCenterId, programId, etc.). */
57
+ fetchCustomDashboardById(id: string | number): import("rxjs").Observable<ArrayBuffer>;
40
58
  getUserInformation(): import("rxjs").Observable<ArrayBuffer>;
41
59
  _ID(): any;
42
60
  checkDuplicateDashboardName(payload: any): import("rxjs").Observable<ArrayBuffer>;
61
+ createDashboard(payload: any): import("rxjs").Observable<ArrayBuffer>;
62
+ updateDashboard(payload: any, id: any): import("rxjs").Observable<ArrayBuffer>;
63
+ saveWidgetDetails(payload: any): import("rxjs").Observable<ArrayBuffer>;
64
+ buildPayload(payload: any): {
65
+ dashboard: {
66
+ name: any;
67
+ description: any;
68
+ viewer: {
69
+ userId: any;
70
+ userGroupId: any;
71
+ };
72
+ responsibilityCenterId: any;
73
+ programId: any;
74
+ timeframe: {
75
+ from: any;
76
+ to: any;
77
+ };
78
+ };
79
+ };
43
80
  static ɵfac: i0.ɵɵFactoryDeclaration<CreateDashboardService, [null, null, { optional: true; }]>;
44
81
  static ɵprov: i0.ɵɵInjectableDeclaration<CreateDashboardService>;
45
82
  }
@@ -0,0 +1,16 @@
1
+ /** Shared helpers for custom dashboard create/edit form hydration. */
2
+ export type ProgramSelectionMap = Record<string, any[]>;
3
+ export declare function normalizeIdArray(value: unknown): number[];
4
+ export declare function extractProgramIdsFromDashboard(data: any): number[];
5
+ export declare function extractCategoryIdsFromDashboard(data: any): number[];
6
+ export declare function extractRcIdsFromDashboard(data: any): number[];
7
+ export declare function hasProgramSelectionInMap(map: ProgramSelectionMap | null | undefined): boolean;
8
+ export declare function normalizeProgramCategories(categories: any[]): any[];
9
+ export declare function flattenProgramSelectionMap(selections: ProgramSelectionMap): any[];
10
+ export declare function normalizeProgramSelectionMap(map: ProgramSelectionMap): ProgramSelectionMap | null;
11
+ export declare function resolveCategoryProgramId(cat: any, complianceCatalog?: any[]): string;
12
+ export declare function buildProgramSelectionMapFromCategories(categories: any[], complianceCatalog?: any[]): ProgramSelectionMap;
13
+ export declare function parseSailsProgramList(res: any): any[];
14
+ export declare function getEditDashboardCdid(data: any, dashboardDetails: any, dashboardId: string): string;
15
+ export declare function getSelectedProgramsMap(data: any): ProgramSelectionMap | undefined;
16
+ export declare function filterActiveWidgets(widgets: any[]): any[];
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./table-loader/table-loader.component";
3
+ import * as i2 from "@angular/common";
4
+ export declare class LoadersModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadersModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LoadersModule, [typeof i1.TableLoaderComponent], [typeof i2.CommonModule], [typeof i1.TableLoaderComponent]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<LoadersModule>;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TableLoaderComponent implements OnInit {
4
+ listSize: number[];
5
+ constructor();
6
+ ngOnInit(): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableLoaderComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableLoaderComponent, "app-table-loader", never, { "listSize": { "alias": "listSize"; "required": false; }; }, {}, never, never, false, never>;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vc-create-dashboard",
3
- "version": "3.0.80",
3
+ "version": "3.0.82",
4
4
  "peerDependencies": {
5
5
  "@angular/common": " 12.x || 13.x || 14.x || 15.x || 16.x || 17.x || 18.x || 19.x ",
6
6
  "@angular/core": " 12.x || 13.x || 14.x || 15.x || 16.x || 17.x || 18.x || 19.x "
@@ -1,29 +0,0 @@
1
- import { Injectable, Optional } from '@angular/core';
2
- import { ASSETS } from '../constants/assets.constant';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "../../configurations";
5
- export class ConfigureBaseUrlService {
6
- ASSETS = ASSETS;
7
- env;
8
- constructor(config) {
9
- if (config) {
10
- this.env = config?.envConfig;
11
- }
12
- }
13
- updateBaseUrl() {
14
- Object.keys(this.ASSETS).forEach((key) => {
15
- this.ASSETS[key] = `${this.env?.cdnUrl}${this.ASSETS[key]}`;
16
- });
17
- }
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfigureBaseUrlService, deps: [{ token: i1.Configurations, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
19
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfigureBaseUrlService, providedIn: 'root' });
20
- }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfigureBaseUrlService, decorators: [{
22
- type: Injectable,
23
- args: [{
24
- providedIn: 'root',
25
- }]
26
- }], ctorParameters: function () { return [{ type: i1.Configurations, decorators: [{
27
- type: Optional
28
- }] }]; } });
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXJsQ29uZmlnLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jcmVhdGUtZGFzaGJvYXJkL3NyYy9saWIvY3JlYXRlLWRhc2hib2FyZC1jb250YWluZXIvc2VydmljZXMvdXJsQ29uZmlnLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFckQsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLDhCQUE4QixDQUFDOzs7QUFLdEQsTUFBTSxPQUFPLHVCQUF1QjtJQUNsQyxNQUFNLEdBQVEsTUFBTSxDQUFDO0lBQ2QsR0FBRyxDQUFPO0lBQ2pCLFlBQXdCLE1BQXVCO1FBQzdDLElBQUksTUFBTSxFQUFFO1lBQ1YsSUFBSSxDQUFDLEdBQUcsR0FBRyxNQUFNLEVBQUUsU0FBUyxDQUFDO1NBQzlCO0lBQ0gsQ0FBQztJQUNELGFBQWE7UUFDWCxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRTtZQUN2QyxJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEdBQUcsSUFBSSxDQUFDLEdBQUcsRUFBRSxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDO1FBQzlELENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQzt3R0FaVSx1QkFBdUI7NEdBQXZCLHVCQUF1QixjQUZ0QixNQUFNOzs0RkFFUCx1QkFBdUI7a0JBSG5DLFVBQVU7bUJBQUM7b0JBQ1YsVUFBVSxFQUFFLE1BQU07aUJBQ25COzswQkFJYyxRQUFRIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0YWJsZSwgT3B0aW9uYWwgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbmZpZ3VyYXRpb25zIH0gZnJvbSAnLi4vLi4vY29uZmlndXJhdGlvbnMnO1xuaW1wb3J0IHsgQVNTRVRTIH0gZnJvbSAnLi4vY29uc3RhbnRzL2Fzc2V0cy5jb25zdGFudCc7XG5cbkBJbmplY3RhYmxlKHtcbiAgcHJvdmlkZWRJbjogJ3Jvb3QnLFxufSlcbmV4cG9ydCBjbGFzcyBDb25maWd1cmVCYXNlVXJsU2VydmljZSB7XG4gIEFTU0VUUzogYW55ID0gQVNTRVRTO1xuICBwdWJsaWMgZW52ITogYW55O1xuICBjb25zdHJ1Y3RvcihAT3B0aW9uYWwoKSBjb25maWc/OiBDb25maWd1cmF0aW9ucykge1xuICAgIGlmIChjb25maWcpIHtcbiAgICAgIHRoaXMuZW52ID0gY29uZmlnPy5lbnZDb25maWc7XG4gICAgfVxuICB9XG4gIHVwZGF0ZUJhc2VVcmwoKSB7XG4gICAgT2JqZWN0LmtleXModGhpcy5BU1NFVFMpLmZvckVhY2goKGtleSkgPT4ge1xuICAgICAgdGhpcy5BU1NFVFNba2V5XSA9IGAke3RoaXMuZW52Py5jZG5Vcmx9JHt0aGlzLkFTU0VUU1trZXldfWA7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==