change -1 to No Limit in View All Templates for # Instances Allowed
[clamp.git] / 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 })
                });
        }