Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions codbex-organizations/codbex-organizations.edm

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions codbex-organizations/codbex-organizations.gen
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"Organization-details",
"Organization-details",
"Organization-details",
"Organization-details",
"Organization-details",
"Organization-details",
"Organization-details",
"Organization-details"
],
"name": "Organizations",
Expand Down Expand Up @@ -73,6 +77,10 @@
"Team-details",
"Team-details",
"Team-details",
"Team-details",
"Team-details",
"Team-details",
"Team-details",
"Team-details"
],
"name": "Teams",
Expand Down Expand Up @@ -871,10 +879,10 @@
"description": "",
"name": "Department",
"tooltip": "",
"widgetDependsOnEntity": "",
"widgetDependsOnFilterBy": "",
"widgetDependsOnProperty": "",
"widgetDependsOnValueFrom": "",
"widgetDependsOnEntity": "Organization",
"widgetDependsOnFilterBy": "Organization",
"widgetDependsOnProperty": "Organization",
"widgetDependsOnValueFrom": "Id",
"widgetDropDownKey": "Id",
"widgetDropDownValue": "Name",
"widgetIsMajor": true,
Expand Down Expand Up @@ -1024,10 +1032,10 @@
"description": "",
"name": "Department",
"tooltip": "",
"widgetDependsOnEntity": "",
"widgetDependsOnFilterBy": "",
"widgetDependsOnProperty": "",
"widgetDependsOnValueFrom": "",
"widgetDependsOnEntity": "Organization",
"widgetDependsOnFilterBy": "Organization",
"widgetDependsOnProperty": "Organization",
"widgetDependsOnValueFrom": "Id",
"widgetDropDownKey": "Id",
"widgetDropDownValue": "Name",
"widgetIsMajor": true,
Expand Down
8 changes: 4 additions & 4 deletions codbex-organizations/codbex-organizations.model
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@
"description": "",
"name": "Department",
"tooltip": "",
"widgetDependsOnEntity": "",
"widgetDependsOnFilterBy": "",
"widgetDependsOnProperty": "",
"widgetDependsOnValueFrom": "",
"widgetDependsOnEntity": "Organization",
"widgetDependsOnFilterBy": "Organization",
"widgetDependsOnProperty": "Organization",
"widgetDependsOnValueFrom": "Id",
"widgetDropDownKey": "Id",
"widgetDropDownValue": "Name",
"widgetIsMajor": "true",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module": "codbex-organizations/gen/codbex-organizations/ui/Organizations/Organization/Department/dialog-filter/view.js",
"extensionPoint": "codbex-organizations-dialog-window",
"extensionPoint": "dialog-window",
"description": "codbex-organizations - Application Dialog Window"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module": "codbex-organizations/gen/codbex-organizations/ui/Organizations/Organization/Department/dialog-window/view.js",
"extensionPoint": "codbex-organizations-dialog-window",
"extensionPoint": "dialog-window",
"description": "codbex-organizations - Application Dialog Window"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module": "codbex-organizations/gen/codbex-organizations/ui/Organizations/Organization/dialog-filter/view.js",
"extensionPoint": "codbex-organizations-dialog-window",
"extensionPoint": "dialog-window",
"description": "codbex-organizations - Application Dialog Window"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
angular.module('page', ["ideUI", "ideView", "entityApi"])
.config(["messageHubProvider", function (messageHubProvider) {
messageHubProvider.eventIdPrefix = 'codbex-organizations.Organizations.Organization';
}])
.config(["entityApiProvider", function (entityApiProvider) {
entityApiProvider.baseUrl = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/OrganizationService.ts";
}])
.controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) {

$scope.entity = {};
$scope.forms = {
details: {},
};
$scope.formHeaders = {
select: "Organization Details",
create: "Create Organization",
update: "Update Organization"
};
$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.optionsCompany = params.optionsCompany;
}

