mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 21:20:08 -03:30
updates to jshint and groups language to inventory_source
This commit is contained in:
@@ -5,13 +5,12 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
|
export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
|
||||||
'ParseTypeChange', 'GenerateForm', 'inventoryData', 'GroupManageService',
|
'ParseTypeChange', 'GenerateForm', 'inventoryData', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'Empty',
|
||||||
'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'Empty',
|
'rbacUiControlService', 'ToJSON', 'SourcesService', 'Wait', 'Rest', 'Alert', 'ProcessErrors',
|
||||||
'rbacUiControlService', 'ToJSON', 'SourcesService', 'Wait', 'Rest',
|
|
||||||
function($state, $stateParams, $scope, SourcesFormDefinition, ParseTypeChange,
|
function($state, $stateParams, $scope, SourcesFormDefinition, ParseTypeChange,
|
||||||
GenerateForm, inventoryData, GroupManageService, GetChoices,
|
GenerateForm, inventoryData, GetChoices,
|
||||||
GetBasePath, CreateSelect2, GetSourceTypeOptions, Empty, rbacUiControlService,
|
GetBasePath, CreateSelect2, GetSourceTypeOptions, Empty, rbacUiControlService,
|
||||||
ToJSON, SourcesService, Wait, Rest) {
|
ToJSON, SourcesService, Wait, Rest, Alert, ProcessErrors) {
|
||||||
|
|
||||||
let form = SourcesFormDefinition;
|
let form = SourcesFormDefinition;
|
||||||
init();
|
init();
|
||||||
@@ -42,7 +41,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
|
|||||||
sync_inventory_file_select2();
|
sync_inventory_file_select2();
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
.error(function (ret,status_code) {
|
.error(function () {
|
||||||
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
|
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,13 +5,11 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
||||||
'rbacUiControlService', 'ToJSON', 'ParseTypeChange', 'GroupManageService',
|
'rbacUiControlService', 'ToJSON', 'ParseTypeChange', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions',
|
||||||
'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions',
|
'inventorySourceData', 'SourcesService', 'inventoryData', 'Empty', 'Wait', 'Rest', 'Alert', 'ProcessErrors',
|
||||||
'inventorySourceData', 'SourcesService', 'inventoryData', 'Empty', 'Wait', 'Rest',
|
|
||||||
function($state, $stateParams, $scope, ParseVariableString,
|
function($state, $stateParams, $scope, ParseVariableString,
|
||||||
rbacUiControlService, ToJSON,ParseTypeChange, GroupManageService,
|
rbacUiControlService, ToJSON,ParseTypeChange, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions,
|
||||||
GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions,
|
inventorySourceData, SourcesService, inventoryData, Empty, Wait, Rest, Alert, ProcessErrors) {
|
||||||
inventorySourceData, SourcesService, inventoryData, Empty, Wait, Rest) {
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
@@ -31,6 +29,8 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
{instance_filters: inventorySourceData.instance_filters},
|
{instance_filters: inventorySourceData.instance_filters},
|
||||||
{inventory_script: inventorySourceData.source_script},
|
{inventory_script: inventorySourceData.source_script},
|
||||||
{verbosity: inventorySourceData.verbosity});
|
{verbosity: inventorySourceData.verbosity});
|
||||||
|
|
||||||
|
$scope.inventory_source_obj = inventorySourceData;
|
||||||
if (inventorySourceData.credential) {
|
if (inventorySourceData.credential) {
|
||||||
$scope.credential_name = inventorySourceData.summary_fields.credential.name;
|
$scope.credential_name = inventorySourceData.summary_fields.credential.name;
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
sync_inventory_file_select2();
|
sync_inventory_file_select2();
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
.error(function (ret,status_code) {
|
.error(function () {
|
||||||
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
|
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
@@ -104,7 +104,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Failed to get project ' + $scope.project + '. GET returned status: ' + status });
|
msg: 'Failed to get project ' + $scope.project + '. GET returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,18 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
export default
|
export default
|
||||||
['$scope', '$rootScope', '$state', '$stateParams', 'SourcesListDefinition',
|
['$scope', '$rootScope', '$state', '$stateParams', 'SourcesListDefinition',
|
||||||
'InventoryUpdate', 'GroupManageService', 'CancelSourceUpdate',
|
'InventoryUpdate', 'CancelSourceUpdate',
|
||||||
'ViewUpdateStatus', 'rbacUiControlService', 'GetBasePath',
|
'ViewUpdateStatus', 'rbacUiControlService', 'GetBasePath',
|
||||||
'GetSyncStatusMsg', 'Dataset', 'Find', 'QuerySet',
|
'GetSyncStatusMsg', 'Dataset', 'Find', 'QuerySet',
|
||||||
'inventoryData', '$filter', 'Prompt', 'Wait', 'SourcesService',
|
'inventoryData', '$filter', 'Prompt', 'Wait', 'SourcesService',
|
||||||
function($scope, $rootScope, $state, $stateParams, SourcesListDefinition,
|
function($scope, $rootScope, $state, $stateParams, SourcesListDefinition,
|
||||||
InventoryUpdate, GroupManageService, CancelSourceUpdate,
|
InventoryUpdate, CancelSourceUpdate,
|
||||||
ViewUpdateStatus, rbacUiControlService, GetBasePath, GetSyncStatusMsg,
|
ViewUpdateStatus, rbacUiControlService, GetBasePath, GetSyncStatusMsg,
|
||||||
Dataset, Find, qs, inventoryData, $filter, Prompt,
|
Dataset, Find, qs, inventoryData, $filter, Prompt,
|
||||||
Wait, SourcesService){
|
Wait, SourcesService){
|
||||||
|
|
||||||
let list = SourcesListDefinition;
|
let list = SourcesListDefinition;
|
||||||
|
var inventory_source;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
$scope.canAdhoc = inventoryData.summary_fields.user_capabilities.adhoc;
|
$scope.canAdhoc = inventoryData.summary_fields.user_capabilities.adhoc;
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
|
|
||||||
rbacUiControlService.canAdd(GetBasePath('inventory') + $scope.inventory_id + "/groups")
|
rbacUiControlService.canAdd(GetBasePath('inventory') + $scope.inventory_id + "/inventory_sources")
|
||||||
.then(function(canAdd) {
|
.then(function(canAdd) {
|
||||||
$scope.canAdd = canAdd;
|
$scope.canAdd = canAdd;
|
||||||
});
|
});
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
_.forEach($scope[list.name], buildStatusIndicators);
|
_.forEach($scope[list.name], buildStatusIndicators);
|
||||||
|
|
||||||
$scope.$on(`ws-jobs`, function(e, data){
|
$scope.$on(`ws-jobs`, function(e, data){
|
||||||
var inventory_source = Find({ list: $scope.inventory_sources, key: 'id', val: data.inventory_source_id });
|
inventory_source = Find({ list: $scope.inventory_sources, key: 'id', val: data.inventory_source_id });
|
||||||
|
|
||||||
if (inventory_source === undefined || inventory_source === null) {
|
if (inventory_source === undefined || inventory_source === null) {
|
||||||
inventory_source = {};
|
inventory_source = {};
|
||||||
@@ -101,7 +102,7 @@
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
SourcesService.delete(inventory_source.id).then(() => {
|
SourcesService.delete(inventory_source.id).then(() => {
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
if (parseInt($state.params.source_id) === invnetory_source) {
|
if (parseInt($state.params.source_id) === inventory_source) {
|
||||||
$state.go("sources", null, {reload: true});
|
$state.go("sources", null, {reload: true});
|
||||||
} else {
|
} else {
|
||||||
$state.go($state.current.name, null, {reload: true});
|
$state.go($state.current.name, null, {reload: true});
|
||||||
@@ -136,7 +137,7 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
$scope.scheduleSource = function(id) {
|
$scope.scheduleSource = function(id) {
|
||||||
// Add this group's id to the array of group id's so that it gets
|
// Add this inv source's id to the array of inv source id's so that it gets
|
||||||
// added to the breadcrumb trail
|
// added to the breadcrumb trail
|
||||||
$state.go('inventories.edit.inventory_sources.edit.schedules', {inventory_source_id: id}, {reload: true});
|
$state.go('inventories.edit.inventory_sources.edit.schedules', {inventory_source_id: id}, {reload: true});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="Modal-title ng-binding">
|
<div class="Modal-title ng-binding">
|
||||||
Delete Group
|
Delete Group
|
||||||
<a href="" id="awp-promote" href=""
|
<a href="" id="awp-promote" href=""
|
||||||
aw-pop-over="<dl><dt>Delete</dt><dd>Deletes groups and hosts associated with the group being deleted. If a group or host is associated with other groups, it will still exist within those groups. Otherwise, the associated groups and hosts will no longer appear in the inventory.</dd>\n<dt style='margin-top: 5px;'>Promote</dt><dd>Groups and hosts associated with the group being removed will be promoted root level. Note: groups already associated with other groups cannot be promoted.</dd></dl>\n" aw-tool-tip="Click for help"
|
aw-pop-over="<dl><dt>Delete</dt><dd>Deletes groups and hosts associated with the inventory source being deleted. If a group or host is associated with other inventory sources, it will still exist within those inventory sources. Otherwise, the associated groups and hosts will no longer appear in the inventory.</dd>\n<dt style='margin-top: 5px;'>Promote</dt><dd>Groups and hosts associated with the inventory source being removed will be promoted root level. Note: groups already associated with other inventory sources cannot be promoted.</dd></dl>\n" aw-tool-tip="Click for help"
|
||||||
data-placement="right"
|
data-placement="right"
|
||||||
data-container="body"
|
data-container="body"
|
||||||
data-title="Delete Group"
|
data-title="Delete Group"
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="toDelete.total_groups == 0 && toDelete.total_hosts == 0">
|
<div ng-show="toDelete.total_groups == 0 && toDelete.total_hosts == 0">
|
||||||
<div class="Prompt-bodyQuery">Are you sure you want to permanently delete the group below from the inventory?</div>
|
<div class="Prompt-bodyQuery">Are you sure you want to permanently delete the inventory source below from the inventory?</div>
|
||||||
<div class="Prompt-bodyTarget">{{ toDelete.name }}</div>
|
<div class="Prompt-bodyTarget">{{ toDelete.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="Modal-footer">
|
<div class="Modal-footer">
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ return {
|
|||||||
name: {
|
name: {
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
required: true,
|
required: true,
|
||||||
tab: 'properties'
|
tab: 'properties'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
tab: 'properties'
|
tab: 'properties'
|
||||||
},
|
},
|
||||||
source: {
|
source: {
|
||||||
@@ -62,7 +62,7 @@ return {
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
ngOptions: 'source.label for source in source_type_options track by source.value',
|
ngOptions: 'source.label for source in source_type_options track by source.value',
|
||||||
ngChange: 'sourceChange(source)',
|
ngChange: 'sourceChange(source)',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
ngModel: 'source'
|
ngModel: 'source'
|
||||||
},
|
},
|
||||||
credential: {
|
credential: {
|
||||||
@@ -78,7 +78,7 @@ return {
|
|||||||
reqExpression: "cloudCredentialRequired",
|
reqExpression: "cloudCredentialRequired",
|
||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
watchBasePath: "credentialBasePath"
|
watchBasePath: "credentialBasePath"
|
||||||
},
|
},
|
||||||
project: {
|
project: {
|
||||||
@@ -96,7 +96,7 @@ return {
|
|||||||
reqExpression: "projectRequired",
|
reqExpression: "projectRequired",
|
||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
watchBasePath: "projectBasePath"
|
watchBasePath: "projectBasePath"
|
||||||
},
|
},
|
||||||
inventory_file: {
|
inventory_file: {
|
||||||
@@ -104,7 +104,7 @@ return {
|
|||||||
type:'select',
|
type:'select',
|
||||||
ngOptions: 'file for file in inventory_files track by file',
|
ngOptions: 'file for file in inventory_files track by file',
|
||||||
ngShow: "source && source.value === 'scm'",
|
ngShow: "source && source.value === 'scm'",
|
||||||
ngDisabled: "!(group_obj.summary_fields.user_capabilities.edit || canAdd) || disableInventoryFileBecausePermissionDenied",
|
ngDisabled: "!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd) || disableInventoryFileBecausePermissionDenied",
|
||||||
id: 'inventory-file-select',
|
id: 'inventory-file-select',
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
reqExpression: "inventoryfilerequired",
|
reqExpression: "inventoryfilerequired",
|
||||||
@@ -131,7 +131,7 @@ return {
|
|||||||
"or choose <em>All</em> to include all regions. Tower will only be updated with Hosts associated with the selected regions." +
|
"or choose <em>All</em> to include all regions. Tower will only be updated with Hosts associated with the selected regions." +
|
||||||
"</p>",
|
"</p>",
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
instance_filters: {
|
instance_filters: {
|
||||||
label: 'Instance Filters',
|
label: 'Instance Filters',
|
||||||
@@ -150,7 +150,7 @@ return {
|
|||||||
"<p>View the <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html\" target=\"_blank\">Describe Instances documentation</a> " +
|
"<p>View the <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html\" target=\"_blank\">Describe Instances documentation</a> " +
|
||||||
"for a complete list of supported filters.</p>",
|
"for a complete list of supported filters.</p>",
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
group_by: {
|
group_by: {
|
||||||
label: 'Only Group By',
|
label: 'Only Group By',
|
||||||
@@ -174,7 +174,7 @@ return {
|
|||||||
"<li>Tag None: <strong>tags » tag_none</strong></li>" +
|
"<li>Tag None: <strong>tags » tag_none</strong></li>" +
|
||||||
"</ul><p>If blank, all groups above are created except <em>Instance ID</em>.</p>",
|
"</ul><p>If blank, all groups above are created except <em>Instance ID</em>.</p>",
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
inventory_script: {
|
inventory_script: {
|
||||||
label : "Custom Inventory Script",
|
label : "Custom Inventory Script",
|
||||||
@@ -188,7 +188,7 @@ return {
|
|||||||
reqExpression: "source && source.value === 'custom'",
|
reqExpression: "source && source.value === 'custom'",
|
||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
},
|
},
|
||||||
custom_variables: {
|
custom_variables: {
|
||||||
id: 'custom_variables',
|
id: 'custom_variables',
|
||||||
@@ -292,7 +292,7 @@ return {
|
|||||||
dataTitle: i18n._('Verbosity'),
|
dataTitle: i18n._('Verbosity'),
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: 'Update Options',
|
label: 'Update Options',
|
||||||
@@ -313,7 +313,7 @@ return {
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: "(!(group_obj.summary_fields.user_capabilities.edit || canAdd))"
|
ngDisabled: "(!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd))"
|
||||||
}, {
|
}, {
|
||||||
name: 'overwrite_vars',
|
name: 'overwrite_vars',
|
||||||
label: 'Overwrite Variables',
|
label: 'Overwrite Variables',
|
||||||
@@ -328,7 +328,7 @@ return {
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: "(!(group_obj.summary_fields.user_capabilities.edit || canAdd) || source.value === 'scm')"
|
ngDisabled: "(!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd) || source.value === 'scm')"
|
||||||
}, {
|
}, {
|
||||||
name: 'update_on_launch',
|
name: 'update_on_launch',
|
||||||
label: 'Update on Launch',
|
label: 'Update on Launch',
|
||||||
@@ -340,7 +340,7 @@ return {
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}, {
|
}, {
|
||||||
name: 'update_on_project_update',
|
name: 'update_on_project_update',
|
||||||
label: 'Update on Project Update',
|
label: 'Update on Project Update',
|
||||||
@@ -351,14 +351,14 @@ return {
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
update_cache_timeout: {
|
update_cache_timeout: {
|
||||||
label: "Cache Timeout <span class=\"small-text\"> (seconds)</span>",
|
label: "Cache Timeout <span class=\"small-text\"> (seconds)</span>",
|
||||||
id: 'source-cache-timeout',
|
id: 'source-cache-timeout',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
integer: true,
|
integer: true,
|
||||||
min: 0,
|
min: 0,
|
||||||
ngShow: "source && source.value !== '' && update_on_launch",
|
ngShow: "source && source.value !== '' && update_on_launch",
|
||||||
@@ -376,16 +376,16 @@ return {
|
|||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: '(group_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -618,17 +618,16 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
var element = params.element,
|
var element = params.element,
|
||||||
options = params.opts,
|
options = params.opts,
|
||||||
multiple = (params.multiple !== undefined) ? params.multiple : true,
|
multiple = (params.multiple !== undefined) ? params.multiple : true,
|
||||||
createNew = (params.createNew !== undefined) ? params.createNew : false,
|
|
||||||
placeholder = params.placeholder,
|
placeholder = params.placeholder,
|
||||||
customDropdownAdapter = (params.customDropdownAdapter !== undefined) ? params.customDropdownAdapter : true,
|
customDropdownAdapter = (params.customDropdownAdapter !== undefined) ? params.customDropdownAdapter : true,
|
||||||
addNew = params.addNew,
|
addNew = params.addNew,
|
||||||
scope = params.scope,
|
scope = params.scope,
|
||||||
options = params.options,
|
selectOptions = params.options,
|
||||||
model = params.model,
|
model = params.model,
|
||||||
original_options;
|
original_options;
|
||||||
|
|
||||||
if (scope && options) {
|
if (scope && selectOptions) {
|
||||||
original_options = _.cloneDeep(scope[options]);
|
original_options = _.cloneDeep(scope[selectOptions]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.select2.amd.require([
|
$.fn.select2.amd.require([
|
||||||
@@ -690,15 +689,15 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
}
|
}
|
||||||
}).on('select2:unselecting', (e) => {
|
}).on('select2:unselecting', (e) => {
|
||||||
$(e.target).data('select2-unselecting', true);
|
$(e.target).data('select2-unselecting', true);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addNew && !multiple) {
|
if (addNew && !multiple) {
|
||||||
$(element).on('select2:select', (e) => {
|
$(element).on('select2:select', (e) => {
|
||||||
scope[model] = e.params.data.text;
|
scope[model] = e.params.data.text;
|
||||||
scope[options] = _.cloneDeep(original_options);
|
scope[selectOptions] = _.cloneDeep(original_options);
|
||||||
if (scope[options].indexOf(e.params.data.text) === -1) {
|
if (scope[selectOptions].indexOf(e.params.data.text) === -1) {
|
||||||
scope[options].push(e.params.data.text);
|
scope[selectOptions].push(e.params.data.text);
|
||||||
}
|
}
|
||||||
$(element).select2(config);
|
$(element).select2(config);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user