diff --git a/codbex-contracts/codbex-contracts.edm b/codbex-contracts/codbex-contracts.edm index d0534de..c50818a 100644 --- a/codbex-contracts/codbex-contracts.edm +++ b/codbex-contracts/codbex-contracts.edm @@ -1,53 +1,53 @@ - - - - - - - - - + + + + + + + + + - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -55,36 +55,36 @@ - - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - Contract/services/web/resources/unicons/document-info.svg100 - Settings/services/web/resources/unicons/wrench.svg999 - EmployeeContracts/services/web/resources/unicons/book-open.svg103 + Contract/services/web/resources/unicons/document-info.svg100 + Settings/services/web/resources/unicons/wrench.svg999 + EmployeeContracts/services/web/resources/unicons/book-open.svg103 - + \ No newline at end of file diff --git a/codbex-contracts/codbex-contracts.gen b/codbex-contracts/codbex-contracts.gen index ee93b67..58edd3d 100644 --- a/codbex-contracts/codbex-contracts.gen +++ b/codbex-contracts/codbex-contracts.gen @@ -55,15 +55,13 @@ "Contract-details", "Contract-details", "Contract-details", - "Contract-details", - "Contract-details", - "Contract-details", - "Contract-details", "Contract-details" ], "name": "Contract", "label": "Contract", + "header": "", "order": "100", + "navId": "", "icon": "/services/web/resources/unicons/document-info.svg", "role": "" }, @@ -73,7 +71,9 @@ ], "name": "Settings", "label": "Settings", + "header": "", "order": "999", + "navId": "", "icon": "/services/web/resources/unicons/wrench.svg", "role": "" }, @@ -84,7 +84,9 @@ ], "name": "Companies", "label": "Companies", + "header": "", "order": "113", + "navId": "", "icon": "/services/web/resources/unicons/user.svg", "role": "" }, @@ -110,15 +112,13 @@ "EmployeeContract-details", "EmployeeContract-details", "EmployeeContract-details", - "EmployeeContract-details", - "EmployeeContract-details", - "EmployeeContract-details", - "EmployeeContract-details", "EmployeeContract-details" ], "name": "EmployeeContracts", "label": "EmployeeContracts", + "header": "", "order": "103", + "navId": "", "icon": "/services/web/resources/unicons/book-open.svg", "role": "" }, @@ -128,15 +128,19 @@ ], "name": "Employees", "label": "Employees", + "header": "", "order": "100", + "navId": "", "icon": "/services/web/resources/unicons/user.svg", "role": "" } }, + "tprefix": "codbex-contracts-model", "models": [ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": true, "dataName": "CONTRACT_ID", "dataNullable": true, @@ -153,14 +157,17 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { - "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generate(23)", + "auditType": "NONE", + "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generateByType('Contract')", "dataLength": "20", "dataName": "CONTRACT_NUMBER", "dataNullable": true, @@ -178,8 +185,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isRequiredProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Number", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -187,6 +196,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_STARTDATE", "dataNullable": true, "dataType": "DATE", @@ -203,14 +213,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "StartDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_ENDDATE", "dataNullable": true, "dataType": "DATE", @@ -227,14 +240,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "EndDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_COMPANY", "dataNullable": true, "dataType": "INTEGER", @@ -257,13 +273,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Company", "widgetDropdownUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "CONTRACT_DOCUMENT", "dataNullable": true, @@ -281,8 +300,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Document", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -290,6 +311,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_TYPE", "dataNullable": true, "dataType": "INTEGER", @@ -312,13 +334,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Type", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "1000", "dataName": "CONTRACT_COMMENT", "dataNullable": true, @@ -336,8 +361,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Comment", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -360,11 +387,13 @@ "menuIndex": "100", "menuKey": "contract", "menuLabel": "Contract", + "multilingual": "false", "name": "Contract", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/document-info.svg", "perspectiveLabel": "Contract", "perspectiveName": "Contract", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-contracts.Contract.ContractReadOnly", @@ -386,7 +415,8 @@ "primaryKeysString": "Id", "masterProperties": { "title": { - "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generate(23)", + "auditType": "NONE", + "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generateByType('Contract')", "dataLength": "20", "dataName": "CONTRACT_NUMBER", "dataNullable": true, @@ -404,8 +434,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isRequiredProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Number", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -414,6 +446,7 @@ }, "properties": [ { + "auditType": "NONE", "dataName": "CONTRACT_STARTDATE", "dataNullable": true, "dataType": "DATE", @@ -430,14 +463,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "StartDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_ENDDATE", "dataNullable": true, "dataType": "DATE", @@ -454,14 +490,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "EndDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_COMPANY", "dataNullable": true, "dataType": "INTEGER", @@ -484,13 +523,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Company", "widgetDropdownUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "CONTRACT_DOCUMENT", "dataNullable": true, @@ -508,8 +550,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Document", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -517,6 +561,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "CONTRACT_TYPE", "dataNullable": true, "dataType": "INTEGER", @@ -539,13 +584,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Type", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "1000", "dataName": "CONTRACT_COMMENT", "dataNullable": true, @@ -563,8 +611,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Comment", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -579,6 +629,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": true, "dataName": "CONTRACTTYPE_ID", "dataNullable": true, @@ -595,13 +646,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "100", "dataName": "CONTRACTTYPE_NAME", "dataNullable": true, @@ -619,8 +673,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -638,15 +694,15 @@ "generateDefaultRoles": "true", "generateReport": "false", "icon": "/services/web/resources/unicons/file.svg", - "layoutType": "MANAGE", "menuIndex": "100", "menuKey": "contracttype", "menuLabel": "ContractType", + "multilingual": "false", "name": "ContractType", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", - "perspectiveLabel": "Settings", "perspectiveName": "Settings", + "perspectiveNavId": "", "perspectiveOrder": "999", "perspectiveRole": "", "roleRead": "codbex-contracts.Settings.ContractTypeReadOnly", @@ -664,6 +720,7 @@ { "properties": [ { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataAutoIncrement": true, @@ -682,13 +739,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "100", @@ -708,8 +768,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -717,6 +779,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "50", @@ -736,8 +799,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Manager", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -745,6 +810,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "100", @@ -764,8 +830,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Email", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -773,6 +841,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "20", @@ -792,8 +861,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Phone", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -801,6 +872,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "200", @@ -820,8 +892,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Address", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -829,6 +903,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "20", @@ -848,8 +923,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "PostCode", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -857,6 +934,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataName": "COMPANY_CITY", @@ -879,13 +957,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "City", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Cities/undefinedService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Cities/undefinedController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataName": "COMPANY_COUNTRY", @@ -908,13 +989,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Country", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Countries/undefinedService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Countries/undefinedController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "20", @@ -934,8 +1018,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "TIN", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -943,6 +1029,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "34", @@ -962,8 +1049,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "IBAN", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -983,11 +1072,13 @@ "menuIndex": "100", "menuKey": "company", "menuLabel": "Company", + "multilingual": "false", "name": "Company", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/university.svg", "perspectiveLabel": "Entities", "perspectiveName": "Companies", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Company", @@ -1006,6 +1097,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": true, "dataName": "COMPANYROLE_ID", "dataNullable": true, @@ -1022,13 +1114,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "20", "dataName": "COMPANYROLE_NAME", "dataNullable": true, @@ -1046,8 +1141,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1055,6 +1152,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "COMPANYROLE_COMPANY", "dataNullable": true, "dataType": "INTEGER", @@ -1076,8 +1174,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Company", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -1095,11 +1195,13 @@ "menuIndex": "100", "menuKey": "jobrole", "menuLabel": "JobRole", + "multilingual": "false", "name": "JobRole", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user.svg", "perspectiveLabel": "Companies", "perspectiveName": "Companies", + "perspectiveNavId": "", "perspectiveOrder": "113", "perspectiveRole": "", "projectionReferencedEntity": "JobRole", @@ -1118,6 +1220,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": true, "dataName": "EMPLOYEECONTRACT_ID", "dataNullable": true, @@ -1134,14 +1237,17 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { - "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generate(28)", + "auditType": "NONE", + "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generateByType('Employee Contract')", "dataLength": "20", "dataName": "EMPLOYEECONTRACT_NUMBER", "dataNullable": true, @@ -1159,8 +1265,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isRequiredProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Number", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1168,6 +1276,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_EMPLOYEE", "dataNullable": true, "dataType": "INTEGER", @@ -1190,13 +1299,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Employee", "widgetDropdownUrl": "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_STARTDATE", "dataNullable": true, "dataType": "DATE", @@ -1213,14 +1325,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "StartDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_ENDDATE", "dataNullable": true, "dataType": "DATE", @@ -1237,14 +1352,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "EndDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_COMPANY", "dataNullable": true, "dataType": "INTEGER", @@ -1267,13 +1385,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Company", "widgetDropdownUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_JOBROLE", "dataNullable": true, "dataType": "INTEGER", @@ -1296,13 +1417,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "JobRole", "widgetDropdownUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_ANNUALPAIDLEAVE", "dataNullable": true, "dataType": "INTEGER", @@ -1319,13 +1443,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "AnnualPaidLeave", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "EMPLOYEECONTRACT_DOCUMENT", "dataNullable": true, @@ -1343,8 +1470,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Document", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1352,6 +1481,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_TYPE", "dataNullable": true, "dataType": "INTEGER", @@ -1374,13 +1504,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Type", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "1000", "dataName": "EMPLOYEECONTRACT_COMMENT", "dataNullable": true, @@ -1398,8 +1531,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Comment", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1420,11 +1555,13 @@ "menuIndex": "100", "menuKey": "employeecontract", "menuLabel": "EmployeeContract", + "multilingual": "false", "name": "EmployeeContract", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/book-open.svg", "perspectiveLabel": "EmployeeContracts", "perspectiveName": "EmployeeContracts", + "perspectiveNavId": "", "perspectiveOrder": "103", "perspectiveRole": "", "roleRead": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly", @@ -1456,7 +1593,8 @@ "primaryKeysString": "Id", "masterProperties": { "title": { - "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generate(28)", + "auditType": "NONE", + "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generateByType('Employee Contract')", "dataLength": "20", "dataName": "EMPLOYEECONTRACT_NUMBER", "dataNullable": true, @@ -1474,8 +1612,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isRequiredProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Number", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1484,6 +1624,7 @@ }, "properties": [ { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_EMPLOYEE", "dataNullable": true, "dataType": "INTEGER", @@ -1506,13 +1647,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Employee", "widgetDropdownUrl": "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_STARTDATE", "dataNullable": true, "dataType": "DATE", @@ -1529,14 +1673,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "StartDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_ENDDATE", "dataNullable": true, "dataType": "DATE", @@ -1553,14 +1700,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "EndDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_COMPANY", "dataNullable": true, "dataType": "INTEGER", @@ -1583,13 +1733,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Company", "widgetDropdownUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_JOBROLE", "dataNullable": true, "dataType": "INTEGER", @@ -1612,13 +1765,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "JobRole", "widgetDropdownUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_ANNUALPAIDLEAVE", "dataNullable": true, "dataType": "INTEGER", @@ -1635,13 +1791,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "AnnualPaidLeave", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "EMPLOYEECONTRACT_DOCUMENT", "dataNullable": true, @@ -1659,8 +1818,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Document", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1668,6 +1829,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_TYPE", "dataNullable": true, "dataType": "INTEGER", @@ -1690,13 +1852,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Type", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "1000", "dataName": "EMPLOYEECONTRACT_COMMENT", "dataNullable": true, @@ -1714,8 +1879,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Comment", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1730,6 +1897,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": true, "dataName": "EMPLOYEECONTRACTITEM_ID", "dataNullable": true, @@ -1746,13 +1914,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "100", "dataName": "EMPLOYEECONTRACTITEM_NAME", "dataNullable": true, @@ -1770,8 +1941,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1779,6 +1952,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "EMPLOYEECONTRACTITEM_DOCUMENT", "dataNullable": true, @@ -1796,8 +1970,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Document", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1805,6 +1981,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACTITEM_EMPLOYEECONTRACT", "dataNullable": true, "dataType": "INTEGER", @@ -1827,8 +2004,10 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "EmployeeContract", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" @@ -1846,11 +2025,13 @@ "menuIndex": "100", "menuKey": "employeecontractitem", "menuLabel": "EmployeeContractItem", + "multilingual": "false", "name": "EmployeeContractItem", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/book-open.svg", "perspectiveLabel": "EmployeeContracts", "perspectiveName": "EmployeeContracts", + "perspectiveNavId": "", "perspectiveOrder": "103", "perspectiveRole": "", "roleRead": "codbex-contracts.EmployeeContracts.EmployeeContractItemReadOnly", @@ -1870,6 +2051,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": true, "dataName": "EMPLOYEE_ID", "dataNullable": true, @@ -1886,13 +2068,16 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Id", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_FIRSTNAME", "dataNullable": true, @@ -1912,7 +2097,9 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1920,6 +2107,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_MIDDLENAME", "dataNullable": true, @@ -1939,7 +2127,9 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1947,6 +2137,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_LASTNAME", "dataNullable": true, @@ -1966,7 +2157,9 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -1974,6 +2167,7 @@ "inputRule": "" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "entity[\"FirstName\"] + \" \" + entity[\"LastName\"]", "dataLength": "70", "dataName": "EMPLOYEE_NAME", @@ -1992,8 +2186,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isRequiredProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Name", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -2001,6 +2197,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_BIRTHDATE", "dataNullable": true, "dataType": "DATE", @@ -2017,14 +2214,17 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "BirthDate", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "date", "dataTypeTypescript": "Date", "isDateType": true, "inputRule": "" }, { + "auditType": "NONE", "dataLength": "10", "dataName": "EMPLOYEE_PERSONALNUMBER", "dataNullable": true, @@ -2042,8 +2242,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "PersonalNumber", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -2051,6 +2253,7 @@ "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_GENDER", "dataNullable": true, "dataType": "INTEGER", @@ -2072,13 +2275,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Gender", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeesSettings/undefinedService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeesSettings/undefinedController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_NATIONALITY", "dataNullable": true, "dataType": "INTEGER", @@ -2100,13 +2306,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "Nationality", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Countries/undefinedService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/Countries/undefinedController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_MARTIALSTATUS", "dataNullable": true, "dataType": "INTEGER", @@ -2128,13 +2337,16 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "MartialStatus", "widgetDropdownUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeesSettings/undefinedService.ts", + "widgetDropdownControllerUrl": "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeesSettings/undefinedController.ts", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_IBAN", "dataNullable": true, @@ -2152,8 +2364,10 @@ "dataPrimaryKey": false, "dataUnique": false, "isCalculatedProperty": false, + "isReadOnlyProperty": false, "widgetLabel": "IBAN", "widgetDropdownUrl": "", + "widgetDropdownControllerUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, @@ -2173,11 +2387,13 @@ "menuIndex": "100", "menuKey": "employee", "menuLabel": "Employee", + "multilingual": "false", "name": "Employee", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user.svg", "perspectiveLabel": "Employees", "perspectiveName": "Employees", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Employee", diff --git a/codbex-contracts/codbex-contracts.model b/codbex-contracts/codbex-contracts.model index 959835a..db91aed 100644 --- a/codbex-contracts/codbex-contracts.model +++ b/codbex-contracts/codbex-contracts.model @@ -4,6 +4,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "CONTRACT_ID", "dataNullable": "true", @@ -18,7 +19,8 @@ "widgetType": "TEXTBOX" }, { - "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generate(23)", + "auditType": "NONE", + "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generateByType('Contract')", "dataLength": "20", "dataName": "CONTRACT_NUMBER", "dataNullable": "true", @@ -33,6 +35,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "CONTRACT_STARTDATE", "dataNullable": "true", "dataType": "DATE", @@ -46,6 +49,7 @@ "widgetType": "DATE" }, { + "auditType": "NONE", "dataName": "CONTRACT_ENDDATE", "dataNullable": "true", "dataType": "DATE", @@ -59,6 +63,7 @@ "widgetType": "DATE" }, { + "auditType": "NONE", "dataName": "CONTRACT_COMPANY", "dataNullable": "true", "dataType": "INTEGER", @@ -78,6 +83,7 @@ "relationshipEntityPerspectiveLabel": "Entities" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "CONTRACT_DOCUMENT", "dataNullable": "true", @@ -92,6 +98,7 @@ "widgetType": "URL" }, { + "auditType": "NONE", "dataName": "CONTRACT_TYPE", "dataNullable": "true", "dataType": "INTEGER", @@ -110,6 +117,7 @@ "relationshipEntityPerspectiveLabel": "Entities" }, { + "auditType": "NONE", "dataLength": "1000", "dataName": "CONTRACT_COMMENT", "dataNullable": "true", @@ -138,11 +146,13 @@ "menuIndex": "100", "menuKey": "contract", "menuLabel": "Contract", + "multilingual": "false", "name": "Contract", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/document-info.svg", "perspectiveLabel": "Contract", "perspectiveName": "Contract", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "roleRead": "codbex-contracts.Contract.ContractReadOnly", @@ -154,6 +164,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "CONTRACTTYPE_ID", "dataNullable": "true", @@ -168,6 +179,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "100", "dataName": "CONTRACTTYPE_NAME", "dataNullable": "true", @@ -195,11 +207,13 @@ "menuIndex": "100", "menuKey": "contracttype", "menuLabel": "ContractType", + "multilingual": "false", "name": "ContractType", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/wrench.svg", "perspectiveLabel": "Settings", "perspectiveName": "Settings", + "perspectiveNavId": "", "perspectiveOrder": "999", "perspectiveRole": "", "roleRead": "codbex-contracts.Settings.ContractTypeReadOnly", @@ -211,6 +225,7 @@ { "properties": [ { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataAutoIncrement": "true", @@ -227,6 +242,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "100", @@ -243,6 +259,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "50", @@ -258,6 +275,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "100", @@ -274,6 +292,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "20", @@ -289,6 +308,7 @@ "widgetType": "TEL" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "200", @@ -305,6 +325,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "20", @@ -321,6 +342,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataName": "COMPANY_CITY", @@ -340,6 +362,7 @@ "widgetType": "DROPDOWN" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataName": "COMPANY_COUNTRY", @@ -359,6 +382,7 @@ "widgetType": "DROPDOWN" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "20", @@ -374,6 +398,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "", "calculatedPropertyExpressionUpdate": "", "dataLength": "34", @@ -401,11 +426,13 @@ "menuIndex": "100", "menuKey": "company", "menuLabel": "Company", + "multilingual": "false", "name": "Company", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/university.svg", "perspectiveLabel": "Entities", "perspectiveName": "Companies", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Company", @@ -417,6 +444,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "COMPANYROLE_ID", "dataNullable": "true", @@ -431,6 +459,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "20", "dataName": "COMPANYROLE_NAME", "dataNullable": "true", @@ -444,6 +473,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "COMPANYROLE_COMPANY", "dataNullable": "true", "dataType": "INTEGER", @@ -473,11 +503,13 @@ "menuIndex": "100", "menuKey": "jobrole", "menuLabel": "JobRole", + "multilingual": "false", "name": "JobRole", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user.svg", "perspectiveLabel": "Companies", "perspectiveName": "Companies", + "perspectiveNavId": "", "perspectiveOrder": "113", "perspectiveRole": "", "projectionReferencedEntity": "JobRole", @@ -489,6 +521,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "EMPLOYEECONTRACT_ID", "dataNullable": "true", @@ -503,7 +536,8 @@ "widgetType": "TEXTBOX" }, { - "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generate(28)", + "auditType": "NONE", + "calculatedPropertyExpressionCreate": "new NumberGeneratorService().generateByType('Employee Contract')", "dataLength": "20", "dataName": "EMPLOYEECONTRACT_NUMBER", "dataNullable": "true", @@ -518,6 +552,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_EMPLOYEE", "dataNullable": "true", "dataType": "INTEGER", @@ -537,6 +572,7 @@ "relationshipEntityPerspectiveLabel": "Employees" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_STARTDATE", "dataNullable": "true", "dataType": "DATE", @@ -550,6 +586,7 @@ "widgetType": "DATE" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_ENDDATE", "dataNullable": "true", "dataType": "DATE", @@ -563,6 +600,7 @@ "widgetType": "DATE" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_COMPANY", "dataNullable": "true", "dataType": "INTEGER", @@ -582,6 +620,7 @@ "relationshipEntityPerspectiveLabel": "Entities" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_JOBROLE", "dataNullable": "true", "dataType": "INTEGER", @@ -601,6 +640,7 @@ "relationshipEntityPerspectiveLabel": "Companies" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_ANNUALPAIDLEAVE", "dataNullable": "true", "dataType": "INTEGER", @@ -614,6 +654,7 @@ "widgetType": "NUMBER" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "EMPLOYEECONTRACT_DOCUMENT", "dataNullable": "true", @@ -628,6 +669,7 @@ "widgetType": "URL" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACT_TYPE", "dataNullable": "true", "dataType": "INTEGER", @@ -647,6 +689,7 @@ "relationshipEntityPerspectiveLabel": "Entities" }, { + "auditType": "NONE", "dataLength": "1000", "dataName": "EMPLOYEECONTRACT_COMMENT", "dataNullable": "true", @@ -673,11 +716,13 @@ "menuIndex": "100", "menuKey": "employeecontract", "menuLabel": "EmployeeContract", + "multilingual": "false", "name": "EmployeeContract", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/book-open.svg", "perspectiveLabel": "EmployeeContracts", "perspectiveName": "EmployeeContracts", + "perspectiveNavId": "", "perspectiveOrder": "103", "perspectiveRole": "", "roleRead": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly", @@ -689,6 +734,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "EMPLOYEECONTRACTITEM_ID", "dataNullable": "true", @@ -703,6 +749,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "100", "dataName": "EMPLOYEECONTRACTITEM_NAME", "dataNullable": "true", @@ -717,6 +764,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "500", "dataName": "EMPLOYEECONTRACTITEM_DOCUMENT", "dataNullable": "true", @@ -730,6 +778,7 @@ "widgetType": "URL" }, { + "auditType": "NONE", "dataName": "EMPLOYEECONTRACTITEM_EMPLOYEECONTRACT", "dataNullable": "true", "dataType": "INTEGER", @@ -760,11 +809,13 @@ "menuIndex": "100", "menuKey": "employeecontractitem", "menuLabel": "EmployeeContractItem", + "multilingual": "false", "name": "EmployeeContractItem", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/book-open.svg", "perspectiveLabel": "EmployeeContracts", "perspectiveName": "EmployeeContracts", + "perspectiveNavId": "", "perspectiveOrder": "103", "perspectiveRole": "", "roleRead": "codbex-contracts.EmployeeContracts.EmployeeContractItemReadOnly", @@ -776,6 +827,7 @@ { "properties": [ { + "auditType": "NONE", "dataAutoIncrement": "true", "dataName": "EMPLOYEE_ID", "dataNullable": "true", @@ -790,6 +842,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_FIRSTNAME", "dataNullable": "true", @@ -806,6 +859,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_MIDDLENAME", "dataNullable": "true", @@ -821,6 +875,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_LASTNAME", "dataNullable": "true", @@ -837,6 +892,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "calculatedPropertyExpressionCreate": "entity[\"FirstName\"] + \" \" + entity[\"LastName\"]", "dataLength": "70", "dataName": "EMPLOYEE_NAME", @@ -852,6 +908,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_BIRTHDATE", "dataNullable": "true", "dataType": "DATE", @@ -865,6 +922,7 @@ "widgetType": "DATE" }, { + "auditType": "NONE", "dataLength": "10", "dataName": "EMPLOYEE_PERSONALNUMBER", "dataNullable": "true", @@ -879,6 +937,7 @@ "widgetType": "TEXTBOX" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_GENDER", "dataNullable": "true", "dataType": "INTEGER", @@ -897,6 +956,7 @@ "widgetType": "DROPDOWN" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_NATIONALITY", "dataNullable": "true", "dataType": "INTEGER", @@ -915,6 +975,7 @@ "widgetType": "DROPDOWN" }, { + "auditType": "NONE", "dataName": "EMPLOYEE_MARTIALSTATUS", "dataNullable": "true", "dataType": "INTEGER", @@ -933,6 +994,7 @@ "widgetType": "DROPDOWN" }, { + "auditType": "NONE", "dataLength": "50", "dataName": "EMPLOYEE_IBAN", "dataNullable": "true", @@ -959,11 +1021,13 @@ "menuIndex": "100", "menuKey": "employee", "menuLabel": "Employee", + "multilingual": "false", "name": "Employee", - "navigationPath": "/Home", + "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/user.svg", "perspectiveLabel": "Employees", "perspectiveName": "Employees", + "perspectiveNavId": "", "perspectiveOrder": "100", "perspectiveRole": "", "projectionReferencedEntity": "Employee", @@ -978,22 +1042,19 @@ "name": "Contract", "label": "Contract", "icon": "/services/web/resources/unicons/document-info.svg", - "order": "100", - "role": {} + "order": "100" }, { "name": "Settings", "label": "Settings", "icon": "/services/web/resources/unicons/wrench.svg", - "order": "999", - "role": {} + "order": "999" }, { "name": "EmployeeContracts", "label": "EmployeeContracts", "icon": "/services/web/resources/unicons/book-open.svg", - "order": "103", - "role": {} + "order": "103" } ], "navigations": [] diff --git a/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts b/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts index 59ee6fb..289ae63 100644 --- a/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts +++ b/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts @@ -1,7 +1,7 @@ -import { Controller, Get, Post, Put, Delete, response } from "sdk/http" -import { Extensions } from "sdk/extensions" +import { Controller, Get, Post, Put, Delete, request, response } from "@aerokit/sdk/http" +import { Extensions } from "@aerokit/sdk/extensions" import { ContractRepository, ContractEntityOptions } from "../../dao/Contract/ContractRepository"; -import { user } from "sdk/security" +import { user } from "@aerokit/sdk/security" import { ForbiddenError } from "../utils/ForbiddenError"; import { ValidationError } from "../utils/ValidationError"; import { HttpUtils } from "../utils/HttpUtils"; @@ -21,7 +21,8 @@ class ContractService { this.checkPermissions("read"); const options: ContractEntityOptions = { $limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : undefined, - $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined + $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined, + $language: request.getLocale().split("_")[0] }; return this.repository.findAll(options); @@ -48,7 +49,7 @@ class ContractService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -58,7 +59,7 @@ class ContractService { 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); } @@ -79,7 +80,10 @@ class ContractService { try { this.checkPermissions("read"); const id = parseInt(ctx.pathParameters.id); - const entity = this.repository.findById(id); + const options: ContractEntityOptions = { + $language: request.getLocale().split("_")[0] + }; + const entity = this.repository.findById(id, options); if (entity) { return entity; } else { diff --git a/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts b/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts index cd8b1b8..4531176 100644 --- a/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts +++ b/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts @@ -1,7 +1,7 @@ -import { Controller, Get, Post, Put, Delete, response } from "sdk/http" -import { Extensions } from "sdk/extensions" +import { Controller, Get, Post, Put, Delete, request, response } from "@aerokit/sdk/http" +import { Extensions } from "@aerokit/sdk/extensions" import { EmployeeContractItemRepository, EmployeeContractItemEntityOptions } from "../../dao/EmployeeContracts/EmployeeContractItemRepository"; -import { user } from "sdk/security" +import { user } from "@aerokit/sdk/security" import { ForbiddenError } from "../utils/ForbiddenError"; import { ValidationError } from "../utils/ValidationError"; import { HttpUtils } from "../utils/HttpUtils"; @@ -19,7 +19,8 @@ class EmployeeContractItemService { this.checkPermissions("read"); const options: EmployeeContractItemEntityOptions = { $limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : undefined, - $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined + $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined, + $language: request.getLocale().split("_")[0] }; let EmployeeContract = parseInt(ctx.queryParameters.EmployeeContract); @@ -57,7 +58,7 @@ class EmployeeContractItemService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -67,7 +68,7 @@ class EmployeeContractItemService { 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); } @@ -88,7 +89,10 @@ class EmployeeContractItemService { try { this.checkPermissions("read"); const id = parseInt(ctx.pathParameters.id); - const entity = this.repository.findById(id); + const options: EmployeeContractItemEntityOptions = { + $language: request.getLocale().split("_")[0] + }; + const entity = this.repository.findById(id, options); if (entity) { return entity; } else { diff --git a/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts b/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts index 445b93f..6e822c2 100644 --- a/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts +++ b/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts @@ -1,7 +1,7 @@ -import { Controller, Get, Post, Put, Delete, response } from "sdk/http" -import { Extensions } from "sdk/extensions" +import { Controller, Get, Post, Put, Delete, request, response } from "@aerokit/sdk/http" +import { Extensions } from "@aerokit/sdk/extensions" import { EmployeeContractRepository, EmployeeContractEntityOptions } from "../../dao/EmployeeContracts/EmployeeContractRepository"; -import { user } from "sdk/security" +import { user } from "@aerokit/sdk/security" import { ForbiddenError } from "../utils/ForbiddenError"; import { ValidationError } from "../utils/ValidationError"; import { HttpUtils } from "../utils/HttpUtils"; @@ -21,7 +21,8 @@ class EmployeeContractService { this.checkPermissions("read"); const options: EmployeeContractEntityOptions = { $limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : undefined, - $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined + $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined, + $language: request.getLocale().split("_")[0] }; return this.repository.findAll(options); @@ -48,7 +49,7 @@ class EmployeeContractService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -58,7 +59,7 @@ class EmployeeContractService { 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); } @@ -79,7 +80,10 @@ class EmployeeContractService { try { this.checkPermissions("read"); const id = parseInt(ctx.pathParameters.id); - const entity = this.repository.findById(id); + const options: EmployeeContractEntityOptions = { + $language: request.getLocale().split("_")[0] + }; + const entity = this.repository.findById(id, options); if (entity) { return entity; } else { diff --git a/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts b/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts index 985843c..f895c2b 100644 --- a/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts +++ b/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts @@ -1,7 +1,7 @@ -import { Controller, Get, Post, Put, Delete, response } from "sdk/http" -import { Extensions } from "sdk/extensions" +import { Controller, Get, Post, Put, Delete, request, response } from "@aerokit/sdk/http" +import { Extensions } from "@aerokit/sdk/extensions" import { ContractTypeRepository, ContractTypeEntityOptions } from "../../dao/Settings/ContractTypeRepository"; -import { user } from "sdk/security" +import { user } from "@aerokit/sdk/security" import { ForbiddenError } from "../utils/ForbiddenError"; import { ValidationError } from "../utils/ValidationError"; import { HttpUtils } from "../utils/HttpUtils"; @@ -19,7 +19,8 @@ class ContractTypeService { this.checkPermissions("read"); const options: ContractTypeEntityOptions = { $limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : undefined, - $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined + $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined, + $language: request.getLocale().split("_")[0] }; return this.repository.findAll(options); @@ -46,7 +47,7 @@ class ContractTypeService { public count() { try { this.checkPermissions("read"); - return this.repository.count(); + return { count: this.repository.count() }; } catch (error: any) { this.handleError(error); } @@ -56,7 +57,7 @@ class ContractTypeService { 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); } @@ -77,7 +78,10 @@ class ContractTypeService { try { this.checkPermissions("read"); const id = parseInt(ctx.pathParameters.id); - const entity = this.repository.findById(id); + const options: ContractTypeEntityOptions = { + $language: request.getLocale().split("_")[0] + }; + const entity = this.repository.findById(id, options); if (entity) { return entity; } else { diff --git a/codbex-contracts/gen/codbex-contracts/api/utils/HttpUtils.ts b/codbex-contracts/gen/codbex-contracts/api/utils/HttpUtils.ts index 80efced..08fbd20 100644 --- a/codbex-contracts/gen/codbex-contracts/api/utils/HttpUtils.ts +++ b/codbex-contracts/gen/codbex-contracts/api/utils/HttpUtils.ts @@ -1,4 +1,4 @@ -import { response } from "sdk/http"; +import { response } from "@aerokit/sdk/http"; export class HttpUtils { @@ -57,4 +57,4 @@ export class HttpUtils { response.println(JSON.stringify(body)); } } -} \ No newline at end of file +} diff --git a/codbex-contracts/gen/codbex-contracts/dao/Contract/ContractRepository.ts b/codbex-contracts/gen/codbex-contracts/dao/Contract/ContractRepository.ts index a57fd94..3a5f75a 100644 --- a/codbex-contracts/gen/codbex-contracts/dao/Contract/ContractRepository.ts +++ b/codbex-contracts/gen/codbex-contracts/dao/Contract/ContractRepository.ts @@ -1,7 +1,7 @@ -import { query } from "sdk/db"; -import { producer } from "sdk/messaging"; -import { extensions } from "sdk/extensions"; -import { dao as daoApi } from "sdk/db"; +import { sql, query } from "@aerokit/sdk/db"; +import { producer } from "@aerokit/sdk/messaging"; +import { extensions } from "@aerokit/sdk/extensions"; +import { dao as daoApi } from "@aerokit/sdk/db"; import { EntityUtils } from "../utils/EntityUtils"; // custom imports import { NumberGeneratorService } from "/codbex-number-generator/service/generator"; @@ -105,12 +105,13 @@ export interface ContractEntityOptions { }, $select?: (keyof ContractEntity)[], $sort?: string | (keyof ContractEntity)[], - $order?: 'asc' | 'desc', + $order?: 'ASC' | 'DESC', $offset?: number, $limit?: number, + $language?: string } -interface ContractEntityEvent { +export interface ContractEntityEvent { readonly operation: 'create' | 'update' | 'delete'; readonly table: string; readonly entity: Partial; @@ -121,7 +122,7 @@ interface ContractEntityEvent { } } -interface ContractUpdateEntityEvent extends ContractEntityEvent { +export interface ContractUpdateEntityEvent extends ContractEntityEvent { readonly previousEntity: ContractEntity; } @@ -178,18 +179,19 @@ export class ContractRepository { private readonly dao; constructor(dataSource = "DefaultDB") { - this.dao = daoApi.create(ContractRepository.DEFINITION, null, dataSource); + this.dao = daoApi.create(ContractRepository.DEFINITION, undefined, dataSource); } - public findAll(options?: ContractEntityOptions): ContractEntity[] { - return this.dao.list(options).map((e: ContractEntity) => { + public findAll(options: ContractEntityOptions = {}): ContractEntity[] { + let list = this.dao.list(options).map((e: ContractEntity) => { EntityUtils.setDate(e, "StartDate"); EntityUtils.setDate(e, "EndDate"); return e; }); + return list; } - public findById(id: number): ContractEntity | undefined { + public findById(id: number, options: ContractEntityOptions = {}): ContractEntity | undefined { const entity = this.dao.find(id); EntityUtils.setDate(entity, "StartDate"); EntityUtils.setDate(entity, "EndDate"); @@ -200,7 +202,7 @@ export class ContractRepository { EntityUtils.setLocalDate(entity, "StartDate"); EntityUtils.setLocalDate(entity, "EndDate"); // @ts-ignore - (entity as ContractEntity).Number = new NumberGeneratorService().generate(23); + (entity as ContractEntity).Number = new NumberGeneratorService().generateByType('Contract'); const id = this.dao.insert(entity); this.triggerEvent({ operation: "create", diff --git a/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractItemRepository.ts b/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractItemRepository.ts index e30f178..ed1074f 100644 --- a/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractItemRepository.ts +++ b/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractItemRepository.ts @@ -1,7 +1,7 @@ -import { query } from "sdk/db"; -import { producer } from "sdk/messaging"; -import { extensions } from "sdk/extensions"; -import { dao as daoApi } from "sdk/db"; +import { sql, query } from "@aerokit/sdk/db"; +import { producer } from "@aerokit/sdk/messaging"; +import { extensions } from "@aerokit/sdk/extensions"; +import { dao as daoApi } from "@aerokit/sdk/db"; export interface EmployeeContractItemEntity { readonly Id: number; @@ -67,12 +67,13 @@ export interface EmployeeContractItemEntityOptions { }, $select?: (keyof EmployeeContractItemEntity)[], $sort?: string | (keyof EmployeeContractItemEntity)[], - $order?: 'asc' | 'desc', + $order?: 'ASC' | 'DESC', $offset?: number, $limit?: number, + $language?: string } -interface EmployeeContractItemEntityEvent { +export interface EmployeeContractItemEntityEvent { readonly operation: 'create' | 'update' | 'delete'; readonly table: string; readonly entity: Partial; @@ -83,7 +84,7 @@ interface EmployeeContractItemEntityEvent { } } -interface EmployeeContractItemUpdateEntityEvent extends EmployeeContractItemEntityEvent { +export interface EmployeeContractItemUpdateEntityEvent extends EmployeeContractItemEntityEvent { readonly previousEntity: EmployeeContractItemEntity; } @@ -120,14 +121,15 @@ export class EmployeeContractItemRepository { private readonly dao; constructor(dataSource = "DefaultDB") { - this.dao = daoApi.create(EmployeeContractItemRepository.DEFINITION, null, dataSource); + this.dao = daoApi.create(EmployeeContractItemRepository.DEFINITION, undefined, dataSource); } - public findAll(options?: EmployeeContractItemEntityOptions): EmployeeContractItemEntity[] { - return this.dao.list(options); + public findAll(options: EmployeeContractItemEntityOptions = {}): EmployeeContractItemEntity[] { + let list = this.dao.list(options); + return list; } - public findById(id: number): EmployeeContractItemEntity | undefined { + public findById(id: number, options: EmployeeContractItemEntityOptions = {}): EmployeeContractItemEntity | undefined { const entity = this.dao.find(id); return entity ?? undefined; } diff --git a/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractRepository.ts b/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractRepository.ts index 4d5fc6f..2c4ba92 100644 --- a/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractRepository.ts +++ b/codbex-contracts/gen/codbex-contracts/dao/EmployeeContracts/EmployeeContractRepository.ts @@ -1,7 +1,7 @@ -import { query } from "sdk/db"; -import { producer } from "sdk/messaging"; -import { extensions } from "sdk/extensions"; -import { dao as daoApi } from "sdk/db"; +import { sql, query } from "@aerokit/sdk/db"; +import { producer } from "@aerokit/sdk/messaging"; +import { extensions } from "@aerokit/sdk/extensions"; +import { dao as daoApi } from "@aerokit/sdk/db"; import { EntityUtils } from "../utils/EntityUtils"; // custom imports import { NumberGeneratorService } from "/codbex-number-generator/service/generator"; @@ -132,12 +132,13 @@ export interface EmployeeContractEntityOptions { }, $select?: (keyof EmployeeContractEntity)[], $sort?: string | (keyof EmployeeContractEntity)[], - $order?: 'asc' | 'desc', + $order?: 'ASC' | 'DESC', $offset?: number, $limit?: number, + $language?: string } -interface EmployeeContractEntityEvent { +export interface EmployeeContractEntityEvent { readonly operation: 'create' | 'update' | 'delete'; readonly table: string; readonly entity: Partial; @@ -148,7 +149,7 @@ interface EmployeeContractEntityEvent { } } -interface EmployeeContractUpdateEntityEvent extends EmployeeContractEntityEvent { +export interface EmployeeContractUpdateEntityEvent extends EmployeeContractEntityEvent { readonly previousEntity: EmployeeContractEntity; } @@ -220,18 +221,19 @@ export class EmployeeContractRepository { private readonly dao; constructor(dataSource = "DefaultDB") { - this.dao = daoApi.create(EmployeeContractRepository.DEFINITION, null, dataSource); + this.dao = daoApi.create(EmployeeContractRepository.DEFINITION, undefined, dataSource); } - public findAll(options?: EmployeeContractEntityOptions): EmployeeContractEntity[] { - return this.dao.list(options).map((e: EmployeeContractEntity) => { + public findAll(options: EmployeeContractEntityOptions = {}): EmployeeContractEntity[] { + let list = this.dao.list(options).map((e: EmployeeContractEntity) => { EntityUtils.setDate(e, "StartDate"); EntityUtils.setDate(e, "EndDate"); return e; }); + return list; } - public findById(id: number): EmployeeContractEntity | undefined { + public findById(id: number, options: EmployeeContractEntityOptions = {}): EmployeeContractEntity | undefined { const entity = this.dao.find(id); EntityUtils.setDate(entity, "StartDate"); EntityUtils.setDate(entity, "EndDate"); @@ -242,7 +244,7 @@ export class EmployeeContractRepository { EntityUtils.setLocalDate(entity, "StartDate"); EntityUtils.setLocalDate(entity, "EndDate"); // @ts-ignore - (entity as EmployeeContractEntity).Number = new NumberGeneratorService().generate(28); + (entity as EmployeeContractEntity).Number = new NumberGeneratorService().generateByType('Employee Contract'); const id = this.dao.insert(entity); this.triggerEvent({ operation: "create", diff --git a/codbex-contracts/gen/codbex-contracts/dao/Settings/ContractTypeRepository.ts b/codbex-contracts/gen/codbex-contracts/dao/Settings/ContractTypeRepository.ts index c6d37b0..efc5f2e 100644 --- a/codbex-contracts/gen/codbex-contracts/dao/Settings/ContractTypeRepository.ts +++ b/codbex-contracts/gen/codbex-contracts/dao/Settings/ContractTypeRepository.ts @@ -1,7 +1,7 @@ -import { query } from "sdk/db"; -import { producer } from "sdk/messaging"; -import { extensions } from "sdk/extensions"; -import { dao as daoApi } from "sdk/db"; +import { sql, query } from "@aerokit/sdk/db"; +import { producer } from "@aerokit/sdk/messaging"; +import { extensions } from "@aerokit/sdk/extensions"; +import { dao as daoApi } from "@aerokit/sdk/db"; export interface ContractTypeEntity { readonly Id: number; @@ -49,12 +49,13 @@ export interface ContractTypeEntityOptions { }, $select?: (keyof ContractTypeEntity)[], $sort?: string | (keyof ContractTypeEntity)[], - $order?: 'asc' | 'desc', + $order?: 'ASC' | 'DESC', $offset?: number, $limit?: number, + $language?: string } -interface ContractTypeEntityEvent { +export interface ContractTypeEntityEvent { readonly operation: 'create' | 'update' | 'delete'; readonly table: string; readonly entity: Partial; @@ -65,7 +66,7 @@ interface ContractTypeEntityEvent { } } -interface ContractTypeUpdateEntityEvent extends ContractTypeEntityEvent { +export interface ContractTypeUpdateEntityEvent extends ContractTypeEntityEvent { readonly previousEntity: ContractTypeEntity; } @@ -92,14 +93,15 @@ export class ContractTypeRepository { private readonly dao; constructor(dataSource = "DefaultDB") { - this.dao = daoApi.create(ContractTypeRepository.DEFINITION, null, dataSource); + this.dao = daoApi.create(ContractTypeRepository.DEFINITION, undefined, dataSource); } - public findAll(options?: ContractTypeEntityOptions): ContractTypeEntity[] { - return this.dao.list(options); + public findAll(options: ContractTypeEntityOptions = {}): ContractTypeEntity[] { + let list = this.dao.list(options); + return list; } - public findById(id: number): ContractTypeEntity | undefined { + public findById(id: number, options: ContractTypeEntityOptions = {}): ContractTypeEntity | undefined { const entity = this.dao.find(id); return entity ?? undefined; } diff --git a/codbex-contracts/gen/codbex-contracts/index.html b/codbex-contracts/gen/codbex-contracts/index.html deleted file mode 100644 index 2c7b0c9..0000000 --- a/codbex-contracts/gen/codbex-contracts/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/controller.js index 0b0e1d9..551c044 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/controller.js @@ -1,31 +1,42 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Contract.Contract'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { + .controller('PageController', ($scope, $http, EntityService, Extensions, LocaleService, ButtonStates) => { + const Dialogs = new DialogHub(); + let translated = { + yes: 'Yes', + no: 'No', + deleteConfirm: 'Are you sure you want to delete Contract? This action cannot be undone.', + deleteTitle: 'Delete Contract?' + }; + LocaleService.onInit(() => { + translated.yes = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.yes'); + translated.no = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.no'); + translated.deleteTitle = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.deleteTitle', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + translated.deleteConfirm = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.deleteConfirm', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + }); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-contracts-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "Contract" && e.view === "Contract" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-contracts-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'Contract' && e.view === 'Contract' && (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: LocaleService.t(action.translation.key, action.translation.options, action.label), + path: action.path, + maxWidth: action.maxWidth, + maxHeight: action.maxHeight, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +53,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.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; } @@ -75,13 +83,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("Contract", `Unable to count Contract: '${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 +95,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("Contract", `Unable to list/filter Contract: '${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.StartDate) { e.StartDate = new Date(e.StartDate); @@ -112,76 +111,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: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLF', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCount', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: 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-contracts.Contract.Contract.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsCompany: $scope.optionsCompany, optionsType: $scope.optionsType, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.createEntity', data: { entity: {}, optionsCompany: $scope.optionsCompany, optionsType: $scope.optionsType, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.updateEntity', data: { entity: $scope.selectedEntity, optionsCompany: $scope.optionsCompany, optionsType: $scope.optionsType, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete Contract?', - `Are you sure you want to delete Contract? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: translated.deleteTitle, + message: translated.deleteConfirm, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: translated.yes, + }, { + id: 'delete-btn-no', + label: translated.no, }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("Contract", `Unable to delete Contract: '${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-contracts.Contract.Contract.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToDelete', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("Contract-filter", { - entity: $scope.filterEntity, - optionsCompany: $scope.optionsCompany, - optionsType: $scope.optionsType, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'Contract-filter', + params: { + entity: $scope.filterEntity, + optionsCompany: $scope.optionsCompany, + optionsType: $scope.optionsType, + }, }); }; @@ -190,25 +211,37 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsType = []; - $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: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts").then(function (response) { - $scope.optionsType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts').then((response) => { + $scope.optionsType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Type', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $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; @@ -216,7 +249,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsTypeValue = function (optionKey) { + $scope.optionsTypeValue = (optionKey) => { for (let i = 0; i < $scope.optionsType.length; i++) { if ($scope.optionsType[i].value === optionKey) { return $scope.optionsType[i].text; @@ -225,5 +258,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/controller.js index 38bf365..e3a36bb 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/controller.js @@ -1,104 +1,99 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Contract.Contract'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).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?.StartDateFrom) { - params.entity.StartDateFrom = new Date(params.entity.StartDateFrom); - } - if (params?.entity?.StartDateTo) { - params.entity.StartDateTo = new Date(params.entity.StartDateTo); - } - if (params?.entity?.EndDateFrom) { - params.entity.EndDateFrom = new Date(params.entity.EndDateFrom); - } - if (params?.entity?.EndDateTo) { - params.entity.EndDateTo = new Date(params.entity.EndDateTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsCompany = params.optionsCompany; - $scope.optionsType = params.optionsType; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.StartDateFrom) { + params.entity.StartDateFrom = new Date(params.entity.StartDateFrom); + } + if (params?.entity?.StartDateTo) { + params.entity.StartDateTo = new Date(params.entity.StartDateTo); } + if (params?.entity?.EndDateFrom) { + params.entity.EndDateFrom = new Date(params.entity.EndDateFrom); + } + if (params?.entity?.EndDateTo) { + params.entity.EndDateTo = new Date(params.entity.EndDateTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsCompany = params.optionsCompany; + $scope.optionsType = params.optionsType; + } - $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.Number) { - filter.$filter.contains.Number = entity.Number; - } - if (entity.StartDateFrom) { - filter.$filter.greaterThanOrEqual.StartDate = entity.StartDateFrom; - } - if (entity.StartDateTo) { - filter.$filter.lessThanOrEqual.StartDate = entity.StartDateTo; - } - if (entity.EndDateFrom) { - filter.$filter.greaterThanOrEqual.EndDate = entity.EndDateFrom; - } - if (entity.EndDateTo) { - filter.$filter.lessThanOrEqual.EndDate = entity.EndDateTo; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.Document) { - filter.$filter.contains.Document = entity.Document; - } - if (entity.Type !== undefined) { - filter.$filter.equals.Type = entity.Type; - } - if (entity.Comment) { - filter.$filter.contains.Comment = entity.Comment; - } - 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.Number) { + filter.$filter.contains.Number = entity.Number; + } + if (entity.StartDateFrom) { + filter.$filter.greaterThanOrEqual.StartDate = entity.StartDateFrom; + } + if (entity.StartDateTo) { + filter.$filter.lessThanOrEqual.StartDate = entity.StartDateTo; + } + if (entity.EndDateFrom) { + filter.$filter.greaterThanOrEqual.EndDate = entity.EndDateFrom; + } + if (entity.EndDateTo) { + filter.$filter.lessThanOrEqual.EndDate = entity.EndDateTo; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.Document) { + filter.$filter.contains.Document = entity.Document; + } + if (entity.Type !== undefined) { + filter.$filter.equals.Type = entity.Type; + } + if (entity.Comment) { + filter.$filter.contains.Comment = entity.Comment; + } + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-contracts.Contract.Contract.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("Contract-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'Contract-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/index.html b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/index.html index 24bcae8..65424cd 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/index.html @@ -2,194 +2,176 @@ - - + - - - - - - + + + + - - - + + + {{ errorMessage }} - - - + + +
- Number + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_NUMBER' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_NUMBER)'} }}"> + +
-
- + +
- From StartDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.from' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_STARTDATE)'} }}
- - + - - Incorrect Input - + +
- To StartDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.to' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_STARTDATE)'} }}
- - + - - Incorrect Input - + +
-
- + +
- From EndDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.from' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_ENDDATE)'} }}
- - + - - Incorrect Input - + +
- To EndDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.to' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_ENDDATE)'} }}
- - + - - Incorrect Input - + +
-
- + +
- Company + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_COMPANY' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_COMPANY)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Company'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Company'} }}"> +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_DOCUMENT' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_DOCUMENT)'} }}"> + +
-
- + +
- Type + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_TYPE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_TYPE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Type'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Type'} }}"> +
-
- + +
- Comment + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_COMMENT' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_COMMENT)'} }}"> + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.extension index 608e06f..5703bad 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.js index 253b9bc..5f0141d 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/view.js @@ -4,14 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "Contract-filter", - label: "Contract Filter", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/index.html", - perspectiveName: "Contract" + id: 'Contract-filter', + label: 'Contract Filter', + translation: { + key: 'codbex-contracts:codbex-contracts-model.extName', + options: { + content: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT) $t(codbex-contracts:codbex-contracts-model.defaults.filter)', + } + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-filter/index.html', + perspectiveName: 'Contract' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/controller.js index b45c246..402f503 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/controller.js @@ -1,23 +1,33 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Contract.Contract'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => { + const Dialogs = new DialogHub(); + const Notifications = new NotificationHub(); + let description = 'Description'; + let propertySuccessfullyCreated = 'Contract successfully created'; + let propertySuccessfullyUpdated = 'Contract successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "Contract Details", - create: "Create Contract", - update: "Update Contract" + select: 'Contract Details', + create: 'Create Contract', + update: 'Update Contract' }; $scope.action = 'select'; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + $scope.formHeaders.select = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadSelect', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + $scope.formHeaders.create = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + $scope.formHeaders.update = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + }); + let params = ViewParameters.get(); if (Object.keys(params).length) { $scope.action = params.action; @@ -34,68 +44,100 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsType = params.optionsType; } - $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 Contract: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.entityCreated', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + description: propertySuccessfullyCreated, + type: 'positive' + }); $scope.cancel(); - messageHub.showAlertSuccess("Contract", "Contract successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: 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 Contract: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("Contract", "Contract successfully updated"); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + description: propertySuccessfullyUpdated, + type: 'positive' + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: message }); + }); + console.error('EntityService:', 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: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $scope.serviceType = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts"; + $scope.serviceType = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts'; $scope.optionsType = []; - $http.get("/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts").then(function (response) { - $scope.optionsType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts').then((response) => { + $scope.optionsType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Type', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: 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("Contract-details"); + Dialogs.closeWindow({ id: 'Contract-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-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/index.html b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/index.html index f6a3721..9404761 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/index.html @@ -2,190 +2,165 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Number + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_NUMBER' | t }}
- - - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_NUMBER)'} }}"> +
-
- + +
- StartDate + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_STARTDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- EndDate + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_ENDDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- Company + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_COMPANY' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_COMPANY)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Company'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Company'} }}"> +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_DOCUMENT' | t }}
- {{entity.Document}} + {{entity.Document}}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_DOCUMENT)'} }}"> + +
-
- + +
- Type + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_TYPE' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_TYPE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Type'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Type'} }}"> +
-
- + +
- Comment + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_COMMENT' | t }}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_COMMENT)'} }}"> + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.extension index cc961bc..e2f7b88 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/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-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.js index 7962faf..5f14301 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/view.js @@ -6,15 +6,15 @@ const viewData = { id: "Contract-details", label: "Contract", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/index.html", + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.CONTRACT', + }, + path: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/dialog-window/index.html", perspectiveName: "Contract", roles: [ "codbex-contracts.Contract.ContractReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/index.html b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/index.html index bbb16be..39731ed 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/index.html @@ -2,69 +2,60 @@ - - - - - - - - - + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + {{'codbex-contracts:codbex-contracts-model.defaults.items' | t}} + + + + + + + + + + + + + + + + + + + + - - + {{next.StartDate | date: "dd/MMM/yyyy"}} | {{next.EndDate | date: "dd/MMM/yyyy"}} | {{optionsCompanyValue(next.Company)}} | - {{next.Document}} | + {{next.Document}} | {{optionsTypeValue(next.Type)}} | {{next.Comment}} - - - - - - - Load More ... - - + + + + + + + {{ 'codbex-contracts:codbex-contracts-model.defaults.loadMore' | t }} + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/controller.js index d936c90..718675d 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/controller.js @@ -1,136 +1,175 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Contract.Contract'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Contract/ContractService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, LocaleService, EntityService) => { + const Dialogs = new DialogHub(); + const Notifications = new NotificationHub(); + let description = 'Description'; + let propertySuccessfullyCreated = 'Contract successfully created'; + let propertySuccessfullyUpdated = 'Contract successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "Contract Details", - create: "Create Contract", - update: "Update Contract" + select: 'Contract Details', + create: 'Create Contract', + update: 'Update Contract' }; $scope.action = 'select'; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + $scope.formHeaders.select = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadSelect', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + $scope.formHeaders.create = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + $scope.formHeaders.update = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)' }); + }); + //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-contracts-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "Contract" && e.view === "Contract" && e.type === "entity"); + Extensions.getWindows(['codbex-contracts-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'Contract' && e.view === 'Contract' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: LocaleService.t(action.translation.key, action.translation.options, 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-contracts.Contract.Contract.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsCompany = []; $scope.optionsType = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.StartDate) { - msg.data.entity.StartDate = new Date(msg.data.entity.StartDate); + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.StartDate) { + data.entity.StartDate = new Date(data.entity.StartDate); } - if (msg.data.entity.EndDate) { - msg.data.entity.EndDate = new Date(msg.data.entity.EndDate); + if (data.entity.EndDate) { + data.entity.EndDate = new Date(data.entity.EndDate); } - $scope.entity = msg.data.entity; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsType = msg.data.optionsType; + $scope.entity = data.entity; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsType = data.optionsType; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsType = msg.data.optionsType; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsType = data.optionsType; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.StartDate) { - msg.data.entity.StartDate = new Date(msg.data.entity.StartDate); + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Contract.Contract.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.StartDate) { + data.entity.StartDate = new Date(data.entity.StartDate); } - if (msg.data.entity.EndDate) { - msg.data.entity.EndDate = new Date(msg.data.entity.EndDate); + if (data.entity.EndDate) { + data.entity.EndDate = new Date(data.entity.EndDate); } - $scope.entity = msg.data.entity; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsType = msg.data.optionsType; + $scope.entity = data.entity; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsType = data.optionsType; $scope.action = 'update'; }); - }); + }}); - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; - $scope.serviceType = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts"; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; + $scope.serviceType = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("Contract", `Unable to create Contract: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("Contract", "Contract successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.clearDetails' , data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + description: propertySuccessfullyCreated, + type: 'positive' + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: 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("Contract", `Unable to update Contract: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("Contract", "Contract successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-contracts.Contract.Contract.clearDetails', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + description: propertySuccessfullyUpdated, + type: 'positive' + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACT)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-contracts.Contract.Contract.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: description, + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $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.createType = function () { - messageHub.showDialogWindow("ContractType-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createType = () => { + Dialogs.showWindow({ + id: 'ContractType-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -139,30 +178,40 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $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: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); }; - $scope.refreshType = function () { + $scope.refreshType = () => { $scope.optionsType = []; - $http.get("/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts").then(function (response) { - $scope.optionsType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts').then((response) => { + $scope.optionsType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Type', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/index.html b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/index.html index 189425c..1616bc4 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/index.html @@ -2,204 +2,178 @@ - - + - - - - - + + + + + - - - - - + + + + +
- Number + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_NUMBER' | t }}
- - - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_NUMBER)'} }}"> +
-
- + +
- StartDate + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_STARTDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- EndDate + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_ENDDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- Company + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_COMPANY' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_COMPANY)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Company'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Company'} }}"> +
-
- - - +
+ +
- - + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_DOCUMENT' | t }}
- {{entity.Document}} + {{entity.Document}}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_DOCUMENT)'} }}"> + +
-
- + +
- Type + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_TYPE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_TYPE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Type'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Type'} }}"> +
-
- - - +
+ +
- - + +
- Comment + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACT_COMMENT' | t }}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACT_COMMENT)'} }}"> + +
-
- - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.extension index 0de3b80..7a112ae 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.js", - "extensionPoint": "codbex-contracts-view", + "extensionPoint": "application-views", "description": "codbex-contracts - Application View - Main Details", "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.js index 9a3a6bc..979be04 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/view.js @@ -4,16 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "Contract-details", - label: "Contract", - factory: "frame", - region: "center", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/index.html", - perspectiveName: "Contract" + id: 'Contract-details', + label: 'Contract', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.CONTRACT', + }, + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/main-details/index.html', + perspectiveName: 'Contract' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile-portal.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile-portal.extension deleted file mode 100644 index b81b995..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-contracts - Application Tile", - "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.extension deleted file mode 100644 index 6841e40..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.js", - "extensionPoint": "codbex-contracts-tile", - "description": "codbex-contracts - Application Tile", - "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/tile.js deleted file mode 100644 index aeb162b..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/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-contracts", - name: "Contract", - caption: "Manage entity Contract", - tooltip: "Contract", - type: "PRIMARY", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html", - order: "100", - groupOrder: "100" - }; -} diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.extension index 310aa42..cf1c2b3 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.js", - "extensionPoint": "codbex-contracts-view", + "extensionPoint": "application-views", "description": "codbex-contracts - Application View", "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.js index 1481a00..db00f88 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/view.js @@ -4,16 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "Contract", - label: "Contract", - factory: "frame", - region: "left", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/index.html", - perspectiveName: "Contract" + id: 'Contract', + label: 'Contract', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.CONTRACT', + }, + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/Contract/index.html', + perspectiveName: 'Contract' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html b/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html index 3de1caa..c49fa78 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html @@ -10,70 +10,41 @@ - - - + + - - - + - - - - - - - {{state.busyText}} - - - Encounterd an error while loading - - - + + + + {{'codbex-contracts:codbex-contracts-model.state.busy' | t}} + + + {{'codbex-contracts:codbex-contracts-model.messages.error.loading' | t}} + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective-portal.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective-portal.extension deleted file mode 100644 index 209f153..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.js", - "extensionPoint": "portal", - "description": "codbex-contracts - Perspective - Contract" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.extension b/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.extension index 631e524..8e65a81 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.extension @@ -1,5 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.js", - "extensionPoint": "codbex-contracts", - "description": "codbex-contracts - Perspective - Contract" + "extensionPoint": "application-perspectives", + "description": "codbex-contracts - Perspective - Contract", + "role": "codbex-contracts.Contract.ContractReadOnly,codbex-contracts.Contract.ContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.js b/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.js index aaa0c27..7c4a407 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Contract/perspective.js @@ -5,14 +5,14 @@ */ const perspectiveData = { id: 'Contract', - name: 'Contract', - link: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html', - order: '100', + label: 'Contract', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.CONTRACT', + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Contract/index.html', + order: 100, icon: '/services/web/resources/unicons/document-info.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/controller.js index 9d531ae..bb44f6d 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/controller.js @@ -1,37 +1,55 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContractItem'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', 'Extensions', function ($scope, messageHub, entityApi, Extensions) { + .controller('PageController', ($scope, EntityService, Extensions, LocaleService, ButtonStates) => { + const Dialogs = new DialogHub(); + let translated = { + yes: 'Yes', + no: 'No', + deleteConfirm: 'Are you sure you want to delete EmployeeContractItem? This action cannot be undone.', + deleteTitle: 'Delete EmployeeContractItem?' + }; + + LocaleService.onInit(() => { + translated.yes = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.yes'); + translated.no = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.no'); + translated.deleteTitle = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.deleteTitle', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + translated.deleteConfirm = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.deleteConfirm', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + }); //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-contracts-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "EmployeeContracts" && e.view === "EmployeeContractItem" && (e.type === "page" || e.type === undefined)); - $scope.entityActions = response.filter(e => e.perspective === "EmployeeContracts" && e.view === "EmployeeContractItem" && e.type === "entity"); + Extensions.getWindows(['codbex-contracts-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'EmployeeContracts' && e.view === 'EmployeeContractItem' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'EmployeeContracts' && e.view === 'EmployeeContractItem' && e.type === 'entity'); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: LocaleService.t(action.translation.key, action.translation.options, action.label), + path: action.path, + params: { + selectedMainEntityKey: 'EmployeeContract', + selectedMainEntityId: $scope.selectedMainEntityId, + }, + maxWidth: action.maxWidth, + maxHeight: action.maxHeight, + closeButton: true + }); }; - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { - id: $scope.entity.Id + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: LocaleService.t(action.translation.key, action.translation.options, action.label), + path: action.path, + params: { + id: $scope.entity.Id, + selectedMainEntityKey: 'EmployeeContract', + selectedMainEntityId: $scope.selectedMainEntityId, }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -43,44 +61,39 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) resetPagination(); //-----------------Events-------------------// - messageHub.onDidReceiveMessage("codbex-contracts.EmployeeContracts.EmployeeContract.entitySelected", function (msg) { + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entitySelected', handler: (data) => { resetPagination(); - $scope.selectedMainEntityId = msg.data.selectedMainEntityId; + $scope.selectedMainEntityId = data.selectedMainEntityId; $scope.loadPage($scope.dataPage); - }, true); - - messageHub.onDidReceiveMessage("codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails', handler: () => { + $scope.$evalAsync(() => { resetPagination(); $scope.selectedMainEntityId = null; $scope.data = null; }); - }, true); - - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.entityCreated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.entityUpdated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.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) => { let EmployeeContract = $scope.selectedMainEntityId; $scope.dataPage = pageNumber; if (!filter && $scope.filter) { @@ -96,90 +109,116 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter.$filter.equals = {}; } filter.$filter.equals.EmployeeContract = EmployeeContract; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("EmployeeContractItem", `Unable to count EmployeeContractItem: '${response.message}'`); - return; - } - if (response.data) { - $scope.dataCount = response.data; + EntityService.count(filter).then((resp) => { + if (resp.data) { + $scope.dataCount = resp.data.count; } filter.$offset = (pageNumber - 1) * $scope.dataLimit; filter.$limit = $scope.dataLimit; - entityApi.search(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("EmployeeContractItem", `Unable to list/filter EmployeeContractItem: '${response.message}'`); - return; - } + EntityService.search(filter).then((response) => { $scope.data = response.data; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLF', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCount', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)', message: message }), + type: AlertTypes.Error }); + console.error('EntityService:', error); }); }; - $scope.selectEntity = function (entity) { + $scope.selectEntity = (entity) => { $scope.selectedEntity = entity; }; - $scope.openDetails = function (entity) { + $scope.openDetails = (entity) => { $scope.selectedEntity = entity; - messageHub.showDialogWindow("EmployeeContractItem-details", { - action: "select", - entity: entity, + Dialogs.showWindow({ + id: 'EmployeeContractItem-details', + params: { + action: 'select', + entity: entity, + }, }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("EmployeeContractItem-filter", { - entity: $scope.filterEntity, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'EmployeeContractItem-filter', + params: { + entity: $scope.filterEntity, + }, }); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - messageHub.showDialogWindow("EmployeeContractItem-details", { - action: "create", - entity: {}, - selectedMainEntityKey: "EmployeeContract", - selectedMainEntityId: $scope.selectedMainEntityId, - }, null, false); + Dialogs.showWindow({ + id: 'EmployeeContractItem-details', + params: { + action: 'create', + entity: { + 'EmployeeContract': $scope.selectedMainEntityId + }, + selectedMainEntityKey: 'EmployeeContract', + selectedMainEntityId: $scope.selectedMainEntityId, + }, + closeButton: false + }); }; - $scope.updateEntity = function (entity) { - messageHub.showDialogWindow("EmployeeContractItem-details", { - action: "update", - entity: entity, - selectedMainEntityKey: "EmployeeContract", - selectedMainEntityId: $scope.selectedMainEntityId, - }, null, false); + $scope.updateEntity = (entity) => { + Dialogs.showWindow({ + id: 'EmployeeContractItem-details', + params: { + action: 'update', + entity: entity, + selectedMainEntityKey: 'EmployeeContract', + selectedMainEntityId: $scope.selectedMainEntityId, + }, + closeButton: false + }); }; - $scope.deleteEntity = function (entity) { + $scope.deleteEntity = (entity) => { let id = entity.Id; - messageHub.showDialogAsync( - 'Delete EmployeeContractItem?', - `Are you sure you want to delete EmployeeContractItem? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: translated.deleteTitle, + message: translated.deleteConfirm, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: translated.yes, + }, { + id: 'delete-btn-no', + label: translated.no, }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("EmployeeContractItem", `Unable to delete EmployeeContractItem: '${response.message}'`); - return; - } + closeButton: false + }).then((buttonId) => { + if (buttonId === 'delete-btn-yes') { + EntityService.delete(id).then(() => { $scope.loadPage($scope.dataPage, $scope.filter); - messageHub.postMessage("clearDetails"); + Dialogs.triggerEvent('codbex-contracts.EmployeeContracts.EmployeeContractItem.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToDelete', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)', message: message }), + type: AlertTypes.Error, + }); + console.error('EntityService:', error); }); } }); }; - - }]); + }); diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/controller.js index ba8137a..254e53a 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/controller.js @@ -1,71 +1,66 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContractItem'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).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: { }, - }; - if (entity.Id !== undefined) { - filter.$filter.equals.Id = entity.Id; - } - if (entity.Name) { - filter.$filter.contains.Name = entity.Name; - } - if (entity.Document) { - filter.$filter.contains.Document = entity.Document; - } - if (entity.EmployeeContract !== undefined) { - filter.$filter.equals.EmployeeContract = entity.EmployeeContract; - } - 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 !== undefined) { + filter.$filter.equals.Id = entity.Id; + } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } + if (entity.Document) { + filter.$filter.contains.Document = entity.Document; + } + if (entity.EmployeeContract !== undefined) { + filter.$filter.equals.EmployeeContract = entity.EmployeeContract; + } + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.entitySearch', data: { + entity: entity, + filter: filter + }}); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("EmployeeContractItem-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'EmployeeContractItem-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/index.html index ba72152..6d0b8d0 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/index.html @@ -2,87 +2,73 @@ - - + - - - - - - + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_NAME' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_NAME)'} }}"> + +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_DOCUMENT' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_DOCUMENT)'} }}"> + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.extension index 9da6106..6efaa66 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.EmployeeContracts.EmployeeContractItemReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractItemFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.js index a09bc20..466c48b 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/view.js @@ -4,14 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeeContractItem-filter", - label: "EmployeeContractItem Filter", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/index.html", - perspectiveName: "EmployeeContracts" + id: 'EmployeeContractItem-filter', + label: 'EmployeeContractItem Filter', + translation: { + key: 'codbex-contracts:codbex-contracts-model.extName', + options: { + content: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM) $t(codbex-contracts:codbex-contracts-model.defaults.filter)', + } + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-filter/index.html', + perspectiveName: 'EmployeeContracts' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/controller.js index dd0665a..5f4c3a3 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/controller.js @@ -1,23 +1,33 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContractItem'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractItemService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => { + const Dialogs = new DialogHub(); + const Notifications = new NotificationHub(); + let description = 'Description'; + let propertySuccessfullyCreated = 'EmployeeContractItem successfully created'; + let propertySuccessfullyUpdated = 'EmployeeContractItem successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "EmployeeContractItem Details", - create: "Create EmployeeContractItem", - update: "Update EmployeeContractItem" + select: 'EmployeeContractItem Details', + create: 'Create EmployeeContractItem', + update: 'Update EmployeeContractItem' }; $scope.action = 'select'; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + $scope.formHeaders.select = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadSelect', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + $scope.formHeaders.create = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + $scope.formHeaders.update = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)' }); + }); + let params = ViewParameters.get(); if (Object.keys(params).length) { $scope.action = params.action; @@ -26,40 +36,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) { - messageHub.showAlertError("EmployeeContractItem", `Unable to create EmployeeContractItem: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.entityCreated', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + description: propertySuccessfullyCreated, + type: 'positive' + }); $scope.cancel(); - messageHub.showAlertSuccess("EmployeeContractItem", "EmployeeContractItem successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)', message: message }), + type: AlertTypes.Error + }); + 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) { - messageHub.showAlertError("EmployeeContractItem", `Unable to update EmployeeContractItem: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContractItem.entityUpdated', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + description: propertySuccessfullyUpdated, + type: 'positive' + }); $scope.cancel(); - messageHub.showAlertSuccess("EmployeeContractItem", "EmployeeContractItem successfully updated"); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM)', message: message }), + type: AlertTypes.Error + }); + 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("EmployeeContractItem-details"); + Dialogs.closeWindow({ id: 'EmployeeContractItem-details' }); }; - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/index.html index c531743..673e09f 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/index.html @@ -2,86 +2,81 @@ - - + - - - - - + + + + + - - - - - + + + + +
- Name + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_NAME' | t }}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_NAME)'} }}"> + +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_DOCUMENT' | t }}
- {{entity.Document}} + {{entity.Document}}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_DOCUMENT)'} }}"> + +
-
-
-
-
+ + + + - - - - - - - - - - + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.extension index a9f6036..75d8e11 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.EmployeeContracts.EmployeeContractItemReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractItemFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.js index de55c3c..161d082 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/view.js @@ -4,14 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeeContractItem-details", - label: "EmployeeContractItem", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/index.html", - perspectiveName: "EmployeeContracts" + id: 'EmployeeContractItem-details', + label: 'EmployeeContractItem', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM', + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/dialog-window/index.html', + perspectiveName: 'EmployeeContracts' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/index.html index 47c80aa..12f3e66 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/index.html @@ -2,78 +2,70 @@ - - - - - - - - - + + + + + + + + - - - Select a record to get a list of it's details. - + + + {{'codbex-contracts:codbex-contracts-model.messages.detailSelectRecord' | t}} + - - Items - - - - - - - - - - - - + + {{'codbex-contracts:codbex-contracts-model.defaults.items' | t}} + + + + + + +
NameDocument
+ + + + + - - - + + + - - - + + -
{{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_NAME' | t:'Name' }}{{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM_DOCUMENT' | t:'Document' }}
No data available.
{{'codbex-contracts:codbex-contracts-model.messages.noData' | t}}
{{next.Name}} - {{next.Document}} +
{{next.Name}} + {{next.Document}} - - - - - - - - - - - - - - + + + + + + + + + + + + + +
-
+ - - + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.extension index e093b5e..66e34bf 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.js", - "extensionPoint": "codbex-contracts-view", + "extensionPoint": "application-views", "description": "codbex-contracts - Application View - Details", "role": "codbex-contracts.EmployeeContracts.EmployeeContractItemReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractItemFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.js index 99bd37c..85bffa3 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/view.js @@ -4,16 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeeContractItem", - label: "EmployeeContractItem", - factory: "frame", - region: "bottom", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/index.html", - perspectiveName: "EmployeeContracts" + id: 'EmployeeContractItem', + label: 'EmployeeContractItem', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACTITEM', + }, + region: 'bottom', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/EmployeeContractItem/index.html', + perspectiveName: 'EmployeeContracts' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/controller.js index 6550dee..28c373e 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/controller.js @@ -1,31 +1,42 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContract'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'entityApi', 'Extensions', function ($scope, $http, messageHub, entityApi, Extensions) { + .controller('PageController', ($scope, $http, EntityService, Extensions, LocaleService, ButtonStates) => { + const Dialogs = new DialogHub(); + let translated = { + yes: 'Yes', + no: 'No', + deleteConfirm: 'Are you sure you want to delete EmployeeContract? This action cannot be undone.', + deleteTitle: 'Delete EmployeeContract?' + }; + LocaleService.onInit(() => { + translated.yes = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.yes'); + translated.no = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.no'); + translated.deleteTitle = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.deleteTitle', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + translated.deleteConfirm = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.deleteConfirm', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + }); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataOffset = 0; $scope.dataLimit = 10; - $scope.action = "select"; + $scope.action = 'select'; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-contracts-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "EmployeeContracts" && e.view === "EmployeeContract" && (e.type === "page" || e.type === undefined)); + Extensions.getWindows(['codbex-contracts-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'EmployeeContracts' && e.view === 'EmployeeContract' && (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: LocaleService.t(action.translation.key, action.translation.options, action.label), + path: action.path, + maxWidth: action.maxWidth, + maxHeight: action.maxHeight, + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -42,32 +53,29 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } //-----------------Events-------------------// - messageHub.onDidReceiveMessage("clearDetails", function (msg) { - $scope.$apply(function () { + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.selectedEntity = null; - $scope.action = "select"; + $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entityCreated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entityUpdated', handler: () => { refreshData(); $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.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; } @@ -75,13 +83,9 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) filter = {}; } $scope.selectedEntity = null; - entityApi.count(filter).then(function (response) { - if (response.status != 200) { - messageHub.showAlertError("EmployeeContract", `Unable to count EmployeeContract: '${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 +95,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("EmployeeContract", `Unable to list/filter EmployeeContract: '${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.StartDate) { e.StartDate = new Date(e.StartDate); @@ -112,84 +111,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: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLF', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCount', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: 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-contracts.EmployeeContracts.EmployeeContract.entitySelected', data: { entity: entity, selectedMainEntityId: entity.Id, optionsEmployee: $scope.optionsEmployee, optionsCompany: $scope.optionsCompany, optionsJobRole: $scope.optionsJobRole, optionsType: $scope.optionsType, - }); + }}); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - $scope.action = "create"; + $scope.action = 'create'; - messageHub.postMessage("createEntity", { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.createEntity', data: { entity: {}, optionsEmployee: $scope.optionsEmployee, optionsCompany: $scope.optionsCompany, optionsJobRole: $scope.optionsJobRole, optionsType: $scope.optionsType, - }); + }}); }; - $scope.updateEntity = function () { - $scope.action = "update"; - messageHub.postMessage("updateEntity", { + $scope.updateEntity = () => { + $scope.action = 'update'; + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.updateEntity', data: { entity: $scope.selectedEntity, optionsEmployee: $scope.optionsEmployee, optionsCompany: $scope.optionsCompany, optionsJobRole: $scope.optionsJobRole, optionsType: $scope.optionsType, - }); + }}); }; - $scope.deleteEntity = function () { + $scope.deleteEntity = () => { let id = $scope.selectedEntity.Id; - messageHub.showDialogAsync( - 'Delete EmployeeContract?', - `Are you sure you want to delete EmployeeContract? This action cannot be undone.`, - [{ - id: "delete-btn-yes", - type: "emphasized", - label: "Yes", - }, - { - id: "delete-btn-no", - type: "normal", - label: "No", + Dialogs.showDialog({ + title: translated.deleteTitle, + message: translated.deleteConfirm, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: translated.yes, + }, { + id: 'delete-btn-no', + label: translated.no, }], - ).then(function (msg) { - if (msg.data === "delete-btn-yes") { - entityApi.delete(id).then(function (response) { - if (response.status != 204) { - messageHub.showAlertError("EmployeeContract", `Unable to delete EmployeeContract: '${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-contracts.EmployeeContracts.EmployeeContract.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToDelete', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("EmployeeContract-filter", { - entity: $scope.filterEntity, - optionsEmployee: $scope.optionsEmployee, - optionsCompany: $scope.optionsCompany, - optionsJobRole: $scope.optionsJobRole, - optionsType: $scope.optionsType, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'EmployeeContract-filter', + params: { + entity: $scope.filterEntity, + optionsEmployee: $scope.optionsEmployee, + optionsCompany: $scope.optionsCompany, + optionsJobRole: $scope.optionsJobRole, + optionsType: $scope.optionsType, + }, }); }; @@ -200,43 +221,67 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsType = []; - $http.get("/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts").then(function (response) { - $scope.optionsEmployee = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts').then((response) => { + $scope.optionsEmployee = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Employee', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: 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: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts").then(function (response) { - $scope.optionsJobRole = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts').then((response) => { + $scope.optionsJobRole = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'JobRole', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $http.get("/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts").then(function (response) { - $scope.optionsType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts').then((response) => { + $scope.optionsType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Type', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $scope.optionsEmployeeValue = function (optionKey) { + $scope.optionsEmployeeValue = (optionKey) => { for (let i = 0; i < $scope.optionsEmployee.length; i++) { if ($scope.optionsEmployee[i].value === optionKey) { return $scope.optionsEmployee[i].text; @@ -244,7 +289,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; @@ -252,7 +297,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsJobRoleValue = function (optionKey) { + $scope.optionsJobRoleValue = (optionKey) => { for (let i = 0; i < $scope.optionsJobRole.length; i++) { if ($scope.optionsJobRole[i].value === optionKey) { return $scope.optionsJobRole[i].text; @@ -260,7 +305,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) } return null; }; - $scope.optionsTypeValue = function (optionKey) { + $scope.optionsTypeValue = (optionKey) => { for (let i = 0; i < $scope.optionsType.length; i++) { if ($scope.optionsType[i].value === optionKey) { return $scope.optionsType[i].text; @@ -269,5 +314,4 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) return null; }; //----------------Dropdowns-----------------// - - }]); + }); diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/controller.js index e26b3ca..19d005d 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/controller.js @@ -1,115 +1,110 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContract'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).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?.StartDateFrom) { - params.entity.StartDateFrom = new Date(params.entity.StartDateFrom); - } - if (params?.entity?.StartDateTo) { - params.entity.StartDateTo = new Date(params.entity.StartDateTo); - } - if (params?.entity?.EndDateFrom) { - params.entity.EndDateFrom = new Date(params.entity.EndDateFrom); - } - if (params?.entity?.EndDateTo) { - params.entity.EndDateTo = new Date(params.entity.EndDateTo); - } - $scope.entity = params.entity ?? {}; - $scope.selectedMainEntityKey = params.selectedMainEntityKey; - $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsEmployee = params.optionsEmployee; - $scope.optionsCompany = params.optionsCompany; - $scope.optionsJobRole = params.optionsJobRole; - $scope.optionsType = params.optionsType; + let params = ViewParameters.get(); + if (Object.keys(params).length) { + if (params?.entity?.StartDateFrom) { + params.entity.StartDateFrom = new Date(params.entity.StartDateFrom); + } + if (params?.entity?.StartDateTo) { + params.entity.StartDateTo = new Date(params.entity.StartDateTo); } + if (params?.entity?.EndDateFrom) { + params.entity.EndDateFrom = new Date(params.entity.EndDateFrom); + } + if (params?.entity?.EndDateTo) { + params.entity.EndDateTo = new Date(params.entity.EndDateTo); + } + $scope.entity = params.entity ?? {}; + $scope.selectedMainEntityKey = params.selectedMainEntityKey; + $scope.selectedMainEntityId = params.selectedMainEntityId; + $scope.optionsEmployee = params.optionsEmployee; + $scope.optionsCompany = params.optionsCompany; + $scope.optionsJobRole = params.optionsJobRole; + $scope.optionsType = params.optionsType; + } - $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.Number) { - filter.$filter.contains.Number = entity.Number; - } - if (entity.Employee !== undefined) { - filter.$filter.equals.Employee = entity.Employee; - } - if (entity.StartDateFrom) { - filter.$filter.greaterThanOrEqual.StartDate = entity.StartDateFrom; - } - if (entity.StartDateTo) { - filter.$filter.lessThanOrEqual.StartDate = entity.StartDateTo; - } - if (entity.EndDateFrom) { - filter.$filter.greaterThanOrEqual.EndDate = entity.EndDateFrom; - } - if (entity.EndDateTo) { - filter.$filter.lessThanOrEqual.EndDate = entity.EndDateTo; - } - if (entity.Company !== undefined) { - filter.$filter.equals.Company = entity.Company; - } - if (entity.JobRole !== undefined) { - filter.$filter.equals.JobRole = entity.JobRole; - } - if (entity.AnnualPaidLeave !== undefined) { - filter.$filter.equals.AnnualPaidLeave = entity.AnnualPaidLeave; - } - if (entity.Document) { - filter.$filter.contains.Document = entity.Document; - } - if (entity.Type !== undefined) { - filter.$filter.equals.Type = entity.Type; - } - if (entity.Comment) { - filter.$filter.contains.Comment = entity.Comment; - } - 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.Number) { + filter.$filter.contains.Number = entity.Number; + } + if (entity.Employee !== undefined) { + filter.$filter.equals.Employee = entity.Employee; + } + if (entity.StartDateFrom) { + filter.$filter.greaterThanOrEqual.StartDate = entity.StartDateFrom; + } + if (entity.StartDateTo) { + filter.$filter.lessThanOrEqual.StartDate = entity.StartDateTo; + } + if (entity.EndDateFrom) { + filter.$filter.greaterThanOrEqual.EndDate = entity.EndDateFrom; + } + if (entity.EndDateTo) { + filter.$filter.lessThanOrEqual.EndDate = entity.EndDateTo; + } + if (entity.Company !== undefined) { + filter.$filter.equals.Company = entity.Company; + } + if (entity.JobRole !== undefined) { + filter.$filter.equals.JobRole = entity.JobRole; + } + if (entity.AnnualPaidLeave !== undefined) { + filter.$filter.equals.AnnualPaidLeave = entity.AnnualPaidLeave; + } + if (entity.Document) { + filter.$filter.contains.Document = entity.Document; + } + if (entity.Type !== undefined) { + filter.$filter.equals.Type = entity.Type; + } + if (entity.Comment) { + filter.$filter.contains.Comment = entity.Comment; + } + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entitySearch', data: { + entity: entity, + filter: filter + }}); + Dialogs.triggerEvent('codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails'); + $scope.cancel(); + }; - $scope.cancel = function () { - messageHub.closeDialogWindow("EmployeeContract-filter"); - }; + $scope.resetFilter = () => { + $scope.entity = {}; + $scope.filter(); + }; - $scope.clearErrorMessage = function () { - $scope.errorMessage = null; - }; + $scope.cancel = () => { + Dialogs.closeWindow({ id: 'EmployeeContract-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/index.html index 8386c8a..c35c0b5 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/index.html @@ -2,236 +2,219 @@ - - + - - - - - - + + + + - - - + + + {{ errorMessage }} - - - + + +
- Number + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_NUMBER' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_NUMBER)'} }}"> + +
-
- + +
- Employee + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_EMPLOYEE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_EMPLOYEE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Employee'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Employee'} }}"> +
-
- + +
- From StartDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.from' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_STARTDATE)'} }}
- - + - - Incorrect Input - + +
- To StartDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.to' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_STARTDATE)'} }}
- - + - - Incorrect Input - + +
-
- + +
- From EndDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.from' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ENDDATE)'} }}
- - + - - Incorrect Input - + +
- To EndDate + {{ 'codbex-contracts:codbex-contracts-model.defaults.to' | t:{'text':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ENDDATE)'} }}
- - + - - Incorrect Input - + +
-
- + +
- Company + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMPANY' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMPANY)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Company'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Company'} }}"> +
-
- + +
- JobRole + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_JOBROLE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_JOBROLE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'JobRole'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'JobRole'} }}"> +
-
- + +
- AnnualPaidLeave + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ANNUALPAIDLEAVE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ANNUALPAIDLEAVE)'} }}"> +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_DOCUMENT' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_DOCUMENT)'} }}"> + +
-
- + +
- Type + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_TYPE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_TYPE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Type'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Type'} }}"> +
-
- + +
- Comment + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMMENT' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMMENT)'} }}"> + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.extension index e08eb7e..d9ce8a8 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.js index 60af3ab..dc92544 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/view.js @@ -4,14 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeeContract-filter", - label: "EmployeeContract Filter", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/index.html", - perspectiveName: "EmployeeContracts" + id: 'EmployeeContract-filter', + label: 'EmployeeContract Filter', + translation: { + key: 'codbex-contracts:codbex-contracts-model.extName', + options: { + content: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT) $t(codbex-contracts:codbex-contracts-model.defaults.filter)', + } + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-filter/index.html', + perspectiveName: 'EmployeeContracts' }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/controller.js index f812486..bdd3757 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/controller.js @@ -1,23 +1,33 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContract'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) { - + .controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => { + const Dialogs = new DialogHub(); + const Notifications = new NotificationHub(); + let description = 'Description'; + let propertySuccessfullyCreated = 'EmployeeContract successfully created'; + let propertySuccessfullyUpdated = 'EmployeeContract successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "EmployeeContract Details", - create: "Create EmployeeContract", - update: "Update EmployeeContract" + select: 'EmployeeContract Details', + create: 'Create EmployeeContract', + update: 'Update EmployeeContract' }; $scope.action = 'select'; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + $scope.formHeaders.select = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadSelect', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + $scope.formHeaders.create = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + $scope.formHeaders.update = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + }); + let params = ViewParameters.get(); if (Object.keys(params).length) { $scope.action = params.action; @@ -36,92 +46,136 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsType = params.optionsType; } - $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 EmployeeContract: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entityCreated', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + description: propertySuccessfullyCreated, + type: 'positive' + }); $scope.cancel(); - messageHub.showAlertSuccess("EmployeeContract", "EmployeeContract successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: 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 EmployeeContract: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entityUpdated', data: response.data }); $scope.cancel(); - messageHub.showAlertSuccess("EmployeeContract", "EmployeeContract successfully updated"); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + description: propertySuccessfullyUpdated, + type: 'positive' + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: message }); + }); + console.error('EntityService:', error); }); }; - $scope.serviceEmployee = "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts"; + $scope.serviceEmployee = '/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts'; $scope.optionsEmployee = []; - $http.get("/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts").then(function (response) { - $scope.optionsEmployee = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts').then((response) => { + $scope.optionsEmployee = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Employee', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: 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: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $scope.serviceJobRole = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts"; + $scope.serviceJobRole = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts'; $scope.optionsJobRole = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts").then(function (response) { - $scope.optionsJobRole = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts').then((response) => { + $scope.optionsJobRole = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'JobRole', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); - $scope.serviceType = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts"; + $scope.serviceType = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts'; $scope.optionsType = []; - $http.get("/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts").then(function (response) { - $scope.optionsType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts').then((response) => { + $scope.optionsType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Type', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: 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("EmployeeContract-details"); + Dialogs.closeWindow({ id: 'EmployeeContract-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-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/index.html index c638581..525fc05 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/index.html @@ -2,241 +2,214 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Number + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_NUMBER' | t }}
- - - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_NUMBER)'} }}"> +
-
- + +
- Employee + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_EMPLOYEE' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_EMPLOYEE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Employee'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Employee'} }}"> +
-
- + +
- StartDate + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_STARTDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- EndDate + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ENDDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- Company + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMPANY' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMPANY)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Company'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Company'} }}"> +
-
- + +
- JobRole + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_JOBROLE' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_JOBROLE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'JobRole'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'JobRole'} }}"> +
-
- + +
- AnnualPaidLeave + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ANNUALPAIDLEAVE' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ANNUALPAIDLEAVE)'} }}"> +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_DOCUMENT' | t }}
- {{entity.Document}} + {{entity.Document}}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_DOCUMENT)'} }}"> + +
-
- + +
- Type + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_TYPE' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_TYPE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Type'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Type'} }}"> +
-
- + +
- Comment + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMMENT' | t }}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMMENT)'} }}"> + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.extension index f09e3b4..d80b1fd 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/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-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.js", + "extensionPoint": "application-windows", + "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.js index 714cd57..d0f578c 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/view.js @@ -6,15 +6,15 @@ const viewData = { id: "EmployeeContract-details", label: "EmployeeContract", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/index.html", + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT', + }, + path: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/dialog-window/index.html", perspectiveName: "EmployeeContracts", roles: [ "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly", ] }; - if (typeof exports !== 'undefined') { - exports.getDialogWindow = function () { - return viewData; - } + exports.getView = () => viewData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/index.html index e3f9d9c..5b80681 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/index.html @@ -2,72 +2,63 @@ - - - - - - - - - + + + + + + + + - - - Items - - - - - - - - - - - - - - - - - - - - - - + + {{'codbex-contracts:codbex-contracts-model.defaults.items' | t}} + + + + + + + + + + + + + + + + + + + + - - + {{optionsEmployeeValue(next.Employee)}} | {{next.StartDate | date: "dd/MMM/yyyy"}} | {{next.EndDate | date: "dd/MMM/yyyy"}} | {{optionsCompanyValue(next.Company)}} | {{optionsJobRoleValue(next.JobRole)}} | {{next.AnnualPaidLeave}} | - {{next.Document}} | + {{next.Document}} | {{optionsTypeValue(next.Type)}} | {{next.Comment}} - - - - - - - Load More ... - - + + + + + + + {{ 'codbex-contracts:codbex-contracts-model.defaults.loadMore' | t }} + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/controller.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/controller.js index 28bf45c..56f23c1 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/controller.js @@ -1,44 +1,54 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.EmployeeContracts.EmployeeContract'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(["EntityServiceProvider", (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/EmployeeContracts/EmployeeContractService.ts"; - }]) - .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) { - + .controller('PageController', ($scope, $http, Extensions, LocaleService, EntityService) => { + const Dialogs = new DialogHub(); + const Notifications = new NotificationHub(); + let description = 'Description'; + let propertySuccessfullyCreated = 'EmployeeContract successfully created'; + let propertySuccessfullyUpdated = 'EmployeeContract successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "EmployeeContract Details", - create: "Create EmployeeContract", - update: "Update EmployeeContract" + select: 'EmployeeContract Details', + create: 'Create EmployeeContract', + update: 'Update EmployeeContract' }; $scope.action = 'select'; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + $scope.formHeaders.select = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadSelect', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + $scope.formHeaders.create = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + $scope.formHeaders.update = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)' }); + }); + //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-contracts-custom-action').then(function (response) { - $scope.entityActions = response.filter(e => e.perspective === "EmployeeContracts" && e.view === "EmployeeContract" && e.type === "entity"); + Extensions.getWindows(['codbex-contracts-custom-action']).then((response) => { + $scope.entityActions = response.data.filter(e => e.perspective === 'EmployeeContracts' && e.view === 'EmployeeContract' && e.type === 'entity'); }); - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: LocaleService.t(action.translation.key, action.translation.options, 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-contracts.EmployeeContracts.EmployeeContract.clearDetails', handler: () => { + $scope.$evalAsync(() => { $scope.entity = {}; $scope.optionsEmployee = []; $scope.optionsCompany = []; @@ -46,113 +56,150 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) $scope.optionsType = []; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("entitySelected", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.StartDate) { - msg.data.entity.StartDate = new Date(msg.data.entity.StartDate); + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entitySelected', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.StartDate) { + data.entity.StartDate = new Date(data.entity.StartDate); } - if (msg.data.entity.EndDate) { - msg.data.entity.EndDate = new Date(msg.data.entity.EndDate); + if (data.entity.EndDate) { + data.entity.EndDate = new Date(data.entity.EndDate); } - $scope.entity = msg.data.entity; - $scope.optionsEmployee = msg.data.optionsEmployee; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsJobRole = msg.data.optionsJobRole; - $scope.optionsType = msg.data.optionsType; + $scope.entity = data.entity; + $scope.optionsEmployee = data.optionsEmployee; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsJobRole = data.optionsJobRole; + $scope.optionsType = data.optionsType; $scope.action = 'select'; }); - }); - - messageHub.onDidReceiveMessage("createEntity", function (msg) { - $scope.$apply(function () { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.createEntity', handler: (data) => { + $scope.$evalAsync(() => { $scope.entity = {}; - $scope.optionsEmployee = msg.data.optionsEmployee; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsJobRole = msg.data.optionsJobRole; - $scope.optionsType = msg.data.optionsType; + $scope.optionsEmployee = data.optionsEmployee; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsJobRole = data.optionsJobRole; + $scope.optionsType = data.optionsType; $scope.action = 'create'; }); - }); - - messageHub.onDidReceiveMessage("updateEntity", function (msg) { - $scope.$apply(function () { - if (msg.data.entity.StartDate) { - msg.data.entity.StartDate = new Date(msg.data.entity.StartDate); + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.updateEntity', handler: (data) => { + $scope.$evalAsync(() => { + if (data.entity.StartDate) { + data.entity.StartDate = new Date(data.entity.StartDate); } - if (msg.data.entity.EndDate) { - msg.data.entity.EndDate = new Date(msg.data.entity.EndDate); + if (data.entity.EndDate) { + data.entity.EndDate = new Date(data.entity.EndDate); } - $scope.entity = msg.data.entity; - $scope.optionsEmployee = msg.data.optionsEmployee; - $scope.optionsCompany = msg.data.optionsCompany; - $scope.optionsJobRole = msg.data.optionsJobRole; - $scope.optionsType = msg.data.optionsType; + $scope.entity = data.entity; + $scope.optionsEmployee = data.optionsEmployee; + $scope.optionsCompany = data.optionsCompany; + $scope.optionsJobRole = data.optionsJobRole; + $scope.optionsType = data.optionsType; $scope.action = 'update'; }); - }); + }}); - $scope.serviceEmployee = "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts"; - $scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts"; - $scope.serviceJobRole = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts"; - $scope.serviceType = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts"; + $scope.serviceEmployee = '/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts'; + $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts'; + $scope.serviceJobRole = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts'; + $scope.serviceType = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts'; //-----------------Events-------------------// - $scope.create = function () { - entityApi.create($scope.entity).then(function (response) { - if (response.status != 201) { - messageHub.showAlertError("EmployeeContract", `Unable to create EmployeeContract: '${response.message}'`); - return; - } - messageHub.postMessage("entityCreated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("EmployeeContract", "EmployeeContract successfully created"); + $scope.create = () => { + EntityService.create($scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails' , data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + description: propertySuccessfullyCreated, + type: 'positive' + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: 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("EmployeeContract", `Unable to update EmployeeContract: '${response.message}'`); - return; - } - messageHub.postMessage("entityUpdated", response.data); - messageHub.postMessage("clearDetails", response.data); - messageHub.showAlertSuccess("EmployeeContract", "EmployeeContract successfully updated"); + $scope.update = () => { + EntityService.update($scope.entity.Id, $scope.entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + description: propertySuccessfullyUpdated, + type: 'positive' + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); }; - $scope.cancel = function () { - messageHub.postMessage("clearDetails"); + $scope.cancel = () => { + Dialogs.triggerEvent('codbex-contracts.EmployeeContracts.EmployeeContract.clearDetails'); }; //-----------------Dialogs-------------------// + $scope.alert = (message) => { + if (message) Dialogs.showAlert({ + title: description, + message: message, + type: AlertTypes.Information, + preformatted: true, + }); + }; - $scope.createEmployee = function () { - messageHub.showDialogWindow("Employee-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createEmployee = () => { + Dialogs.showWindow({ + id: 'Employee-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.createJobRole = function () { - messageHub.showDialogWindow("JobRole-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createJobRole = () => { + Dialogs.showWindow({ + id: 'JobRole-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; - $scope.createType = function () { - messageHub.showDialogWindow("ContractType-details", { - action: "create", - entity: {}, - }, null, false); + $scope.createType = () => { + Dialogs.showWindow({ + id: 'ContractType-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false + }); }; //-----------------Dialogs-------------------// @@ -161,52 +208,74 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) //----------------Dropdowns-----------------// - $scope.refreshEmployee = function () { + $scope.refreshEmployee = () => { $scope.optionsEmployee = []; - $http.get("/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts").then(function (response) { - $scope.optionsEmployee = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts').then((response) => { + $scope.optionsEmployee = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Employee', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: 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: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); }; - $scope.refreshJobRole = function () { + $scope.refreshJobRole = () => { $scope.optionsJobRole = []; - $http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts").then(function (response) { - $scope.optionsJobRole = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/JobRoleService.ts').then((response) => { + $scope.optionsJobRole = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'JobRole', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); }; - $scope.refreshType = function () { + $scope.refreshType = () => { $scope.optionsType = []; - $http.get("/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts").then(function (response) { - $scope.optionsType = response.data.map(e => { - return { - value: e.Id, - text: e.Name - } + $http.get('/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts').then((response) => { + $scope.optionsType = response.data.map(e => ({ + value: e.Id, + text: e.Name + })); + }, (error) => { + console.error(error); + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: 'Type', + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLoad', { message: message }), + type: AlertTypes.Error }); }); }; //----------------Dropdowns-----------------// - - - }]); \ No newline at end of file + }); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/index.html index 3d01da8..b0bd5e4 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/index.html @@ -2,271 +2,235 @@ - - + - - - - - + + + + + - - - - - + + + + +
- Number + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_NUMBER' | t }}
- - - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_NUMBER)'} }}"> +
-
- + +
- Employee + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_EMPLOYEE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_EMPLOYEE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Employee'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Employee'} }}"> +
-
- - - +
+ +
- - + +
- StartDate + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_STARTDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- EndDate + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ENDDATE' | t }}
- - + - - Incorrect Input - - + +
-
- + +
- Company + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMPANY' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMPANY)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Company'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Company'} }}"> +
-
- - - +
+ +
- - + +
- JobRole + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_JOBROLE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_JOBROLE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'JobRole'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'JobRole'} }}"> +
-
- - - +
+ +
- - + +
- AnnualPaidLeave + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ANNUALPAIDLEAVE' | t }}
- - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_ANNUALPAIDLEAVE)'} }}"> +
-
- + +
- Document + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_DOCUMENT' | t }}
- {{entity.Document}} + {{entity.Document}}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_DOCUMENT)'} }}"> + +
-
- + +
- Type + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_TYPE' | t }}
- - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputSearch' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_TYPE)'} }}" + btn-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.showHide' | t:{'name':'Type'} }}" list-aria-label="{{ 'codbex-contracts:codbex-contracts-model.aria.options' | t:{'name':'Type'} }}"> +
-
- - - +
+ +
- - + +
- Comment + {{ 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMMENT' | t }}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT_COMMENT)'} }}"> + +
-
- - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.extension index 0f8394e..f110cab 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.js", - "extensionPoint": "codbex-contracts-view", + "extensionPoint": "application-views", "description": "codbex-contracts - Application View - Main Details", "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.js index f8c4c93..1c92541 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/view.js @@ -4,16 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeeContract-details", - label: "EmployeeContract", - factory: "frame", - region: "center", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/index.html", - perspectiveName: "EmployeeContracts" + id: 'EmployeeContract-details', + label: 'EmployeeContract', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT', + }, + region: 'center', + lazyLoad: false, + autoFocusTab: true, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/main-details/index.html', + perspectiveName: 'EmployeeContracts' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile-portal.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile-portal.extension deleted file mode 100644 index c496ac0..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-contracts - Application Tile", - "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.extension deleted file mode 100644 index 8c346af..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.js", - "extensionPoint": "codbex-contracts-tile", - "description": "codbex-contracts - Application Tile", - "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/tile.js deleted file mode 100644 index eb5de4d..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/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-contracts", - name: "EmployeeContract", - caption: "Manage entity EmployeeContract", - tooltip: "EmployeeContract", - type: "PRIMARY", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html", - order: "100", - groupOrder: "103" - }; -} diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.extension index eda40df..846cff6 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.js", - "extensionPoint": "codbex-contracts-view", + "extensionPoint": "application-views", "description": "codbex-contracts - Application View", "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.js index 631307a..5ad1085 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/view.js @@ -4,16 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "EmployeeContract", - label: "EmployeeContract", - factory: "frame", - region: "left", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/index.html", - perspectiveName: "EmployeeContracts" + id: 'EmployeeContract', + label: 'EmployeeContract', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT', + }, + region: 'left', + lazyLoad: false, + autoFocusTab: false, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/EmployeeContract/index.html', + perspectiveName: 'EmployeeContracts' }; - if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html index e82bf78..c49fa78 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html @@ -10,70 +10,41 @@ - - - + + - - - + - - - - - - - {{state.busyText}} - - - Encounterd an error while loading - - - + + + + {{'codbex-contracts:codbex-contracts-model.state.busy' | t}} + + + {{'codbex-contracts:codbex-contracts-model.messages.error.loading' | t}} + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective-portal.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective-portal.extension deleted file mode 100644 index 3f4f1f3..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.js", - "extensionPoint": "portal", - "description": "codbex-contracts - Perspective - EmployeeContracts" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.extension b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.extension index e93cdbd..f432e71 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.extension @@ -1,5 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.js", - "extensionPoint": "codbex-contracts", - "description": "codbex-contracts - Perspective - EmployeeContracts" + "extensionPoint": "application-perspectives", + "description": "codbex-contracts - Perspective - EmployeeContracts", + "role": "codbex-contracts.EmployeeContracts.EmployeeContractReadOnly,codbex-contracts.EmployeeContracts.EmployeeContractFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.js b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.js index be0c9ae..6d89edd 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.js +++ b/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/perspective.js @@ -5,14 +5,14 @@ */ const perspectiveData = { id: 'EmployeeContracts', - name: 'EmployeeContracts', - link: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html', - order: '103', + label: 'EmployeeContracts', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.EMPLOYEECONTRACT', + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/EmployeeContracts/index.html', + order: 103, icon: '/services/web/resources/unicons/book-open.svg' }; - if (typeof exports !== 'undefined') { - exports.getPerspective = function () { - return perspectiveData; - } + exports.getPerspective = () => perspectiveData; } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/controller.js index f8a434e..cb4febb 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/controller.js @@ -1,42 +1,54 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Settings.ContractType'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', 'Extensions', function ($scope, messageHub, entityApi, Extensions) { + .controller('PageController', ($scope, EntityService, Extensions, LocaleService, ButtonStates) => { + const Dialogs = new DialogHub(); + let translated = { + yes: 'Yes', + no: 'No', + deleteConfirm: 'Are you sure you want to delete ContractType? This action cannot be undone.', + deleteTitle: 'Delete ContractType?' + }; + + LocaleService.onInit(() => { + translated.yes = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.yes'); + translated.no = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.no'); + translated.deleteTitle = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.deleteTitle', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + translated.deleteConfirm = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.deleteConfirm', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + }); $scope.dataPage = 1; $scope.dataCount = 0; $scope.dataLimit = 20; //-----------------Custom Actions-------------------// - Extensions.get('dialogWindow', 'codbex-contracts-custom-action').then(function (response) { - $scope.pageActions = response.filter(e => e.perspective === "Settings" && e.view === "ContractType" && (e.type === "page" || e.type === undefined)); - $scope.entityActions = response.filter(e => e.perspective === "Settings" && e.view === "ContractType" && e.type === "entity"); + Extensions.getWindows(['codbex-contracts-custom-action']).then((response) => { + $scope.pageActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'ContractType' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'Settings' && e.view === 'ContractType' && e.type === 'entity'); }); - $scope.triggerPageAction = function (action) { - messageHub.showDialogWindow( - action.id, - {}, - null, - true, - action - ); + $scope.triggerPageAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: LocaleService.t(action.translation.key, action.translation.options, action.label), + path: action.path, + maxWidth: action.maxWidth, + maxHeight: action.maxHeight, + closeButton: true + }); }; - $scope.triggerEntityAction = function (action) { - messageHub.showDialogWindow( - action.id, - { + $scope.triggerEntityAction = (action) => { + Dialogs.showWindow({ + hasHeader: true, + title: LocaleService.t(action.translation.key, action.translation.options, action.label), + path: action.path, + params: { id: $scope.entity.Id }, - null, - true, - action - ); + closeButton: true + }); }; //-----------------Custom Actions-------------------// @@ -48,34 +60,28 @@ angular.module('page', ["ideUI", "ideView", "entityApi"]) resetPagination(); //-----------------Events-------------------// - messageHub.onDidReceiveMessage("entityCreated", function (msg) { + Dialogs.addMessageListener({ topic: 'codbex-contracts.Settings.ContractType.entityCreated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entityUpdated", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Settings.ContractType.entityUpdated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); - }); - - messageHub.onDidReceiveMessage("entitySearch", function (msg) { + }}); + Dialogs.addMessageListener({ topic: 'codbex-contracts.Settings.ContractType.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("ContractType", `Unable to count ContractType: '${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 +89,111 @@ 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("ContractType", `Unable to list/filter ContractType: '${response.message}'`); - return; - } + request.then((response) => { $scope.data = response.data; + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToLF', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); + }); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCount', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)', message: 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("ContractType-details", { - action: "select", - entity: entity, + Dialogs.showWindow({ + id: 'ContractType-details', + params: { + action: 'select', + entity: entity, + }, + closeButton: true, }); }; - $scope.openFilter = function (entity) { - messageHub.showDialogWindow("ContractType-filter", { - entity: $scope.filterEntity, + $scope.openFilter = () => { + Dialogs.showWindow({ + id: 'ContractType-filter', + params: { + entity: $scope.filterEntity, + }, + closeButton: true, }); }; - $scope.createEntity = function () { + $scope.createEntity = () => { $scope.selectedEntity = null; - messageHub.showDialogWindow("ContractType-details", { - action: "create", - entity: {}, - }, null, false); + Dialogs.showWindow({ + id: 'ContractType-details', + params: { + action: 'create', + entity: {}, + }, + closeButton: false, + }); }; - $scope.updateEntity = function (entity) { - messageHub.showDialogWindow("ContractType-details", { - action: "update", - entity: entity, - }, null, false); + $scope.updateEntity = (entity) => { + Dialogs.showWindow({ + id: 'ContractType-details', + params: { + action: 'update', + entity: entity, + }, + closeButton: false, + }); }; - $scope.deleteEntity = function (entity) { + $scope.deleteEntity = (entity) => { let id = entity.Id; - messageHub.showDialogAsync( - 'Delete ContractType?', - `Are you sure you want to delete ContractType? 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("ContractType", `Unable to delete ContractType: '${response.message}'`); - return; - } + Dialogs.showDialog({ + title: translated.deleteTitle, + message: translated.deleteConfirm, + buttons: [{ + id: 'delete-btn-yes', + state: ButtonStates.Emphasized, + label: translated.yes, + }, { + id: 'delete-btn-no', + label: translated.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-contracts.Settings.ContractType.clearDetails'); + }, (error) => { + const message = error.data ? error.data.message : ''; + Dialogs.showAlert({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE'), + message: LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToDelete', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)', message: message }), + type: AlertTypes.Error + }); + console.error('EntityService:', error); }); } }); }; - }]); + }); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/controller.js index 3cc479e..64c8807 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/controller.js @@ -1,65 +1,74 @@ -angular.module('page', ["ideUI", "ideView"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Settings.ContractType'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', function ($scope, messageHub, ViewParameters) { +angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controller('PageController', ($scope, ViewParameters, LocaleService) => { + const Dialogs = new DialogHub(); + let description = 'Description'; + $scope.entity = {}; + $scope.forms = { + details: {}, + }; - $scope.entity = {}; - $scope.forms = { - details: {}, - }; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + }); - 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-contracts.Settings.ContractType.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("ContractType-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: 'ContractType-filter' }); + }; - }]); \ No newline at end of file + $scope.clearErrorMessage = () => { + $scope.errorMessage = null; + }; +}); \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/index.html b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/index.html index c79548a..b606ac6 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/index.html @@ -2,68 +2,56 @@ - - + - - - - - - + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE_NAME' | t }}
- - + - - Incorrect Input - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE_NAME)'} }}"> + +
-
-
-
-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.extension index 20998da..20e1381 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.Settings.ContractTypeReadOnly,codbex-contracts.Settings.ContractTypeFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.js index 8f4a25e..a5e2250 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/view.js @@ -4,14 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "ContractType-filter", - label: "ContractType Filter", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-filter/index.html", - perspectiveName: "Settings" + id: 'ContractType-filter', + label: 'ContractType Filter', + translation: { + key: 'codbex-contracts:codbex-contracts-model.extName', + options: { + content: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE) $t(codbex-contracts:codbex-contracts-model.defaults.filter)', + } + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/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-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/controller.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/controller.js index 9458a9c..55cdd6a 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/controller.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/controller.js @@ -1,23 +1,34 @@ -angular.module('page', ["ideUI", "ideView", "entityApi"]) - .config(["messageHubProvider", function (messageHubProvider) { - messageHubProvider.eventIdPrefix = 'codbex-contracts.Settings.ContractType'; +angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) + .config(['EntityServiceProvider', (EntityServiceProvider) => { + EntityServiceProvider.baseUrl = '/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts'; }]) - .config(["entityApiProvider", function (entityApiProvider) { - entityApiProvider.baseUrl = "/services/ts/codbex-contracts/gen/codbex-contracts/api/Settings/ContractTypeService.ts"; - }]) - .controller('PageController', ['$scope', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, messageHub, ViewParameters, entityApi) { + .controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => { + const Dialogs = new DialogHub(); + const Notifications = new NotificationHub(); + let description = 'Description'; + let propertySuccessfullyCreated = 'ContractType successfully created'; + let propertySuccessfullyUpdated = 'ContractType successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: "ContractType Details", - create: "Create ContractType", - update: "Update ContractType" + select: 'ContractType Details', + create: 'Create ContractType', + update: 'Update ContractType' }; $scope.action = 'select'; + LocaleService.onInit(() => { + description = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.description'); + $scope.formHeaders.select = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadSelect', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + $scope.formHeaders.create = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + $scope.formHeaders.update = LocaleService.t('codbex-contracts:codbex-contracts-model.defaults.formHeadUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)' }); + }); + let params = ViewParameters.get(); if (Object.keys(params).length) { $scope.action = params.action; @@ -26,44 +37,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 ContractType: '${response.message}'`; - return; - } - messageHub.postMessage("entityCreated", response.data); + EntityService.create(entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.Settings.ContractType.entityCreated', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE'), + description: propertySuccessfullyCreated, + type: 'positive' + }); $scope.cancel(); - messageHub.showAlertSuccess("ContractType", "ContractType successfully created"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToCreate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)', message: 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 ContractType: '${response.message}'`; - return; - } - messageHub.postMessage("entityUpdated", response.data); + EntityService.update(id, entity).then((response) => { + Dialogs.postMessage({ topic: 'codbex-contracts.Settings.ContractType.entityUpdated', data: response.data }); + Notifications.show({ + title: LocaleService.t('codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE'), + description: propertySuccessfullyUpdated, + type: 'positive' + }); $scope.cancel(); - messageHub.showAlertSuccess("ContractType", "ContractType successfully updated"); + }, (error) => { + const message = error.data ? error.data.message : ''; + $scope.$evalAsync(() => { + $scope.errorMessage = LocaleService.t('codbex-contracts:codbex-contracts-model.messages.error.unableToUpdate', { name: '$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE)', message: 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("ContractType-details"); + Dialogs.closeWindow({ id: 'ContractType-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-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/index.html b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/index.html index 1c29355..9b084c1 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/index.html @@ -2,69 +2,59 @@ - - + - - - - - - + + + + + - - - + + + {{ errorMessage }} - - - + + +
- Name + {{ 'codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE_NAME' | t }}
- - + - - The value doesn't match the required pattern '' - - + placeholder="{{ 'codbex-contracts:codbex-contracts-model.messages.inputEnter' | t:{'name':'$t(codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE_NAME)'} }}"> + +
-
-
-
-
- - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.extension index 79e46f7..ebb6b58 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.js", - "extensionPoint": "dialog-window", + "extensionPoint": "application-windows", "description": "codbex-contracts - Application Dialog Window", "role": "codbex-contracts.Settings.ContractTypeReadOnly,codbex-contracts.Settings.ContractTypeFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.js index bbf95dc..4462511 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/view.js @@ -4,14 +4,14 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "ContractType-details", - label: "ContractType", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/dialog-window/index.html", - perspectiveName: "Settings" + id: 'ContractType-details', + label: 'ContractType', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE', + }, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/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-contracts/gen/codbex-contracts/ui/Settings/ContractType/index.html b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/index.html index 12c215d..1bbca02 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/index.html +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/index.html @@ -2,70 +2,64 @@ - - - - - - - - - + + + + + + + + - - - Items - - - - - + + + {{'codbex-contracts:codbex-contracts-model.defaults.items' | t}} + + + + + - - - - - - + +
Name
+ + + + - - - + + + - - - + +
{{ 'codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE_NAME' | t:'Name' }}
No data available.
{{'codbex-contracts:codbex-contracts-model.messages.noData' | t}}
{{next.Name}} - - - - - - - - - - - - - - +
{{next.Name}} + + + + + + + + + + + + +
-
+ - - + + + diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile-portal.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile-portal.extension deleted file mode 100644 index 8127b8f..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile-portal.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.js", - "extensionPoint": "portal-tile", - "description": "codbex-contracts - Application Tile", - "role": "codbex-contracts.Settings.ContractTypeReadOnly,codbex-contracts.Settings.ContractTypeFullAccess" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.extension deleted file mode 100644 index 658cf60..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.extension +++ /dev/null @@ -1,6 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.js", - "extensionPoint": "codbex-contracts-tile", - "description": "codbex-contracts - Application Tile", - "role": "codbex-contracts.Settings.ContractTypeReadOnly,codbex-contracts.Settings.ContractTypeFullAccess" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/tile.js deleted file mode 100644 index b11498c..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/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-contracts", - name: "ContractType", - caption: "Manage entity ContractType", - tooltip: "ContractType", - type: "SETTING", - report: "false", - icon: "/services/web/resources/unicons/file.svg", - location: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/index.html", - order: "100", - groupOrder: "999" - }; -} diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.extension index 3814e1b..b37046c 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.extension +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.extension @@ -1,6 +1,6 @@ { "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.js", - "extensionPoint": "codbex-contracts-view", + "extensionPoint": "application-settings", "description": "codbex-contracts - Application View", "role": "codbex-contracts.Settings.ContractTypeReadOnly,codbex-contracts.Settings.ContractTypeFullAccess" } \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.js index 2da1a5a..b1fcfc2 100644 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.js +++ b/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/view.js @@ -4,16 +4,17 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: "ContractType", - label: "ContractType", - factory: "frame", - region: "center", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/index.html", - perspectiveName: "Settings" + id: 'ContractType', + label: 'ContractType', + translation: { + key: 'codbex-contracts:codbex-contracts-model.t.CONTRACTTYPE', + }, + region: 'center', + lazyLoad: true, + autoFocusTab: false, + path: '/services/web/codbex-contracts/gen/codbex-contracts/ui/Settings/ContractType/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-contracts/gen/codbex-contracts/ui/Settings/index.html b/codbex-contracts/gen/codbex-contracts/ui/Settings/index.html deleted file mode 100644 index f05295f..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - {{state.busyText}} - - - Encounterd an error while loading - - - - - - - diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective-portal.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective-portal.extension deleted file mode 100644 index 3de8437..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective-portal.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.js", - "extensionPoint": "portal", - "description": "codbex-contracts - Perspective - Settings" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.extension b/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.extension deleted file mode 100644 index 4d2d0c6..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.js", - "extensionPoint": "codbex-contracts", - "description": "codbex-contracts - Perspective - Settings" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.js b/codbex-contracts/gen/codbex-contracts/ui/Settings/perspective.js deleted file mode 100644 index eb59bae..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts/gen/codbex-contracts/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-contracts/gen/codbex-contracts/ui/launchpad/Home/controller.js b/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/controller.js deleted file mode 100644 index a311405..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts.launchpad.Home'; - }]) - .config(['entityApiProvider', function (entityApiProvider) { - entityApiProvider.baseUrl = '/services/js/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/tiles.js'; - }]) - .controller('PageController', ['$scope', 'messageHub', 'entityApi', '$document', function ($scope, messageHub, entityApi, $document) { - const favoritesStoreId = 'DIRIGIBLE.codbex-contracts.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-contracts/gen/codbex-contracts/ui/launchpad/Home/index.html b/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/index.html deleted file mode 100644 index 8206a8c..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/index.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
-
-