$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 Organization: '${response.message}'`;
return;
}
messageHub.postMessage("entityCreated", response.data);
$scope.cancel();
messageHub.showAlertSuccess("Organization", "Organization 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 Organization: '${response.message}'`;
return;
}
messageHub.postMessage("entityUpdated", response.data);
$scope.cancel();
messageHub.showAlertSuccess("Organization", "Organization successfully updated");
});
};

$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
}
});
});

$scope.cancel = function () {
$scope.entity = {};
$scope.action = 'select';
messageHub.closeDialogWindow("Organization-details");
};

$scope.clearErrorMessage = function () {
$scope.errorMessage = null;
};

}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!DOCTYPE HTML>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" ng-app="page" ng-controller="PageController">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="data:;base64,iVBORw0KGgo=" dg-brand-icon />
<title dg-brand-title></title>
<theme></theme>
<script type="text/javascript"
src="/services/js/resources-core/services/loader.js?id=application-view-js"></script>
<link type="text/css" rel="stylesheet"
href="/services/js/resources-core/services/loader.js?id=application-view-css" />

<script type="text/javascript" src="controller.js"></script>
</head>

<body class="dg-vbox">
<fd-scrollbar class="dg-full-height">
<div class="fd-margin--md fd-message-strip fd-message-strip--error fd-message-strip--dismissible"
role="alert" ng-show="errorMessage">
<p class="fd-message-strip__text">{{ errorMessage }}</p>
<fd-button glyph="sap-icon--decline" compact="true" dg-type="transparent" aria-label="Close" in-msg-strip="true" ng-click="clearErrorMessage()">
</fd-button>
</div>

<fd-fieldset ng-form="forms.details">
<fd-form-group dg-header="{{formHeaders[action]}}" name="entityForm" class="fd-container fd-form-layout-grid-container">
<fd-form-item class="fd-row">
<div class="fd-col fd-col-md--2">
<fd-form-label for="idName" dg-required="true" dg-colon="true">Name</fd-form-label>
</div>
<div class="fd-col fd-col-md--8 ">
<fd-form-input-message-group dg-inactive="{{ forms.details['Name'].$valid }}">
<fd-input id="idName"
name="Name"
state="{{ forms.details['Name'].$valid ? '' : 'error' }}"
ng-required="true"
ng-model="entity.Name"
ng-readonly="action === 'select'"
ng-minlength="0.0 || 0"
ng-maxlength="100.0 || -1"
dg-input-rules="{ patterns: [''] }"
type="text"
placeholder="Enter Name">
</fd-input>
<fd-form-message dg-type="error">The value doesn't match the required pattern ''</fd-form-message>
</fd-form-input-message-group>
<i class="sap-icon--information" role="presentation" onclick="javascript:alert('')"></i>
</div>
</fd-form-item>
<fd-form-item class="fd-row">
<div class="fd-col fd-col-md--2">
<fd-form-label for="idCostCenter" dg-required="false" dg-colon="true">CostCenter</fd-form-label>
</div>
<div class="fd-col fd-col-md--8 ">
<fd-form-input-message-group dg-inactive="{{ forms.details['CostCenter'].$valid }}">
<fd-input id="idCostCenter"
name="CostCenter"
state="{{ forms.details['CostCenter'].$valid ? '' : 'error' }}"
ng-required="false"
ng-model="entity.CostCenter"
ng-readonly="action === 'select'"
ng-minlength="0.0 || 0"
ng-maxlength="10.0 || -1"
dg-input-rules="{ patterns: [''] }"
type="text"
placeholder="Enter CostCenter">
</fd-input>
<fd-form-message dg-type="error">The value doesn't match the required pattern ''</fd-form-message>
</fd-form-input-message-group>
<i class="sap-icon--information" role="presentation" onclick="javascript:alert('')"></i>
</div>
</fd-form-item>
<fd-form-item class="fd-row">
<div class="fd-col fd-col-md--2">
<fd-form-label for="idCompany" dg-required="true" dg-colon="true">Company</fd-form-label>
</div>
<div class="fd-col fd-col-md--8 ">
<fd-combobox-input id="idCompany"
name="Company"
state="{{ forms.details['Company'].$valid ? '' : 'error' }}"
ng-required="true"
ng-model="entity.Company"
dg-disabled="action === 'select'"
dropdown-items="optionsCompany"
dg-placeholder="Search Company ...">
</fd-combobox-input>
<i class="sap-icon--information" role="presentation" onclick="javascript:alert('')"></i>
</div>
</fd-form-item>
</fd-form-group>
</fd-fieldset>
</fd-scrollbar>

