diff options
author | sebdet <sebastien.determe@intl.att.com> | 2020-04-16 12:09:24 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2020-04-16 12:09:24 +0200 |
commit | ab3eab60a0883ffa22eb12e2b8680088c9ad25a1 (patch) | |
tree | aa9c2ae4d9f8b49e43e9fcf0fe1cf53353290df1 /ui-react | |
parent | edaf4f9e6d0f8e1b95115cc39492c84d730ba1a2 (diff) |
Remove policy from PEF when removing op policy
The operational policy must be removed from the PEF when the user remove an operational policy (at least attempt to purge the PEF)
Issue-ID: CLAMP-824
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I442c0890c391d43e8fcbdb89189d6ad2581db3af
Diffstat (limited to 'ui-react')
-rw-r--r-- | ui-react/src/api/LoopService.js | 4 | ||||
-rw-r--r-- | ui-react/src/components/dialogs/Loop/ModifyLoopModal.js | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js index 698ee28c2..f10d187cb 100644 --- a/ui-react/src/api/LoopService.js +++ b/ui-react/src/api/LoopService.js @@ -240,8 +240,8 @@ export default class LoopService { }); } - static removeOperationalPolicyType(loopName, policyType, policyVersion) { - return fetch('/restservices/clds/v2/loop/removeOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion , { + static removeOperationalPolicyType(loopName, policyType, policyVersion, policyName) { + return fetch('/restservices/clds/v2/loop/removeOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion + '/' + policyName , { method: 'PUT', headers: { "Content-Type": "application/json" diff --git a/ui-react/src/components/dialogs/Loop/ModifyLoopModal.js b/ui-react/src/components/dialogs/Loop/ModifyLoopModal.js index 1802e43de..11e935338 100644 --- a/ui-react/src/components/dialogs/Loop/ModifyLoopModal.js +++ b/ui-react/src/components/dialogs/Loop/ModifyLoopModal.js @@ -78,6 +78,10 @@ export default class ModifyLoopModal extends React.Component { cellStyle: cellStyle, headerStyle: headerStyle }, + { title: "Policy Name", field: "policyName", + cellStyle: cellStyle, + headerStyle: headerStyle + }, { title: "Version", field: "version", cellStyle: cellStyle, headerStyle: headerStyle @@ -90,7 +94,7 @@ export default class ModifyLoopModal extends React.Component { cellStyle: cellStyle, headerStyle: headerStyle }, - { title: "Add", field: "updatedDate", editable: 'never', + { title: "Created Date", field: "createdDate", editable: 'never', cellStyle: cellStyle, headerStyle: headerStyle } @@ -128,7 +132,9 @@ export default class ModifyLoopModal extends React.Component { var operationalPolicies = this.state.loopCache.getOperationalPolicies(); var selectedPolicyModels = []; for (var policy in operationalPolicies) { - selectedPolicyModels.push(operationalPolicies[policy]["policyModel"]); + var newRow = operationalPolicies[policy]["policyModel"]; + newRow.add("policyName", operationalPolicies[policy].name); + selectedPolicyModels.push(newRow); } PolicyToscaService.getToscaPolicyModels().then(allToscaModels => { @@ -167,7 +173,7 @@ export default class ModifyLoopModal extends React.Component { } handleRemove() { - LoopService.removeOperationalPolicyType(this.state.loopCache.getLoopName(),this.state.selectedRowData.policyModelType,this.state.selectedRowData.version); + LoopService.removeOperationalPolicyType(this.state.loopCache.getLoopName(),this.state.selectedRowData.policyModelType,this.state.selectedRowData.version,this.state.selectedRowData.policyName); this.props.loadLoopFunction(this.state.loopCache.getLoopName()); this.handleClose(); } @@ -203,7 +209,7 @@ export default class ModifyLoopModal extends React.Component { <Tab eventKey="remove" title="Remove Operational Policies"> <Modal.Body> <MaterialTable - title={"Already added Tosca Policy Models"} + title={"Tosca Policy Models already added"} data={this.state.selectedPolicyModelsData} columns={this.state.toscaColumns} icons={this.state.tableIcons} |