-
-
-
+
+
+
-
-
+
+
- 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 }}
-
-
-
+
+
+ {{ 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 }}
-
-
+
-
- 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
-
-
-
-
-
-
-
-
-
- | Name |
- Document |
- |
+
+ {{'codbex-contracts:codbex-contracts-model.defaults.items' | t}}
+
+
+
+
+
+
+
+
+
+ | {{ '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 }}
-
-
-
+
+
+ {{ 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 }}
-
-
-
+
+
+ {{ 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 }}
-
-
+
-
- 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 }}
-
-
+
-
- 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 }}
-
-
-
+
+
+ {{ 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 }}
-
-
-
+
+
+ {{ 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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | 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