<fd-bar bar-design="footer" compact="true" ng-show="action !== 'select'">
<fd-bar-right>
<fd-bar-element>
<fd-button dg-label="{{action === 'create' ? 'Create' : 'Update'}}" dg-type="emphasized" ng-click="action === 'create' ? create() : update()" state="{{ forms.details.$valid ? '' : 'disabled' }}"></fd-button>
</fd-bar-element>
<fd-bar-element>
<fd-button dg-label="Cancel" ng-click="cancel()"></fd-button>
</fd-bar-element>
</fd-bar-right>
</fd-bar>

</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"module":"codbex-organizations/gen/codbex-organizations/ui/Organizations/Organization/dialog-window/view.js","extensionPoint":"dialog-window","description":"codbex-organizations - Application Dialog Window"}
Original file line number Diff line number Diff line change
@@ -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: "Organization-details",
label: "Organization",
link: "/services/web/codbex-organizations/gen/codbex-organizations/ui/Organizations/Organization/dialog-window/index.html",
perspectiveName: "Organizations",
};

if (typeof exports !== 'undefined') {
exports.getDialogWindow = function () {
return viewData;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ angular.module('page', ["ideUI", "ideView", "entityApi"])
.config(["entityApiProvider", function (entityApiProvider) {
entityApiProvider.baseUrl = "/services/ts/codbex-organizations/gen/codbex-organizations/api/Organizations/OrganizationService.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 = {
Expand Down Expand Up @@ -100,5 +100,35 @@ angular.module('page', ["ideUI", "ideView", "entityApi"])
$scope.cancel = function () {
messageHub.postMessage("clearDetails");
};

//-----------------Dialogs-------------------//

$scope.createCompany = function () {
messageHub.showDialogWindow("Company-details", {
action: "create",
entity: {},
}, null, false);
};

//-----------------Dialogs-------------------//



//----------------Dropdowns-----------------//

$scope.refreshCompany = function () {
$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
}
});
});
};

//----------------Dropdowns-----------------//


}]);
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div class="fd-col fd-col-md--2">
<fd-form-label for="idCompany" dg-required="true" dg-colon="true">Company</fd-form-label>
</div>
<div class="fd-col fd-col-md--8 ">
<div class="fd-col fd-col-md--7 ">
<fd-combobox-input id="idCompany"
name="Company"
state="{{ forms.details['Company'].$valid ? '' : 'error' }}"
Expand All @@ -79,8 +79,16 @@
dropdown-items="optionsCompany"
dg-placeholder="Search Company ...">
</fd-combobox-input>
<i class="sap-icon--information" role="presentation" onclick="javascript:alert('')"></i>
</div>
<div class="fd-col fd-col-md--1">
<button class="fd-button" ng-click="createCompany()" ng-hide="action === 'select'">
<i class="sap-icon--add" role="presentation"></i>
</button>
<button class="fd-button" ng-click="refreshCompany()" ng-hide="action === 'select'">
<i class="sap-icon--refresh" role="presentation"></i>
</button>
<i class="sap-icon--information" role="presentation" onclick="javascript:alert('')"></i>
</div>
</fd-form-item>
</fd-form-group>
</fd-fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Loading