Contracts Managing Module

-
-

Managing contracts 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-contracts/gen/codbex-contracts/ui/launchpad/Home/styles.css b/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/styles.css deleted file mode 100644 index ae6a001..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts/gen/codbex-contracts/ui/launchpad/Home/tiles.js b/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/tiles.js deleted file mode 100644 index fc9b970..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts-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-contracts/gen/codbex-contracts/ui/launchpad/Home/view.extension b/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/view.extension deleted file mode 100644 index 69aec76..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/view.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/view.js", - "extensionPoint": "codbex-contracts-view", - "description": "codbex-contracts - Application View" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/view.js b/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/view.js deleted file mode 100644 index 019a4cc..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts-home-launchpad", - label: "Home Launchpad", - factory: "frame", - region: "center", - link: "/services/web/codbex-contracts/gen/codbex-contracts/ui/launchpad/Home/index.html", - isLaunchpad: true, -}; - -if (typeof exports !== 'undefined') { - exports.getView = function () { - return viewData; - } -} diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/dialog-window.extensionpoint b/codbex-contracts/gen/codbex-contracts/ui/launchpad/dialog-window.extensionpoint deleted file mode 100644 index ebfdc93..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/dialog-window.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dialog-window", - "description": "codbex-contracts - Extension Point for the Application Dialog Window Providers" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu-help.extension b/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu-help.extension deleted file mode 100644 index fb10aea..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu-help.extension +++ /dev/null @@ -1,5 +0,0 @@ -{ - "module": "codbex-contracts/gen/codbex-contracts/ui/launchpad/menu-help.js", - "extensionPoint": "codbex-contracts-menu", - "description": "codbex-contracts - Application Menu" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu-help.js b/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu-help.js deleted file mode 100644 index 9051c09..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts/gen/codbex-contracts/ui/launchpad/menu.extensionpoint b/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu.extensionpoint deleted file mode 100644 index 58bdf90..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/menu.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-contracts-menu", - "description": "codbex-contracts - Extension Point for the Application Main Menu" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.extension b/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.extension deleted file mode 100644 index 925d7c7..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.extension +++ /dev/null @@ -1 +0,0 @@ -{"module":"codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.js","extensionPoint":"codbex-contracts","description":"codbex-contracts - Application Perspective"} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.extensionpoint b/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.extensionpoint deleted file mode 100644 index 6b830d5..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-contracts-perspective", - "description": "codbex-contracts - Extension Point for the Application Perspective Providers" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.js b/codbex-contracts/gen/codbex-contracts/ui/launchpad/perspective.js deleted file mode 100644 index 44b6ca8..0000000 --- a/codbex-contracts/gen/codbex-contracts/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-contracts/gen/codbex-contracts/ui/launchpad/tile.extensionpoint b/codbex-contracts/gen/codbex-contracts/ui/launchpad/tile.extensionpoint deleted file mode 100644 index debe42f..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/tile.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-contracts-tile", - "description": "codbex-contracts - Extension Point for the Application Tile Providers" -} \ No newline at end of file diff --git a/codbex-contracts/gen/codbex-contracts/ui/launchpad/view.extensionpoint b/codbex-contracts/gen/codbex-contracts/ui/launchpad/view.extensionpoint deleted file mode 100644 index 7f53c17..0000000 --- a/codbex-contracts/gen/codbex-contracts/ui/launchpad/view.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-contracts-view", - "description": "codbex-contracts - Extension Point for the Application View Providers" -} \ No newline at end of file diff --git a/codbex-contracts/package.json b/codbex-contracts/package.json index 0973a58..8b3e646 100644 --- a/codbex-contracts/package.json +++ b/codbex-contracts/package.json @@ -7,11 +7,10 @@ }, "publishConfig": { "registry": "https://npm.pkg.github.com" - }, - "scripts": { - "build": "tsc" - }, + } "dependencies": { - "@codbex/codbex-companies": "0.5.0" + "@codbex/codbex-companies": "^1.1.0", + "@codbex/codbex-number-generator": "^1.1.0", + "@codbex/codbex-number-generator-data": "^1.0.0" } } diff --git a/codbex-contracts/project.json b/codbex-contracts/project.json index cf80f06..1e55253 100644 --- a/codbex-contracts/project.json +++ b/codbex-contracts/project.json @@ -1,33 +1,3 @@ { - "guid": "codbex-contracts", - "dependencies": [ - { - "guid": "codbex-companies", - "type": "git", - "url": "https://github.com/codbex/codbex-companies.git", - "branch": "main" - }, - { - "guid": "codbex-navigation-groups", - "type": "git", - "url": "https://github.com/codbex/codbex-navigation-groups", - "branch": "main" - } - ], - "actions": [ - { - "name": "Build TypeScript", - "commands": [ - { - "os": "unix", - "command": "tsc" - }, - { - "os": "windows", - "command": "cmd /c tsc" - } - ], - "registry": "true" - } - ] -} \ No newline at end of file + "guid": "codbex-contracts" +} diff --git a/codbex-contracts/translations/en-US/codbex-contracts.model.json b/codbex-contracts/translations/en-US/codbex-contracts.model.json new file mode 100644 index 0000000..46f0e46 --- /dev/null +++ b/codbex-contracts/translations/en-US/codbex-contracts.model.json @@ -0,0 +1,131 @@ +{ + "codbex-contracts-model": { + "aria": { + "showHide": "show/hide {{name}} options", + "options": "{{name}} options", + "tableRowMenu": "Table Row Menu", + "tableRowMenuBtn": "Table Row Menu Button", + "headerMenu": "Header Menu", + "headerMenuBtn": "Header Menu Button", + "addEntity": "add entity", + "editEntity": "edit entity", + "deleteEntity": "delete entity" + }, + "state": { + "busy": "Loading..." + }, + "messages": { + "error": { + "incorrectInput": "Incorrect Input", + "loading": "Encounterd an error while loading", + "unableToCreate": "Unable to create {{name}}: '{{message}}'", + "unableToUpdate": "Unable to update {{name}}: '{{message}}'", + "unableToDelete": "Unable to delete {{name}}: '{{message}}'", + "unableToLoad": "Unable to load data: '{{message}}'", + "unableToLF": "Unable to list/filter {{name}}: '{{message}}'", + "unableToCount": "Unable to count {{name}}: '{{message}}'", + "pattern": "The value doesn't match the required pattern: {{rule}}", + "lengthMinMax": "Value must be between {{min}} and {{max}} characters long", + "lengthMin": "Value must not be less than {{min}} characters", + "lengthMax": "Value must not be more than {{max}} characters" + }, + "propertySuccessfullyCreated": "{{name}} successfully created", + "propertySuccessfullyUpdated": "{{name}} successfully updated", + "inputSearch": "Search {{name}}...", + "inputEnter": "Enter {{name}}...", + "noData": "No data available.", + "deleteConfirm": "Are you sure you want to delete {{name}}? This action cannot be undone.", + "detailSelectRecord": "Select a record to get a list of it's details." + }, + "defaults": { + "yes": "Yes", + "no": "No", + "add": "Add", + "refresh": "Refresh", + "to": "To {{text}}", + "from": "From {{text}}", + "filter": "Filter", + "print": "Print", + "reset": "Reset", + "create": "Create", + "edit": "Edit", + "update": "Update", + "delete": "Delete", + "cancel": "Cancel", + "items": "Items", + "description": "Description", + "formGrpFilter": "{{name}} Filter", + "formHeadSelect": "{{name}} Details", + "formHeadCreate": "Create {{name}}", + "formHeadUpdate": "Update {{name}}", + "reportTitle": "{{name}} Report", + "reportFilter": "Report Filter", + "viewDetails": "View Details", + "deleteTitle": "Delete {{name}}?", + "loadMore": "Load More..." + }, + "extName": "{{content}}", + "t": { + "CONTRACT": "Contract", + "CONTRACT_ID": "Id", + "CONTRACT_NUMBER": "Number", + "CONTRACT_STARTDATE": "StartDate", + "CONTRACT_ENDDATE": "EndDate", + "CONTRACT_COMPANY": "Company", + "CONTRACT_DOCUMENT": "Document", + "CONTRACT_TYPE": "Type", + "CONTRACT_COMMENT": "Comment", + "CONTRACTTYPE": "ContractType", + "CONTRACTTYPE_ID": "Id", + "CONTRACTTYPE_NAME": "Name", + "COMPANY": "Company", + "COMPANY_ID": "Id", + "COMPANY_NAME": "Name", + "COMPANY_MANAGER": "Manager", + "COMPANY_EMAIL": "Email", + "COMPANY_PHONE": "Phone", + "COMPANY_ADDRESS": "Address", + "COMPANY_POSTCODE": "PostCode", + "COMPANY_CITY": "City", + "COMPANY_COUNTRY": "Country", + "COMPANY_TIN": "TIN", + "COMPANY_IBAN": "IBAN", + "JOBROLE": "JobRole", + "COMPANYROLE_ID": "Id", + "COMPANYROLE_NAME": "Name", + "COMPANYROLE_COMPANY": "Company", + "EMPLOYEECONTRACT": "EmployeeContract", + "EMPLOYEECONTRACT_ID": "Id", + "EMPLOYEECONTRACT_NUMBER": "Number", + "EMPLOYEECONTRACT_EMPLOYEE": "Employee", + "EMPLOYEECONTRACT_STARTDATE": "StartDate", + "EMPLOYEECONTRACT_ENDDATE": "EndDate", + "EMPLOYEECONTRACT_COMPANY": "Company", + "EMPLOYEECONTRACT_JOBROLE": "JobRole", + "EMPLOYEECONTRACT_ANNUALPAIDLEAVE": "AnnualPaidLeave", + "EMPLOYEECONTRACT_DOCUMENT": "Document", + "EMPLOYEECONTRACT_TYPE": "Type", + "EMPLOYEECONTRACT_COMMENT": "Comment", + "EMPLOYEECONTRACTITEM": "EmployeeContractItem", + "EMPLOYEECONTRACTITEM_ID": "Id", + "EMPLOYEECONTRACTITEM_NAME": "Name", + "EMPLOYEECONTRACTITEM_DOCUMENT": "Document", + "EMPLOYEECONTRACTITEM_EMPLOYEECONTRACT": "EmployeeContract", + "EMPLOYEE": "Employee", + "EMPLOYEE_ID": "Id", + "EMPLOYEE_FIRSTNAME": "First Name", + "EMPLOYEE_MIDDLENAME": "Middle Name", + "EMPLOYEE_LASTNAME": "Last Name", + "EMPLOYEE_NAME": "Name", + "EMPLOYEE_BIRTHDATE": "BirthDate", + "EMPLOYEE_PERSONALNUMBER": "PersonalNumber", + "EMPLOYEE_GENDER": "Gender", + "EMPLOYEE_NATIONALITY": "Nationality", + "EMPLOYEE_MARTIALSTATUS": "MartialStatus", + "EMPLOYEE_IBAN": "IBAN", + "Contract": "Contract", + "Settings": "Settings", + "EmployeeContracts": "EmployeeContracts" + } + } +} \ No newline at end of file diff --git a/codbex-contracts/tsconfig.json b/codbex-contracts/tsconfig.json deleted file mode 100644 index 9b957e3..0000000 --- a/codbex-contracts/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "ESNext", - "target": "ES6", - "moduleResolution": "Node", - "baseUrl": "../", - "lib": [ - "ESNext", - "DOM" - ], - "paths": { - "sdk/*": [ - "./modules/src/*" - ], - "/*": [ - "./*" - ] - }, - "types": [ - "../modules/types" - ] - } -} \ No newline at end of file