Only show 'Schedules' tab on inventory groups dialog when a source value is selected.

This commit is contained in:
Chris Houseknecht 2014-03-18 10:35:00 -04:00
parent 2585855e1c
commit 0f3bd58745
2 changed files with 17 additions and 1 deletions

View File

@ -34,6 +34,7 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G
});
}
}
scope.$emit('sourceTypeOptionsReady');
})
.error(function (data, status) {
ProcessErrors(scope, data, status, null, {
@ -853,6 +854,18 @@ function(SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize) {
}
});
sources_scope.removeScopeSourceTypeOptionsReady = sources_scope.$on('sourceTypeOptionsReady', function() {
if (mode === 'add') {
sources_scope.source = Find({
list: sources_scope.source_type_options,
key: 'value',
val: ''
});
console.log(sources_scope.source);
parent_scope.showSourceTab = false;
}
});
if (modal_scope.removeChoicesComplete) {
modal_scope.removeChoicesComplete();
}
@ -889,6 +902,8 @@ function(SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize) {
modal_scope.$emit('choicesCompleteGroup');
}
else {
properties_scope.variables = "---";
master.variables = properties_scope.variables;
modal_scope.$emit('groupVariablesLoaded');
}
}
@ -1125,6 +1140,7 @@ function(SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize) {
// Change the lookup and regions when the source changes
sources_scope.sourceChange = function () {
parent_scope.showSourceTab = (sources_scope.source && sources_scope.source.value) ? true : false;
SourceChange({ scope: sources_scope, form: SourceForm });
};

View File

@ -19,7 +19,7 @@
href="#properties-tab" data-toggle="tab">Properties</a></li>
<li><a id="source_link" ng-click="toggleTab($event, 'source_link', 'group_tabs')"
href="#sources-tab" data-toggle="tab">Source</a></li>
<li><a id="schedules_link" ng-click="toggleTab($event, 'schedules_link', 'group_tabs')"
<li ng-show="showSourceTab"><a id="schedules_link" ng-click="toggleTab($event, 'schedules_link', 'group_tabs')"
href="#schedules-tab" data-toggle="tab">Schedule</a></li>
</ul>
<div class="tab-content">