aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/Policy/PolicyEditor.js
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2021-03-26 18:31:08 +0100
committerS�bastien Determe <sebastien.determe@intl.att.com>2021-04-07 12:51:19 +0000
commit42fa9f46d63968458cae9b2c72e7c4d0daca394b (patch)
tree26582950b74d6415ab5555fc06a94a6c6b7f5969 /ui-react/src/components/dialogs/Policy/PolicyEditor.js
parent7f685aa342813c611b6e43d7b4a869c7454baddc (diff)
Modify the PolicyDeploymentEditor to support checkboxes
Add code to the PolicyDeploymentEditor so that checkboxes are rendered. Issue-ID: POLICY-2931 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: I3c933272419770595b706f6950f821220a76f789
Diffstat (limited to 'ui-react/src/components/dialogs/Policy/PolicyEditor.js')
-rw-r--r--ui-react/src/components/dialogs/Policy/PolicyEditor.js26
1 files changed, 1 insertions, 25 deletions
diff --git a/ui-react/src/components/dialogs/Policy/PolicyEditor.js b/ui-react/src/components/dialogs/Policy/PolicyEditor.js
index f20650e26..8ee48535f 100644
--- a/ui-react/src/components/dialogs/Policy/PolicyEditor.js
+++ b/ui-react/src/components/dialogs/Policy/PolicyEditor.js
@@ -33,7 +33,6 @@ import PolicyService from '../../../api/PolicyService';
import OnapUtils from '../../../utils/OnapUtils';
import uuid from 'react-uuid';
-//const JSONEditor = require("@json-editor/json-editor").JSONEditor;
const DivWhiteSpaceStyled = styled.div`
white-space: pre;
`
@@ -46,7 +45,6 @@ const JsonEditorDiv = styled.div`
border: 1px solid #C0C0C0;
`
const PanelDiv = styled.div`
- margin-top: 20px;
text-align: justify;
font-size: ${props => props.theme.policyEditorFontSize};
background-color: ${props => props.theme.loopViewerBackgroundColor};
@@ -112,17 +110,12 @@ export default class PolicyEditor extends React.Component {
showSuccessAlert: true,
showMessage: 'Policy '+ this.state.policyName + '/' + this.state.policyVersion + ' created successfully'
});
- this.props.policyUpdateFunction();
+ this.props.policiesTableUpdateFunction();
}
})
}
}
- bumpVersion(versionToBump) {
- let semVer = versionToBump.split(".");
- return parseInt(semVer[0])+1 + "." + semVer[1] + "." + semVer[2];
- }
-
getToscaModelForPolicy() {
PolicyToscaService.getToscaPolicyModel(this.state.policyModelType, this.state.policyModelTypeVersion).then(respJsonPolicyTosca => {
if (respJsonPolicyTosca !== {}) {
@@ -139,27 +132,10 @@ export default class PolicyEditor extends React.Component {
}
createJsonEditor(toscaModel, editorData) {
- /*JSONEditor.defaults.themes.myBootstrap4 = JSONEditor.defaults.themes.bootstrap4.extend({
- getTab: function(text,tabId) {
- var liel = document.createElement('li');
- liel.classList.add('nav-item');
- var ael = document.createElement("a");
- ael.classList.add("nav-link");
- ael.setAttribute("style",'padding:10px;max-width:160px;');
- ael.setAttribute("href", "#" + tabId);
- ael.setAttribute('data-toggle', 'tab');
- text.setAttribute("style",'word-wrap:break-word;');
- ael.appendChild(text);
- liel.appendChild(ael);
- return liel;
- }
- });*/
-
return new JSONEditor(document.getElementById(this.state.jsonEditorDivId),
{
schema: toscaModel,
startval: editorData,
- //theme: 'myBootstrap4',
theme: 'bootstrap4',
iconlib: 'fontawesome5',
object_layout: 'grid',