From 44a539f0b8ac56494ce2100aab798f268526a127 Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 16 Feb 2021 14:53:43 +0100 Subject: Introduce a new endpoint to create policy One first part of the update is to create a policy version from an existing one (this is similar as the create new policy). The policy-flow.xml has been refactored so that the same policy query is done for policies and loop related flows. A code has been added to remove fields from the UI that could be present (the PDP group info json enrichment) Issue-ID: POLICY-2926 Signed-off-by: sebdet Change-Id: Ia60c656a9b5100296042d3346d5c97c8dad5d041 (cherry picked from commit a0a3a03686a386bf6def6f7da6de4d3f6a11ce61) --- .../components/dialogs/Policy/ViewAllPolicies.js | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'ui-react/src/components/dialogs/Policy/ViewAllPolicies.js') diff --git a/ui-react/src/components/dialogs/Policy/ViewAllPolicies.js b/ui-react/src/components/dialogs/Policy/ViewAllPolicies.js index 625aeb341..a1cf9d5c1 100644 --- a/ui-react/src/components/dialogs/Policy/ViewAllPolicies.js +++ b/ui-react/src/components/dialogs/Policy/ViewAllPolicies.js @@ -146,8 +146,9 @@ export default class ViewAllPolicies extends React.Component { this.handlePdpGroupChange = this.handlePdpGroupChange.bind(this); this.createJsonEditor = this.createJsonEditor.bind(this); this.handlePrefixGrouping = this.handlePrefixGrouping.bind(this); - this.deletePolicy = this.deletePolicy.bind(this); + this.handleDeletePolicy = this.handleDeletePolicy.bind(this); this.handleUpdatePolicy = this.handleUpdatePolicy.bind(this); + this.handleCreateNewVersion = this.handleCreateNewVersion(this); this.getAllPolicies(); } @@ -233,11 +234,6 @@ export default class ViewAllPolicies extends React.Component { this.props.history.push('/') } - handleUpdatePolicy() { - this.setState({ show: false }); - this.props.history.push('/') - } - handleOnRowClick(rowData) { PolicyToscaService.getToscaPolicyModel(rowData["type"], rowData["type_version"]).then(respJsonPolicyTosca => { this.setState({ @@ -251,12 +247,21 @@ export default class ViewAllPolicies extends React.Component { handlePrefixGrouping(event) { this.setState({prefixGrouping: event.target.checked}); - }; + } - deletePolicy(event, rowData) { + handleDeletePolicy(event, rowData) { return null; } + handleCreateNewVersion(event,rowData) { + return null; + } + + handleUpdatePolicy() { + this.setState({ show: false }); + this.props.history.push('/') + } + render() { return ( @@ -285,7 +290,7 @@ export default class ViewAllPolicies extends React.Component { { icon: forwardRef((props, ref) => ), tooltip: 'Delete Policy', - onClick: (event, rowData) => this.deletePolicy(event, rowData) + onClick: (event, rowData) => this.handleDeletePolicy(event, rowData) } ]} @@ -293,7 +298,8 @@ export default class ViewAllPolicies extends React.Component {
Policy Properties Editor
- + + -- cgit 1.2.3-korg