cat-qw-lib 0.8.2 → 0.9.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.
- package/fesm2022/cat-qw-lib.mjs +54 -28
- package/fesm2022/cat-qw-lib.mjs.map +1 -1
- package/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.d.ts +2 -0
- package/lib/admin/action-admin/models/admin-action.model.d.ts +5 -4
- package/lib/admin/action-admin/state/admin-action.service.d.ts +2 -1
- package/lib/shared/_base/base-form/base-form.component.d.ts +1 -1
- package/lib/shared/_base/base-list/base-list.component.d.ts +1 -1
- package/lib/shared/constant/LIST-CONFIG.d.ts +4 -12
- package/lib/shared/constant/SHARED.d.ts +4 -3
- package/lib/shared/services/app-config.service.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/config/api.config.json +5 -0
package/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -291,7 +291,7 @@ const propertyDataList = [
|
|
|
291
291
|
]
|
|
292
292
|
}
|
|
293
293
|
];
|
|
294
|
-
const actionHiddenHeaderList = ['
|
|
294
|
+
const actionHiddenHeaderList = ['_id', 'createdAt', 'updatedAt', '__v', 'formFields'];
|
|
295
295
|
const actionList = [
|
|
296
296
|
{ action: 'Valuation Fee',
|
|
297
297
|
prompt: `The following conversation includes references to various addresses. Based on the selected form "Valuation Fee",
|
|
@@ -338,7 +338,7 @@ const actionList = [
|
|
|
338
338
|
Data:`, queueId: '67332cf2f9439e97c47a3c43', apiEndPoint: 'http://qa-gb.api.dynamatix.com:3100/api/applications', status: 'Enable'
|
|
339
339
|
}
|
|
340
340
|
];
|
|
341
|
-
const actionTableColumnWidthList = {
|
|
341
|
+
const actionTableColumnWidthList = { name: 'w-3', apiConfigID: 'w-3', queueID: 'w-3', prompt: 'w-4', isActive: 'w-2' };
|
|
342
342
|
|
|
343
343
|
class SidebarComponent {
|
|
344
344
|
renderer;
|
|
@@ -628,16 +628,32 @@ class URLS {
|
|
|
628
628
|
class AppConfigService {
|
|
629
629
|
http;
|
|
630
630
|
appConfig;
|
|
631
|
+
isConfigLoaded = false;
|
|
631
632
|
constructor(http) {
|
|
632
633
|
this.http = http;
|
|
633
634
|
}
|
|
634
|
-
|
|
635
|
-
|
|
635
|
+
loadAppConfig() {
|
|
636
|
+
return firstValueFrom(this.http.get(URLS.CONFIGFILEURL))
|
|
637
|
+
.then(config => {
|
|
638
|
+
this.appConfig = config;
|
|
639
|
+
this.isConfigLoaded = true;
|
|
640
|
+
})
|
|
641
|
+
.catch(err => {
|
|
642
|
+
console.error('Error loading app config:', err);
|
|
643
|
+
throw err;
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
ensureConfigLoaded() {
|
|
647
|
+
if (!this.isConfigLoaded) {
|
|
648
|
+
throw new Error('App configuration not loaded. Ensure loadAppConfig() is called before accessing properties.');
|
|
649
|
+
}
|
|
636
650
|
}
|
|
637
651
|
get apiBaseUrl() {
|
|
638
|
-
|
|
652
|
+
this.ensureConfigLoaded();
|
|
653
|
+
return this.appConfig?.baseApi;
|
|
639
654
|
}
|
|
640
655
|
get visibilityOptions() {
|
|
656
|
+
this.ensureConfigLoaded();
|
|
641
657
|
return this.appConfig?.visibilityOption;
|
|
642
658
|
}
|
|
643
659
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: AppConfigService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -833,9 +849,9 @@ class BaseListComponent {
|
|
|
833
849
|
this.handleRefreshTable();
|
|
834
850
|
}
|
|
835
851
|
}
|
|
836
|
-
init() {
|
|
852
|
+
init(dynamicWidth) {
|
|
837
853
|
this.service.getAll().subscribe((res) => {
|
|
838
|
-
this.table = this.builder.buildTable(res);
|
|
854
|
+
this.table = this.builder.buildTable(res, dynamicWidth);
|
|
839
855
|
this.afterTableBuild();
|
|
840
856
|
});
|
|
841
857
|
}
|
|
@@ -1374,25 +1390,25 @@ class BaseFormComponent {
|
|
|
1374
1390
|
let validateRecords = this.validatorService ? this.validatorService.handleValidateRecords(this.record) : true;
|
|
1375
1391
|
if (validateRecords) {
|
|
1376
1392
|
if (this.record._id) {
|
|
1377
|
-
this.
|
|
1393
|
+
this.handleUpdateRecord();
|
|
1378
1394
|
}
|
|
1379
1395
|
else {
|
|
1380
|
-
this.
|
|
1396
|
+
this.handleAddRecord();
|
|
1381
1397
|
}
|
|
1382
1398
|
}
|
|
1383
1399
|
}
|
|
1384
|
-
|
|
1400
|
+
handleUpdateRecord() {
|
|
1385
1401
|
this.service.update(this.record._id, this.record).subscribe({
|
|
1386
1402
|
next: (response) => {
|
|
1387
|
-
console.log('Record
|
|
1403
|
+
console.log('Record updated:', response);
|
|
1388
1404
|
this.onSave.emit();
|
|
1389
1405
|
},
|
|
1390
1406
|
error: (error) => {
|
|
1391
|
-
console.error('Error
|
|
1407
|
+
console.error('Error updating record:', error);
|
|
1392
1408
|
}
|
|
1393
1409
|
});
|
|
1394
1410
|
}
|
|
1395
|
-
|
|
1411
|
+
handleAddRecord() {
|
|
1396
1412
|
this.service.create(this.record).subscribe({
|
|
1397
1413
|
next: (response) => {
|
|
1398
1414
|
console.log('Record created:', response);
|
|
@@ -1496,21 +1512,22 @@ class MESSAGE {
|
|
|
1496
1512
|
}
|
|
1497
1513
|
|
|
1498
1514
|
class LISTCONFIG {
|
|
1499
|
-
static
|
|
1500
|
-
{
|
|
1501
|
-
name:
|
|
1502
|
-
dataSource:
|
|
1515
|
+
static createConfig(name, dataSource) {
|
|
1516
|
+
return {
|
|
1517
|
+
name: name,
|
|
1518
|
+
dataSource: dataSource,
|
|
1503
1519
|
listValueProperty: "_id",
|
|
1504
1520
|
listLabelProperty: "name"
|
|
1505
|
-
}
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
static APICONFIG = [
|
|
1524
|
+
LISTCONFIG.createConfig("parentApiConfigID", "api-configurations")
|
|
1506
1525
|
];
|
|
1507
1526
|
static QUEUECONFIG = [
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
listLabelProperty: "name"
|
|
1513
|
-
}
|
|
1527
|
+
LISTCONFIG.createConfig("queueID", "queues")
|
|
1528
|
+
];
|
|
1529
|
+
static ACTIONAPICONFIG = [
|
|
1530
|
+
LISTCONFIG.createConfig("apiConfigID", "api-configurations")
|
|
1514
1531
|
];
|
|
1515
1532
|
}
|
|
1516
1533
|
|
|
@@ -2000,6 +2017,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
2000
2017
|
|
|
2001
2018
|
class AdminActionService extends BaseService {
|
|
2002
2019
|
actionStore;
|
|
2020
|
+
list = [...LISTCONFIG.ACTIONAPICONFIG, ...LISTCONFIG.QUEUECONFIG];
|
|
2003
2021
|
constructor(actionStore, http, appConfigService, listService) {
|
|
2004
2022
|
super(http, actionStore, appConfigService, listService);
|
|
2005
2023
|
this.actionStore = actionStore;
|
|
@@ -2024,8 +2042,7 @@ class AdminActionListComponent extends BaseListComponent {
|
|
|
2024
2042
|
this.tableBuilder.hiddenHeaders = actionHiddenHeaderList;
|
|
2025
2043
|
}
|
|
2026
2044
|
ngOnInit() {
|
|
2027
|
-
|
|
2028
|
-
this.table = this.tableBuilder.buildTable(actionList, actionTableColumnWidths);
|
|
2045
|
+
this.init(actionTableColumnWidthList);
|
|
2029
2046
|
}
|
|
2030
2047
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: AdminActionListComponent, deps: [{ token: AdminActionService }, { token: TableBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
2031
2048
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: AdminActionListComponent, isStandalone: false, selector: "lib-admin-action-list", usesInheritance: true, ngImport: i0, template: "<div class=\"dicitonary-list-wrapper\">\r\n @if(table){\r\n <lib-table-primary [title]=\"'Actions'\" [table]=\"table\"></lib-table-primary>\r\n }\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["table", "title", "showStatus", "showActions", "showSearchBar", "showNewRecordButton", "showRefreshButton"] }] });
|
|
@@ -2051,13 +2068,22 @@ class AdminActionFormComponent extends BaseFormComponent {
|
|
|
2051
2068
|
this.router = router;
|
|
2052
2069
|
this.activatedRoute = activatedRoute;
|
|
2053
2070
|
this.adminActionStore = adminActionStore;
|
|
2071
|
+
this.record.isActive = true;
|
|
2072
|
+
}
|
|
2073
|
+
ngOnInit() {
|
|
2074
|
+
this.init();
|
|
2075
|
+
}
|
|
2076
|
+
handleSubmit() {
|
|
2077
|
+
this.record.formFields = JSON.stringify(this.record.formFields);
|
|
2078
|
+
super.handleSubmit();
|
|
2054
2079
|
}
|
|
2080
|
+
;
|
|
2055
2081
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: AdminActionFormComponent, deps: [{ token: AdminActionService }, { token: ValidatorService }, { token: i3$3.Router }, { token: i3$3.ActivatedRoute }, { token: AdminActionStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
2056
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: AdminActionFormComponent, isStandalone: false, selector: "lib-admin-action-form", usesInheritance: true, ngImport: i0, template: "<form-container\r\n [headerText]=\"'Actions / Actions Form'\"\r\n [messages]=\"messages\"\r\n (onSave)=\"handleSubmit()\"\r\n [showSave]=\"true\"\r\n>\r\n <div class=\"card p-fluid p-formgrid grid \">\r\n <h4 class=\"font-bold col-12 md:col-12\">Actions Form</h4>\r\n <div class=\"col-12 md:col-6\">\r\n <text-box\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: '
|
|
2082
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: AdminActionFormComponent, isStandalone: false, selector: "lib-admin-action-form", usesInheritance: true, ngImport: i0, template: "<form-container\r\n [record]=\"record\"\r\n [headerText]=\"'Actions / Actions Form'\"\r\n [messages]=\"messages\"\r\n (onSave)=\"handleSubmit()\"\r\n [showSave]=\"true\"\r\n>\r\n <div class=\"card p-fluid p-formgrid grid \">\r\n <h4 class=\"font-bold col-12 md:col-12\">Actions Form</h4>\r\n <div class=\"col-12 md:col-6\">\r\n <text-box\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Action Name',\r\n placeholder: 'Enter Action Name'\r\n }\"\r\n ></text-box>\r\n </div>\r\n \r\n <div class=\"col-12 md:col-6\">\r\n <dropdown\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n name: 'apiConfigID',\r\n readonly: false,\r\n isRequired: true,\r\n displayText: 'End Point',\r\n placeholder: 'Select End Point'\r\n }\"></dropdown>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12\">\r\n <text-area\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: 'prompt',\r\n isRequired: true,\r\n displayText: 'Prompt',\r\n placeholder: 'Enter prompt'\r\n }\"\r\n ></text-area>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n name:'queueID',\r\n isRequired: true,\r\n displayText : 'Queue',\r\n placeholder: 'Select Queue',\r\n readonly: false\r\n }\"></dropdown>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-2 flex align-items-end justify-content-end validate-btn-wrapper\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Validate\"\r\n class=\"p-button-raised\"\r\n ></button>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12\">\r\n <text-area\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: 'formFields',\r\n isRequired: true,\r\n displayText: 'Form Configuration',\r\n placeholder: 'Enter form fields'\r\n }\"\r\n ></text-area>\r\n </div>\r\n </div>\r\n \r\n</form-container>", styles: [".validate-btn-wrapper{margin-bottom:2px}\n"], dependencies: [{ kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["isDisable", "messages", "record", "headerText", "showSave", "disableButton", "disableSubmitButton", "disableSaveButton", "overrideNavigate"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: TextAreaComponent, selector: "text-area", inputs: ["rowspan"] }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
2057
2083
|
}
|
|
2058
2084
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: AdminActionFormComponent, decorators: [{
|
|
2059
2085
|
type: Component,
|
|
2060
|
-
args: [{ selector: 'lib-admin-action-form', standalone: false, template: "<form-container\r\n [headerText]=\"'Actions / Actions Form'\"\r\n [messages]=\"messages\"\r\n (onSave)=\"handleSubmit()\"\r\n [showSave]=\"true\"\r\n>\r\n <div class=\"card p-fluid p-formgrid grid \">\r\n <h4 class=\"font-bold col-12 md:col-12\">Actions Form</h4>\r\n <div class=\"col-12 md:col-6\">\r\n <text-box\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: '
|
|
2086
|
+
args: [{ selector: 'lib-admin-action-form', standalone: false, template: "<form-container\r\n [record]=\"record\"\r\n [headerText]=\"'Actions / Actions Form'\"\r\n [messages]=\"messages\"\r\n (onSave)=\"handleSubmit()\"\r\n [showSave]=\"true\"\r\n>\r\n <div class=\"card p-fluid p-formgrid grid \">\r\n <h4 class=\"font-bold col-12 md:col-12\">Actions Form</h4>\r\n <div class=\"col-12 md:col-6\">\r\n <text-box\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Action Name',\r\n placeholder: 'Enter Action Name'\r\n }\"\r\n ></text-box>\r\n </div>\r\n \r\n <div class=\"col-12 md:col-6\">\r\n <dropdown\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n name: 'apiConfigID',\r\n readonly: false,\r\n isRequired: true,\r\n displayText: 'End Point',\r\n placeholder: 'Select End Point'\r\n }\"></dropdown>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12\">\r\n <text-area\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: 'prompt',\r\n isRequired: true,\r\n displayText: 'Prompt',\r\n placeholder: 'Enter prompt'\r\n }\"\r\n ></text-area>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n name:'queueID',\r\n isRequired: true,\r\n displayText : 'Queue',\r\n placeholder: 'Select Queue',\r\n readonly: false\r\n }\"></dropdown>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-2 flex align-items-end justify-content-end validate-btn-wrapper\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Validate\"\r\n class=\"p-button-raised\"\r\n ></button>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12\">\r\n <text-area\r\n [store]=\"adminActionStore\"\r\n [record]=\"record\"\r\n [attributeModel]=\"{\r\n readonly: false,\r\n name: 'formFields',\r\n isRequired: true,\r\n displayText: 'Form Configuration',\r\n placeholder: 'Enter form fields'\r\n }\"\r\n ></text-area>\r\n </div>\r\n </div>\r\n \r\n</form-container>", styles: [".validate-btn-wrapper{margin-bottom:2px}\n"] }]
|
|
2061
2087
|
}], ctorParameters: () => [{ type: AdminActionService }, { type: ValidatorService }, { type: i3$3.Router }, { type: i3$3.ActivatedRoute }, { type: AdminActionStore }] });
|
|
2062
2088
|
|
|
2063
2089
|
class ActionAdminModule {
|