ENTAXY-480 release version 1.8.3
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -20,16 +20,75 @@
|
||||
var Entaxy;
|
||||
(function (Entaxy) {
|
||||
|
||||
const MODAL_MODES = {
|
||||
VIEW: 'View',
|
||||
EDIT: 'Edit',
|
||||
ADD: 'Add'
|
||||
};
|
||||
Entaxy.MODAL_MODES = MODAL_MODES;
|
||||
|
||||
function getButtonTitleByMode(mode) {
|
||||
switch (mode) {
|
||||
case MODAL_MODES.ADD:
|
||||
return 'Add';
|
||||
case MODAL_MODES.EDIT:
|
||||
return 'Save';
|
||||
case MODAL_MODES.VIEW:
|
||||
return 'Ok';
|
||||
}
|
||||
}
|
||||
Entaxy.getButtonTitleByMode = getButtonTitleByMode;
|
||||
|
||||
function capitalize(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
Entaxy.capitalize = capitalize;
|
||||
|
||||
function uncapitalize(string) {
|
||||
return string.charAt(0).toLowerCase() + string.slice(1);
|
||||
}
|
||||
Entaxy.uncapitalize = uncapitalize;
|
||||
|
||||
function getChildrenRecursive(folder) {
|
||||
let children = folder.children;
|
||||
if (children) {
|
||||
folder.children.forEach(child => {
|
||||
if (child.children) {
|
||||
children = children.concat(getChildrenRecursive(child));
|
||||
}
|
||||
});
|
||||
}
|
||||
return children;
|
||||
}
|
||||
Entaxy.getChildrenRecursive = getChildrenRecursive;
|
||||
|
||||
function compareBy(fieldName) {
|
||||
return function(a, b) {
|
||||
let valueA = a[fieldName].toLowerCase();
|
||||
let valueB = b[fieldName].toLowerCase();
|
||||
if (valueA < valueB) {
|
||||
return -1;
|
||||
}
|
||||
if (valueA > valueB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Entaxy.compareBy = compareBy;
|
||||
|
||||
function convertToHtmlInputType(javaType) {
|
||||
if (!javaType || javaType.startsWith('entaxy.runtime')) {
|
||||
// fixme maybe
|
||||
return javaType;
|
||||
}
|
||||
switch (javaType) {
|
||||
case 'xml:route':
|
||||
return javaType;
|
||||
case 'boolean':
|
||||
case 'Boolean':
|
||||
case 'java.lang.Boolean':
|
||||
return 'checkbox';
|
||||
case 'number':
|
||||
case 'int':
|
||||
case 'long':
|
||||
case 'java.lang.Integer':
|
||||
@@ -41,6 +100,26 @@ var Entaxy;
|
||||
}
|
||||
Entaxy.convertToHtmlInputType = convertToHtmlInputType;
|
||||
|
||||
function createTableFromResponse(response) {
|
||||
let tableHtml = `<table class="entaxy-result-table">`;
|
||||
tableHtml +=
|
||||
`
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>Step name</th>
|
||||
<th>Step result</th>
|
||||
</tr>
|
||||
`;
|
||||
_.forEach(JSON.parse(response), (step) => {
|
||||
let iconName = step['Step result'] === 'OK' ? 'ok' : 'error-circle-o';
|
||||
tableHtml += `<tr><td>` + step['Step'] + `</td><td>` + step['Step name'] + `</td>`;
|
||||
tableHtml += `<td><span class="pficon pficon-${iconName}"></span></td></tr>`;
|
||||
});
|
||||
tableHtml += `</table>`;
|
||||
return tableHtml;
|
||||
}
|
||||
Entaxy.createTableFromResponse = createTableFromResponse;
|
||||
|
||||
function notification(type, message, duration) {
|
||||
|
||||
let visibleToastElem = null;
|
||||
@@ -52,7 +131,9 @@ var Entaxy;
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
<span class="pficon pficon-${resolveToastIcon(type)}"></span>
|
||||
${message}
|
||||
<div class="toast-pf-content">
|
||||
${message}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user