Merge pull request #2442 from jaredevantabor/manual-group-notifications

Disabling notifications related button for manual groups
This commit is contained in:
Jared Tabor
2016-06-16 14:16:05 -07:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -350,9 +350,9 @@ export default
for (itm in GroupFormObject.related) { for (itm in GroupFormObject.related) {
if (GroupFormObject.related[itm].include === "NotificationsList") { if (GroupFormObject.related[itm].include === "NotificationsList") {
GroupFormObject.related[itm] = NotificationsList; GroupFormObject.related[itm] = angular.copy(NotificationsList);
GroupFormObject.related[itm].generateList = true; GroupFormObject.related[itm].generateList = true;
GroupFormObject.related[itm].disabled = "source === undefined"; GroupFormObject.related[itm].disabled = "source === undefined || source.value === ''";
} }
} }
return GroupFormObject; return GroupFormObject;

View File

@@ -1519,7 +1519,11 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += `<div id="${itm}_tab"`+ html += `<div id="${itm}_tab"`+
`class="Form-tab"`+ `class="Form-tab"`+
`ng-click="${this.form.related[itm].disabled} || toggleFormTabs($event)"` + `ng-click="${this.form.related[itm].disabled} || toggleFormTabs($event)"` +
`ng-class="{'is-selected': ${itm}Selected, 'Form-tab--disabled' : ${this.form.related[itm].disabled }}">${(collection.title || collection.editTitle)} </div>`; `ng-class="{'is-selected': ${itm}Selected ` ;
if(this.form.related[itm].disabled){
html += `, 'Form-tab--disabled' : ${this.form.related[itm].disabled }`;
}
html += `}">${(collection.title || collection.editTitle)}</div>`;
} }
} }
else if(this.mode === "add"){ else if(this.mode === "add"){