Merge "change -1 to No Limit in View All Templates for # Instances Allowed"
authorSébastien Determe <sebastien.determe@intl.att.com>
Thu, 30 Jul 2020 14:36:15 +0000 (14:36 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 30 Jul 2020 14:36:15 +0000 (14:36 +0000)
ui-react/src/components/dialogs/Tosca/ViewLoopTemplatesModal.js

index 1047394..eb6e70f 100644 (file)
@@ -99,7 +99,13 @@ export default class ViewLoopTemplatesModal extends React.Component {
 
        getAllLoopTemplates() {
                TemplateService.getAllLoopTemplates().then(templatesData => {
-                   this.setState({ loopTemplatesData: templatesData })
+                       // replace -1 in maximumInstancesAllowed with more meaningful 'No Limit'
+                       for (let item in templatesData) {
+                               if (templatesData[item].maximumInstancesAllowed === -1) {
+                                       templatesData[item].maximumInstancesAllowed = 'No Limit';
+                               }
+                       } 
+                       this.setState({ loopTemplatesData: templatesData })
                });
        }