+
-
+
+
+
+
+
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Organizations/index.html b/codbex-organizations/gen/codbex-organizations/ui/Organizations/index.html
index 7038e67..51c1c37 100644
--- a/codbex-organizations/gen/codbex-organizations/ui/Organizations/index.html
+++ b/codbex-organizations/gen/codbex-organizations/ui/Organizations/index.html
@@ -52,7 +52,7 @@
.constant('extensionPoint', {
perspectives: 'codbex-organizations',
views: 'codbex-organizations-view',
- dialogWindows: 'codbex-organizations-dialog-window'
+ dialogWindows: 'dialog-window'
})
.controller('ApplicationController', ['$scope', 'messageHub', 'Extensions', function ($scope, messageHub, Extensions) {
$scope.state = {
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-filter/view.extension b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-filter/view.extension
index a4e3893..16c05bf 100644
--- a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-filter/view.extension
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-filter/view.extension
@@ -1,5 +1,5 @@
{
"module": "codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-filter/view.js",
- "extensionPoint": "codbex-organizations-dialog-window",
+ "extensionPoint": "dialog-window",
"description": "codbex-organizations - Application Dialog Window"
}
\ No newline at end of file
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/controller.js b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/controller.js
new file mode 100644
index 0000000..99b6734
--- /dev/null
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/controller.js
@@ -0,0 +1,137 @@
+angular.module('page', ["ideUI", "ideView", "entityApi"])
+ .config(["messageHubProvider", function (messageHubProvider) {
+ messageHubProvider.eventIdPrefix = 'codbex-organizations.Teams.Team';
+ }])
+ .config(["entityApiProvider", function (entityApiProvider) {
+ entityApiProvider.baseUrl = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Teams/TeamService.ts";
+ }])
+ .controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) {
+
+ $scope.entity = {};
+ $scope.forms = {
+ details: {},
+ };
+ $scope.formHeaders = {
+ select: "Team Details",
+ create: "Create Team",
+ update: "Update Team"
+ };
+ $scope.action = 'select';
+
+ let params = ViewParameters.get();
+ if (Object.keys(params).length) {
+ $scope.action = params.action;
+ $scope.entity = params.entity;
+ $scope.selectedMainEntityKey = params.selectedMainEntityKey;
+ $scope.selectedMainEntityId = params.selectedMainEntityId;
+ $scope.optionsManager = params.optionsManager;
+ $scope.optionsOrganization = params.optionsOrganization;
+ $scope.optionsDepartment = params.optionsDepartment;
+ }
+
+ $scope.create = function () {
+ let entity = $scope.entity;
+ entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId;
+ entityApi.create(entity).then(function (response) {
+ if (response.status != 201) {
+ $scope.errorMessage = `Unable to create Team: '${response.message}'`;
+ return;
+ }
+ messageHub.postMessage("entityCreated", response.data);
+ $scope.cancel();
+ messageHub.showAlertSuccess("Team", "Team successfully created");
+ });
+ };
+
+ $scope.update = function () {
+ 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 Team: '${response.message}'`;
+ return;
+ }
+ messageHub.postMessage("entityUpdated", response.data);
+ $scope.cancel();
+ messageHub.showAlertSuccess("Team", "Team successfully updated");
+ });
+ };
+
+ $scope.serviceManager = "/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts";
+
+ $scope.optionsManager = [];
+
+ $http.get("/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts").then(function (response) {
+ $scope.optionsManager = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ });
+ $scope.serviceOrganization = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/OrganizationService.ts";
+
+ $scope.optionsOrganization = [];
+
+ $http.get("/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/OrganizationService.ts").then(function (response) {
+ $scope.optionsOrganization = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ });
+ $scope.serviceDepartment = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/DepartmentService.ts";
+
+ $scope.optionsDepartment = [];
+
+ $http.get("/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/DepartmentService.ts").then(function (response) {
+ $scope.optionsDepartment = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ });
+
+ $scope.$watch('entity.Organization', function (newValue, oldValue) {
+ if (newValue !== undefined && newValue !== null) {
+ entityApi.$http.get($scope.serviceOrganization + '/' + newValue).then(function (response) {
+ let valueFrom = response.data.Id;
+ entityApi.$http.post("/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/DepartmentService.ts/search", {
+ $filter: {
+ equals: {
+ Organization: valueFrom
+ }
+ }
+ }).then(function (response) {
+ $scope.optionsDepartment = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ if ($scope.action !== 'select' && newValue !== oldValue) {
+ if ($scope.optionsDepartment.length == 1) {
+ $scope.entity.Department = $scope.optionsDepartment[0].value;
+ } else {
+ $scope.entity.Department = undefined;
+ }
+ }
+ });
+ });
+ }
+ });
+
+ $scope.cancel = function () {
+ $scope.entity = {};
+ $scope.action = 'select';
+ messageHub.closeDialogWindow("Team-details");
+ };
+
+ $scope.clearErrorMessage = function () {
+ $scope.errorMessage = null;
+ };
+
+ }]);
\ No newline at end of file
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/index.html b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/index.html
new file mode 100644
index 0000000..2a22f68
--- /dev/null
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/index.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ errorMessage }}
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+ The value doesn't match the required pattern ''
+
+
+
+
+
+
+ Manager
+
+
+
+
+
+
+
+
+
+ Organization
+
+
+
+
+
+
+
+
+
+ Department
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.extension b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.extension
new file mode 100644
index 0000000..cd57280
--- /dev/null
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.extension
@@ -0,0 +1 @@
+{"module":"codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.js","extensionPoint":"dialog-window","description":"codbex-organizations - Application Dialog Window"}
\ No newline at end of file
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.js b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.js
new file mode 100644
index 0000000..c0520f3
--- /dev/null
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/view.js
@@ -0,0 +1,17 @@
+/*
+ * Generated by Eclipse Dirigible based on model and template.
+ *
+ * Do not modify the content as it may be re-generated again.
+ */
+const viewData = {
+ id: "Team-details",
+ label: "Team",
+ link: "/services/web/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/dialog-window/index.html",
+ perspectiveName: "Teams",
+};
+
+if (typeof exports !== 'undefined') {
+ exports.getDialogWindow = function () {
+ return viewData;
+ }
+}
\ No newline at end of file
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/controller.js b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/controller.js
index 1b18a19..5ab3d98 100644
--- a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/controller.js
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/controller.js
@@ -5,7 +5,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"])
.config(["entityApiProvider", function (entityApiProvider) {
entityApiProvider.baseUrl = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Teams/TeamService.ts";
}])
- .controller('PageController', ['$scope', 'Extensions', 'messageHub', 'entityApi', function ($scope, Extensions, messageHub, entityApi) {
+ .controller('PageController', ['$scope', '$http', 'Extensions', 'messageHub', 'entityApi', function ($scope, $http, Extensions, messageHub, entityApi) {
$scope.entity = {};
$scope.forms = {
@@ -81,6 +81,35 @@ angular.module('page', ["ideUI", "ideView", "entityApi"])
$scope.serviceOrganization = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/OrganizationService.ts";
$scope.serviceDepartment = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/DepartmentService.ts";
+
+ $scope.$watch('entity.Organization', function (newValue, oldValue) {
+ if (newValue !== undefined && newValue !== null) {
+ entityApi.$http.get($scope.serviceOrganization + '/' + newValue).then(function (response) {
+ let valueFrom = response.data.Id;
+ entityApi.$http.post("/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/DepartmentService.ts/search", {
+ $filter: {
+ equals: {
+ Organization: valueFrom
+ }
+ }
+ }).then(function (response) {
+ $scope.optionsDepartment = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ if ($scope.action !== 'select' && newValue !== oldValue) {
+ if ($scope.optionsDepartment.length == 1) {
+ $scope.entity.Department = $scope.optionsDepartment[0].value;
+ } else {
+ $scope.entity.Department = undefined;
+ }
+ }
+ });
+ });
+ }
+ });
//-----------------Events-------------------//
$scope.create = function () {
@@ -110,5 +139,69 @@ angular.module('page', ["ideUI", "ideView", "entityApi"])
$scope.cancel = function () {
messageHub.postMessage("clearDetails");
};
+
+ //-----------------Dialogs-------------------//
+
+ $scope.createManager = function () {
+ messageHub.showDialogWindow("Employee-details", {
+ action: "create",
+ entity: {},
+ }, null, false);
+ };
+ $scope.createOrganization = function () {
+ messageHub.showDialogWindow("Organization-details", {
+ action: "create",
+ entity: {},
+ }, null, false);
+ };
+ $scope.createDepartment = function () {
+ messageHub.showDialogWindow("Department-details", {
+ action: "create",
+ entity: {},
+ }, null, false);
+ };
+
+ //-----------------Dialogs-------------------//
+
+
+
+ //----------------Dropdowns-----------------//
+
+ $scope.refreshManager = function () {
+ $scope.optionsManager = [];
+ $http.get("/services/ts/codbex-employees/gen/codbex-employees/api/Employees/EmployeeService.ts").then(function (response) {
+ $scope.optionsManager = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ });
+ };
+ $scope.refreshOrganization = function () {
+ $scope.optionsOrganization = [];
+ $http.get("/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/OrganizationService.ts").then(function (response) {
+ $scope.optionsOrganization = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ });
+ };
+ $scope.refreshDepartment = function () {
+ $scope.optionsDepartment = [];
+ $http.get("/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/DepartmentService.ts").then(function (response) {
+ $scope.optionsDepartment = response.data.map(e => {
+ return {
+ value: e.Id,
+ text: e.Name
+ }
+ });
+ });
+ };
+
+ //----------------Dropdowns-----------------//
+
}]);
\ No newline at end of file
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/index.html b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/index.html
index e9d6ebc..f5d3eff 100644
--- a/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/index.html
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/Team/main-details/index.html
@@ -46,7 +46,7 @@
Manager
-
+
-
+
+
+
+
+
Organization
-
+
-
+
+
+
+
+
Department
-
+
-
+
+
+
+
+
diff --git a/codbex-organizations/gen/codbex-organizations/ui/Teams/index.html b/codbex-organizations/gen/codbex-organizations/ui/Teams/index.html
index 34c4058..8b48003 100644
--- a/codbex-organizations/gen/codbex-organizations/ui/Teams/index.html
+++ b/codbex-organizations/gen/codbex-organizations/ui/Teams/index.html
@@ -52,7 +52,7 @@
.constant('extensionPoint', {
perspectives: 'codbex-organizations',
views: 'codbex-organizations-view',
- dialogWindows: 'codbex-organizations-dialog-window'
+ dialogWindows: 'dialog-window'
})
.controller('ApplicationController', ['$scope', 'messageHub', 'Extensions', function ($scope, messageHub, Extensions) {
$scope.state = {