diff --git a/codbex-payments/codbex-payments.edm b/codbex-payments/codbex-payments.edm index 87c50da..7aacaef 100644 --- a/codbex-payments/codbex-payments.edm +++ b/codbex-payments/codbex-payments.edm @@ -1,6 +1,6 @@ - + @@ -18,7 +18,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -79,9 +79,9 @@ - + - + @@ -96,43 +96,43 @@ - + - + - + - + - + - + - + - + - + @@ -147,7 +147,7 @@ - + @@ -157,11 +157,11 @@ - + - + @@ -178,14 +178,13 @@ - CustomerPayment/services/web/resources/unicons/usd-square.svg10 - SupplierPayment/services/web/resources/unicons/box.svg20 - PaymentRecord/services/web/resources/unicons/align-justify.svg40 - Settings/services/web/resources/unicons/wrench.svg999 - EmployeePayment/services/web/resources/unicons/folder-check.svg30 - PaymentAdjustment/services/web/resources/unicons/paypal.svg110 + CustomerPaymentsales-navigation-group/services/web/resources/unicons/usd-square.svg300 + SupplierPaymentpurchasing-navigation-group/services/web/resources/unicons/box.svg300 + PaymentRecordaccounting-navigation-group/services/web/resources/unicons/align-justify.svg40 + EmployeePaymentsalaries-navigation-group/services/web/resources/unicons/folder-check.svg300 + PaymentAdjustmentsales-navigation-group/services/web/resources/unicons/paypal.svg700 - + \ No newline at end of file diff --git a/codbex-payments/codbex-payments.gen b/codbex-payments/codbex-payments.gen index 69ed9b4..c55a1ba 100644 --- a/codbex-payments/codbex-payments.gen +++ b/codbex-payments/codbex-payments.gen @@ -75,15 +75,13 @@ "CustomerPayment-details", "CustomerPayment-details", "CustomerPayment-details", - "CustomerPayment-details", - "CustomerPayment-details", - "CustomerPayment-details", - "CustomerPayment-details", "CustomerPayment-details" ], "name": "CustomerPayment", "label": "CustomerPayment", - "order": "10", + "header": "", + "order": "300", + "navId": "sales-navigation-group", "icon": "/services/web/resources/unicons/usd-square.svg", "role": "" }, @@ -108,15 +106,13 @@ "SupplierPayment-details", "SupplierPayment-details", "SupplierPayment-details", - "SupplierPayment-details", - "SupplierPayment-details", - "SupplierPayment-details", - "SupplierPayment-details", "SupplierPayment-details" ], "name": "SupplierPayment", "label": "SupplierPayment", - "order": "20", + "header": "", + "order": "300", + "navId": "purchasing-navigation-group", "icon": "/services/web/resources/unicons/box.svg", "role": "" }, @@ -141,15 +137,13 @@ "EmployeePayment-details", "EmployeePayment-details", "EmployeePayment-details", - "EmployeePayment-details", - "EmployeePayment-details", - "EmployeePayment-details", - "EmployeePayment-details", "EmployeePayment-details" ], "name": "EmployeePayment", "label": "EmployeePayment", - "order": "30", + "header": "", + "order": "300", + "navId": "salaries-navigation-group", "icon": "/services/web/resources/unicons/folder-check.svg", "role": "" }, @@ -174,58 +168,42 @@ "PaymentRecord-details", "PaymentRecord-details", "PaymentRecord-details", - "PaymentRecord-details", - "PaymentRecord-details", - "PaymentRecord-details", - "PaymentRecord-details", "PaymentRecord-details" ], "name": "PaymentRecord", "label": "PaymentRecord", + "header": "", "order": "40", + "navId": "accounting-navigation-group", "icon": "/services/web/resources/unicons/align-justify.svg", "role": "" }, - "Currencies": { - "views": [ - "Currency" - ], - "name": "Currencies", - "label": "Currencies", - "order": "990", - "icon": "/services/web/resources/unicons/dollar-alt.svg", - "role": "" - }, - "Companies": { - "views": [ - "Company" - ], - "name": "Companies", - "label": "Companies", - "order": "100", - "icon": "/services/web/resources/unicons/university.svg", - "role": "" - }, "Settings": { "views": [ + "Currency", "PaymentRecordDirection", "PaymentStatus", - "PaymentType" + "PaymentType", + "PaymentMethod" ], "name": "Settings", "label": "Settings", - "order": "999", - "icon": "/services/web/resources/unicons/wrench.svg", + "header": "", + "order": "100", + "navId": "", + "icon": "/services/web/resources/unicons/archive.svg", "role": "" }, - "Methods": { + "Companies": { "views": [ - "PaymentMethod" + "Company" ], - "name": "Methods", - "label": "Methods", + "name": "Companies", + "label": "Companies", + "header": "", "order": "100", - "icon": "/services/web/resources/unicons/archive.svg", + "navId": "", + "icon": "/services/web/resources/unicons/university.svg", "role": "" }, "Customers": { @@ -234,7 +212,9 @@ ], "name": "Customers", "label": "Customers", + "header": "", "order": "100", + "navId": "", "icon": "/services/web/resources/unicons/user-plus.svg", "role": "" }, @@ -259,15 +239,13 @@ "PaymentAdjustment-details", "PaymentAdjustment-details", "PaymentAdjustment-details", - "PaymentAdjustment-details", - "PaymentAdjustment-details", - "PaymentAdjustment-details", - "PaymentAdjustment-details", "PaymentAdjustment-details" ], "name": "PaymentAdjustment", "label": "PaymentAdjustment", - "order": "110", + "header": "", + "order": "700", + "navId": "sales-navigation-group", "icon": "/services/web/resources/unicons/paypal.svg", "role": "" }, @@ -277,7 +255,9 @@ ], "name": "Suppliers", "label": "Suppliers", + "header": "", "order": "200", + "navId": "", "icon": "/services/web/resources/unicons/user-minus.svg", "role": "" } @@ -506,7 +486,7 @@ "widgetType": "DROPDOWN", "relationshipName": "CustomerPayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": true, "dataAutoIncrement": false, @@ -514,7 +494,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -695,7 +675,7 @@ "widgetType": "DROPDOWN", "relationshipName": "CustomerPayment_PaymentMethod", "relationshipEntityName": "PaymentMethod", - "relationshipEntityPerspectiveName": "Methods", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "methods", "dataNotNull": false, "dataAutoIncrement": false, @@ -704,7 +684,7 @@ "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "PaymentMethod", - "widgetDropdownUrl": "/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts", + "widgetDropdownUrl": "/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -726,11 +706,12 @@ "menuKey": "customerpayment", "menuLabel": "CustomerPayment", "name": "CustomerPayment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/usd-square.svg", "perspectiveLabel": "CustomerPayment", "perspectiveName": "CustomerPayment", - "perspectiveOrder": "10", + "perspectiveNavId": "sales-navigation-group", + "perspectiveOrder": "300", "perspectiveRole": "", "roleRead": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly", "roleWrite": "codbex-payments.CustomerPayment.CustomerPaymentFullAccess", @@ -964,7 +945,7 @@ "widgetType": "DROPDOWN", "relationshipName": "CustomerPayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": true, "dataAutoIncrement": false, @@ -972,7 +953,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -1100,7 +1081,7 @@ "widgetType": "DROPDOWN", "relationshipName": "CustomerPayment_PaymentMethod", "relationshipEntityName": "PaymentMethod", - "relationshipEntityPerspectiveName": "Methods", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "methods", "dataNotNull": false, "dataAutoIncrement": false, @@ -1109,7 +1090,7 @@ "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "PaymentMethod", - "widgetDropdownUrl": "/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts", + "widgetDropdownUrl": "/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -1342,7 +1323,7 @@ "widgetType": "DROPDOWN", "relationshipName": "SupplierPayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": true, "dataAutoIncrement": false, @@ -1350,7 +1331,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -1533,11 +1514,12 @@ "menuKey": "supplierpayment", "menuLabel": "SupplierPayment", "name": "SupplierPayment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/box.svg", "perspectiveLabel": "SupplierPayment", "perspectiveName": "SupplierPayment", - "perspectiveOrder": "20", + "perspectiveNavId": "purchasing-navigation-group", + "perspectiveOrder": "300", "perspectiveRole": "", "roleRead": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly", "roleWrite": "codbex-payments.SupplierPayment.SupplierPaymentFullAccess", @@ -1766,7 +1748,7 @@ "widgetType": "DROPDOWN", "relationshipName": "SupplierPayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": true, "dataAutoIncrement": false, @@ -1774,7 +1756,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -2139,7 +2121,7 @@ "widgetType": "DROPDOWN", "relationshipName": "EmployeePayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": true, "dataAutoIncrement": false, @@ -2147,7 +2129,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -2330,11 +2312,12 @@ "menuKey": "employeepayment", "menuLabel": "EmployeePayment", "name": "EmployeePayment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/folder-check.svg", "perspectiveLabel": "EmployeePayment", "perspectiveName": "EmployeePayment", - "perspectiveOrder": "30", + "perspectiveNavId": "salaries-navigation-group", + "perspectiveOrder": "300", "perspectiveRole": "", "roleRead": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly", "roleWrite": "codbex-payments.EmployeePayment.EmployeePaymentFullAccess", @@ -2529,7 +2512,7 @@ "widgetType": "DROPDOWN", "relationshipName": "EmployeePayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": true, "dataAutoIncrement": false, @@ -2537,7 +2520,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -2901,7 +2884,7 @@ "widgetType": "DROPDOWN", "relationshipName": "PaymentRecord_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": false, "dataAutoIncrement": false, @@ -2910,7 +2893,7 @@ "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -3175,10 +3158,11 @@ "menuKey": "paymentrecord", "menuLabel": "PaymentRecord", "name": "PaymentRecord", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/align-justify.svg", "perspectiveLabel": "PaymentRecord", "perspectiveName": "PaymentRecord", + "perspectiveNavId": "accounting-navigation-group", "perspectiveOrder": "40", "perspectiveRole": "", "roleRead": "codbex-payments.PaymentRecord.PaymentRecordReadOnly", @@ -3373,7 +3357,7 @@ "widgetType": "DROPDOWN", "relationshipName": "PaymentRecord_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": false, "dataAutoIncrement": false, @@ -3382,7 +3366,7 @@ "isRequiredProperty": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -3836,10 +3820,11 @@ "menuKey": "currency", "menuLabel": "Currency", "name": "Currency", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/dollar-alt.svg", "perspectiveLabel": "Entities", - "perspectiveName": "Currencies", + "perspectiveName": "Settings", + "perspectiveNavId": "", "perspectiveOrder": "990", "perspectiveRole": "", "projectionReferencedEntity": "Currency", @@ -4177,10 +4162,11 @@ "menuKey": "company", "menuLabel": "Company", "name": "Company", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/university.svg", "perspectiveLabel": "Entities", "perspectiveName": "Companies", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Company", @@ -4258,16 +4244,15 @@ "generateDefaultRoles": "true", "generateReport": "false", "icon": "/services/web/resources/unicons/file.svg", - "layoutType": "MANAGE", "menuIndex": "100", "menuKey": "paymentrecorddirection", "menuLabel": "PaymentRecordDirection", "name": "PaymentRecordDirection", - "navigationPath": "/Home", - "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", + "perspectiveHeader": "", + "perspectiveIcon": "/services/web/resources/unicons/copy.svg", "perspectiveName": "Settings", - "perspectiveOrder": "999", + "perspectiveNavId": "", + "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-payments.Settings.PaymentRecordDirectionReadOnly", "roleWrite": "codbex-payments.Settings.PaymentRecordDirectionFullAccess", @@ -4343,16 +4328,15 @@ "generateDefaultRoles": "true", "generateReport": "false", "icon": "/services/web/resources/unicons/file.svg", - "layoutType": "MANAGE", "menuIndex": "100", "menuKey": "paymentstatus", "menuLabel": "PaymentStatus", "name": "PaymentStatus", - "navigationPath": "/Home", - "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", + "perspectiveHeader": "", + "perspectiveIcon": "/services/web/resources/unicons/copy.svg", "perspectiveName": "Settings", - "perspectiveOrder": "999", + "perspectiveNavId": "", + "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-payments.Settings.PaymentStatusReadOnly", "roleWrite": "codbex-payments.Settings.PaymentStatusFullAccess", @@ -4428,16 +4412,15 @@ "generateDefaultRoles": "true", "generateReport": "false", "icon": "/services/web/resources/unicons/file.svg", - "layoutType": "MANAGE", "menuIndex": "100", "menuKey": "paymenttype", "menuLabel": "PaymentType", "name": "PaymentType", - "navigationPath": "/Home", - "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", + "perspectiveHeader": "", + "perspectiveIcon": "/services/web/resources/unicons/copy.svg", "perspectiveName": "Settings", - "perspectiveOrder": "999", + "perspectiveNavId": "", + "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-payments.Settings.PaymentTypeReadOnly", "roleWrite": "codbex-payments.Settings.PaymentTypeFullAccess", @@ -4516,10 +4499,11 @@ "menuKey": "paymentmethod", "menuLabel": "PaymentMethod", "name": "PaymentMethod", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/archive.svg", "perspectiveLabel": "methods", - "perspectiveName": "Methods", + "perspectiveName": "Settings", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "PaymentMethod", @@ -4837,10 +4821,11 @@ "menuKey": "customer", "menuLabel": "Customer", "name": "Customer", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user-plus.svg", "perspectiveLabel": "Customers", "perspectiveName": "Customers", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Customer", @@ -4971,7 +4956,7 @@ "widgetType": "DROPDOWN", "relationshipName": "PaymentAdjustment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": false, "dataAutoIncrement": false, @@ -4979,7 +4964,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -5082,11 +5067,12 @@ "menuKey": "paymentadjustment", "menuLabel": "PaymentAdjustment", "name": "PaymentAdjustment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/paypal.svg", "perspectiveLabel": "PaymentAdjustment", "perspectiveName": "PaymentAdjustment", - "perspectiveOrder": "110", + "perspectiveNavId": "sales-navigation-group", + "perspectiveOrder": "700", "perspectiveRole": "", "roleRead": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly", "roleWrite": "codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess", @@ -5202,7 +5188,7 @@ "widgetType": "DROPDOWN", "relationshipName": "PaymentAdjustment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities", "dataNotNull": false, "dataAutoIncrement": false, @@ -5210,7 +5196,7 @@ "dataUnique": false, "isCalculatedProperty": false, "widgetLabel": "Currency", - "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts", + "widgetDropdownUrl": "/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -5605,10 +5591,11 @@ "menuKey": "supplier", "menuLabel": "Supplier", "name": "Supplier", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user-minus.svg", "perspectiveLabel": "Suppliers", "perspectiveName": "Suppliers", + "perspectiveNavId": "", "perspectiveOrder": "200", "perspectiveRole": "", "projectionReferencedEntity": "Supplier", diff --git a/codbex-payments/codbex-payments.model b/codbex-payments/codbex-payments.model index 0e02ea0..5b392ff 100644 --- a/codbex-payments/codbex-payments.model +++ b/codbex-payments/codbex-payments.model @@ -134,7 +134,7 @@ "widgetType": "DROPDOWN", "relationshipName": "CustomerPayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities" }, { @@ -241,7 +241,7 @@ "widgetType": "DROPDOWN", "relationshipName": "CustomerPayment_PaymentMethod", "relationshipEntityName": "PaymentMethod", - "relationshipEntityPerspectiveName": "Methods", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "methods" } ], @@ -261,11 +261,12 @@ "menuKey": "customerpayment", "menuLabel": "CustomerPayment", "name": "CustomerPayment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/usd-square.svg", "perspectiveLabel": "CustomerPayment", "perspectiveName": "CustomerPayment", - "perspectiveOrder": "10", + "perspectiveNavId": "sales-navigation-group", + "perspectiveOrder": "300", "perspectiveRole": "", "roleRead": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly", "roleWrite": "codbex-payments.CustomerPayment.CustomerPaymentFullAccess", @@ -405,7 +406,7 @@ "widgetType": "DROPDOWN", "relationshipName": "SupplierPayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities" }, { @@ -514,11 +515,12 @@ "menuKey": "supplierpayment", "menuLabel": "SupplierPayment", "name": "SupplierPayment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/box.svg", "perspectiveLabel": "SupplierPayment", "perspectiveName": "SupplierPayment", - "perspectiveOrder": "20", + "perspectiveNavId": "purchasing-navigation-group", + "perspectiveOrder": "300", "perspectiveRole": "", "roleRead": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly", "roleWrite": "codbex-payments.SupplierPayment.SupplierPaymentFullAccess", @@ -640,7 +642,7 @@ "widgetType": "DROPDOWN", "relationshipName": "EmployeePayment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities" }, { @@ -749,11 +751,12 @@ "menuKey": "employeepayment", "menuLabel": "EmployeePayment", "name": "EmployeePayment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/folder-check.svg", "perspectiveLabel": "EmployeePayment", "perspectiveName": "EmployeePayment", - "perspectiveOrder": "30", + "perspectiveNavId": "salaries-navigation-group", + "perspectiveOrder": "300", "perspectiveRole": "", "roleRead": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly", "roleWrite": "codbex-payments.EmployeePayment.EmployeePaymentFullAccess", @@ -873,7 +876,7 @@ "widgetType": "DROPDOWN", "relationshipName": "PaymentRecord_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities" }, { @@ -1031,10 +1034,11 @@ "menuKey": "paymentrecord", "menuLabel": "PaymentRecord", "name": "PaymentRecord", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/align-justify.svg", "perspectiveLabel": "PaymentRecord", "perspectiveName": "PaymentRecord", + "perspectiveNavId": "accounting-navigation-group", "perspectiveOrder": "40", "perspectiveRole": "", "roleRead": "codbex-payments.PaymentRecord.PaymentRecordReadOnly", @@ -1162,10 +1166,11 @@ "menuKey": "currency", "menuLabel": "Currency", "name": "Currency", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/dollar-alt.svg", "perspectiveLabel": "Entities", - "perspectiveName": "Currencies", + "perspectiveName": "Settings", + "perspectiveNavId": "", "perspectiveOrder": "990", "perspectiveRole": "", "projectionReferencedEntity": "Currency", @@ -1368,10 +1373,11 @@ "menuKey": "company", "menuLabel": "Company", "name": "Company", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/university.svg", "perspectiveLabel": "Entities", "perspectiveName": "Companies", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Company", @@ -1425,11 +1431,12 @@ "menuKey": "paymentrecorddirection", "menuLabel": "PaymentRecordDirection", "name": "PaymentRecordDirection", - "navigationPath": "/Home", - "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", + "perspectiveHeader": "", + "perspectiveIcon": "/services/web/resources/unicons/copy.svg", + "perspectiveLabel": "Entities", "perspectiveName": "Settings", - "perspectiveOrder": "999", + "perspectiveNavId": "", + "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-payments.Settings.PaymentRecordDirectionReadOnly", "roleWrite": "codbex-payments.Settings.PaymentRecordDirectionFullAccess", @@ -1482,11 +1489,12 @@ "menuKey": "paymentstatus", "menuLabel": "PaymentStatus", "name": "PaymentStatus", - "navigationPath": "/Home", - "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", + "perspectiveHeader": "", + "perspectiveIcon": "/services/web/resources/unicons/copy.svg", + "perspectiveLabel": "Entities", "perspectiveName": "Settings", - "perspectiveOrder": "999", + "perspectiveNavId": "", + "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-payments.Settings.PaymentStatusReadOnly", "roleWrite": "codbex-payments.Settings.PaymentStatusFullAccess", @@ -1539,11 +1547,12 @@ "menuKey": "paymenttype", "menuLabel": "PaymentType", "name": "PaymentType", - "navigationPath": "/Home", - "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", + "perspectiveHeader": "", + "perspectiveIcon": "/services/web/resources/unicons/copy.svg", + "perspectiveLabel": "Entities", "perspectiveName": "Settings", - "perspectiveOrder": "999", + "perspectiveNavId": "", + "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-payments.Settings.PaymentTypeReadOnly", "roleWrite": "codbex-payments.Settings.PaymentTypeFullAccess", @@ -1594,10 +1603,11 @@ "menuKey": "paymentmethod", "menuLabel": "PaymentMethod", "name": "PaymentMethod", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/archive.svg", "perspectiveLabel": "methods", - "perspectiveName": "Methods", + "perspectiveName": "Settings", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "PaymentMethod", @@ -1779,10 +1789,11 @@ "menuKey": "customer", "menuLabel": "Customer", "name": "Customer", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user-plus.svg", "perspectiveLabel": "Customers", "perspectiveName": "Customers", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Customer", @@ -1865,7 +1876,7 @@ "widgetType": "DROPDOWN", "relationshipName": "PaymentAdjustment_Currency", "relationshipEntityName": "Currency", - "relationshipEntityPerspectiveName": "Currencies", + "relationshipEntityPerspectiveName": "Settings", "relationshipEntityPerspectiveLabel": "Entities" }, { @@ -1931,11 +1942,12 @@ "menuKey": "paymentadjustment", "menuLabel": "PaymentAdjustment", "name": "PaymentAdjustment", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/paypal.svg", "perspectiveLabel": "PaymentAdjustment", "perspectiveName": "PaymentAdjustment", - "perspectiveOrder": "110", + "perspectiveNavId": "sales-navigation-group", + "perspectiveOrder": "700", "perspectiveRole": "", "roleRead": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly", "roleWrite": "codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess", @@ -2116,10 +2128,11 @@ "menuKey": "supplier", "menuLabel": "Supplier", "name": "Supplier", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user-minus.svg", "perspectiveLabel": "Suppliers", "perspectiveName": "Suppliers", + "perspectiveNavId": "", "perspectiveOrder": "200", "perspectiveRole": "", "projectionReferencedEntity": "Supplier", @@ -2133,44 +2146,37 @@ { "name": "CustomerPayment", "label": "CustomerPayment", + "navId": "sales-navigation-group", "icon": "/services/web/resources/unicons/usd-square.svg", - "order": "10", - "role": {} + "order": "300" }, { "name": "SupplierPayment", "label": "SupplierPayment", + "navId": "purchasing-navigation-group", "icon": "/services/web/resources/unicons/box.svg", - "order": "20", - "role": {} + "order": "300" }, { "name": "PaymentRecord", "label": "PaymentRecord", + "navId": "accounting-navigation-group", "icon": "/services/web/resources/unicons/align-justify.svg", - "order": "40", - "role": {} - }, - { - "name": "Settings", - "label": "Settings", - "icon": "/services/web/resources/unicons/wrench.svg", - "order": "999", - "role": {} + "order": "40" }, { "name": "EmployeePayment", "label": "EmployeePayment", + "navId": "salaries-navigation-group", "icon": "/services/web/resources/unicons/folder-check.svg", - "order": "30", - "role": {} + "order": "300" }, { "name": "PaymentAdjustment", "label": "PaymentAdjustment", + "navId": "sales-navigation-group", "icon": "/services/web/resources/unicons/paypal.svg", - "order": "110", - "role": {} + "order": "700" } ], "navigations": [] diff --git a/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts b/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts index 32abd1f..f5194f7 100644 --- a/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts +++ b/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts @@ -48,7 +48,7 @@ class CustomerPaymentService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -58,7 +58,7 @@ class CustomerPaymentService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts b/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts index 67c7522..8524faa 100644 --- a/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts +++ b/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts @@ -48,7 +48,7 @@ class EmployeePaymentService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -58,7 +58,7 @@ class EmployeePaymentService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts b/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts index 5353541..a9ea913 100644 --- a/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts +++ b/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts @@ -46,7 +46,7 @@ class PaymentAdjustmentService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -56,7 +56,7 @@ class PaymentAdjustmentService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts b/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts index 674be07..bb5ac4e 100644 --- a/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts +++ b/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts @@ -46,7 +46,7 @@ class PaymentRecordService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -56,7 +56,7 @@ class PaymentRecordService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts b/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts index 0ea21f7..6c3ee0c 100644 --- a/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts +++ b/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts @@ -46,7 +46,7 @@ class PaymentRecordDirectionService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -56,7 +56,7 @@ class PaymentRecordDirectionService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts b/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts index cfdd94c..13b4f48 100644 --- a/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts +++ b/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts @@ -46,7 +46,7 @@ class PaymentStatusService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -56,7 +56,7 @@ class PaymentStatusService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts b/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts index 777f06b..dd2bcda 100644 --- a/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts +++ b/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts @@ -46,7 +46,7 @@ class PaymentTypeService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -56,7 +56,7 @@ class PaymentTypeService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts b/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts index adeaaf2..e8b355f 100644 --- a/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts +++ b/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts @@ -48,7 +48,7 @@ class SupplierPaymentService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -58,7 +58,7 @@ class SupplierPaymentService { public countWithFilter(filter: any) { try { this.checkPermissions("read"); - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/api/Suppliers/SupplierService.ts b/codbex-payments/gen/codbex-payments/api/Suppliers/SupplierService.ts index 6ffe061..baca253 100644 --- a/codbex-payments/gen/codbex-payments/api/Suppliers/SupplierService.ts +++ b/codbex-payments/gen/codbex-payments/api/Suppliers/SupplierService.ts @@ -41,7 +41,7 @@ class SupplierService { @Get("/count") public count() { try { - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -50,7 +50,7 @@ class SupplierService { @Post("/count") public countWithFilter(filter: any) { try { - return this.repository.count(filter); + return { count: this.repository.count(filter) }; } catch (error: any) { this.handleError(error); } diff --git a/codbex-payments/gen/codbex-payments/index.html b/codbex-payments/gen/codbex-payments/index.html deleted file mode 100644 index 96c995a..0000000 --- a/codbex-payments/gen/codbex-payments/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/controller.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/controller.js index be349f2..a5cc54f 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/controller.js @@ -1,31 +1,27 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.CustomerPayment.CustomerPayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, $http, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "CustomerPayment" && e.view === "CustomerPayment" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'CustomerPayment' && e.view === 'CustomerPayment' && (e.type === 'page' || e.type === undefined)); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +38,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entitySearch', handler: () => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } @@ -75,13 +68,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("CustomerPayment", `Unable to count CustomerPayment: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } $scope.dataPages = Math.ceil($scope.dataCount / $scope.dataLimit); filter.$offset = ($scope.dataPage - 1) * $scope.dataLimit; @@ -91,16 +80,11 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter.$limit = $scope.dataPage * $scope.dataLimit; } - entityApi.search(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("CustomerPayment", `Unable to list/filter CustomerPayment: '${response.message}'`); - return; - } + EntityService.search(filter).then((response) => { if ($scope.data == null || $scope.dataReset) { $scope.data = []; $scope.dataReset = false; } - response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -112,84 +96,106 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.data = $scope.data.concat(response.data); $scope.dataPage++; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'CustomerPayment', + message: `Unable to list/filter CustomerPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'CustomerPayment', + message: `Unable to count CustomerPayment: '${message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; - messageHub.postMessage("entitySelected", { + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsCustomer: $scope.optionsCustomer, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, optionsPaymentMethod: $scope.optionsPaymentMethod, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.createEntity', data: { entity: {}, optionsCustomer: $scope.optionsCustomer, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, optionsPaymentMethod: $scope.optionsPaymentMethod, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.updateEntity', data: { entity: $scope.selectedEntity, optionsCustomer: $scope.optionsCustomer, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, optionsPaymentMethod: $scope.optionsPaymentMethod, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete CustomerPayment?', - `Are you sure you want to delete CustomerPayment? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: 'Delete CustomerPayment?', + message: `Are you sure you want to delete CustomerPayment? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("CustomerPayment", `Unable to delete CustomerPayment: '${response.message}'`); - return; - } + closeButton: false + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then(() => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.CustomerPayment.CustomerPayment.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'CustomerPayment', + message: `Unable to delete CustomerPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("CustomerPayment-filter", { - entity: $scope.filterEntity, - optionsCustomer: $scope.optionsCustomer, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, - optionsPaymentMethod: $scope.optionsPaymentMethod, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'CustomerPayment-filter', + params: { + entity: $scope.filterEntity, + optionsCustomer: $scope.optionsCustomer, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + optionsPaymentMethod: $scope.optionsPaymentMethod, + }, }); }; @@ -200,43 +206,67 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentMethod = []; - $http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts").then(function (response) { - $scope.optionsCustomer = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts').then((response) => { + $scope.optionsCustomer = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Customer', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts").then(function (response) { - $scope.optionsPaymentMethod = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts').then((response) => { + $scope.optionsPaymentMethod = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentMethod', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.optionsCustomerValue = function (optionKey) { + $scope.optionsCustomerValue = (optionKey) => { for (let i = 0; i < $scope.optionsCustomer.length; i++) { if ($scope.optionsCustomer[i].value === optionKey) { return $scope.optionsCustomer[i].text; @@ -244,7 +274,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -252,7 +282,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -260,7 +290,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentMethodValue = function (optionKey) { + $scope.optionsPaymentMethodValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentMethod.length; i++) { if ($scope.optionsPaymentMethod[i].value === optionKey) { return $scope.optionsPaymentMethod[i].text; @@ -269,5 +299,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/controller.js index 387f3d6..6f56087 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/controller.js @@ -1,130 +1,125 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.CustomerPayment.CustomerPayment'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - if (params?.entity?.DateFrom) { - params.entity.DateFrom = new Date(params.entity.DateFrom); - } - if (params?.entity?.DateTo) { - params.entity.DateTo = new Date(params.entity.DateTo); - } - if (params?.entity?.ValorFrom) { - params.entity.ValorFrom = new Date(params.entity.ValorFrom); - } - if (params?.entity?.ValorTo) { - params.entity.ValorTo = new Date(params.entity.ValorTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsCustomer = params.optionsCustomer; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; - $scope.optionsPaymentMethod = params.optionsPaymentMethod; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.DateFrom) { + params.entity.DateFrom = new Date(params.entity.DateFrom); + } + if (params?.entity?.DateTo) { + params.entity.DateTo = new Date(params.entity.DateTo); + } + if (params?.entity?.ValorFrom) { + params.entity.ValorFrom = new Date(params.entity.ValorFrom); } + if (params?.entity?.ValorTo) { + params.entity.ValorTo = new Date(params.entity.ValorTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsCustomer = params.optionsCustomer; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + $scope.optionsPaymentMethod = params.optionsPaymentMethod; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.Customer !== undefined) { - filter.$filter.equals.Customer = entity.Customer; - } - if (entity.DateFrom) { - filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; - } - if (entity.DateTo) { - filter.$filter.lessThanOrEqual.Date = entity.DateTo; - } - if (entity.ValorFrom) { - filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; - } - if (entity.ValorTo) { - filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; - } - if (entity.CompanyIBAN) { - filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; - } - if (entity.CounterpartyIBAN) { - filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; - } - if (entity.CounterpartyName) { - filter.$filter.contains.CounterpartyName = entity.CounterpartyName; - } - if (entity.Amount !== undefined) { - filter.$filter.equals.Amount = entity.Amount; - } - if (entity.Currency !== undefined) { - filter.$filter.equals.Currency = entity.Currency; - } - if (entity.Reason) { - filter.$filter.contains.Reason = entity.Reason; - } - if (entity.Description) { - filter.$filter.contains.Description = entity.Description; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - if (entity.UUID) { - filter.$filter.contains.UUID = entity.UUID; - } - if (entity.Reference) { - filter.$filter.contains.Reference = entity.Reference; - } - if (entity.PaymentMethod !== undefined) { - filter.$filter.equals.PaymentMethod = entity.PaymentMethod; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - messageHub.postMessage("clearDetails"); - $scope.cancel(); - }; - - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { + }, + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.Customer !== undefined) { + filter.$filter.equals.Customer = entity.Customer; + } + if (entity.DateFrom) { + filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; + } + if (entity.DateTo) { + filter.$filter.lessThanOrEqual.Date = entity.DateTo; + } + if (entity.ValorFrom) { + filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; + } + if (entity.ValorTo) { + filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; + } + if (entity.CompanyIBAN) { + filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; + } + if (entity.CounterpartyIBAN) { + filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; + } + if (entity.CounterpartyName) { + filter.$filter.contains.CounterpartyName = entity.CounterpartyName; + } + if (entity.Amount !== undefined) { + filter.$filter.equals.Amount = entity.Amount; + } + if (entity.Currency !== undefined) { + filter.$filter.equals.Currency = entity.Currency; + } + if (entity.Reason) { + filter.$filter.contains.Reason = entity.Reason; + } + if (entity.Description) { + filter.$filter.contains.Description = entity.Description; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + if (entity.UUID) { + filter.$filter.contains.UUID = entity.UUID; + } + if (entity.Reference) { + filter.$filter.contains.Reference = entity.Reference; + } + if (entity.PaymentMethod !== undefined) { + filter.$filter.equals.PaymentMethod = entity.PaymentMethod; + } + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-payments.CustomerPayment.CustomerPayment.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("CustomerPayment-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'CustomerPayment-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/index.html index 9bde56e..f85dc84 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/index.html @@ -2,331 +2,305 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Customer + Customer
- - + placeholder="Search Customer ..." + btn-aria-label="show/hide Customer options" list-aria-label="Customer options"> +
-
- + +
- From Date + From Date
- - + - - Incorrect Input - + +
- To Date + To Date
- - + - - Incorrect Input - + +
-
- + +
- From Valor + From Valor
- - + - - Incorrect Input - + +
- To Valor + To Valor
- - + - - Incorrect Input - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - Incorrect Input - + +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - Incorrect Input - + +
-
- + +
- Description + Description
- - + - - Incorrect Input - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Name + Name
- - + - - Incorrect Input - + +
-
- + +
- UUID + UUID
- - + - - Incorrect Input - + +
-
- + +
- Reference + Reference
- - + - - Incorrect Input - + +
-
- + +
- PaymentMethod + PaymentMethod
- - + placeholder="Search PaymentMethod ..." + btn-aria-label="show/hide PaymentMethod options" list-aria-label="PaymentMethod options"> +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.extension index 118568f..a54239a 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.js index 04cfa11..7bc45d9 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "CustomerPayment-filter", - label: "CustomerPayment Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/index.html", - perspectiveName: "CustomerPayment" + id: 'CustomerPayment-filter', + label: 'CustomerPayment Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/index.html', + perspectiveName: 'CustomerPayment' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/controller.js index 66faec3..e1ce1fc 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.CustomerPayment.CustomerPayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "CustomerPayment Details", - create: "Create CustomerPayment", - update: "Update CustomerPayment" + select: 'CustomerPayment Details', + create: 'Create CustomerPayment', + update: 'Update CustomerPayment' }; $scope.action = 'select'; @@ -36,92 +33,136 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentMethod = params.optionsPaymentMethod; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create CustomerPayment: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'CustomerPayment', + message: 'CustomerPayment successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("CustomerPayment", "CustomerPayment successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create CustomerPayment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update CustomerPayment: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("CustomerPayment", "CustomerPayment successfully updated"); + Dialogs.showAlert({ + title: 'CustomerPayment', + message: 'CustomerPayment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update CustomerPayment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.serviceCustomer = "/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts"; + $scope.serviceCustomer = '/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts'; $scope.optionsCustomer = []; - $http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts").then(function (response) { - $scope.optionsCustomer = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts').then((response) => { + $scope.optionsCustomer = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Customer', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.servicePaymentMethod = "/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts"; + $scope.servicePaymentMethod = '/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts'; $scope.optionsPaymentMethod = []; - $http.get("/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts").then(function (response) { - $scope.optionsPaymentMethod = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts').then((response) => { + $scope.optionsPaymentMethod = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentMethod', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("CustomerPayment-details"); + Dialogs.closeWindow({ id: 'CustomerPayment-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/index.html index 7dad454..80b7b31 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/index.html @@ -2,353 +2,315 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Customer + Customer
- - - + placeholder="Search Customer ..." + btn-aria-label="show/hide Customer options" list-aria-label="Customer options"> +
-
- + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- PaymentMethod + PaymentMethod
- - - + placeholder="Search PaymentMethod ..." + btn-aria-label="show/hide PaymentMethod options" list-aria-label="PaymentMethod options"> +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.extension index 09a790e..6997625 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.extension @@ -1,6 +1,6 @@ { - "module": "{{projectName}}/gen/{{genFolderName}}/ui/{{perspectiveName}}/{{name}}/dialog-window/view.js", - "extensionPoint": "dialog-window", - "description": "{{projectName}} - Application Dialog Window", + "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.js index 3270554..7050e03 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/view.js @@ -6,15 +6,12 @@ const viewData = { id: "CustomerPayment-details", label: "CustomerPayment", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/index.html", + path: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-window/index.html", perspectiveName: "CustomerPayment", roles: [ "codbex-payments.CustomerPayment.CustomerPaymentReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/index.html b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/index.html index ed2dc3f..7b3e503 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/index.html @@ -2,54 +2,45 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + Items + + + + + + + + + + + + + + + + + + + + - - + {{next.Date | date: "dd/MMM/yyyy"}} | {{next.Valor | date: "dd/MMM/yyyy"}} | {{next.CompanyIBAN}} | @@ -62,15 +53,16 @@ {{optionsCompanyValue(next.Company)}} | {{next.Name}} | {{optionsPaymentMethodValue(next.PaymentMethod)}} - - - - - - + + + + + + Load More ... - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/controller.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/controller.js index da6e2c7..810d972 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/controller.js @@ -1,44 +1,41 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.CustomerPayment.CustomerPayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "CustomerPayment Details", - create: "Create CustomerPayment", - update: "Update CustomerPayment" + select: 'CustomerPayment Details', + create: 'Create CustomerPayment', + update: 'Update CustomerPayment' }; $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "CustomerPayment" && e.view === "CustomerPayment" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'CustomerPayment' && e.view === 'CustomerPayment' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsCustomer = []; $scope.optionsCurrency = []; @@ -46,113 +43,150 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentMethod = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCustomer = msg.data.optionsCustomer; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsPaymentMethod = msg.data.optionsPaymentMethod; + $scope.entity = data.entity; + $scope.optionsCustomer = data.optionsCustomer; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsPaymentMethod = data.optionsPaymentMethod; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsCustomer = msg.data.optionsCustomer; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsPaymentMethod = msg.data.optionsPaymentMethod; + $scope.optionsCustomer = data.optionsCustomer; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsPaymentMethod = data.optionsPaymentMethod; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCustomer = msg.data.optionsCustomer; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsPaymentMethod = msg.data.optionsPaymentMethod; + $scope.entity = data.entity; + $scope.optionsCustomer = data.optionsCustomer; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsPaymentMethod = data.optionsPaymentMethod; $scope.action = 'update'; }); - }); + }}); - $scope.serviceCustomer = "/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts"; - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; - $scope.servicePaymentMethod = "/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts"; + $scope.serviceCustomer = '/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts'; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; + $scope.servicePaymentMethod = '/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("CustomerPayment", `Unable to create CustomerPayment: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("CustomerPayment", "CustomerPayment successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.clearDetails' , data: response.data }); + Dialogs.showAlert({ + title: 'CustomerPayment', + message: 'CustomerPayment successfully created', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'CustomerPayment', + message: `Unable to create CustomerPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { - entityApi.update($scope.entity.Id, $scope.entity).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("CustomerPayment", `Unable to update CustomerPayment: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("CustomerPayment", "CustomerPayment successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.CustomerPayment.CustomerPayment.clearDetails', data: response.data }); + Dialogs.showAlert({ + title: 'CustomerPayment', + message: 'CustomerPayment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'CustomerPayment', + message: `Unable to create CustomerPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-payments.CustomerPayment.CustomerPayment.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.createCustomer = function () { - messageHub.showDialogWindow("Customer-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCustomer = () => { + Dialogs.showWindow({ + id: 'Customer-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createCurrency = function () { - messageHub.showDialogWindow("Currency-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCurrency = () => { + Dialogs.showWindow({ + id: 'Currency-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createCompany = function () { - messageHub.showDialogWindow("Company-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCompany = () => { + Dialogs.showWindow({ + id: 'Company-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createPaymentMethod = function () { - messageHub.showDialogWindow("PaymentMethod-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createPaymentMethod = () => { + Dialogs.showWindow({ + id: 'PaymentMethod-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -161,52 +195,74 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $scope.refreshCustomer = function () { + $scope.refreshCustomer = () => { $scope.optionsCustomer = []; - $http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts").then(function (response) { - $scope.optionsCustomer = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts').then((response) => { + $scope.optionsCustomer = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Customer', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCurrency = function () { + $scope.refreshCurrency = () => { $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCompany = function () { + $scope.refreshCompany = () => { $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshPaymentMethod = function () { + $scope.refreshPaymentMethod = () => { $scope.optionsPaymentMethod = []; - $http.get("/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts").then(function (response) { - $scope.optionsPaymentMethod = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-methods/gen/codbex-methods/api/Settings/PaymentMethodService.ts').then((response) => { + $scope.optionsPaymentMethod = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentMethod', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/index.html b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/index.html index 4b2cacf..cfab968 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/index.html +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/index.html @@ -2,383 +2,336 @@ - - + - - - - - + + + + + + - - - - - + + + + +
- Customer + Customer
- - + placeholder="Search Customer ..." + btn-aria-label="show/hide Customer options" list-aria-label="Customer options"> +
-
- - - +
+ +
- - + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- - - +
+ +
- - + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- - - +
+ +
- - + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- PaymentMethod + PaymentMethod
- - + placeholder="Search PaymentMethod ..." + btn-aria-label="show/hide PaymentMethod options" list-aria-label="PaymentMethod options"> +
-
- - - +
+ +
- - - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.extension index 1a2d1a5..be152b9 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View - Main Details", "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.js index 7902373..56d4ea9 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "CustomerPayment-details", - label: "CustomerPayment", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/index.html", - perspectiveName: "CustomerPayment" + id: 'CustomerPayment-details', + label: 'CustomerPayment', + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/main-details/index.html', + perspectiveName: 'CustomerPayment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile-portal.extension deleted file mode 100644 index 104ecc7..0000000 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.extension deleted file mode 100644 index ca5a1a3..0000000 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.js deleted file mode 100644 index 8c90151..0000000 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "CustomerPayment", - caption: "Manage entity CustomerPayment", - tooltip: "CustomerPayment", - type: "PRIMARY", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html", - order: "100", - groupOrder: "10" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.extension index 6071b66..dff977f 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View", "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.js index c1ffa66..10a1317 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "CustomerPayment", - label: "CustomerPayment", - factory: "frame", - region: "left", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/index.html", - perspectiveName: "CustomerPayment" + id: 'CustomerPayment', + label: 'CustomerPayment', + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/index.html', + perspectiveName: 'CustomerPayment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html index 0da12c7..cff8962 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html @@ -10,70 +10,43 @@ - - - + + - - - + + - - - - - - + + + {{state.busyText}} - - - Encounterd an error while loading - - - + + + Encounterd an error while loading + + diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective-portal.extension deleted file mode 100644 index 06420ef..0000000 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - CustomerPayment" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.extension b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.extension index 6572427..89d1787 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.extension +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.extension @@ -1,5 +1,5 @@ { "module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.js", - "extensionPoint": "codbex-payments", + "extensionPoint": "application-perspectives", "description": "codbex-payments - Perspective - CustomerPayment" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.js b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.js index 8738afb..f6f9ee2 100644 --- a/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.js +++ b/codbex-payments/gen/codbex-payments/ui/CustomerPayment/perspective.js @@ -5,14 +5,12 @@ */ const perspectiveData = { id: 'CustomerPayment', - name: 'CustomerPayment', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html', - order: '10', + label: 'CustomerPayment', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html', + groupId: 'sales-navigation-group', + order: 300, icon: '/services/web/resources/unicons/usd-square.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/controller.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/controller.js index 4acb1f2..dc7588c 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/controller.js @@ -1,31 +1,27 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.EmployeePayment.EmployeePayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, $http, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "EmployeePayment" && e.view === "EmployeePayment" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'EmployeePayment' && e.view === 'EmployeePayment' && (e.type === 'page' || e.type === undefined)); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +38,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entitySearch', handler: () => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } @@ -75,13 +68,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("EmployeePayment", `Unable to count EmployeePayment: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } $scope.dataPages = Math.ceil($scope.dataCount / $scope.dataLimit); filter.$offset = ($scope.dataPage - 1) * $scope.dataLimit; @@ -91,16 +80,11 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter.$limit = $scope.dataPage * $scope.dataLimit; } - entityApi.search(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("EmployeePayment", `Unable to list/filter EmployeePayment: '${response.message}'`); - return; - } + EntityService.search(filter).then((response) => { if ($scope.data == null || $scope.dataReset) { $scope.data = []; $scope.dataReset = false; } - response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -112,76 +96,98 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.data = $scope.data.concat(response.data); $scope.dataPage++; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'EmployeePayment', + message: `Unable to list/filter EmployeePayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'EmployeePayment', + message: `Unable to count EmployeePayment: '${message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; - messageHub.postMessage("entitySelected", { + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.createEntity', data: { entity: {}, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.updateEntity', data: { entity: $scope.selectedEntity, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete EmployeePayment?', - `Are you sure you want to delete EmployeePayment? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: 'Delete EmployeePayment?', + message: `Are you sure you want to delete EmployeePayment? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("EmployeePayment", `Unable to delete EmployeePayment: '${response.message}'`); - return; - } + closeButton: false + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then(() => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.EmployeePayment.EmployeePayment.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'EmployeePayment', + message: `Unable to delete EmployeePayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("EmployeePayment-filter", { - entity: $scope.filterEntity, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'EmployeePayment-filter', + params: { + entity: $scope.filterEntity, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + }, }); }; @@ -190,25 +196,37 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsCompany = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -216,7 +234,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -225,5 +243,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/controller.js index 37e8d73..f3c3bde 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/controller.js @@ -1,122 +1,117 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.EmployeePayment.EmployeePayment'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - if (params?.entity?.DateFrom) { - params.entity.DateFrom = new Date(params.entity.DateFrom); - } - if (params?.entity?.DateTo) { - params.entity.DateTo = new Date(params.entity.DateTo); - } - if (params?.entity?.ValorFrom) { - params.entity.ValorFrom = new Date(params.entity.ValorFrom); - } - if (params?.entity?.ValorTo) { - params.entity.ValorTo = new Date(params.entity.ValorTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.DateFrom) { + params.entity.DateFrom = new Date(params.entity.DateFrom); + } + if (params?.entity?.DateTo) { + params.entity.DateTo = new Date(params.entity.DateTo); } + if (params?.entity?.ValorFrom) { + params.entity.ValorFrom = new Date(params.entity.ValorFrom); + } + if (params?.entity?.ValorTo) { + params.entity.ValorTo = new Date(params.entity.ValorTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.DateFrom) { - filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; - } - if (entity.DateTo) { - filter.$filter.lessThanOrEqual.Date = entity.DateTo; - } - if (entity.ValorFrom) { - filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; - } - if (entity.ValorTo) { - filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; - } - if (entity.CompanyIBAN) { - filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; - } - if (entity.CounterpartyIBAN) { - filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; - } - if (entity.CounterpartyName) { - filter.$filter.contains.CounterpartyName = entity.CounterpartyName; - } - if (entity.Amount !== undefined) { - filter.$filter.equals.Amount = entity.Amount; - } - if (entity.Currency !== undefined) { - filter.$filter.equals.Currency = entity.Currency; - } - if (entity.Reason) { - filter.$filter.contains.Reason = entity.Reason; - } - if (entity.Description) { - filter.$filter.contains.Description = entity.Description; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - if (entity.UUID) { - filter.$filter.contains.UUID = entity.UUID; - } - if (entity.Reference) { - filter.$filter.contains.Reference = entity.Reference; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - messageHub.postMessage("clearDetails"); - $scope.cancel(); - }; - - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { + }, + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.DateFrom) { + filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; + } + if (entity.DateTo) { + filter.$filter.lessThanOrEqual.Date = entity.DateTo; + } + if (entity.ValorFrom) { + filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; + } + if (entity.ValorTo) { + filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; + } + if (entity.CompanyIBAN) { + filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; + } + if (entity.CounterpartyIBAN) { + filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; + } + if (entity.CounterpartyName) { + filter.$filter.contains.CounterpartyName = entity.CounterpartyName; + } + if (entity.Amount !== undefined) { + filter.$filter.equals.Amount = entity.Amount; + } + if (entity.Currency !== undefined) { + filter.$filter.equals.Currency = entity.Currency; + } + if (entity.Reason) { + filter.$filter.contains.Reason = entity.Reason; + } + if (entity.Description) { + filter.$filter.contains.Description = entity.Description; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + if (entity.UUID) { + filter.$filter.contains.UUID = entity.UUID; + } + if (entity.Reference) { + filter.$filter.contains.Reference = entity.Reference; + } + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-payments.EmployeePayment.EmployeePayment.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("EmployeePayment-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'EmployeePayment-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/index.html index 5949c2e..fd68144 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/index.html @@ -2,303 +2,275 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- From Date + From Date
- - + - - Incorrect Input - + +
- To Date + To Date
- - + - - Incorrect Input - + +
-
- + +
- From Valor + From Valor
- - + - - Incorrect Input - + +
- To Valor + To Valor
- - + - - Incorrect Input - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - Incorrect Input - + +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - Incorrect Input - + +
-
- + +
- Description + Description
- - + - - Incorrect Input - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Name + Name
- - + - - Incorrect Input - + +
-
- + +
- UUID + UUID
- - + - - Incorrect Input - + +
-
- + +
- Reference + Reference
- - + - - Incorrect Input - + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.extension index cac4c96..c83f047 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.js index 58d39d4..0212074 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeePayment-filter", - label: "EmployeePayment Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/index.html", - perspectiveName: "EmployeePayment" + id: 'EmployeePayment-filter', + label: 'EmployeePayment Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-filter/index.html', + perspectiveName: 'EmployeePayment' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/controller.js index 492d420..7e221d4 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.EmployeePayment.EmployeePayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "EmployeePayment Details", - create: "Create EmployeePayment", - update: "Update EmployeePayment" + select: 'EmployeePayment Details', + create: 'Create EmployeePayment', + update: 'Update EmployeePayment' }; $scope.action = 'select'; @@ -34,68 +31,100 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsCompany = params.optionsCompany; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create EmployeePayment: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'EmployeePayment', + message: 'EmployeePayment successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("EmployeePayment", "EmployeePayment successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create EmployeePayment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update EmployeePayment: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("EmployeePayment", "EmployeePayment successfully updated"); + Dialogs.showAlert({ + title: 'EmployeePayment', + message: 'EmployeePayment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update EmployeePayment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("EmployeePayment-details"); + Dialogs.closeWindow({ id: 'EmployeePayment-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/index.html index aff3496..1eacd13 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/index.html @@ -2,319 +2,281 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.extension index d763f11..61bf3bb 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.extension @@ -1,6 +1,6 @@ { - "module": "{{projectName}}/gen/{{genFolderName}}/ui/{{perspectiveName}}/{{name}}/dialog-window/view.js", - "extensionPoint": "dialog-window", - "description": "{{projectName}} - Application Dialog Window", + "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.js index 475db54..bf594a4 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/view.js @@ -6,15 +6,12 @@ const viewData = { id: "EmployeePayment-details", label: "EmployeePayment", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/index.html", + path: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/dialog-window/index.html", perspectiveName: "EmployeePayment", roles: [ "codbex-payments.EmployeePayment.EmployeePaymentReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/index.html b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/index.html index edc60e5..fb4ec07 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/index.html @@ -2,54 +2,45 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + Items + + + + + + + + + + + + + + + + + + + + - - + {{next.Valor | date: "dd/MMM/yyyy"}} | {{next.CompanyIBAN}} | {{next.CounterpartyIBAN}} | @@ -62,15 +53,16 @@ {{next.Name}} | {{next.UUID}} | {{next.Reference}} - - - - - - + + + + + + Load More ... - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/controller.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/controller.js index 327856a..1a3d49d 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/controller.js @@ -1,136 +1,162 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.EmployeePayment.EmployeePayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/EmployeePayment/EmployeePaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "EmployeePayment Details", - create: "Create EmployeePayment", - update: "Update EmployeePayment" + select: 'EmployeePayment Details', + create: 'Create EmployeePayment', + update: 'Update EmployeePayment' }; $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "EmployeePayment" && e.view === "EmployeePayment" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'EmployeePayment' && e.view === 'EmployeePayment' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsCurrency = []; $scope.optionsCompany = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.entity = data.entity; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.entity = data.entity; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'update'; }); - }); + }}); - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("EmployeePayment", `Unable to create EmployeePayment: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("EmployeePayment", "EmployeePayment successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.clearDetails' , data: response.data }); + Dialogs.showAlert({ + title: 'EmployeePayment', + message: 'EmployeePayment successfully created', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'EmployeePayment', + message: `Unable to create EmployeePayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { - entityApi.update($scope.entity.Id, $scope.entity).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("EmployeePayment", `Unable to update EmployeePayment: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("EmployeePayment", "EmployeePayment successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.EmployeePayment.EmployeePayment.clearDetails', data: response.data }); + Dialogs.showAlert({ + title: 'EmployeePayment', + message: 'EmployeePayment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'EmployeePayment', + message: `Unable to create EmployeePayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-payments.EmployeePayment.EmployeePayment.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.createCurrency = function () { - messageHub.showDialogWindow("Currency-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCurrency = () => { + Dialogs.showWindow({ + id: 'Currency-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createCompany = function () { - messageHub.showDialogWindow("Company-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCompany = () => { + Dialogs.showWindow({ + id: 'Company-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -139,30 +165,40 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $scope.refreshCurrency = function () { + $scope.refreshCurrency = () => { $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCompany = function () { + $scope.refreshCompany = () => { $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/index.html b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/index.html index c0aab5c..42776ab 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/index.html +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/index.html @@ -2,333 +2,294 @@ - - + - - - - - + + + + + + - - - - - + + + + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- - - +
+ +
- - + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- - - +
+ +
- - + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
- - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.extension index 7712a64..c1a6ad9 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View - Main Details", "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.js index f79f155..7430b53 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeePayment-details", - label: "EmployeePayment", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/index.html", - perspectiveName: "EmployeePayment" + id: 'EmployeePayment-details', + label: 'EmployeePayment', + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/main-details/index.html', + perspectiveName: 'EmployeePayment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile-portal.extension deleted file mode 100644 index 1c86a3c..0000000 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.extension deleted file mode 100644 index ab6f811..0000000 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.js deleted file mode 100644 index 34b01ff..0000000 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "EmployeePayment", - caption: "Manage entity EmployeePayment", - tooltip: "EmployeePayment", - type: "PRIMARY", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html", - order: "100", - groupOrder: "30" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.extension index 18978e0..d0196db 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View", "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.js index 7b571a1..1c83ec7 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeePayment", - label: "EmployeePayment", - factory: "frame", - region: "left", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/index.html", - perspectiveName: "EmployeePayment" + id: 'EmployeePayment', + label: 'EmployeePayment', + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/EmployeePayment/index.html', + perspectiveName: 'EmployeePayment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html index e6d8d05..cff8962 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html @@ -10,70 +10,43 @@ - - - + + - - - + + - - - - - - + + + {{state.busyText}} - - - Encounterd an error while loading - - - + + + Encounterd an error while loading + + diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective-portal.extension deleted file mode 100644 index 53d4962..0000000 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - EmployeePayment" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.extension b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.extension index 37f150c..592bc8d 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.extension +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.extension @@ -1,5 +1,5 @@ { "module": "codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.js", - "extensionPoint": "codbex-payments", + "extensionPoint": "application-perspectives", "description": "codbex-payments - Perspective - EmployeePayment" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.js b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.js index f8045c0..49b3761 100644 --- a/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.js +++ b/codbex-payments/gen/codbex-payments/ui/EmployeePayment/perspective.js @@ -5,14 +5,12 @@ */ const perspectiveData = { id: 'EmployeePayment', - name: 'EmployeePayment', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html', - order: '30', + label: 'EmployeePayment', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html', + groupId: 'salaries-navigation-group', + order: 300, icon: '/services/web/resources/unicons/folder-check.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/controller.js index 1282cf6..222c2ee 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/controller.js @@ -1,31 +1,27 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentAdjustment.PaymentAdjustment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, $http, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "PaymentAdjustment" && e.view === "PaymentAdjustment" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'PaymentAdjustment' && e.view === 'PaymentAdjustment' && (e.type === 'page' || e.type === undefined)); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +38,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entitySearch', handler: () => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } @@ -75,13 +68,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentAdjustment", `Unable to count PaymentAdjustment: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } $scope.dataPages = Math.ceil($scope.dataCount / $scope.dataLimit); filter.$offset = ($scope.dataPage - 1) * $scope.dataLimit; @@ -91,16 +80,11 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter.$limit = $scope.dataPage * $scope.dataLimit; } - entityApi.search(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentAdjustment", `Unable to list/filter PaymentAdjustment: '${response.message}'`); - return; - } + EntityService.search(filter).then((response) => { if ($scope.data == null || $scope.dataReset) { $scope.data = []; $scope.dataReset = false; } - response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -112,76 +96,98 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.data = $scope.data.concat(response.data); $scope.dataPage++; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: `Unable to list/filter PaymentAdjustment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: `Unable to count PaymentAdjustment: '${message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; - messageHub.postMessage("entitySelected", { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.createEntity', data: { entity: {}, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.updateEntity', data: { entity: $scope.selectedEntity, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete PaymentAdjustment?', - `Are you sure you want to delete PaymentAdjustment? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: 'Delete PaymentAdjustment?', + message: `Are you sure you want to delete PaymentAdjustment? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("PaymentAdjustment", `Unable to delete PaymentAdjustment: '${response.message}'`); - return; - } + closeButton: false + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then(() => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: `Unable to delete PaymentAdjustment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("PaymentAdjustment-filter", { - entity: $scope.filterEntity, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'PaymentAdjustment-filter', + params: { + entity: $scope.filterEntity, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + }, }); }; @@ -190,25 +196,37 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsCompany = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -216,7 +234,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -225,5 +243,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/controller.js index 95d0ea4..cf1a70f 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/controller.js @@ -1,104 +1,99 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentAdjustment.PaymentAdjustment'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - if (params?.entity?.DateFrom) { - params.entity.DateFrom = new Date(params.entity.DateFrom); - } - if (params?.entity?.DateTo) { - params.entity.DateTo = new Date(params.entity.DateTo); - } - if (params?.entity?.ValorFrom) { - params.entity.ValorFrom = new Date(params.entity.ValorFrom); - } - if (params?.entity?.ValorTo) { - params.entity.ValorTo = new Date(params.entity.ValorTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.DateFrom) { + params.entity.DateFrom = new Date(params.entity.DateFrom); + } + if (params?.entity?.DateTo) { + params.entity.DateTo = new Date(params.entity.DateTo); } + if (params?.entity?.ValorFrom) { + params.entity.ValorFrom = new Date(params.entity.ValorFrom); + } + if (params?.entity?.ValorTo) { + params.entity.ValorTo = new Date(params.entity.ValorTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.DateFrom) { - filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; - } - if (entity.DateTo) { - filter.$filter.lessThanOrEqual.Date = entity.DateTo; - } - if (entity.ValorFrom) { - filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; - } - if (entity.ValorTo) { - filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; - } - if (entity.Amount !== undefined) { - filter.$filter.equals.Amount = entity.Amount; - } - if (entity.Currency !== undefined) { - filter.$filter.equals.Currency = entity.Currency; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.Reason) { - filter.$filter.contains.Reason = entity.Reason; - } - if (entity.UUID) { - filter.$filter.contains.UUID = entity.UUID; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - messageHub.postMessage("clearDetails"); - $scope.cancel(); - }; - - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { + }, + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.DateFrom) { + filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; + } + if (entity.DateTo) { + filter.$filter.lessThanOrEqual.Date = entity.DateTo; + } + if (entity.ValorFrom) { + filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; + } + if (entity.ValorTo) { + filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; + } + if (entity.Amount !== undefined) { + filter.$filter.equals.Amount = entity.Amount; + } + if (entity.Currency !== undefined) { + filter.$filter.equals.Currency = entity.Currency; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.Reason) { + filter.$filter.contains.Reason = entity.Reason; + } + if (entity.UUID) { + filter.$filter.contains.UUID = entity.UUID; + } + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("PaymentAdjustment-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'PaymentAdjustment-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/index.html index 70502ee..1c2c52c 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/index.html @@ -2,189 +2,173 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- From Date + From Date
- - + - - Incorrect Input - + +
- To Date + To Date
- - + - - Incorrect Input - + +
-
- + +
- From Valor + From Valor
- - + - - Incorrect Input - + +
- To Valor + To Valor
- - + - - Incorrect Input - + +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Reason + Reason
- - + - - Incorrect Input - + +
-
- + +
- UUID + UUID
- - + - - Incorrect Input - + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.extension index 211ae9c..e60b524 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.js index 90b2cf1..a833cdd 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentAdjustment-filter", - label: "PaymentAdjustment Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/index.html", - perspectiveName: "PaymentAdjustment" + id: 'PaymentAdjustment-filter', + label: 'PaymentAdjustment Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-filter/index.html', + perspectiveName: 'PaymentAdjustment' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/controller.js index f235871..c4e7925 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentAdjustment.PaymentAdjustment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentAdjustment Details", - create: "Create PaymentAdjustment", - update: "Update PaymentAdjustment" + select: 'PaymentAdjustment Details', + create: 'Create PaymentAdjustment', + update: 'Update PaymentAdjustment' }; $scope.action = 'select'; @@ -34,68 +31,100 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsCompany = params.optionsCompany; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create PaymentAdjustment: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: 'PaymentAdjustment successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentAdjustment", "PaymentAdjustment successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create PaymentAdjustment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update PaymentAdjustment: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentAdjustment", "PaymentAdjustment successfully updated"); + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: 'PaymentAdjustment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update PaymentAdjustment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("PaymentAdjustment-details"); + Dialogs.closeWindow({ id: 'PaymentAdjustment-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/index.html index 1eb8fd7..597c95f 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/index.html @@ -2,181 +2,161 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Company + Company
- - - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.extension index 7dcec2b..ca55459 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.extension @@ -1,6 +1,6 @@ { - "module": "{{projectName}}/gen/{{genFolderName}}/ui/{{perspectiveName}}/{{name}}/dialog-window/view.js", - "extensionPoint": "dialog-window", - "description": "{{projectName}} - Application Dialog Window", + "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.js index 0cb88ee..c0cc547 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/view.js @@ -6,15 +6,12 @@ const viewData = { id: "PaymentAdjustment-details", label: "PaymentAdjustment", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/index.html", + path: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/dialog-window/index.html", perspectiveName: "PaymentAdjustment", roles: [ "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/index.html index 952c6ec..6aec0fb 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/index.html @@ -2,69 +2,61 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + Items + + + + + + + + + + + + + + + + + + + + - - + {{next.Valor | date: "dd/MMM/yyyy"}} | {{next.Amount}} | {{optionsCurrencyValue(next.Currency)}} | {{optionsCompanyValue(next.Company)}} | {{next.Reason}} | {{next.UUID}} - - - - - - + + + + + + Load More ... - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/controller.js index 81c10ee..4a10937 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/controller.js @@ -1,136 +1,162 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentAdjustment.PaymentAdjustment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentAdjustment/PaymentAdjustmentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentAdjustment Details", - create: "Create PaymentAdjustment", - update: "Update PaymentAdjustment" + select: 'PaymentAdjustment Details', + create: 'Create PaymentAdjustment', + update: 'Update PaymentAdjustment' }; $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "PaymentAdjustment" && e.view === "PaymentAdjustment" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'PaymentAdjustment' && e.view === 'PaymentAdjustment' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsCurrency = []; $scope.optionsCompany = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.entity = data.entity; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.entity = data.entity; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'update'; }); - }); + }}); - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("PaymentAdjustment", `Unable to create PaymentAdjustment: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("PaymentAdjustment", "PaymentAdjustment successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails' , data: response.data }); + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: 'PaymentAdjustment successfully created', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: `Unable to create PaymentAdjustment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { - entityApi.update($scope.entity.Id, $scope.entity).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentAdjustment", `Unable to update PaymentAdjustment: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("PaymentAdjustment", "PaymentAdjustment successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: 'PaymentAdjustment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentAdjustment', + message: `Unable to create PaymentAdjustment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-payments.PaymentAdjustment.PaymentAdjustment.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.createCurrency = function () { - messageHub.showDialogWindow("Currency-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCurrency = () => { + Dialogs.showWindow({ + id: 'Currency-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createCompany = function () { - messageHub.showDialogWindow("Company-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCompany = () => { + Dialogs.showWindow({ + id: 'Company-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -139,30 +165,40 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $scope.refreshCurrency = function () { + $scope.refreshCurrency = () => { $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCompany = function () { + $scope.refreshCompany = () => { $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/index.html index ccf9829..4736efb 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/index.html @@ -2,195 +2,174 @@ - - + - - - - - + + + + + + - - - - - + + + + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- - - +
+ +
- - + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- - - +
+ +
- - + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.extension index 1fc6775..43f66da 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View - Main Details", "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.js index f675e89..0917348 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentAdjustment-details", - label: "PaymentAdjustment", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/index.html", - perspectiveName: "PaymentAdjustment" + id: 'PaymentAdjustment-details', + label: 'PaymentAdjustment', + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/main-details/index.html', + perspectiveName: 'PaymentAdjustment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile-portal.extension deleted file mode 100644 index 90d2f30..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.extension deleted file mode 100644 index c3213cf..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.js deleted file mode 100644 index 3c7b141..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "PaymentAdjustment", - caption: "Manage entity PaymentAdjustment", - tooltip: "PaymentAdjustment", - type: "PRIMARY", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html", - order: "100", - groupOrder: "110" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.extension index 3a45e30..6fb04ab 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View", "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.js index 4ffe621..e8adfd0 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentAdjustment", - label: "PaymentAdjustment", - factory: "frame", - region: "left", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/index.html", - perspectiveName: "PaymentAdjustment" + id: 'PaymentAdjustment', + label: 'PaymentAdjustment', + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/PaymentAdjustment/index.html', + perspectiveName: 'PaymentAdjustment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html index 4391b4c..cff8962 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html @@ -10,70 +10,43 @@ - - - + + - - - + + - - - - - - + + + {{state.busyText}} - - - Encounterd an error while loading - - - + + + Encounterd an error while loading + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective-portal.extension deleted file mode 100644 index 39e09dd..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - PaymentAdjustment" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.extension b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.extension index 8f4f241..296ec0d 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.extension @@ -1,5 +1,5 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.js", - "extensionPoint": "codbex-payments", + "extensionPoint": "application-perspectives", "description": "codbex-payments - Perspective - PaymentAdjustment" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.js b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.js index eb1cfa2..3a1d3c6 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/perspective.js @@ -5,14 +5,12 @@ */ const perspectiveData = { id: 'PaymentAdjustment', - name: 'PaymentAdjustment', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html', - order: '110', + label: 'PaymentAdjustment', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html', + groupId: 'sales-navigation-group', + order: 700, icon: '/services/web/resources/unicons/paypal.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/controller.js index 4dfba17..3ed72ae 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/controller.js @@ -1,31 +1,27 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentRecord.PaymentRecord'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, $http, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "PaymentRecord" && e.view === "PaymentRecord" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'PaymentRecord' && e.view === 'PaymentRecord' && (e.type === 'page' || e.type === undefined)); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +38,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entitySearch', handler: () => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } @@ -75,13 +68,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecord", `Unable to count PaymentRecord: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } $scope.dataPages = Math.ceil($scope.dataCount / $scope.dataLimit); filter.$offset = ($scope.dataPage - 1) * $scope.dataLimit; @@ -91,16 +80,11 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter.$limit = $scope.dataPage * $scope.dataLimit; } - entityApi.search(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecord", `Unable to list/filter PaymentRecord: '${response.message}'`); - return; - } + EntityService.search(filter).then((response) => { if ($scope.data == null || $scope.dataReset) { $scope.data = []; $scope.dataReset = false; } - response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -112,14 +96,30 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.data = $scope.data.concat(response.data); $scope.dataPage++; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecord', + message: `Unable to list/filter PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecord', + message: `Unable to count PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; - messageHub.postMessage("entitySelected", { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsCurrency: $scope.optionsCurrency, @@ -127,73 +127,79 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, optionsPaymentStatus: $scope.optionsPaymentStatus, optionsPaymentType: $scope.optionsPaymentType, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.createEntity', data: { entity: {}, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, optionsPaymentStatus: $scope.optionsPaymentStatus, optionsPaymentType: $scope.optionsPaymentType, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.updateEntity', data: { entity: $scope.selectedEntity, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, optionsPaymentStatus: $scope.optionsPaymentStatus, optionsPaymentType: $scope.optionsPaymentType, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete PaymentRecord?', - `Are you sure you want to delete PaymentRecord? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: 'Delete PaymentRecord?', + message: `Are you sure you want to delete PaymentRecord? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("PaymentRecord", `Unable to delete PaymentRecord: '${response.message}'`); - return; - } + closeButton: false + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then(() => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.PaymentRecord.PaymentRecord.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecord', + message: `Unable to delete PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("PaymentRecord-filter", { - entity: $scope.filterEntity, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, - optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, - optionsPaymentStatus: $scope.optionsPaymentStatus, - optionsPaymentType: $scope.optionsPaymentType, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'PaymentRecord-filter', + params: { + entity: $scope.filterEntity, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, + optionsPaymentStatus: $scope.optionsPaymentStatus, + optionsPaymentType: $scope.optionsPaymentType, + }, }); }; @@ -205,52 +211,82 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentType = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts").then(function (response) { - $scope.optionsPaymentRecordDirection = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts').then((response) => { + $scope.optionsPaymentRecordDirection = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts").then(function (response) { - $scope.optionsPaymentStatus = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts').then((response) => { + $scope.optionsPaymentStatus = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts").then(function (response) { - $scope.optionsPaymentType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts').then((response) => { + $scope.optionsPaymentType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -258,7 +294,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -266,7 +302,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentRecordDirectionValue = function (optionKey) { + $scope.optionsPaymentRecordDirectionValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentRecordDirection.length; i++) { if ($scope.optionsPaymentRecordDirection[i].value === optionKey) { return $scope.optionsPaymentRecordDirection[i].text; @@ -274,7 +310,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentStatusValue = function (optionKey) { + $scope.optionsPaymentStatusValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentStatus.length; i++) { if ($scope.optionsPaymentStatus[i].value === optionKey) { return $scope.optionsPaymentStatus[i].text; @@ -282,7 +318,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentTypeValue = function (optionKey) { + $scope.optionsPaymentTypeValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentType.length; i++) { if ($scope.optionsPaymentType[i].value === optionKey) { return $scope.optionsPaymentType[i].text; @@ -291,5 +327,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/controller.js index 8e2b81c..5659f50 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/controller.js @@ -1,134 +1,129 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentRecord.PaymentRecord'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - if (params?.entity?.DateFrom) { - params.entity.DateFrom = new Date(params.entity.DateFrom); - } - if (params?.entity?.DateTo) { - params.entity.DateTo = new Date(params.entity.DateTo); - } - if (params?.entity?.ValorFrom) { - params.entity.ValorFrom = new Date(params.entity.ValorFrom); - } - if (params?.entity?.ValorTo) { - params.entity.ValorTo = new Date(params.entity.ValorTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; - $scope.optionsPaymentRecordDirection = params.optionsPaymentRecordDirection; - $scope.optionsPaymentStatus = params.optionsPaymentStatus; - $scope.optionsPaymentType = params.optionsPaymentType; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.DateFrom) { + params.entity.DateFrom = new Date(params.entity.DateFrom); + } + if (params?.entity?.DateTo) { + params.entity.DateTo = new Date(params.entity.DateTo); + } + if (params?.entity?.ValorFrom) { + params.entity.ValorFrom = new Date(params.entity.ValorFrom); } + if (params?.entity?.ValorTo) { + params.entity.ValorTo = new Date(params.entity.ValorTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + $scope.optionsPaymentRecordDirection = params.optionsPaymentRecordDirection; + $scope.optionsPaymentStatus = params.optionsPaymentStatus; + $scope.optionsPaymentType = params.optionsPaymentType; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.DateFrom) { - filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; - } - if (entity.DateTo) { - filter.$filter.lessThanOrEqual.Date = entity.DateTo; - } - if (entity.ValorFrom) { - filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; - } - if (entity.ValorTo) { - filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; - } - if (entity.CompanyIBAN) { - filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; - } - if (entity.CounterpartyIBAN) { - filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; - } - if (entity.CounterpartyName) { - filter.$filter.contains.CounterpartyName = entity.CounterpartyName; - } - if (entity.Amount !== undefined) { - filter.$filter.equals.Amount = entity.Amount; - } - if (entity.Currency !== undefined) { - filter.$filter.equals.Currency = entity.Currency; - } - if (entity.Reason) { - filter.$filter.contains.Reason = entity.Reason; - } - if (entity.Description) { - filter.$filter.contains.Description = entity.Description; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.PaymentRecordDirection !== undefined) { - filter.$filter.equals.PaymentRecordDirection = entity.PaymentRecordDirection; - } - if (entity.PaymentStatus !== undefined) { - filter.$filter.equals.PaymentStatus = entity.PaymentStatus; - } - if (entity.PaymentType !== undefined) { - filter.$filter.equals.PaymentType = entity.PaymentType; - } - if (entity.UUID) { - filter.$filter.contains.UUID = entity.UUID; - } - if (entity.Reference) { - filter.$filter.contains.Reference = entity.Reference; - } - if (entity.Deleted !== undefined && entity.isDeletedIndeterminate === false) { - filter.$filter.equals.Deleted = entity.Deleted; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - messageHub.postMessage("clearDetails"); - $scope.cancel(); - }; - - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { + }, + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.DateFrom) { + filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; + } + if (entity.DateTo) { + filter.$filter.lessThanOrEqual.Date = entity.DateTo; + } + if (entity.ValorFrom) { + filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; + } + if (entity.ValorTo) { + filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; + } + if (entity.CompanyIBAN) { + filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; + } + if (entity.CounterpartyIBAN) { + filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; + } + if (entity.CounterpartyName) { + filter.$filter.contains.CounterpartyName = entity.CounterpartyName; + } + if (entity.Amount !== undefined) { + filter.$filter.equals.Amount = entity.Amount; + } + if (entity.Currency !== undefined) { + filter.$filter.equals.Currency = entity.Currency; + } + if (entity.Reason) { + filter.$filter.contains.Reason = entity.Reason; + } + if (entity.Description) { + filter.$filter.contains.Description = entity.Description; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.PaymentRecordDirection !== undefined) { + filter.$filter.equals.PaymentRecordDirection = entity.PaymentRecordDirection; + } + if (entity.PaymentStatus !== undefined) { + filter.$filter.equals.PaymentStatus = entity.PaymentStatus; + } + if (entity.PaymentType !== undefined) { + filter.$filter.equals.PaymentType = entity.PaymentType; + } + if (entity.UUID) { + filter.$filter.contains.UUID = entity.UUID; + } + if (entity.Reference) { + filter.$filter.contains.Reference = entity.Reference; + } + if (entity.Deleted !== undefined && entity.isDeletedIndeterminate === false) { + filter.$filter.equals.Deleted = entity.Deleted; + } + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-payments.PaymentRecord.PaymentRecord.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("PaymentRecord-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'PaymentRecord-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/index.html index 8346870..edd6baf 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/index.html @@ -2,339 +2,316 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- From Date + From Date
- - + - - Incorrect Input - + +
- To Date + To Date
- - + - - Incorrect Input - + +
-
- + +
- From Valor + From Valor
- - + - - Incorrect Input - + +
- To Valor + To Valor
- - + - - Incorrect Input - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - Incorrect Input - + +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - Incorrect Input - + +
-
- + +
- Description + Description
- - + - - Incorrect Input - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- PaymentRecordDirection + PaymentRecordDirection
- - + placeholder="Search PaymentRecordDirection ..." + btn-aria-label="show/hide PaymentRecordDirection options" list-aria-label="PaymentRecordDirection options"> +
-
- + +
- PaymentStatus + PaymentStatus
- - + placeholder="Search PaymentStatus ..." + btn-aria-label="show/hide PaymentStatus options" list-aria-label="PaymentStatus options"> +
-
- + +
- PaymentType + PaymentType
- - + placeholder="Search PaymentType ..." + btn-aria-label="show/hide PaymentType options" list-aria-label="PaymentType options"> +
-
- + +
- UUID + UUID
- - + - - Incorrect Input - + +
-
- + +
- Reference + Reference
- - + - - Incorrect Input - + +
-
- + +
- - - Deleted + + Deleted
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.extension index d55c0f6..eaa2e2e 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly,codbex-payments.PaymentRecord.PaymentRecordFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.js index d260762..706213f 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecord-filter", - label: "PaymentRecord Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/index.html", - perspectiveName: "PaymentRecord" + id: 'PaymentRecord-filter', + label: 'PaymentRecord Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-filter/index.html', + perspectiveName: 'PaymentRecord' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/controller.js index 91ffc3b..0f3a521 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentRecord.PaymentRecord'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentRecord Details", - create: "Create PaymentRecord", - update: "Update PaymentRecord" + select: 'PaymentRecord Details', + create: 'Create PaymentRecord', + update: 'Update PaymentRecord' }; $scope.action = 'select'; @@ -37,104 +34,154 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentType = params.optionsPaymentType; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create PaymentRecord: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentRecord', + message: 'PaymentRecord successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentRecord", "PaymentRecord successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create PaymentRecord: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update PaymentRecord: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentRecord", "PaymentRecord successfully updated"); + Dialogs.showAlert({ + title: 'PaymentRecord', + message: 'PaymentRecord successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update PaymentRecord: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.servicePaymentRecordDirection = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts"; + $scope.servicePaymentRecordDirection = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts'; $scope.optionsPaymentRecordDirection = []; - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts").then(function (response) { - $scope.optionsPaymentRecordDirection = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts').then((response) => { + $scope.optionsPaymentRecordDirection = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.servicePaymentStatus = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts"; + $scope.servicePaymentStatus = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts'; $scope.optionsPaymentStatus = []; - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts").then(function (response) { - $scope.optionsPaymentStatus = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts').then((response) => { + $scope.optionsPaymentStatus = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.servicePaymentType = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts"; + $scope.servicePaymentType = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts'; $scope.optionsPaymentType = []; - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts").then(function (response) { - $scope.optionsPaymentType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts').then((response) => { + $scope.optionsPaymentType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("PaymentRecord-details"); + Dialogs.closeWindow({ id: 'PaymentRecord-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/index.html index d147f53..ca3aeda 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/index.html @@ -2,363 +2,324 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- PaymentRecordDirection + PaymentRecordDirection
- - - + placeholder="Search PaymentRecordDirection ..." + btn-aria-label="show/hide PaymentRecordDirection options" list-aria-label="PaymentRecordDirection options"> +
-
- + +
- PaymentStatus + PaymentStatus
- - - + placeholder="Search PaymentStatus ..." + btn-aria-label="show/hide PaymentStatus options" list-aria-label="PaymentStatus options"> +
-
- + +
- PaymentType + PaymentType
- - - + placeholder="Search PaymentType ..." + btn-aria-label="show/hide PaymentType options" list-aria-label="PaymentType options"> +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
-
- + - - Deleted + + Deleted
-
- -
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.extension index 59566a9..dafbef3 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.extension @@ -1,6 +1,6 @@ { - "module": "{{projectName}}/gen/{{genFolderName}}/ui/{{perspectiveName}}/{{name}}/dialog-window/view.js", - "extensionPoint": "dialog-window", - "description": "{{projectName}} - Application Dialog Window", + "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly,codbex-payments.PaymentRecord.PaymentRecordFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.js index daf7cb1..d02047c 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/view.js @@ -6,15 +6,12 @@ const viewData = { id: "PaymentRecord-details", label: "PaymentRecord", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/index.html", + path: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/dialog-window/index.html", perspectiveName: "PaymentRecord", roles: [ "codbex-payments.PaymentRecord.PaymentRecordReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/index.html index 7969d74..c0d92d6 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/index.html @@ -2,54 +2,45 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + Items + + + + + + + + + + + + + + + + + + + + - - + {{next.Valor | date: "dd/MMM/yyyy"}} | {{next.CompanyIBAN}} | {{next.CounterpartyIBAN}} | @@ -65,15 +56,16 @@ {{next.UUID}} | {{next.Reference}} | {{next.Deleted}} - - - - - - + + + + + + Load More ... - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/controller.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/controller.js index 78656f7..417467f 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/controller.js @@ -1,44 +1,41 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.PaymentRecord.PaymentRecord'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentRecord Details", - create: "Create PaymentRecord", - update: "Update PaymentRecord" + select: 'PaymentRecord Details', + create: 'Create PaymentRecord', + update: 'Update PaymentRecord' }; $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "PaymentRecord" && e.view === "PaymentRecord" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'PaymentRecord' && e.view === 'PaymentRecord' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsCurrency = []; $scope.optionsCompany = []; @@ -47,123 +44,164 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentType = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsPaymentRecordDirection = msg.data.optionsPaymentRecordDirection; - $scope.optionsPaymentStatus = msg.data.optionsPaymentStatus; - $scope.optionsPaymentType = msg.data.optionsPaymentType; + $scope.entity = data.entity; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsPaymentRecordDirection = data.optionsPaymentRecordDirection; + $scope.optionsPaymentStatus = data.optionsPaymentStatus; + $scope.optionsPaymentType = data.optionsPaymentType; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsPaymentRecordDirection = msg.data.optionsPaymentRecordDirection; - $scope.optionsPaymentStatus = msg.data.optionsPaymentStatus; - $scope.optionsPaymentType = msg.data.optionsPaymentType; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsPaymentRecordDirection = data.optionsPaymentRecordDirection; + $scope.optionsPaymentStatus = data.optionsPaymentStatus; + $scope.optionsPaymentType = data.optionsPaymentType; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsPaymentRecordDirection = msg.data.optionsPaymentRecordDirection; - $scope.optionsPaymentStatus = msg.data.optionsPaymentStatus; - $scope.optionsPaymentType = msg.data.optionsPaymentType; + $scope.entity = data.entity; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsPaymentRecordDirection = data.optionsPaymentRecordDirection; + $scope.optionsPaymentStatus = data.optionsPaymentStatus; + $scope.optionsPaymentType = data.optionsPaymentType; $scope.action = 'update'; }); - }); + }}); - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; - $scope.servicePaymentRecordDirection = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts"; - $scope.servicePaymentStatus = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts"; - $scope.servicePaymentType = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; + $scope.servicePaymentRecordDirection = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts'; + $scope.servicePaymentStatus = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts'; + $scope.servicePaymentType = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("PaymentRecord", `Unable to create PaymentRecord: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("PaymentRecord", "PaymentRecord successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.clearDetails' , data: response.data }); + Dialogs.showAlert({ + title: 'PaymentRecord', + message: 'PaymentRecord successfully created', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecord', + message: `Unable to create PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { - entityApi.update($scope.entity.Id, $scope.entity).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecord", `Unable to update PaymentRecord: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("PaymentRecord", "PaymentRecord successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.clearDetails', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentRecord', + message: 'PaymentRecord successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecord', + message: `Unable to create PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-payments.PaymentRecord.PaymentRecord.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.createCurrency = function () { - messageHub.showDialogWindow("Currency-details", { - action: "create", - entity: {}, - }, null, false); - }; - $scope.createCompany = function () { - messageHub.showDialogWindow("Company-details", { - action: "create", - entity: {}, - }, null, false); - }; - $scope.createPaymentRecordDirection = function () { - messageHub.showDialogWindow("PaymentRecordDirection-details", { - action: "create", - entity: {}, - }, null, false); - }; - $scope.createPaymentStatus = function () { - messageHub.showDialogWindow("PaymentStatus-details", { - action: "create", - entity: {}, - }, null, false); - }; - $scope.createPaymentType = function () { - messageHub.showDialogWindow("PaymentType-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCurrency = () => { + Dialogs.showWindow({ + id: 'Currency-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); + }; + $scope.createCompany = () => { + Dialogs.showWindow({ + id: 'Company-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); + }; + $scope.createPaymentRecordDirection = () => { + Dialogs.showWindow({ + id: 'PaymentRecordDirection-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); + }; + $scope.createPaymentStatus = () => { + Dialogs.showWindow({ + id: 'PaymentStatus-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); + }; + $scope.createPaymentType = () => { + Dialogs.showWindow({ + id: 'PaymentType-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -172,63 +210,91 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $scope.refreshCurrency = function () { + $scope.refreshCurrency = () => { $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCompany = function () { + $scope.refreshCompany = () => { $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshPaymentRecordDirection = function () { + $scope.refreshPaymentRecordDirection = () => { $scope.optionsPaymentRecordDirection = []; - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts").then(function (response) { - $scope.optionsPaymentRecordDirection = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts').then((response) => { + $scope.optionsPaymentRecordDirection = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshPaymentStatus = function () { + $scope.refreshPaymentStatus = () => { $scope.optionsPaymentStatus = []; - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts").then(function (response) { - $scope.optionsPaymentStatus = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts').then((response) => { + $scope.optionsPaymentStatus = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshPaymentType = function () { + $scope.refreshPaymentType = () => { $scope.optionsPaymentType = []; - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts").then(function (response) { - $scope.optionsPaymentType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts').then((response) => { + $scope.optionsPaymentType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/index.html index 7e2869a..35f205e 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/index.html @@ -2,401 +2,349 @@ - - + - - - - - + + + + + + - - - - - + + + + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- - - +
+ +
- - + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- - - +
+ +
- - + +
- PaymentRecordDirection + PaymentRecordDirection
- - + placeholder="Search PaymentRecordDirection ..." + btn-aria-label="show/hide PaymentRecordDirection options" list-aria-label="PaymentRecordDirection options"> +
-
- - - +
+ +
- - + +
- PaymentStatus + PaymentStatus
- - + placeholder="Search PaymentStatus ..." + btn-aria-label="show/hide PaymentStatus options" list-aria-label="PaymentStatus options"> +
-
- - - +
+ +
- - + +
- PaymentType + PaymentType
- - + placeholder="Search PaymentType ..." + btn-aria-label="show/hide PaymentType options" list-aria-label="PaymentType options"> +
-
- - - +
+ +
- - + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
-
- + - - Deleted + + Deleted
-
- -
-
- - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.extension index aa16960..02934c2 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View - Main Details", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly,codbex-payments.PaymentRecord.PaymentRecordFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.js index cd7e31c..92398bd 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecord-details", - label: "PaymentRecord", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/index.html", - perspectiveName: "PaymentRecord" + id: 'PaymentRecord-details', + label: 'PaymentRecord', + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/main-details/index.html', + perspectiveName: 'PaymentRecord' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile-portal.extension deleted file mode 100644 index cc4420c..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly,codbex-payments.PaymentRecord.PaymentRecordFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.extension deleted file mode 100644 index 24eb085..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly,codbex-payments.PaymentRecord.PaymentRecordFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.js deleted file mode 100644 index 60ff8e9..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "PaymentRecord", - caption: "Manage entity PaymentRecord", - tooltip: "PaymentRecord", - type: "PRIMARY", - report: "true", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html", - order: "100", - groupOrder: "40" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.extension index 653d55e..ad203c6 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly,codbex-payments.PaymentRecord.PaymentRecordFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.js index 173cc55..2a1b4c9 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecord", - label: "PaymentRecord", - factory: "frame", - region: "left", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/index.html", - perspectiveName: "PaymentRecord" + id: 'PaymentRecord', + label: 'PaymentRecord', + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/PaymentRecord/index.html', + perspectiveName: 'PaymentRecord' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html index 845385f..cff8962 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html @@ -10,70 +10,43 @@ - - - + + - - - + + - - - - - - + + + {{state.busyText}} - - - Encounterd an error while loading - - - + + + Encounterd an error while loading + + diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective-portal.extension deleted file mode 100644 index 9600550..0000000 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - PaymentRecord" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.extension b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.extension index 380bd92..c072dff 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.extension +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.extension @@ -1,5 +1,5 @@ { "module": "codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.js", - "extensionPoint": "codbex-payments", + "extensionPoint": "application-perspectives", "description": "codbex-payments - Perspective - PaymentRecord" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.js b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.js index b8d3564..e0b8d53 100644 --- a/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.js +++ b/codbex-payments/gen/codbex-payments/ui/PaymentRecord/perspective.js @@ -5,14 +5,12 @@ */ const perspectiveData = { id: 'PaymentRecord', - name: 'PaymentRecord', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html', - order: '40', + label: 'PaymentRecord', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/PaymentRecord/index.html', + groupId: 'accounting-navigation-group', + order: 40, icon: '/services/web/resources/unicons/align-justify.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/controller.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/controller.js index b36375e..f141d07 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/controller.js @@ -1,26 +1,25 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Reports.PaymentRecord'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, $http, EntityService, Extensions) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataLimit = 20; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "Reports" && e.view === "PaymentRecord" && (e.type === "page" || e.type === undefined)); - $scope.entityActions = response.filter(e => e.perspective === "Reports" && e.view === "PaymentRecord" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'PaymentRecord' && e.view === 'PaymentRecord' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'PaymentRecord' && e.view === 'PaymentRecord' && e.type === 'entity'); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { filterEntity: $scope.filterEntity, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, @@ -28,22 +27,20 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) optionsPaymentStatus: $scope.optionsPaymentStatus, optionsPaymentType: $scope.optionsPaymentType, }, - null, - true, - action - ); + closeButton: true, + }); }; - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true, + }); }; //-----------------Custom Actions-------------------// @@ -55,26 +52,22 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) resetPagination(); //-----------------Events-------------------// - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + Dialogs.addMessageListener({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entitySearch', handler: (data) => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } $scope.dataPage = pageNumber; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecord", `Unable to count PaymentRecord: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } let offset = (pageNumber - 1) * $scope.dataLimit; let limit = $scope.dataLimit; @@ -82,16 +75,11 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) if (filter) { filter.$offset = offset; filter.$limit = limit; - request = entityApi.search(filter); + request = EntityService.search(filter); } else { - request = entityApi.list(offset, limit); + request = EntityService.list(offset, limit); } - request.then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecord", `Unable to list/filter PaymentRecord: '${response.message}'`); - return; - } - + request.then((response) => { response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -102,36 +90,58 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) }); $scope.data = response.data; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: "PaymentRecord", + message: `Unable to list/filter PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: "PaymentRecord", + message: `Unable to count PaymentRecord: '${message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; }; - $scope.openDetails = function (entity) { + $scope.openDetails = (entity) => { $scope.selectedEntity = entity; - messageHub.showDialogWindow("PaymentRecord-Report-details", { - action: "select", - entity: entity, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, - optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, - optionsPaymentStatus: $scope.optionsPaymentStatus, - optionsPaymentType: $scope.optionsPaymentType, + Dialogs.showWindow({ + id: 'PaymentRecord-Report-details', + params: { + action: "select", + entity: entity, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, + optionsPaymentStatus: $scope.optionsPaymentStatus, + optionsPaymentType: $scope.optionsPaymentType, + }, }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("PaymentRecord-Report-filter", { - entity: $scope.filterEntity, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, - optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, - optionsPaymentStatus: $scope.optionsPaymentStatus, - optionsPaymentType: $scope.optionsPaymentType, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'PaymentRecord-Report-filter', + params: { + entity: $scope.filterEntity, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + optionsPaymentRecordDirection: $scope.optionsPaymentRecordDirection, + optionsPaymentStatus: $scope.optionsPaymentStatus, + optionsPaymentType: $scope.optionsPaymentType, + }, }); }; @@ -142,51 +152,81 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentStatus = []; $scope.optionsPaymentType = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts").then(function (response) { - $scope.optionsPaymentRecordDirection = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts').then((response) => { + $scope.optionsPaymentRecordDirection = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts").then(function (response) { - $scope.optionsPaymentStatus = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts').then((response) => { + $scope.optionsPaymentStatus = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts").then(function (response) { - $scope.optionsPaymentType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts').then((response) => { + $scope.optionsPaymentType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -194,7 +234,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -202,7 +242,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentRecordDirectionValue = function (optionKey) { + $scope.optionsPaymentRecordDirectionValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentRecordDirection.length; i++) { if ($scope.optionsPaymentRecordDirection[i].value === optionKey) { return $scope.optionsPaymentRecordDirection[i].text; @@ -210,7 +250,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentStatusValue = function (optionKey) { + $scope.optionsPaymentStatusValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentStatus.length; i++) { if ($scope.optionsPaymentStatus[i].value === optionKey) { return $scope.optionsPaymentStatus[i].text; @@ -218,7 +258,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentTypeValue = function (optionKey) { + $scope.optionsPaymentTypeValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentType.length; i++) { if ($scope.optionsPaymentType[i].value === optionKey) { return $scope.optionsPaymentType[i].text; @@ -227,5 +267,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/controller.js index 25cc247..be1747d 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/controller.js @@ -1,133 +1,128 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Reports.PaymentRecord'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - if (params?.entity?.DateFrom) { - params.entity.DateFrom = new Date(params.entity.DateFrom); - } - if (params?.entity?.DateTo) { - params.entity.DateTo = new Date(params.entity.DateTo); - } - if (params?.entity?.ValorFrom) { - params.entity.ValorFrom = new Date(params.entity.ValorFrom); - } - if (params?.entity?.ValorTo) { - params.entity.ValorTo = new Date(params.entity.ValorTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; - $scope.optionsPaymentRecordDirection = params.optionsPaymentRecordDirection; - $scope.optionsPaymentStatus = params.optionsPaymentStatus; - $scope.optionsPaymentType = params.optionsPaymentType; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.DateFrom) { + params.entity.DateFrom = new Date(params.entity.DateFrom); + } + if (params?.entity?.DateTo) { + params.entity.DateTo = new Date(params.entity.DateTo); + } + if (params?.entity?.ValorFrom) { + params.entity.ValorFrom = new Date(params.entity.ValorFrom); } + if (params?.entity?.ValorTo) { + params.entity.ValorTo = new Date(params.entity.ValorTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + $scope.optionsPaymentRecordDirection = params.optionsPaymentRecordDirection; + $scope.optionsPaymentStatus = params.optionsPaymentStatus; + $scope.optionsPaymentType = params.optionsPaymentType; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { }, - }; - if (entity.Id) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.DateFrom) { - filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; - } - if (entity.DateTo) { - filter.$filter.lessThanOrEqual.Date = entity.DateTo; - } - if (entity.ValorFrom) { - filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; - } - if (entity.ValorTo) { - filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; - } - if (entity.CompanyIBAN) { - filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; - } - if (entity.CounterpartyIBAN) { - filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; - } - if (entity.CounterpartyName) { - filter.$filter.contains.CounterpartyName = entity.CounterpartyName; - } - if (entity.Amount) { - filter.$filter.equals.Amount = entity.Amount; - } - if (entity.Currency) { - filter.$filter.equals.Currency = entity.Currency; - } - if (entity.Reason) { - filter.$filter.contains.Reason = entity.Reason; - } - if (entity.Description) { - filter.$filter.contains.Description = entity.Description; - } - if (entity.Company) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.PaymentRecordDirection) { - filter.$filter.equals.PaymentRecordDirection = entity.PaymentRecordDirection; - } - if (entity.PaymentStatus) { - filter.$filter.equals.PaymentStatus = entity.PaymentStatus; - } - if (entity.PaymentType) { - filter.$filter.equals.PaymentType = entity.PaymentType; - } - if (entity.UUID) { - filter.$filter.contains.UUID = entity.UUID; - } - if (entity.Reference) { - filter.$filter.contains.Reference = entity.Reference; - } - if (entity.Deleted) { - filter.$filter.equals.Deleted = entity.Deleted; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - $scope.cancel(); - }; - - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { + }, + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.DateFrom) { + filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; + } + if (entity.DateTo) { + filter.$filter.lessThanOrEqual.Date = entity.DateTo; + } + if (entity.ValorFrom) { + filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; + } + if (entity.ValorTo) { + filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; + } + if (entity.CompanyIBAN) { + filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; + } + if (entity.CounterpartyIBAN) { + filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; + } + if (entity.CounterpartyName) { + filter.$filter.contains.CounterpartyName = entity.CounterpartyName; + } + if (entity.Amount) { + filter.$filter.equals.Amount = entity.Amount; + } + if (entity.Currency) { + filter.$filter.equals.Currency = entity.Currency; + } + if (entity.Reason) { + filter.$filter.contains.Reason = entity.Reason; + } + if (entity.Description) { + filter.$filter.contains.Description = entity.Description; + } + if (entity.Company) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.PaymentRecordDirection) { + filter.$filter.equals.PaymentRecordDirection = entity.PaymentRecordDirection; + } + if (entity.PaymentStatus) { + filter.$filter.equals.PaymentStatus = entity.PaymentStatus; + } + if (entity.PaymentType) { + filter.$filter.equals.PaymentType = entity.PaymentType; + } + if (entity.UUID) { + filter.$filter.contains.UUID = entity.UUID; + } + if (entity.Reference) { + filter.$filter.contains.Reference = entity.Reference; + } + if (entity.Deleted) { + filter.$filter.equals.Deleted = entity.Deleted; + } + Dialogs.postMessage({ topic: 'codbex-payments.PaymentRecord.PaymentRecord.entitySearch', data: { + entity: entity, + filter: filter + } }); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("PaymentRecord-Report-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'PaymentRecord-Report-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/index.html index 62bd9b8..184bf97 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/index.html @@ -2,336 +2,311 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- From Date + From Date
- - + - - Incorrect Input - + +
- To Date + To Date
- - + - - Incorrect Input - + +
-
- + +
- From Valor + From Valor
- - + - - Incorrect Input - + +
- To Valor + To Valor
- - + - - Incorrect Input - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - Incorrect Input - + +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - Incorrect Input - + +
-
- + +
- Description + Description
- - + - - Incorrect Input - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- PaymentRecordDirection + PaymentRecordDirection
- - + placeholder="Search PaymentRecordDirection ..." + btn-aria-label="show/hide PaymentRecordDirection options" list-aria-label="PaymentRecordDirection options"> +
-
- + +
- PaymentStatus + PaymentStatus
- - + placeholder="Search PaymentStatus ..." + btn-aria-label="show/hide PaymentStatus options" list-aria-label="PaymentStatus options"> +
-
- + +
- PaymentType + PaymentType
- - + placeholder="Search PaymentType ..." + btn-aria-label="show/hide PaymentType options" list-aria-label="PaymentType options"> +
-
- + +
- UUID + UUID
- - + - - Incorrect Input - + +
-
- + +
- Reference + Reference
- - + - - Incorrect Input - + +
-
- + +
- - - Deleted + + Deleted
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.extension index f7f146d..acde21e 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.js index b50d6ba..4d4ae98 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecord-Report-filter", - label: "PaymentRecord Rerport Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/index.html", - perspectiveName: "Reports" + id: 'PaymentRecord-Report-filter', + label: 'PaymentRecord Report Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-filter/index.html', + perspectiveName: 'Reports' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js index e21646b..676bc59 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js @@ -1,12 +1,9 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Reports.PaymentRecord'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', 'ViewParameters', function ($scope, messageHub, entityApi, ViewParameters) { - + .controller('PageController', ($scope, EntityService, ViewParameters) => { + const Dialogs = new DialogHub(); let params = ViewParameters.get(); if (Object.keys(params).length) { const filterEntity = params.filterEntity ?? {}; @@ -89,22 +86,17 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsPaymentType = params.optionsPaymentType; } - $scope.loadPage = function (filter) { + $scope.loadPage = (filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } let request; if (filter) { - request = entityApi.search(filter); + request = EntityService.search(filter); } else { - request = entityApi.list(); + request = EntityService.list(); } - request.then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecord", `Unable to list/filter PaymentRecord: '${response.message}'`); - return; - } - + request.then((response) => { response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -117,13 +109,20 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.data = response.data; setTimeout(() => { window.print(); - }, 250); - }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecord', + message: `Unable to list/filter PaymentRecord: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); }; $scope.loadPage($scope.filter); - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -131,7 +130,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -139,7 +138,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentRecordDirectionValue = function (optionKey) { + $scope.optionsPaymentRecordDirectionValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentRecordDirection.length; i++) { if ($scope.optionsPaymentRecordDirection[i].value === optionKey) { return $scope.optionsPaymentRecordDirection[i].text; @@ -147,7 +146,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentStatusValue = function (optionKey) { + $scope.optionsPaymentStatusValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentStatus.length; i++) { if ($scope.optionsPaymentStatus[i].value === optionKey) { return $scope.optionsPaymentStatus[i].text; @@ -155,7 +154,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsPaymentTypeValue = function (optionKey) { + $scope.optionsPaymentTypeValue = (optionKey) => { for (let i = 0; i < $scope.optionsPaymentType.length; i++) { if ($scope.optionsPaymentType[i].value === optionKey) { return $scope.optionsPaymentType[i].text; @@ -164,7 +163,6 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; window.onafterprint = () => { - messageHub.closeDialogWindow("codbex-payments-Reports-PaymentRecord-print"); + Dialogs.closeWindow({ path: viewData.path }); } - - }]); + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html index b270f88..1aa61f7 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html @@ -2,77 +2,76 @@ - - + - - - - - + + + + + + - - PaymentRecord Report - - - - - - - - - - - - - - - - - - - - - + + PaymentRecord Report + + +
DateValorCompanyIBANCounterpartyIBANCounterpartyNameAmountCurrencyReasonDescriptionCompanyPaymentRecordDirectionPaymentStatusPaymentTypeUUIDReferenceDeleted
+ + + + + + + + + + + + + + + + + + - - - + + + - - + - - - - - - - - - - - - - - - + + + + + + + + + + + + +
DateValorCompanyIBANCounterpartyIBANCounterpartyNameAmountCurrencyReasonDescriptionCompanyPaymentRecordDirectionPaymentStatusPaymentTypeUUIDReferenceDeleted
No data available.
No data available.
- +
+ - + + {{next.CompanyIBAN}}{{next.CounterpartyIBAN}}{{next.CounterpartyName}}{{next.Amount}}{{optionsCurrencyValue(next.Currency)}}{{next.Reason}}{{next.Description}}{{optionsCompanyValue(next.Company)}}{{optionsPaymentRecordDirectionValue(next.PaymentRecordDirection)}}{{optionsPaymentStatusValue(next.PaymentStatus)}}{{optionsPaymentTypeValue(next.PaymentType)}}{{next.UUID}}{{next.Reference}} - - + {{next.CompanyIBAN}}{{next.CounterpartyIBAN}}{{next.CounterpartyName}}{{next.Amount}}{{optionsCurrencyValue(next.Currency)}}{{next.Reason}}{{next.Description}}{{optionsCompanyValue(next.Company)}}{{optionsPaymentRecordDirectionValue(next.PaymentRecordDirection)}}{{optionsPaymentStatusValue(next.PaymentStatus)}}{{optionsPaymentTypeValue(next.PaymentType)}}{{next.UUID}}{{next.Reference}} + +
-
+ + diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/print.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/print.js index c94afcd..8ad1a4e 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/print.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/print.js @@ -1,15 +1,12 @@ const viewData = { id: 'codbex-payments-Reports-PaymentRecord-print', label: 'Print', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html', perspective: 'Reports', view: 'PaymentRecord', type: 'page', order: 10 }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js index 7b990a7..d11b00c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js @@ -1,24 +1,21 @@ -angular.module('page', ["ideUI", "ideView"]) - .controller('PageController', ['$scope', 'ViewParameters', function ($scope, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + $scope.entity = {}; - $scope.entity = {}; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + $scope.action = 'select'; - let params = ViewParameters.get(); - if (Object.keys(params).length) { - $scope.action = "select";; - - if (params.entity.Date) { - params.entity.Date = new Date(params.entity.Date); - } - if (params.entity.Valor) { - params.entity.Valor = new Date(params.entity.Valor); - } - $scope.entity = params.entity; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; - $scope.optionsPaymentRecordDirection = params.optionsPaymentRecordDirection; - $scope.optionsPaymentStatus = params.optionsPaymentStatus; - $scope.optionsPaymentType = params.optionsPaymentType; + if (params.entity.Date) { + params.entity.Date = new Date(params.entity.Date); } - - }]); \ No newline at end of file + if (params.entity.Valor) { + params.entity.Valor = new Date(params.entity.Valor); + } + $scope.entity = params.entity; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + $scope.optionsPaymentRecordDirection = params.optionsPaymentRecordDirection; + $scope.optionsPaymentStatus = params.optionsPaymentStatus; + $scope.optionsPaymentType = params.optionsPaymentType; + } +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html index 27e76e5..39d0bd1 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html @@ -2,264 +2,259 @@ - - + - - - - - + + + + + - - - - - - - + + + + +
- Date + Date
- - +
-
- + +
- Valor + Valor
- - +
-
- + +
- CompanyIBAN + CompanyIBAN
- - +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - +
-
- + +
- CounterpartyName + CounterpartyName
- - +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - +
-
- + +
- Description + Description
- - +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- PaymentRecordDirection + PaymentRecordDirection
- - + placeholder="Search PaymentRecordDirection ..." + btn-aria-label="show/hide PaymentRecordDirection options" list-aria-label="PaymentRecordDirection options"> +
-
- + +
- PaymentStatus + PaymentStatus
- - + placeholder="Search PaymentStatus ..." + btn-aria-label="show/hide PaymentStatus options" list-aria-label="PaymentStatus options"> +
-
- + +
- PaymentType + PaymentType
- - + placeholder="Search PaymentType ..." + btn-aria-label="show/hide PaymentType options" list-aria-label="PaymentType options"> +
-
- + +
- UUID + UUID
- - +
-
- + +
- Reference + Reference
- - +
-
- + +
- - Deleted + + Deleted
-
-
-
-
+ + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.extension index 093df10..f2a28ad 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.js index 5f45a75..bcf0303 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecord-Report-details", - label: "PaymentRecord Report", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html", - perspectiveName: "Reports" + id: 'PaymentRecord-Report-details', + label: 'PaymentRecord Report', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html', + perspectiveName: 'Reports' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html index d28baa7..1de353c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html @@ -2,114 +2,109 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - + + + Items + + + + - - - - - - - - - - - - - - - - - - - - - + +
DateValorCompanyIBANCounterpartyIBANCounterpartyNameAmountCurrencyReasonDescriptionCompanyPaymentRecordDirectionPaymentStatusPaymentTypeUUIDReferenceDeleted
+ + + + + + + + + + + + + + + + + + + - - - + + + - - + - - - - - - + + + + - - - + + - - - - - - + + -
DateValorCompanyIBANCounterpartyIBANCounterpartyNameAmountCurrencyReasonDescriptionCompanyPaymentRecordDirectionPaymentStatusPaymentTypeUUIDReferenceDeleted
No data available.
No data available.
- +
+ - + + {{next.CompanyIBAN}}{{next.CounterpartyIBAN}}{{next.CounterpartyName}}{{next.Amount}} + {{next.CompanyIBAN}}{{next.CounterpartyIBAN}}{{next.CounterpartyName}}{{next.Amount}} {{optionsCurrencyValue(next.Currency)}} {{next.Reason}}{{next.Description}} + {{next.Reason}}{{next.Description}} {{optionsCompanyValue(next.Company)}} + {{optionsPaymentRecordDirectionValue(next.PaymentRecordDirection)}} + {{optionsPaymentStatusValue(next.PaymentStatus)}} + {{optionsPaymentTypeValue(next.PaymentType)}} {{next.UUID}}{{next.Reference}} - - + {{next.UUID}}{{next.Reference}} + + - - - - - - - - - - - - + + + + + + + + + + + +
-
+ - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile-portal.extension deleted file mode 100644 index df620aa..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.extension b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.extension deleted file mode 100644 index 014fe97..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.js deleted file mode 100644 index 3b289c3..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "Reports", - name: "PaymentRecord Report", - caption: "Report for entity PaymentRecord", - tooltip: "PaymentRecord", - type: "PRIMARY", - report: "true", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/Reports/index.html", - order: "100", - groupOrder: "999" - }; -}; diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.extension b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.extension index 1a26fe7..0375a5c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-reports", "description": "codbex-payments - Application View", "role": "codbex-payments.PaymentRecord.PaymentRecordReadOnly" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.js index 676fa87..266b99c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecordReport", - label: "PaymentRecord Report", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html", - perspectiveName: "Reports" + id: 'PaymentRecordReport', + label: 'PaymentRecord Report', + region: 'center', + lazyLoad: true, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html', + perspectiveName: 'Reports' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/index.html deleted file mode 100644 index 0ce7142..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - {{state.busyText}} - - - Encounterd an error while loading - - - - - - - diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/Reports/perspective-portal.extension deleted file mode 100644 index da5a63c..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Reports/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - Reports" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/perspective.extension b/codbex-payments/gen/codbex-payments/ui/Reports/perspective.extension deleted file mode 100644 index 6f9dcb7..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/perspective.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Reports/perspective.js", - "extensionPoint": "codbex-payments", - "description": "codbex-payments - Perspective - Reports" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/perspective.js b/codbex-payments/gen/codbex-payments/ui/Reports/perspective.js deleted file mode 100644 index 53fc0b4..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Reports/perspective.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -const perspectiveData = { - id: 'Reports', - name: 'Reports', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/Reports/index.html', - order: 999, - icon: '/services/web/resources/unicons/dashboard.svg' -}; - -if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/controller.js index d244803..d4a555c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/controller.js @@ -1,42 +1,38 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentRecordDirection'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', 'Extensions', function ($scope, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataLimit = 20; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "Settings" && e.view === "PaymentRecordDirection" && (e.type === "page" || e.type === undefined)); - $scope.entityActions = response.filter(e => e.perspective === "Settings" && e.view === "PaymentRecordDirection" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'PaymentRecordDirection' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'PaymentRecordDirection' && e.type === 'entity'); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -48,34 +44,28 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) resetPagination(); //-----------------Events-------------------// - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentRecordDirection.entityCreated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentRecordDirection.entityUpdated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentRecordDirection.entitySearch', handler: (data) => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } $scope.dataPage = pageNumber; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecordDirection", `Unable to count PaymentRecordDirection: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } let offset = (pageNumber - 1) * $scope.dataLimit; let limit = $scope.dataLimit; @@ -83,81 +73,109 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) if (filter) { filter.$offset = offset; filter.$limit = limit; - request = entityApi.search(filter); + request = EntityService.search(filter); } else { - request = entityApi.list(offset, limit); + request = EntityService.list(offset, limit); } - request.then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentRecordDirection", `Unable to list/filter PaymentRecordDirection: '${response.message}'`); - return; - } + request.then((response) => { $scope.data = response.data; + }, (error) => { + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to list/filter PaymentRecordDirection: '${error.message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to count PaymentRecordDirection: '${error.message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; }; - $scope.openDetails = function (entity) { + $scope.openDetails = (entity) => { $scope.selectedEntity = entity; - messageHub.showDialogWindow("PaymentRecordDirection-details", { - action: "select", - entity: entity, + Dialogs.showWindow({ + id: 'PaymentRecordDirection-details', + params: { + action: 'select', + entity: entity, + }, + closeButton: true, }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("PaymentRecordDirection-filter", { - entity: $scope.filterEntity, + $scope.openFilter = (entity) => { + Dialogs.showWindow({ + id: 'PaymentRecordDirection-details', + params: { + entity: $scope.filterEntity, + }, + closeButton: true, }); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - messageHub.showDialogWindow("PaymentRecordDirection-details", { - action: "create", - entity: {}, - }, null, false); + Dialogs.showWindow({ + id: 'PaymentRecordDirection-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false, + }); }; - $scope.updateEntity = function (entity) { - messageHub.showDialogWindow("PaymentRecordDirection-details", { - action: "update", - entity: entity, - }, null, false); + $scope.updateEntity = (entity) => { + Dialogs.showWindow({ + id: 'PaymentRecordDirection-details', + params: { + action: 'update', + entity: entity, + }, + closeButton: false, + }); }; - $scope.deleteEntity = function (entity) { + $scope.deleteEntity = (entity) => { let id = entity.Id; - messageHub.showDialogAsync( - 'Delete PaymentRecordDirection?', - `Are you sure you want to delete PaymentRecordDirection? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", - }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("PaymentRecordDirection", `Unable to delete PaymentRecordDirection: '${response.message}'`); - return; - } + Dialog.showDialog({ + title: 'Delete PaymentRecordDirection?', + message: `Are you sure you want to delete PaymentRecordDirection? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', + }] + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then((response) => { $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.Settings.PaymentRecordDirection.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: `Unable to delete PaymentRecordDirection: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - }]); + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/controller.js index 1114b38..728f5c7 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/controller.js @@ -1,65 +1,69 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentRecordDirection'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - } + let params = ViewParameters.get(); + if (Object.keys(params).length) { + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { + }, + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - $scope.cancel(); + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentRecordDirection.entitySearch', data: { + entity: entity, + filter: filter + }}); + $scope.cancel(); + }; - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("PaymentRecordDirection-filter"); - }; + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'PaymentRecordDirection-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/index.html index 69c5d15..628d28c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/index.html @@ -2,68 +2,57 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + Name
- - + - - Incorrect Input - + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.extension index 34cca3b..4537bff 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.Settings.PaymentRecordDirectionReadOnly,codbex-payments.Settings.PaymentRecordDirectionFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.js index ef21d18..c336a37 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecordDirection-filter", - label: "PaymentRecordDirection Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/index.html", - perspectiveName: "Settings" + id: 'PaymentRecordDirection-filter', + label: 'PaymentRecordDirection Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-filter/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/controller.js index bc1af29..a5a77ed 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentRecordDirection'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentRecordDirectionService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentRecordDirection Details", - create: "Create PaymentRecordDirection", - update: "Update PaymentRecordDirection" + select: 'PaymentRecordDirection Details', + create: 'Create PaymentRecordDirection', + update: 'Update PaymentRecordDirection' }; $scope.action = 'select'; @@ -26,44 +23,64 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.selectedMainEntityId = params.selectedMainEntityId; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create PaymentRecordDirection: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentRecordDirection.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: 'PaymentRecordDirection successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentRecordDirection", "PaymentRecordDirection successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create PaymentRecordDirection: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update PaymentRecordDirection: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentRecordDirection.entityUpdated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentRecordDirection', + message: 'PaymentRecordDirection successfully updated', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentRecordDirection", "PaymentRecordDirection successfully updated"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update PaymentRecordDirection: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("PaymentRecordDirection-details"); + Dialogs.closeWindow({ id: 'PaymentRecordDirection-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/index.html index 47f5bf5..8606e3a 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/index.html @@ -2,69 +2,58 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.extension index 244ac26..22d35ab 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.Settings.PaymentRecordDirectionReadOnly,codbex-payments.Settings.PaymentRecordDirectionFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.js index b7d9c1e..08f3069 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecordDirection-details", - label: "PaymentRecordDirection", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/index.html", - perspectiveName: "Settings" + id: 'PaymentRecordDirection-details', + label: 'PaymentRecordDirection', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/dialog-window/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/index.html index 12c215d..85b2008 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/index.html @@ -2,70 +2,66 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - + + + Items + + + + + - - - - - - + +
Name
+ + + + - - - + + + - - - + +
Name
No data available.
No data available.
{{next.Name}} - - - - - - - - - - - - - - +
{{next.Name}} + + + + + + + + + + + + + +
-
+ - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile-portal.extension deleted file mode 100644 index 4b9fdcb..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.Settings.PaymentRecordDirectionReadOnly,codbex-payments.Settings.PaymentRecordDirectionFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.extension deleted file mode 100644 index e719b72..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.Settings.PaymentRecordDirectionReadOnly,codbex-payments.Settings.PaymentRecordDirectionFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.js deleted file mode 100644 index 1e59ff4..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "PaymentRecordDirection", - caption: "Manage entity PaymentRecordDirection", - tooltip: "PaymentRecordDirection", - type: "SETTING", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/index.html", - order: "100", - groupOrder: "999" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.extension index 31010d4..25393f9 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-settings", "description": "codbex-payments - Application View", "role": "codbex-payments.Settings.PaymentRecordDirectionReadOnly,codbex-payments.Settings.PaymentRecordDirectionFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.js index 9e991d1..8b5d3c5 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentRecordDirection", - label: "PaymentRecordDirection", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/index.html", - perspectiveName: "Settings" + id: 'PaymentRecordDirection', + label: 'PaymentRecordDirection', + region: 'center', + lazyLoad: true, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentRecordDirection/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/controller.js index fa97f50..4468806 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/controller.js @@ -1,42 +1,38 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentStatus'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', 'Extensions', function ($scope, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataLimit = 20; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "Settings" && e.view === "PaymentStatus" && (e.type === "page" || e.type === undefined)); - $scope.entityActions = response.filter(e => e.perspective === "Settings" && e.view === "PaymentStatus" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'PaymentStatus' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'PaymentStatus' && e.type === 'entity'); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -48,34 +44,28 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) resetPagination(); //-----------------Events-------------------// - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentStatus.entityCreated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentStatus.entityUpdated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentStatus.entitySearch', handler: (data) => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } $scope.dataPage = pageNumber; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentStatus", `Unable to count PaymentStatus: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } let offset = (pageNumber - 1) * $scope.dataLimit; let limit = $scope.dataLimit; @@ -83,81 +73,109 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) if (filter) { filter.$offset = offset; filter.$limit = limit; - request = entityApi.search(filter); + request = EntityService.search(filter); } else { - request = entityApi.list(offset, limit); + request = EntityService.list(offset, limit); } - request.then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentStatus", `Unable to list/filter PaymentStatus: '${response.message}'`); - return; - } + request.then((response) => { $scope.data = response.data; + }, (error) => { + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to list/filter PaymentStatus: '${error.message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to count PaymentStatus: '${error.message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; }; - $scope.openDetails = function (entity) { + $scope.openDetails = (entity) => { $scope.selectedEntity = entity; - messageHub.showDialogWindow("PaymentStatus-details", { - action: "select", - entity: entity, + Dialogs.showWindow({ + id: 'PaymentStatus-details', + params: { + action: 'select', + entity: entity, + }, + closeButton: true, }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("PaymentStatus-filter", { - entity: $scope.filterEntity, + $scope.openFilter = (entity) => { + Dialogs.showWindow({ + id: 'PaymentStatus-details', + params: { + entity: $scope.filterEntity, + }, + closeButton: true, }); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - messageHub.showDialogWindow("PaymentStatus-details", { - action: "create", - entity: {}, - }, null, false); + Dialogs.showWindow({ + id: 'PaymentStatus-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false, + }); }; - $scope.updateEntity = function (entity) { - messageHub.showDialogWindow("PaymentStatus-details", { - action: "update", - entity: entity, - }, null, false); + $scope.updateEntity = (entity) => { + Dialogs.showWindow({ + id: 'PaymentStatus-details', + params: { + action: 'update', + entity: entity, + }, + closeButton: false, + }); }; - $scope.deleteEntity = function (entity) { + $scope.deleteEntity = (entity) => { let id = entity.Id; - messageHub.showDialogAsync( - 'Delete PaymentStatus?', - `Are you sure you want to delete PaymentStatus? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", - }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("PaymentStatus", `Unable to delete PaymentStatus: '${response.message}'`); - return; - } + Dialog.showDialog({ + title: 'Delete PaymentStatus?', + message: `Are you sure you want to delete PaymentStatus? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', + }] + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then((response) => { $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.Settings.PaymentStatus.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentStatus', + message: `Unable to delete PaymentStatus: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - }]); + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/controller.js index 1250be7..83e470a 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/controller.js @@ -1,65 +1,69 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentStatus'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - } + let params = ViewParameters.get(); + if (Object.keys(params).length) { + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { + }, + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - $scope.cancel(); + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentStatus.entitySearch', data: { + entity: entity, + filter: filter + }}); + $scope.cancel(); + }; - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("PaymentStatus-filter"); - }; + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'PaymentStatus-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/index.html index d254ee0..79d18ea 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/index.html @@ -2,68 +2,57 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + Name
- - + - - Incorrect Input - + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.extension index b6ba135..f075746 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.Settings.PaymentStatusReadOnly,codbex-payments.Settings.PaymentStatusFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.js index 8676639..ebb5c54 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentStatus-filter", - label: "PaymentStatus Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/index.html", - perspectiveName: "Settings" + id: 'PaymentStatus-filter', + label: 'PaymentStatus Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-filter/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/controller.js index b2d11b0..da80765 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentStatus'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentStatusService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentStatus Details", - create: "Create PaymentStatus", - update: "Update PaymentStatus" + select: 'PaymentStatus Details', + create: 'Create PaymentStatus', + update: 'Update PaymentStatus' }; $scope.action = 'select'; @@ -26,44 +23,64 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.selectedMainEntityId = params.selectedMainEntityId; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create PaymentStatus: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentStatus.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentStatus', + message: 'PaymentStatus successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentStatus", "PaymentStatus successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create PaymentStatus: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update PaymentStatus: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentStatus.entityUpdated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentStatus', + message: 'PaymentStatus successfully updated', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentStatus", "PaymentStatus successfully updated"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update PaymentStatus: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("PaymentStatus-details"); + Dialogs.closeWindow({ id: 'PaymentStatus-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/index.html index 47f5bf5..8606e3a 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/index.html @@ -2,69 +2,58 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.extension index ec75995..8130ba4 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.Settings.PaymentStatusReadOnly,codbex-payments.Settings.PaymentStatusFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.js index b5fce37..0d1288c 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentStatus-details", - label: "PaymentStatus", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/index.html", - perspectiveName: "Settings" + id: 'PaymentStatus-details', + label: 'PaymentStatus', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/dialog-window/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/index.html index 12c215d..85b2008 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/index.html @@ -2,70 +2,66 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - + + + Items + + + + + - - - - - - + +
Name
+ + + + - - - + + + - - - + +
Name
No data available.
No data available.
{{next.Name}} - - - - - - - - - - - - - - +
{{next.Name}} + + + + + + + + + + + + + +
-
+ - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile-portal.extension deleted file mode 100644 index b540724..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.Settings.PaymentStatusReadOnly,codbex-payments.Settings.PaymentStatusFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.extension deleted file mode 100644 index 1823a11..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.Settings.PaymentStatusReadOnly,codbex-payments.Settings.PaymentStatusFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.js deleted file mode 100644 index 5416bff..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "PaymentStatus", - caption: "Manage entity PaymentStatus", - tooltip: "PaymentStatus", - type: "SETTING", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/index.html", - order: "100", - groupOrder: "999" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.extension index 01aea08..084aa66 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-settings", "description": "codbex-payments - Application View", "role": "codbex-payments.Settings.PaymentStatusReadOnly,codbex-payments.Settings.PaymentStatusFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.js index 24159c7..7d3df24 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentStatus", - label: "PaymentStatus", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/index.html", - perspectiveName: "Settings" + id: 'PaymentStatus', + label: 'PaymentStatus', + region: 'center', + lazyLoad: true, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentStatus/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js index eba7e18..cc065c4 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js @@ -1,42 +1,38 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentType'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', 'Extensions', function ($scope, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataLimit = 20; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "Settings" && e.view === "PaymentType" && (e.type === "page" || e.type === undefined)); - $scope.entityActions = response.filter(e => e.perspective === "Settings" && e.view === "PaymentType" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'PaymentType' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'PaymentType' && e.type === 'entity'); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -48,34 +44,28 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) resetPagination(); //-----------------Events-------------------// - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentType.entityCreated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentType.entityUpdated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.Settings.PaymentType.entitySearch', handler: (data) => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } $scope.dataPage = pageNumber; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentType", `Unable to count PaymentType: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } let offset = (pageNumber - 1) * $scope.dataLimit; let limit = $scope.dataLimit; @@ -83,81 +73,109 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) if (filter) { filter.$offset = offset; filter.$limit = limit; - request = entityApi.search(filter); + request = EntityService.search(filter); } else { - request = entityApi.list(offset, limit); + request = EntityService.list(offset, limit); } - request.then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("PaymentType", `Unable to list/filter PaymentType: '${response.message}'`); - return; - } + request.then((response) => { $scope.data = response.data; + }, (error) => { + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to list/filter PaymentType: '${error.message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to count PaymentType: '${error.message}'`, + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; }; - $scope.openDetails = function (entity) { + $scope.openDetails = (entity) => { $scope.selectedEntity = entity; - messageHub.showDialogWindow("PaymentType-details", { - action: "select", - entity: entity, + Dialogs.showWindow({ + id: 'PaymentType-details', + params: { + action: 'select', + entity: entity, + }, + closeButton: true, }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("PaymentType-filter", { - entity: $scope.filterEntity, + $scope.openFilter = (entity) => { + Dialogs.showWindow({ + id: 'PaymentType-details', + params: { + entity: $scope.filterEntity, + }, + closeButton: true, }); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - messageHub.showDialogWindow("PaymentType-details", { - action: "create", - entity: {}, - }, null, false); + Dialogs.showWindow({ + id: 'PaymentType-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false, + }); }; - $scope.updateEntity = function (entity) { - messageHub.showDialogWindow("PaymentType-details", { - action: "update", - entity: entity, - }, null, false); + $scope.updateEntity = (entity) => { + Dialogs.showWindow({ + id: 'PaymentType-details', + params: { + action: 'update', + entity: entity, + }, + closeButton: false, + }); }; - $scope.deleteEntity = function (entity) { + $scope.deleteEntity = (entity) => { let id = entity.Id; - messageHub.showDialogAsync( - 'Delete PaymentType?', - `Are you sure you want to delete PaymentType? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", - }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("PaymentType", `Unable to delete PaymentType: '${response.message}'`); - return; - } + Dialog.showDialog({ + title: 'Delete PaymentType?', + message: `Are you sure you want to delete PaymentType? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', + }] + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then((response) => { $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.Settings.PaymentType.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'PaymentType', + message: `Unable to delete PaymentType: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - }]); + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/controller.js index a721203..aae50de 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/controller.js @@ -1,65 +1,69 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentType'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - } + let params = ViewParameters.get(); + if (Object.keys(params).length) { + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { + }, + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - $scope.cancel(); + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentType.entitySearch', data: { + entity: entity, + filter: filter + }}); + $scope.cancel(); + }; - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("PaymentType-filter"); - }; + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'PaymentType-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/index.html index a528e3d..19bb8d9 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/index.html @@ -2,68 +2,57 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + Name
- - + - - Incorrect Input - + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.extension index a16eafe..5f99390 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.Settings.PaymentTypeReadOnly,codbex-payments.Settings.PaymentTypeFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.js index 2bbcba8..3653241 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentType-filter", - label: "PaymentType Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/index.html", - perspectiveName: "Settings" + id: 'PaymentType-filter', + label: 'PaymentType Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-filter/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js index 2a6ce59..84443b5 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.Settings.PaymentType'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "PaymentType Details", - create: "Create PaymentType", - update: "Update PaymentType" + select: 'PaymentType Details', + create: 'Create PaymentType', + update: 'Update PaymentType' }; $scope.action = 'select'; @@ -26,44 +23,64 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.selectedMainEntityId = params.selectedMainEntityId; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create PaymentType: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentType.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentType', + message: 'PaymentType successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentType", "PaymentType successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create PaymentType: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update PaymentType: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.Settings.PaymentType.entityUpdated', data: response.data }); + Dialogs.showAlert({ + title: 'PaymentType', + message: 'PaymentType successfully updated', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("PaymentType", "PaymentType successfully updated"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update PaymentType: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("PaymentType-details"); + Dialogs.closeWindow({ id: 'PaymentType-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/index.html index 47f5bf5..8606e3a 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/index.html @@ -2,69 +2,58 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.extension index b5bf966..1672f4d 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.Settings.PaymentTypeReadOnly,codbex-payments.Settings.PaymentTypeFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.js index 34b059d..127b8f4 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentType-details", - label: "PaymentType", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/index.html", - perspectiveName: "Settings" + id: 'PaymentType-details', + label: 'PaymentType', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/index.html index 12c215d..85b2008 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/index.html +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/index.html @@ -2,70 +2,66 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - + + + Items + + + + + - - - - - - + +
Name
+ + + + - - - + + + - - - + +
Name
No data available.
No data available.
{{next.Name}} - - - - - - - - - - - - - - +
{{next.Name}} + + + + + + + + + + + + + +
-
+ - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile-portal.extension deleted file mode 100644 index b75b19b..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.Settings.PaymentTypeReadOnly,codbex-payments.Settings.PaymentTypeFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.extension deleted file mode 100644 index 2e8a1ce..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.Settings.PaymentTypeReadOnly,codbex-payments.Settings.PaymentTypeFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.js deleted file mode 100644 index eb7ca73..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "PaymentType", - caption: "Manage entity PaymentType", - tooltip: "PaymentType", - type: "SETTING", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/index.html", - order: "100", - groupOrder: "999" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.extension b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.extension index 115291d..46e6d11 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-settings", "description": "codbex-payments - Application View", "role": "codbex-payments.Settings.PaymentTypeReadOnly,codbex-payments.Settings.PaymentTypeFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.js index 77e3863..e2c2ee5 100644 --- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.js +++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "PaymentType", - label: "PaymentType", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/index.html", - perspectiveName: "Settings" + id: 'PaymentType', + label: 'PaymentType', + region: 'center', + lazyLoad: true, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/index.html', + perspectiveName: 'Settings' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/index.html b/codbex-payments/gen/codbex-payments/ui/Settings/index.html deleted file mode 100644 index b69f160..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - {{state.busyText}} - - - Encounterd an error while loading - - - - - - - diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/Settings/perspective-portal.extension deleted file mode 100644 index 53317e7..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - Settings" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/perspective.extension b/codbex-payments/gen/codbex-payments/ui/Settings/perspective.extension deleted file mode 100644 index d0e31ad..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/perspective.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/Settings/perspective.js", - "extensionPoint": "codbex-payments", - "description": "codbex-payments - Perspective - Settings" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/perspective.js b/codbex-payments/gen/codbex-payments/ui/Settings/perspective.js deleted file mode 100644 index 828dbb7..0000000 --- a/codbex-payments/gen/codbex-payments/ui/Settings/perspective.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -const perspectiveData = { - id: 'Settings', - name: 'Settings', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/Settings/index.html', - order: '999', - icon: '/services/web/resources/unicons/wrench.svg' -}; - -if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js index 8ef7d2c..23bc433 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js @@ -1,31 +1,27 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.SupplierPayment.SupplierPayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { - + .controller('PageController', ($scope, $http, EntityService, Extensions, ButtonStates) => { + const Dialogs = new DialogHub(); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "SupplierPayment" && e.view === "SupplierPayment" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'SupplierPayment' && e.view === 'SupplierPayment' && (e.type === 'page' || e.type === undefined)); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +38,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entitySearch', handler: () => { resetPagination(); - $scope.filter = msg.data.filter; - $scope.filterEntity = msg.data.entity; + $scope.filter = data.filter; + $scope.filterEntity = data.entity; $scope.loadPage($scope.dataPage, $scope.filter); - }); + }}); //-----------------Events-------------------// - $scope.loadPage = function (pageNumber, filter) { + $scope.loadPage = (pageNumber, filter) => { if (!filter && $scope.filter) { filter = $scope.filter; } @@ -75,13 +68,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("SupplierPayment", `Unable to count SupplierPayment: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } $scope.dataPages = Math.ceil($scope.dataCount / $scope.dataLimit); filter.$offset = ($scope.dataPage - 1) * $scope.dataLimit; @@ -91,16 +80,11 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter.$limit = $scope.dataPage * $scope.dataLimit; } - entityApi.search(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("SupplierPayment", `Unable to list/filter SupplierPayment: '${response.message}'`); - return; - } + EntityService.search(filter).then((response) => { if ($scope.data == null || $scope.dataReset) { $scope.data = []; $scope.dataReset = false; } - response.data.forEach(e => { if (e.Date) { e.Date = new Date(e.Date); @@ -112,80 +96,102 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.data = $scope.data.concat(response.data); $scope.dataPage++; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'SupplierPayment', + message: `Unable to list/filter SupplierPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'SupplierPayment', + message: `Unable to count SupplierPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; $scope.loadPage($scope.dataPage, $scope.filter); - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; - messageHub.postMessage("entitySelected", { + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsSupplier: $scope.optionsSupplier, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.createEntity', data: { entity: {}, optionsSupplier: $scope.optionsSupplier, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.updateEntity', data: { entity: $scope.selectedEntity, optionsSupplier: $scope.optionsSupplier, optionsCurrency: $scope.optionsCurrency, optionsCompany: $scope.optionsCompany, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete SupplierPayment?', - `Are you sure you want to delete SupplierPayment? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: 'Delete SupplierPayment?', + message: `Are you sure you want to delete SupplierPayment? This action cannot be undone.`, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: 'Yes', + }, { + id: 'delete-btn-no', + label: 'No', }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("SupplierPayment", `Unable to delete SupplierPayment: '${response.message}'`); - return; - } + closeButton: false + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then(() => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-payments.SupplierPayment.SupplierPayment.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'SupplierPayment', + message: `Unable to delete SupplierPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("SupplierPayment-filter", { - entity: $scope.filterEntity, - optionsSupplier: $scope.optionsSupplier, - optionsCurrency: $scope.optionsCurrency, - optionsCompany: $scope.optionsCompany, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'SupplierPayment-filter', + params: { + entity: $scope.filterEntity, + optionsSupplier: $scope.optionsSupplier, + optionsCurrency: $scope.optionsCurrency, + optionsCompany: $scope.optionsCompany, + }, }); }; @@ -195,34 +201,52 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsCompany = []; - $http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts").then(function (response) { - $scope.optionsSupplier = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts').then((response) => { + $scope.optionsSupplier = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Supplier', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.optionsSupplierValue = function (optionKey) { + $scope.optionsSupplierValue = (optionKey) => { for (let i = 0; i < $scope.optionsSupplier.length; i++) { if ($scope.optionsSupplier[i].value === optionKey) { return $scope.optionsSupplier[i].text; @@ -230,7 +254,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCurrencyValue = function (optionKey) { + $scope.optionsCurrencyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCurrency.length; i++) { if ($scope.optionsCurrency[i].value === optionKey) { return $scope.optionsCurrency[i].text; @@ -238,7 +262,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsCompanyValue = function (optionKey) { + $scope.optionsCompanyValue = (optionKey) => { for (let i = 0; i < $scope.optionsCompany.length; i++) { if ($scope.optionsCompany[i].value === optionKey) { return $scope.optionsCompany[i].text; @@ -247,5 +271,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js index 7e7f24f..5c794ca 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js @@ -1,126 +1,121 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.SupplierPayment.SupplierPayment'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView']).controller('PageController', ($scope, ViewParameters) => { + const Dialogs = new DialogHub(); + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; - - let params = ViewParameters.get(); - if (Object.keys(params).length) { - if (params?.entity?.DateFrom) { - params.entity.DateFrom = new Date(params.entity.DateFrom); - } - if (params?.entity?.DateTo) { - params.entity.DateTo = new Date(params.entity.DateTo); - } - if (params?.entity?.ValorFrom) { - params.entity.ValorFrom = new Date(params.entity.ValorFrom); - } - if (params?.entity?.ValorTo) { - params.entity.ValorTo = new Date(params.entity.ValorTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsSupplier = params.optionsSupplier; - $scope.optionsCurrency = params.optionsCurrency; - $scope.optionsCompany = params.optionsCompany; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.DateFrom) { + params.entity.DateFrom = new Date(params.entity.DateFrom); + } + if (params?.entity?.DateTo) { + params.entity.DateTo = new Date(params.entity.DateTo); + } + if (params?.entity?.ValorFrom) { + params.entity.ValorFrom = new Date(params.entity.ValorFrom); } + if (params?.entity?.ValorTo) { + params.entity.ValorTo = new Date(params.entity.ValorTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsSupplier = params.optionsSupplier; + $scope.optionsCurrency = params.optionsCurrency; + $scope.optionsCompany = params.optionsCompany; + } - $scope.filter = function () { - let entity = $scope.entity; - const filter = { - $filter: { - equals: { - }, - notEquals: { - }, - contains: { - }, - greaterThan: { - }, - greaterThanOrEqual: { - }, - lessThan: { - }, - lessThanOrEqual: { - } + $scope.filter = () => { + let entity = $scope.entity; + const filter = { + $filter: { + equals: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.Supplier !== undefined) { - filter.$filter.equals.Supplier = entity.Supplier; - } - if (entity.DateFrom) { - filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; - } - if (entity.DateTo) { - filter.$filter.lessThanOrEqual.Date = entity.DateTo; - } - if (entity.ValorFrom) { - filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; - } - if (entity.ValorTo) { - filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; - } - if (entity.CompanyIBAN) { - filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; - } - if (entity.CounterpartyIBAN) { - filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; - } - if (entity.CounterpartyName) { - filter.$filter.contains.CounterpartyName = entity.CounterpartyName; - } - if (entity.Amount !== undefined) { - filter.$filter.equals.Amount = entity.Amount; - } - if (entity.Currency !== undefined) { - filter.$filter.equals.Currency = entity.Currency; - } - if (entity.Reason) { - filter.$filter.contains.Reason = entity.Reason; - } - if (entity.Description) { - filter.$filter.contains.Description = entity.Description; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - if (entity.UUID) { - filter.$filter.contains.UUID = entity.UUID; - } - if (entity.Reference) { - filter.$filter.contains.Reference = entity.Reference; - } - messageHub.postMessage("entitySearch", { - entity: entity, - filter: filter - }); - messageHub.postMessage("clearDetails"); - $scope.cancel(); - }; - - $scope.resetFilter = function () { - $scope.entity = {}; - $scope.filter(); + notEquals: { + }, + contains: { + }, + greaterThan: { + }, + greaterThanOrEqual: { + }, + lessThan: { + }, + lessThanOrEqual: { + } + }, }; + if (entity.Id !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.Supplier !== undefined) { + filter.$filter.equals.Supplier = entity.Supplier; + } + if (entity.DateFrom) { + filter.$filter.greaterThanOrEqual.Date = entity.DateFrom; + } + if (entity.DateTo) { + filter.$filter.lessThanOrEqual.Date = entity.DateTo; + } + if (entity.ValorFrom) { + filter.$filter.greaterThanOrEqual.Valor = entity.ValorFrom; + } + if (entity.ValorTo) { + filter.$filter.lessThanOrEqual.Valor = entity.ValorTo; + } + if (entity.CompanyIBAN) { + filter.$filter.contains.CompanyIBAN = entity.CompanyIBAN; + } + if (entity.CounterpartyIBAN) { + filter.$filter.contains.CounterpartyIBAN = entity.CounterpartyIBAN; + } + if (entity.CounterpartyName) { + filter.$filter.contains.CounterpartyName = entity.CounterpartyName; + } + if (entity.Amount !== undefined) { + filter.$filter.equals.Amount = entity.Amount; + } + if (entity.Currency !== undefined) { + filter.$filter.equals.Currency = entity.Currency; + } + if (entity.Reason) { + filter.$filter.contains.Reason = entity.Reason; + } + if (entity.Description) { + filter.$filter.contains.Description = entity.Description; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + if (entity.UUID) { + filter.$filter.contains.UUID = entity.UUID; + } + if (entity.Reference) { + filter.$filter.contains.Reference = entity.Reference; + } + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-payments.SupplierPayment.SupplierPayment.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("SupplierPayment-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'SupplierPayment-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html index 12006b0..362d7fb 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html @@ -2,317 +2,290 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Supplier + Supplier
- - + placeholder="Search Supplier ..." + btn-aria-label="show/hide Supplier options" list-aria-label="Supplier options"> +
-
- + +
- From Date + From Date
- - + - - Incorrect Input - + +
- To Date + To Date
- - + - - Incorrect Input - + +
-
- + +
- From Valor + From Valor
- - + - - Incorrect Input - + +
- To Valor + To Valor
- - + - - Incorrect Input - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - Incorrect Input - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - Incorrect Input - + +
-
- + +
- Amount + Amount
- - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - Incorrect Input - + +
-
- + +
- Description + Description
- - + - - Incorrect Input - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Name + Name
- - + - - Incorrect Input - + +
-
- + +
- UUID + UUID
- - + - - Incorrect Input - + +
-
- + +
- Reference + Reference
- - + - - Incorrect Input - + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.extension index ebd374e..fafd291 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.js index 18b5b7e..02ef5bf 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/view.js @@ -4,14 +4,11 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "SupplierPayment-filter", - label: "SupplierPayment Filter", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html", - perspectiveName: "SupplierPayment" + id: 'SupplierPayment-filter', + label: 'SupplierPayment Filter', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html', + perspectiveName: 'SupplierPayment' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js index 25231d7..f7c3d41 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js @@ -1,20 +1,17 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.SupplierPayment.SupplierPayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "SupplierPayment Details", - create: "Create SupplierPayment", - update: "Update SupplierPayment" + select: 'SupplierPayment Details', + create: 'Create SupplierPayment', + update: 'Update SupplierPayment' }; $scope.action = 'select'; @@ -35,80 +32,118 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsCompany = params.optionsCompany; } - $scope.create = function () { + $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.create(entity).then(function (response) { - if (response.status != 201) { - $scope.errorMessage = `Unable to create SupplierPayment: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entityCreated', data: response.data }); + Dialogs.showAlert({ + title: 'SupplierPayment', + message: 'SupplierPayment successfully created', + type: AlertTypes.Success + }); $scope.cancel(); - messageHub.showAlertSuccess("SupplierPayment", "SupplierPayment successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to create SupplierPayment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { + $scope.update = () => { let id = $scope.entity.Id; let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; - entityApi.update(id, entity).then(function (response) { - if (response.status != 200) { - $scope.errorMessage = `Unable to update SupplierPayment: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("SupplierPayment", "SupplierPayment successfully updated"); + Dialogs.showAlert({ + title: 'SupplierPayment', + message: 'SupplierPayment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = `Unable to update SupplierPayment: '${message}'`; + }); + console.error('EntityService:', error); }); }; - $scope.serviceSupplier = "/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts"; + $scope.serviceSupplier = '/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts'; $scope.optionsSupplier = []; - $http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts").then(function (response) { - $scope.optionsSupplier = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts').then((response) => { + $scope.optionsSupplier = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Supplier', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); - $scope.cancel = function () { + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; + + $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - messageHub.closeDialogWindow("SupplierPayment-details"); + Dialogs.closeWindow({ id: 'SupplierPayment-details' }); }; - $scope.clearErrorMessage = function () { + $scope.clearErrorMessage = () => { $scope.errorMessage = null; }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html index 2086af1..5ade5b4 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html @@ -2,336 +2,298 @@ - - + - - - - - - + + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Supplier + Supplier
- - - + placeholder="Search Supplier ..." + btn-aria-label="show/hide Supplier options" list-aria-label="Supplier options"> +
-
- + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.extension index c5c55a3..a3f0282 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.extension @@ -1,6 +1,6 @@ { - "module": "{{projectName}}/gen/{{genFolderName}}/ui/{{perspectiveName}}/{{name}}/dialog-window/view.js", - "extensionPoint": "dialog-window", - "description": "{{projectName}} - Application Dialog Window", + "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-payments - Application Dialog Window", "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.js index 773663e..4ad8c71 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/view.js @@ -6,15 +6,12 @@ const viewData = { id: "SupplierPayment-details", label: "SupplierPayment", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html", + path: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html", perspectiveName: "SupplierPayment", roles: [ "codbex-payments.SupplierPayment.SupplierPaymentReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html index eaba1ea..ae16536 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html @@ -2,54 +2,45 @@ - - - - - - - - - + + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + Items + + + + + + + + + + + + + + + + + + + + - - + {{next.Date | date: "dd/MMM/yyyy"}} | {{next.Valor | date: "dd/MMM/yyyy"}} | {{next.CompanyIBAN}} | @@ -63,15 +54,16 @@ {{next.Name}} | {{next.UUID}} | {{next.Reference}} - - - - - - + + + + + + Load More ... - - + + + diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js index 93d7fab..cf8bb22 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js @@ -1,147 +1,177 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.SupplierPayment.SupplierPayment'; +angular.module('page', ['blimpKit', 'platformView', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, EntityService) => { + const Dialogs = new DialogHub(); $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "SupplierPayment Details", - create: "Create SupplierPayment", - update: "Update SupplierPayment" + select: 'SupplierPayment Details', + create: 'Create SupplierPayment', + update: 'Update SupplierPayment' }; $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-payments-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "SupplierPayment" && e.view === "SupplierPayment" && e.type === "entity"); + Extensions.getWindows(['codbex-payments-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'SupplierPayment' && e.view === 'SupplierPayment' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: action.label, + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsSupplier = []; $scope.optionsCurrency = []; $scope.optionsCompany = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsSupplier = msg.data.optionsSupplier; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.entity = data.entity; + $scope.optionsSupplier = data.optionsSupplier; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsSupplier = msg.data.optionsSupplier; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.optionsSupplier = data.optionsSupplier; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.Date) { - msg.data.entity.Date = new Date(msg.data.entity.Date); + }}); + Dialogs.addMessageListener({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.Date) { + data.entity.Date = new Date(data.entity.Date); } - if (msg.data.entity.Valor) { - msg.data.entity.Valor = new Date(msg.data.entity.Valor); + if (data.entity.Valor) { + data.entity.Valor = new Date(data.entity.Valor); } - $scope.entity = msg.data.entity; - $scope.optionsSupplier = msg.data.optionsSupplier; - $scope.optionsCurrency = msg.data.optionsCurrency; - $scope.optionsCompany = msg.data.optionsCompany; + $scope.entity = data.entity; + $scope.optionsSupplier = data.optionsSupplier; + $scope.optionsCurrency = data.optionsCurrency; + $scope.optionsCompany = data.optionsCompany; $scope.action = 'update'; }); - }); + }}); - $scope.serviceSupplier = "/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts"; - $scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts"; - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; + $scope.serviceSupplier = '/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts'; + $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts'; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("SupplierPayment", `Unable to create SupplierPayment: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("SupplierPayment", "SupplierPayment successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.clearDetails' , data: response.data }); + Dialogs.showAlert({ + title: 'SupplierPayment', + message: 'SupplierPayment successfully created', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'SupplierPayment', + message: `Unable to create SupplierPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.update = function () { - entityApi.update($scope.entity.Id, $scope.entity).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("SupplierPayment", `Unable to update SupplierPayment: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("SupplierPayment", "SupplierPayment successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-payments.SupplierPayment.SupplierPayment.clearDetails', data: response.data }); + Dialogs.showAlert({ + title: 'SupplierPayment', + message: 'SupplierPayment successfully updated', + type: AlertTypes.Success + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'SupplierPayment', + message: `Unable to create SupplierPayment: '${message}'`, + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-payments.SupplierPayment.SupplierPayment.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: 'Description', + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.createSupplier = function () { - messageHub.showDialogWindow("Supplier-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createSupplier = () => { + Dialogs.showWindow({ + id: 'Supplier-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createCurrency = function () { - messageHub.showDialogWindow("Currency-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCurrency = () => { + Dialogs.showWindow({ + id: 'Currency-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createCompany = function () { - messageHub.showDialogWindow("Company-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createCompany = () => { + Dialogs.showWindow({ + id: 'Company-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -150,41 +180,57 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $scope.refreshSupplier = function () { + $scope.refreshSupplier = () => { $scope.optionsSupplier = []; - $http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts").then(function (response) { - $scope.optionsSupplier = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierService.ts').then((response) => { + $scope.optionsSupplier = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Supplier', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCurrency = function () { + $scope.refreshCurrency = () => { $scope.optionsCurrency = []; - $http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) { - $scope.optionsCurrency = response.data.map(e => { - return { - value: e.Id, - text: e.Code - } + $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyService.ts').then((response) => { + $scope.optionsCurrency = response.data.map(e => ({ + value: e.Id, + text: e.Code + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Currency', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; - $scope.refreshCompany = function () { + $scope.refreshCompany = () => { $scope.optionsCompany = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) { - $scope.optionsCompany = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts').then((response) => { + $scope.optionsCompany = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Company', + message: `Unable to load data: '${message}'`, + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html index 0021511..d03006d 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html @@ -2,358 +2,315 @@ - - + - - - - - + + + + + + - - - - - + + + + +
- Supplier + Supplier
- - + placeholder="Search Supplier ..." + btn-aria-label="show/hide Supplier options" list-aria-label="Supplier options"> +
-
- - - +
+ +
- - + +
- Date + Date
- - + - - Incorrect Input - - + +
-
- + +
- Valor + Valor
- - + - - Incorrect Input - - + +
-
- + +
- CompanyIBAN + CompanyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyIBAN + CounterpartyIBAN
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- CounterpartyName + CounterpartyName
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Amount + Amount
- - - + placeholder="Enter Amount"> +
-
- + +
- Currency + Currency
- - + placeholder="Search Currency ..." + btn-aria-label="show/hide Currency options" list-aria-label="Currency options"> +
-
- - - +
+ +
- - + +
- Reason + Reason
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Description + Description
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Company + Company
- - + placeholder="Search Company ..." + btn-aria-label="show/hide Company options" list-aria-label="Company options"> +
-
- - - +
+ +
- - + +
- Name + Name
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- UUID + UUID
- - + - - The value doesn't match the required pattern '' - - + +
-
- + +
- Reference + Reference
- - + - - The value doesn't match the required pattern '' - - + +
-
- - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.extension index 50fbe97..62825b4 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View - Main Details", "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.js index 14e85cc..e047a97 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "SupplierPayment-details", - label: "SupplierPayment", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html", - perspectiveName: "SupplierPayment" + id: 'SupplierPayment-details', + label: 'SupplierPayment', + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html', + perspectiveName: 'SupplierPayment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile-portal.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile-portal.extension deleted file mode 100644 index a3dd1a1..0000000 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.extension deleted file mode 100644 index 8b67649..0000000 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.js", - "extensionPoint": "codbex-payments-tile", - "description": "codbex-payments - Application Tile", - "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.js deleted file mode 100644 index 61f2226..0000000 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/tile.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -exports.getTile = function () { - return { - group: "codbex-payments", - name: "SupplierPayment", - caption: "Manage entity SupplierPayment", - tooltip: "SupplierPayment", - type: "PRIMARY", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html", - order: "100", - groupOrder: "20" - }; -} diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.extension index 5ccb416..0ca3eb5 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.extension +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.js", - "extensionPoint": "codbex-payments-view", + "extensionPoint": "application-views", "description": "codbex-payments - Application View", "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.js index b9df67d..4cd15a4 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/view.js @@ -4,16 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "SupplierPayment", - label: "SupplierPayment", - factory: "frame", - region: "left", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html", - perspectiveName: "SupplierPayment" + id: 'SupplierPayment', + label: 'SupplierPayment', + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html', + perspectiveName: 'SupplierPayment' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html index ea14f76..cff8962 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html @@ -10,70 +10,43 @@ - - - + + - - - + + - - - - - - + + + {{state.busyText}} - - - Encounterd an error while loading - - - + + + Encounterd an error while loading + + diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective-portal.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective-portal.extension deleted file mode 100644 index 8fe6cad..0000000 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.js", - "extensionPoint": "portal", - "description": "codbex-payments - Perspective - SupplierPayment" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.extension b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.extension index 9f76498..84354fc 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.extension +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.extension @@ -1,5 +1,5 @@ { "module": "codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.js", - "extensionPoint": "codbex-payments", + "extensionPoint": "application-perspectives", "description": "codbex-payments - Perspective - SupplierPayment" } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.js index 859255a..cf0d5ae 100644 --- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.js +++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/perspective.js @@ -5,14 +5,12 @@ */ const perspectiveData = { id: 'SupplierPayment', - name: 'SupplierPayment', - link: '/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html', - order: '20', + label: 'SupplierPayment', + path: '/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html', + groupId: 'purchasing-navigation-group', + order: 300, icon: '/services/web/resources/unicons/box.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/controller.js b/codbex-payments/gen/codbex-payments/ui/launchpad/Home/controller.js deleted file mode 100644 index ac36b6f..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/controller.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -angular.module('page', ['ideUI', 'ideView', 'entityApi']) - .config(['messageHubProvider', function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-payments.launchpad.Home'; - }]) - .config(['entityApiProvider', function (entityApiProvider) { - entityApiProvider.baseUrl = '/services/js/codbex-payments/gen/codbex-payments/ui/launchpad/Home/tiles.js'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', '$document', function ($scope, messageHub, entityApi, $document) { - const favoritesStoreId = 'DIRIGIBLE.codbex-payments.favorites'; - $scope.state = { - isBusy: true, - error: false, - busyText: 'Loading...', - }; - $scope.modules = []; - $scope.referenceData = []; - $scope.favorites = []; - $scope.hasFavorites = false; - $scope.editMode = false; - $scope.favIcons = { - 'report': 'sap-icon--vertical-bar-chart', - 'entity': 'sap-icon--form', - 'setting': 'sap-icon--settings' - }; - - $scope.openView = function (location, name) { - messageHub.postMessage('openView', { - location: (name ? `${location.substring(0, location.indexOf('/gen/ui/'))}/gen/ui/Reports/index.html?${name}` : location) - }); - }; - - $scope.toggleEditMode = function () { - $scope.editMode = !$scope.editMode; - }; - - function saveFavorites() { - let favorites = []; - for (let i = 0; i < $scope.favorites.length; i++) { - favorites.push($scope.favorites[i].id); - } - localStorage.setItem(favoritesStoreId, JSON.stringify(favorites)); - } - - $scope.removeFavorite = function (pos) { - $scope.favorites.splice(pos, 1); - saveFavorites(); - $scope.hasFavorites = $scope.favorites.length > 0; - if ($scope.favorites.length === 0) $scope.editMode = false; - }; - - $scope.toggleFavorite = function (module, type, name, location, caption) { - const id = `${module}.${type}.${name}`; - if (!$scope.favorites.some((elem, pos) => { - if (elem.id === id) { - $scope.favorites.splice(pos, 1); - return true - } return false; - })) { - $scope.favorites.push({ - id: id, - type: type, - name: name, - location: location, - caption: caption, - }); - } - saveFavorites(); - $scope.hasFavorites = $scope.favorites.length > 0; - }; - - $scope.isFavorite = function (module, type, name) { - const id = `${module}.${type}.${name}`; - if ($scope.favorites.some(e => e.id === id)) { - return true; - } return false; - }; - - entityApi.list().then(function (response) { - if (response.status != 200) { - messageHub.showAlertError('Home', `Unable to get Home Launchpad: '${response.message}'`); - $scope.state.isBusy = false; - $scope.state.error = true; - return; - } - - $scope.modules = response.data.modules.filter(module => (module.name !== 'Reports')); - for (let i = 0; i < response.data.referenceData.length; i++) { - $scope.referenceData.push(...response.data.referenceData[i].settings); - } - - const storedFavorites = JSON.parse(localStorage.getItem(favoritesStoreId) || '[]'); - for (let mi = 0; mi < $scope.modules.length; mi++) { - for (let ei = 0; ei < $scope.modules[mi].entities.length; ei++) { - const id = `${$scope.modules[mi].name}.entity.${$scope.modules[mi].entities[ei].name}`; - const index = storedFavorites.indexOf(id); - if (index > -1) { - storedFavorites[index] = { - id: id, - type: 'entity', - name: $scope.modules[mi].entities[ei].name, - location: $scope.modules[mi].entities[ei].location, - caption: $scope.modules[mi].entities[ei].caption, - }; - } - } - for (let ri = 0; ri < $scope.modules[mi].reports.length; ri++) { - const id = `${$scope.modules[mi].name}.report.${$scope.modules[mi].reports[ri].name}`; - const index = storedFavorites.indexOf(id); - if (index > -1) { - storedFavorites[index] = { - id: id, - type: 'report', - name: $scope.modules[mi].reports[ri].name, - location: $scope.modules[mi].reports[ri].location, - caption: $scope.modules[mi].reports[ri].caption, - }; - } - } - for (let ri = 0; ri < $scope.modules[mi].settings.length; ri++) { - const id = `${$scope.modules[mi].name}.setting.${$scope.modules[mi].settings[ri].name}`; - const index = storedFavorites.indexOf(id); - if (index > -1) { - storedFavorites[index] = { - id: id, - type: 'setting', - name: $scope.modules[mi].settings[ri].name, - location: $scope.modules[mi].settings[ri].location, - caption: $scope.modules[mi].settings[ri].caption, - }; - } - } - } - $scope.favorites = storedFavorites.filter(fav => (typeof fav !== 'string')); - $scope.hasFavorites = $scope.favorites.length > 0; - saveFavorites(); - $scope.state.isBusy = false; - }, function (error) { - console.error(error); - $scope.state.error = true; - }); - - function favoriteOrderChange(evt) { - const elem = $scope.favorites.splice(evt.oldIndex, 1)[0]; - $scope.$apply(function () { - $scope.favorites.splice(evt.newIndex, 0, elem); - }); - saveFavorites(); - } - - angular.element($document[0]).ready(function () { - Sortable.create($document[0].getElementById('favorites'), { - group: { - name: 'favorites', - put: false - }, - animation: 200, - onEnd: favoriteOrderChange, - onMove: () => $scope.editMode - }); - }); - }]); - diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/index.html b/codbex-payments/gen/codbex-payments/ui/launchpad/Home/index.html deleted file mode 100644 index 04d3f19..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/index.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
-
-

Payments Management Application

-
-

Managing payments data

- -
-
General -
-
- - - - - Applications Portal - Central entry point to installed applications - - - - - - - - Process Inbox - Execute user tasks from running processes - - - - - - - - Documents Storage - Browse and manage documents - - - -
- - -
Favorites
- - - -
-
- - - - - - - {{fav.name}} - {{fav.caption}} - - - -
- - -
Modules
- - - - - - - - - - - - -
-
-
-
-
-
- {{::module.name}} -
- - - - - - - -
- - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - -
Entities
No entities -
- {{::entity.name}} - - - -
-
- - - - - - - - - - - - - - - - - -
Reports
No reports -
- {{::report.name}} - - - -
-
-
-
-
-
-
-
-
- - {{state.busyText}} - - - Error while initializing launchpad - - - - diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/styles.css b/codbex-payments/gen/codbex-payments/ui/launchpad/Home/styles.css deleted file mode 100644 index ae6a001..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/styles.css +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -.wrap-list { - align-self: start; - flex-wrap: wrap; - padding-top: 1rem; - padding-bottom: 1rem; -} - -.wrap-list>* { - width: auto; -} - -.fd-card__header:only-child, -.fd-card__header:last-child { - border: none; - border-radius: var(--fdCard_Border_Radius, .25rem); -} - -.card-table-column { - flex: 1 1 0; - width: 0; -} - -.card-table { - max-height: calc(100% - 2.75rem); - min-height: auto; - height: 100%; -} - -.card-table>* { - flex: 1; -} - -.hbox-menu-item:not(:last-child) { - border-bottom: solid 0.0625rem var(--sapGroup_TitleBorderColor, #d9d9d9); -} - -.hbox-menu-item>button { - margin-right: .25rem; -} - -.hbox-menu-item>li { - width: 100%; -} - -.module-header { - height: 2.5rem; - padding: 0 .5rem .25rem; - overflow: visible; -} - -.fd-avatar[dg-size="s"]>i { - font-size: 2rem; -} - -.fd-col { - height: 18rem; - max-width: 100%; - min-width: 100%; -} - -@media (min-width: 1200px) { - .fd-col { - max-width: 50%; - min-width: 50%; - } -} - -@media (min-width: 1600px) { - .fd-col { - max-width: 33.333333333%; - min-width: 33.333333333%; - } -} - -@media (min-width: 2560px) { - .fd-col { - max-width: 25%; - min-width: 25%; - } -} - -@media (min-width: 3000px) { - .fd-col { - max-width: 20%; - min-width: 20%; - } -} - -@media (min-width: 3800px) { - .fd-col { - max-width: 16.666666667%; - min-width: 16.666666667%; - } -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/tiles.js b/codbex-payments/gen/codbex-payments/ui/launchpad/Home/tiles.js deleted file mode 100644 index 6b01b60..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/tiles.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -import { response } from "sdk/http"; -import { extensions } from "sdk/extensions"; -import { user } from "sdk/security"; - -let tiles = {}; - -let tileExtensions = await extensions.loadExtensionModules("codbex-payments-tile"); -for (let i = 0; i < tileExtensions?.length; i++) { - let tile = tileExtensions[i].getTile(); - - let hasRoles = true; - if (tile.roles && Array.isArray(tile.roles)) { - for (const next of tile.roles) { - if (!user.isInRole(next)) { - hasRoles = false; - break; - } - } - } - - if (!tile || (tile.role && !user.isInRole(tile.role)) || !hasRoles) { - continue; - } - if (!tiles[tile.group]) { - tiles[tile.group] = { - entities: [], - reports: [], - settings: [] - }; - } - if (tile.type === 'REPORT' || tile.report === 'true' || tile.report === true) { - tiles[tile.group].reports.push({ - name: tile.name, - location: tile.location, - caption: tile.caption, - tooltip: tile.tooltip, - project: tile.project, - type: tile.type, - group: tile.group, - report: tile.report, - icon: tile.icon, - order: parseInt(tile.order), - groupOrder: parseInt(tile.groupOrder) - }); - } else if (tile.type === 'SETTING') { - tiles[tile.group].settings.push({ - name: tile.name, - location: tile.location, - caption: tile.caption, - tooltip: tile.tooltip, - project: tile.project, - type: tile.type, - group: tile.group, - report: tile.report, - icon: tile.icon, - order: parseInt(tile.order), - groupOrder: parseInt(tile.groupOrder) - }); - } else { - tiles[tile.group].entities.push({ - name: tile.name, - location: tile.location, - caption: tile.caption, - tooltip: tile.tooltip, - project: tile.project, - type: tile.type, - group: tile.group, - report: tile.report, - icon: tile.icon, - order: parseInt(tile.order), - groupOrder: parseInt(tile.groupOrder) - }); - } -} - -let modules = []; -let referenceData = []; -for (const [key, group] of Object.entries(tiles)) { - if (!group.entities.length && !group.reports.length && group.settings.length) { - group.settings.sort((a, b) => a.order - b.order); - referenceData.push({ name: key, settings: group.settings }); - } else { - group.entities.sort((a, b) => a.order - b.order); - group.reports.sort((a, b) => a.order - b.order); - group.settings.sort((a, b) => a.order - b.order); - modules.push({ name: key, ...group }); - } -} -response.setContentType("application/json"); -response.println(JSON.stringify({ modules: modules, referenceData: referenceData })); \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.extension b/codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.extension deleted file mode 100644 index 827514a..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.js", - "extensionPoint": "codbex-payments-view", - "description": "codbex-payments - Application View" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.js b/codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.js deleted file mode 100644 index e25221d..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/Home/view.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -const viewData = { - id: "codbex-payments-home-launchpad", - label: "Home Launchpad", - factory: "frame", - region: "center", - link: "/services/web/codbex-payments/gen/codbex-payments/ui/launchpad/Home/index.html", - isLaunchpad: true, -}; - -if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/dialog-window.extensionpoint b/codbex-payments/gen/codbex-payments/ui/launchpad/dialog-window.extensionpoint deleted file mode 100644 index c0f69ad..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/dialog-window.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dialog-window", - "description": "codbex-payments - Extension Point for the Application Dialog Window Providers" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.extension b/codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.extension deleted file mode 100644 index a502832..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.js", - "extensionPoint": "codbex-payments-menu", - "description": "codbex-payments - Application Menu" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.js b/codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.js deleted file mode 100644 index 9051c09..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/menu-help.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ - -import { Configurations as config } from "sdk/core"; - -const defaultMenuItems = [ - { - label: "Applications Portal", - action: "open", - order: 1, - data: "/services/web/portal/", - divider: false - }, - { - label: "Help Portal", - action: "open", - order: 1, - data: "https://www.dirigible.io/help/", - divider: false - }, - { - label: "Contact Support", - action: "open", - order: 2, - data: "https://github.com/eclipse/dirigible/issues", - divider: false - }, - { - label: "Suggest a Feature", - action: "open", - order: 3, - data: "https://github.com/eclipse/dirigible/issues/new?assignees=&labels=&template=feature_request.md&title=[New%20Feature]", - divider: false - }, - { - label: "What's New", - action: "open", - order: 4, - data: "https://twitter.com/dirigible_io", - divider: false - }, - { - label: "Check for Updates", - action: "open", - order: 5, - data: "http://download.dirigible.io/", - divider: true - } -]; - -export function getMenu() { - let menu = { - label: "Help", - order: 900, - items: [ - { - label: "About", - action: "openDialogWindow", - order: 6, - dialogId: "about", - divider: false - }] - }; - - let brandingHelpItems = config.get("DIRIGIBLE_BRANDING_HELP_ITEMS", ""); - if (brandingHelpItems && typeof brandingHelpItems === "string") { - let helpItems = brandingHelpItems.split(","); - helpItems.forEach(e => { - let item = e.trim(); - menu.items.push({ - label: config.get(`DIRIGIBLE_BRANDING_HELP_ITEM_${item}_NAME`, item), - order: parseInt(config.get(`DIRIGIBLE_BRANDING_HELP_ITEM_${item}_ORDER`, "0")), - action: "open", - data: config.get(`DIRIGIBLE_BRANDING_HELP_ITEM_${item}_URL`, "#"), - divider: config.get(`DIRIGIBLE_BRANDING_HELP_ITEM_${item}_DIVIDER`, "false").toLowerCase() === "true" - }); - }); - } else { - menu.items = menu.items.concat(defaultMenuItems); - } - - menu.items.sort((a, b) => a.order - b.order); - return menu; -}; \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/menu.extensionpoint b/codbex-payments/gen/codbex-payments/ui/launchpad/menu.extensionpoint deleted file mode 100644 index 0151b0b..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/menu.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-payments-menu", - "description": "codbex-payments - Extension Point for the Application Main Menu" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.extension b/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.extension deleted file mode 100644 index b730273..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.extension +++ /dev/null @@ -1 +0,0 @@ -{"module":"codbex-payments/gen/codbex-payments/ui/launchpad/perspective.js","extensionPoint":"codbex-payments","description":"codbex-payments - Application Perspective"} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.extensionpoint b/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.extensionpoint deleted file mode 100644 index c81939b..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-payments-perspective", - "description": "codbex-payments - Extension Point for the Application Perspective Providers" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.js b/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.js deleted file mode 100644 index 44b6ca8..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/perspective.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Generated by Eclipse Dirigible based on model and template. - * - * Do not modify the content as it may be re-generated again. - */ -const perspectiveData = { - id: 'home', - name: 'Home', - link: '/services/web/portal/index.html', - icon: '/services/web/resources/unicons/estate.svg', - order: 1, -}; - -if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/tile.extensionpoint b/codbex-payments/gen/codbex-payments/ui/launchpad/tile.extensionpoint deleted file mode 100644 index eca8ef2..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/tile.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-payments-tile", - "description": "codbex-payments - Extension Point for the Application Tile Providers" -} \ No newline at end of file diff --git a/codbex-payments/gen/codbex-payments/ui/launchpad/view.extensionpoint b/codbex-payments/gen/codbex-payments/ui/launchpad/view.extensionpoint deleted file mode 100644 index a6c4447..0000000 --- a/codbex-payments/gen/codbex-payments/ui/launchpad/view.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-payments-view", - "description": "codbex-payments - Extension Point for the Application View Providers" -} \ No newline at end of file diff --git a/codbex-payments/navigations/customer-payments/navigation.extension b/codbex-payments/navigations/customer-payments/navigation.extension deleted file mode 100644 index 00b4966..0000000 --- a/codbex-payments/navigations/customer-payments/navigation.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/navigations/customer-payments/service.js", - "extensionPoint": "dashboard-navigations", - "description": "Customer Payments Navigation", - "role": "codbex-payments.CustomerPayment.CustomerPaymentReadOnly,codbex-payments.CustomerPayment.CustomerPaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/navigations/customer-payments/service.js b/codbex-payments/navigations/customer-payments/service.js deleted file mode 100644 index 53e5573..0000000 --- a/codbex-payments/navigations/customer-payments/service.js +++ /dev/null @@ -1,17 +0,0 @@ -const navigationData = { - id: 'customer-payments-navigation', - label: "Customer Payments", - group: "sales", - order: 300, - link: "/services/web/codbex-payments/gen/codbex-payments/ui/CustomerPayment/index.html?embedded" -}; - -function getNavigation() { - return navigationData; -} - -if (typeof exports !== 'undefined') { - exports.getNavigation = getNavigation; -} - -export { getNavigation } diff --git a/codbex-payments/navigations/employee-payments/navigation.extension b/codbex-payments/navigations/employee-payments/navigation.extension deleted file mode 100644 index f0cdb81..0000000 --- a/codbex-payments/navigations/employee-payments/navigation.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/navigations/employee-payments/service.js", - "extensionPoint": "dashboard-navigations", - "description": "Employee Payments Navigation", - "role": "codbex-payments.EmployeePayment.EmployeePaymentReadOnly,codbex-payments.EmployeePayment.EmployeePaymentFullAcces" -} \ No newline at end of file diff --git a/codbex-payments/navigations/employee-payments/service.js b/codbex-payments/navigations/employee-payments/service.js deleted file mode 100644 index 0f33f47..0000000 --- a/codbex-payments/navigations/employee-payments/service.js +++ /dev/null @@ -1,17 +0,0 @@ -const navigationData = { - id: 'employee-payments-navigation', - label: "Employee Payments", - group: "salaries", - order: 300, - link: "/services/web/codbex-payments/gen/codbex-payments/ui/EmployeePayment/index.html?embedded" -}; - -function getNavigation() { - return navigationData; -} - -if (typeof exports !== 'undefined') { - exports.getNavigation = getNavigation; -} - -export { getNavigation } diff --git a/codbex-payments/navigations/payment-adjustments/navigation.extension b/codbex-payments/navigations/payment-adjustments/navigation.extension deleted file mode 100644 index 8713370..0000000 --- a/codbex-payments/navigations/payment-adjustments/navigation.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/navigations/payment-adjustments/service.js", - "extensionPoint": "dashboard-navigations", - "description": "Payment Adjustments Navigation", - "role": "codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly,codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/navigations/payment-adjustments/service.js b/codbex-payments/navigations/payment-adjustments/service.js deleted file mode 100644 index c5a6852..0000000 --- a/codbex-payments/navigations/payment-adjustments/service.js +++ /dev/null @@ -1,17 +0,0 @@ -const navigationData = { - id: 'payment-adjustments-navigation', - label: "Payment Adjustments", - group: "sales", - order: 700, - link: "/services/web/codbex-payments/gen/codbex-payments/ui/PaymentAdjustment/index.html?embedded" -}; - -function getNavigation() { - return navigationData; -} - -if (typeof exports !== 'undefined') { - exports.getNavigation = getNavigation; -} - -export { getNavigation } diff --git a/codbex-payments/navigations/supplier-payments/navigation.extension b/codbex-payments/navigations/supplier-payments/navigation.extension deleted file mode 100644 index 79bc088..0000000 --- a/codbex-payments/navigations/supplier-payments/navigation.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-payments/navigations/supplier-payments/service.js", - "extensionPoint": "dashboard-navigations", - "description": "Supplier Payments Navigation", - "role": "codbex-payments.SupplierPayment.SupplierPaymentReadOnly,codbex-payments.SupplierPayment.SupplierPaymentFullAccess" -} \ No newline at end of file diff --git a/codbex-payments/navigations/supplier-payments/service.js b/codbex-payments/navigations/supplier-payments/service.js deleted file mode 100644 index c6bd748..0000000 --- a/codbex-payments/navigations/supplier-payments/service.js +++ /dev/null @@ -1,17 +0,0 @@ -const navigationData = { - id: 'supplier-payments-navigation', - label: "Supplier Payments", - group: "purchasing", - order: 300, - link: "/services/web/codbex-payments/gen/codbex-payments/ui/SupplierPayment/index.html?embedded" -}; - -function getNavigation() { - return navigationData; -} - -if (typeof exports !== 'undefined') { - exports.getNavigation = getNavigation; -} - -export { getNavigation }