mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
remove use of canEdit in favor of user capabilities
This commit is contained in:
@@ -18,14 +18,12 @@ export function CredentialsList($scope, $rootScope, $location, $log,
|
|||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('credentials'));
|
Rest.setUrl(GetBasePath('credentials'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -367,16 +365,6 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
id = $stateParams.credential_id,
|
id = $stateParams.credential_id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('credentials') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
$scope.id = id;
|
$scope.id = id;
|
||||||
|
|||||||
@@ -19,14 +19,12 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('projects'));
|
Rest.setUrl(GetBasePath('projects'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -588,16 +586,6 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
id = $stateParams.id,
|
id = $stateParams.id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('projects') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// remove "type" field from search options
|
// remove "type" field from search options
|
||||||
CredentialList = _.cloneDeep(CredentialList);
|
CredentialList = _.cloneDeep(CredentialList);
|
||||||
CredentialList.fields.kind.noSearch = true;
|
CredentialList.fields.kind.noSearch = true;
|
||||||
|
|||||||
@@ -18,14 +18,12 @@ export function TeamsList($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('teams'));
|
Rest.setUrl(GetBasePath('teams'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -226,16 +224,6 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
relatedSets = {},
|
relatedSets = {},
|
||||||
set;
|
set;
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('teams') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.team_id = id;
|
$scope.team_id = id;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,14 +38,12 @@ export function UsersList($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('users'));
|
Rest.setUrl(GetBasePath('users'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -292,16 +290,6 @@ export function UsersEdit($scope, $rootScope, $location,
|
|||||||
relatedSets = {},
|
relatedSets = {},
|
||||||
set;
|
set;
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('users') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
@@ -55,7 +55,7 @@ export default
|
|||||||
dataTitle: 'Organization ',
|
dataTitle: 'Organization ',
|
||||||
dataPlacement: 'bottom',
|
dataPlacement: 'bottom',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
kind: {
|
kind: {
|
||||||
label: 'Type',
|
label: 'Type',
|
||||||
@@ -87,7 +87,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
hasSubForm: true,
|
hasSubForm: true,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
access_key: {
|
access_key: {
|
||||||
label: 'Access Key',
|
label: 'Access Key',
|
||||||
@@ -100,13 +100,13 @@ export default
|
|||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
apiField: 'username',
|
apiField: 'username',
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
secret_key: {
|
secret_key: {
|
||||||
label: 'Secret Key',
|
label: 'Secret Key',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'aws'",
|
ngShow: "kind.value == 'aws'",
|
||||||
ngDisabled: "secret_key_ask || !canEdit",
|
ngDisabled: "secret_key_ask || !credential_obj.summary_fields.user_capabilities.edit",
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
reqExpression: "aws_required",
|
reqExpression: "aws_required",
|
||||||
init: false
|
init: false
|
||||||
@@ -129,7 +129,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"host": {
|
"host": {
|
||||||
labelBind: 'hostLabel',
|
labelBind: 'hostLabel',
|
||||||
@@ -146,7 +146,7 @@ export default
|
|||||||
init: false
|
init: false
|
||||||
},
|
},
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"subscription": {
|
"subscription": {
|
||||||
label: "Subscription ID",
|
label: "Subscription ID",
|
||||||
@@ -164,7 +164,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"username": {
|
"username": {
|
||||||
labelBind: 'usernameLabel',
|
labelBind: 'usernameLabel',
|
||||||
@@ -177,7 +177,7 @@ export default
|
|||||||
},
|
},
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
subForm: "credentialSubForm",
|
subForm: "credentialSubForm",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"email_address": {
|
"email_address": {
|
||||||
labelBind: 'usernameLabel',
|
labelBind: 'usernameLabel',
|
||||||
@@ -193,7 +193,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"api_key": {
|
"api_key": {
|
||||||
label: 'API Key',
|
label: 'API Key',
|
||||||
@@ -207,7 +207,7 @@ export default
|
|||||||
hasShowInputButton: true,
|
hasShowInputButton: true,
|
||||||
clear: false,
|
clear: false,
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"password": {
|
"password": {
|
||||||
labelBind: 'passwordLabel',
|
labelBind: 'passwordLabel',
|
||||||
@@ -221,13 +221,13 @@ export default
|
|||||||
init: false
|
init: false
|
||||||
},
|
},
|
||||||
subForm: "credentialSubForm",
|
subForm: "credentialSubForm",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"ssh_password": {
|
"ssh_password": {
|
||||||
label: 'Password',
|
label: 'Password',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'ssh'",
|
ngShow: "kind.value == 'ssh'",
|
||||||
ngDisabled: "ssh_password_ask || !canEdit",
|
ngDisabled: "ssh_password_ask || !credential_obj.summary_fields.user_capabilities.edit",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
subCheckbox: {
|
subCheckbox: {
|
||||||
@@ -260,7 +260,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
subForm: "credentialSubForm",
|
subForm: "credentialSubForm",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"ssh_key_unlock": {
|
"ssh_key_unlock": {
|
||||||
label: 'Private Key Passphrase',
|
label: 'Private Key Passphrase',
|
||||||
@@ -268,7 +268,7 @@ export default
|
|||||||
ngShow: "kind.value == 'ssh' || kind.value == 'scm'",
|
ngShow: "kind.value == 'ssh' || kind.value == 'scm'",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: "keyEntered === false || ssh_key_unlock_ask || !canEdit",
|
ngDisabled: "keyEntered === false || ssh_key_unlock_ask || !credential_obj.summary_fields.user_capabilities.edit",
|
||||||
subCheckbox: {
|
subCheckbox: {
|
||||||
variable: 'ssh_key_unlock_ask',
|
variable: 'ssh_key_unlock_ask',
|
||||||
ngShow: "kind.value == 'ssh'",
|
ngShow: "kind.value == 'ssh'",
|
||||||
@@ -292,7 +292,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"become_username": {
|
"become_username": {
|
||||||
labelBind: 'becomeUsernameLabel',
|
labelBind: 'becomeUsernameLabel',
|
||||||
@@ -302,13 +302,13 @@ export default
|
|||||||
editRequired: false,
|
editRequired: false,
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"become_password": {
|
"become_password": {
|
||||||
labelBind: 'becomePasswordLabel',
|
labelBind: 'becomePasswordLabel',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
||||||
ngDisabled: "become_password_ask || !canEdit",
|
ngDisabled: "become_password_ask || !credential_obj.summary_fields.user_capabilities.edit",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
subCheckbox: {
|
subCheckbox: {
|
||||||
@@ -325,7 +325,7 @@ export default
|
|||||||
label: 'Client ID',
|
label: 'Client ID',
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngShow: "kind.value === 'azure_rm'",
|
ngShow: "kind.value === 'azure_rm'",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
secret:{
|
secret:{
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
@@ -334,14 +334,14 @@ export default
|
|||||||
label: 'Client Secret',
|
label: 'Client Secret',
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngShow: "kind.value === 'azure_rm'",
|
ngShow: "kind.value === 'azure_rm'",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
tenant: {
|
tenant: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: 'Tenant ID',
|
label: 'Tenant ID',
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngShow: "kind.value === 'azure_rm'",
|
ngShow: "kind.value === 'azure_rm'",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
authorize: {
|
authorize: {
|
||||||
label: 'Authorize',
|
label: 'Authorize',
|
||||||
@@ -349,7 +349,7 @@ export default
|
|||||||
ngChange: "toggleCallback('host_config_key')",
|
ngChange: "toggleCallback('host_config_key')",
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngShow: "kind.value === 'net'",
|
ngShow: "kind.value === 'net'",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
authorize_password: {
|
authorize_password: {
|
||||||
label: 'Authorize Password',
|
label: 'Authorize Password',
|
||||||
@@ -358,7 +358,7 @@ export default
|
|||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngShow: "authorize && authorize !== 'false'",
|
ngShow: "authorize && authorize !== 'false'",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"project": {
|
"project": {
|
||||||
labelBind: 'projectLabel',
|
labelBind: 'projectLabel',
|
||||||
@@ -376,7 +376,7 @@ export default
|
|||||||
init: false
|
init: false
|
||||||
},
|
},
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"domain": {
|
"domain": {
|
||||||
labelBind: 'domainLabel',
|
labelBind: 'domainLabel',
|
||||||
@@ -393,13 +393,13 @@ export default
|
|||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
subForm: 'credentialSubForm',
|
subForm: 'credentialSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"vault_password": {
|
"vault_password": {
|
||||||
label: "Vault Password",
|
label: "Vault Password",
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'ssh'",
|
ngShow: "kind.value == 'ssh'",
|
||||||
ngDisabled: "vault_password_ask || !canEdit",
|
ngDisabled: "vault_password_ask || !credential_obj.summary_fields.user_capabilities.edit",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
subCheckbox: {
|
subCheckbox: {
|
||||||
@@ -416,17 +416,17 @@ export default
|
|||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!credential_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
label: 'Save',
|
label: 'Save',
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit' //Disable when $pristine or $invalid, optional
|
ngShow: 'credential_obj.summary_fields.user_capabilities.edit' //Disable when $pristine or $invalid, optional
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -450,7 +450,7 @@ export default
|
|||||||
awToolTip: 'Add a permission',
|
awToolTip: 'Add a permission',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD',
|
buttonContent: '+ ADD',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'credential_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
tab: 'properties',
|
tab: 'properties',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
@@ -35,7 +35,7 @@ export default
|
|||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
tab: 'properties',
|
tab: 'properties',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
variables: {
|
variables: {
|
||||||
label: 'Variables',
|
label: 'Variables',
|
||||||
@@ -68,7 +68,7 @@ export default
|
|||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngModel: 'source',
|
ngModel: 'source',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
credential: {
|
credential: {
|
||||||
label: 'Cloud Credential',
|
label: 'Cloud Credential',
|
||||||
@@ -81,7 +81,7 @@ export default
|
|||||||
reqExpression: "cloudCredentialRequired",
|
reqExpression: "cloudCredentialRequired",
|
||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
source_regions: {
|
source_regions: {
|
||||||
label: 'Regions',
|
label: 'Regions',
|
||||||
@@ -97,7 +97,7 @@ export default
|
|||||||
"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: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
instance_filters: {
|
instance_filters: {
|
||||||
label: 'Instance Filters',
|
label: 'Instance Filters',
|
||||||
@@ -118,7 +118,7 @@ export default
|
|||||||
"<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: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
group_by: {
|
group_by: {
|
||||||
label: 'Only Group By',
|
label: 'Only Group By',
|
||||||
@@ -144,7 +144,7 @@ export default
|
|||||||
"<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: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
inventory_script: {
|
inventory_script: {
|
||||||
label : "Custom Inventory Script",
|
label : "Custom Inventory Script",
|
||||||
@@ -156,7 +156,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
ngRequired: "source && source.value === 'custom'",
|
ngRequired: "source && source.value === 'custom'",
|
||||||
ngDisabled: '!canEdit',
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit',
|
||||||
},
|
},
|
||||||
custom_variables: {
|
custom_variables: {
|
||||||
id: 'custom_variables',
|
id: 'custom_variables',
|
||||||
@@ -278,7 +278,7 @@ export default
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
}, {
|
}, {
|
||||||
name: 'overwrite_vars',
|
name: 'overwrite_vars',
|
||||||
label: 'Overwrite Variables',
|
label: 'Overwrite Variables',
|
||||||
@@ -293,7 +293,7 @@ export default
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
}, {
|
}, {
|
||||||
name: 'update_on_launch',
|
name: 'update_on_launch',
|
||||||
label: 'Update on Launch',
|
label: 'Update on Launch',
|
||||||
@@ -307,7 +307,7 @@ export default
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options',
|
labelClass: 'checkbox-options',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
update_cache_timeout: {
|
update_cache_timeout: {
|
||||||
@@ -333,16 +333,16 @@ export default
|
|||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!group_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'group_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ export default
|
|||||||
dataTitle: 'Host Name',
|
dataTitle: 'Host Name',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!host.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!host.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
variables: {
|
variables: {
|
||||||
label: 'Variables',
|
label: 'Variables',
|
||||||
@@ -85,16 +85,16 @@ export default
|
|||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'host.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!host.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'host.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
inventory_description: {
|
inventory_description: {
|
||||||
realName: 'description',
|
realName: 'description',
|
||||||
@@ -35,7 +35,7 @@ export default
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -47,7 +47,7 @@ export default
|
|||||||
reqExpression: "organizationrequired",
|
reqExpression: "organizationrequired",
|
||||||
init: "true"
|
init: "true"
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
variables: {
|
variables: {
|
||||||
label: 'Variables',
|
label: 'Variables',
|
||||||
@@ -67,23 +67,23 @@ export default
|
|||||||
dataTitle: 'Inventory Variables',
|
dataTitle: 'Inventory Variables',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!canEdit' // TODO: get working
|
ngDisabled: '!inventory_obj.summary_fields.user_capabilities.edit' // TODO: get working
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngHide: 'canEdit'
|
ngHide: 'inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ export default
|
|||||||
awToolTip: 'Add a permission',
|
awToolTip: 'Add a permission',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD',
|
buttonContent: '+ ADD',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'inventory_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
column: 1,
|
column: 1,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
@@ -36,7 +36,7 @@ export default
|
|||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
column: 1,
|
column: 1,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
job_type: {
|
job_type: {
|
||||||
label: 'Job Type',
|
label: 'Job Type',
|
||||||
@@ -59,7 +59,7 @@ export default
|
|||||||
ngShow: "!job_type.value || job_type.value !== 'scan'",
|
ngShow: "!job_type.value || job_type.value !== 'scan'",
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
inventory: {
|
inventory: {
|
||||||
label: 'Inventory',
|
label: 'Inventory',
|
||||||
@@ -82,7 +82,7 @@ export default
|
|||||||
ngShow: "!job_type.value || job_type.value !== 'scan'",
|
ngShow: "!job_type.value || job_type.value !== 'scan'",
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
project: {
|
project: {
|
||||||
label: 'Project',
|
label: 'Project',
|
||||||
@@ -104,13 +104,13 @@ export default
|
|||||||
dataTitle: 'Project',
|
dataTitle: 'Project',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
playbook: {
|
playbook: {
|
||||||
label: 'Playbook',
|
label: 'Playbook',
|
||||||
type:'select',
|
type:'select',
|
||||||
ngOptions: 'book for book in playbook_options track by book',
|
ngOptions: 'book for book in playbook_options track by book',
|
||||||
ngDisabled: "(job_type.value === 'scan' && project_name === 'Default') || !canEdit",
|
ngDisabled: "(job_type.value === 'scan' && project_name === 'Default') || !job_template_obj.summary_fields.user_capabilities.edit",
|
||||||
id: 'playbook-select',
|
id: 'playbook-select',
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
reqExpression: "playbookrequired",
|
reqExpression: "playbookrequired",
|
||||||
@@ -144,7 +144,7 @@ export default
|
|||||||
variable: 'ask_credential_on_launch',
|
variable: 'ask_credential_on_launch',
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
cloud_credential: {
|
cloud_credential: {
|
||||||
label: 'Cloud Credential',
|
label: 'Cloud Credential',
|
||||||
@@ -160,7 +160,7 @@ export default
|
|||||||
dataTitle: 'Cloud Credential',
|
dataTitle: 'Cloud Credential',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
network_credential: {
|
network_credential: {
|
||||||
label: 'Network Credential',
|
label: 'Network Credential',
|
||||||
@@ -175,7 +175,7 @@ export default
|
|||||||
dataTitle: 'Network Credential',
|
dataTitle: 'Network Credential',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
forks: {
|
forks: {
|
||||||
label: 'Forks',
|
label: 'Forks',
|
||||||
@@ -195,7 +195,7 @@ export default
|
|||||||
dataTitle: 'Forks',
|
dataTitle: 'Forks',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit' // TODO: get working
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit' // TODO: get working
|
||||||
},
|
},
|
||||||
limit: {
|
limit: {
|
||||||
label: 'Limit',
|
label: 'Limit',
|
||||||
@@ -213,7 +213,7 @@ export default
|
|||||||
variable: 'ask_limit_on_launch',
|
variable: 'ask_limit_on_launch',
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
verbosity: {
|
verbosity: {
|
||||||
label: 'Verbosity',
|
label: 'Verbosity',
|
||||||
@@ -227,7 +227,7 @@ export default
|
|||||||
dataTitle: 'Verbosity',
|
dataTitle: 'Verbosity',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
job_tags: {
|
job_tags: {
|
||||||
label: 'Job Tags',
|
label: 'Job Tags',
|
||||||
@@ -247,7 +247,7 @@ export default
|
|||||||
variable: 'ask_tags_on_launch',
|
variable: 'ask_tags_on_launch',
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
skip_tags: {
|
skip_tags: {
|
||||||
label: 'Skip Tags',
|
label: 'Skip Tags',
|
||||||
@@ -267,7 +267,7 @@ export default
|
|||||||
variable: 'ask_skip_tags_on_launch',
|
variable: 'ask_skip_tags_on_launch',
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: 'Options',
|
label: 'Options',
|
||||||
@@ -284,7 +284,7 @@ export default
|
|||||||
dataTitle: 'Become Privilege Escalation',
|
dataTitle: 'Become Privilege Escalation',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
labelClass: 'stack-inline',
|
labelClass: 'stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
}, {
|
}, {
|
||||||
name: 'allow_callbacks',
|
name: 'allow_callbacks',
|
||||||
label: 'Allow Provisioning Callbacks',
|
label: 'Allow Provisioning Callbacks',
|
||||||
@@ -299,7 +299,7 @@ export default
|
|||||||
dataTitle: 'Allow Provisioning Callbacks',
|
dataTitle: 'Allow Provisioning Callbacks',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
labelClass: 'stack-inline',
|
labelClass: 'stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
callback_url: {
|
callback_url: {
|
||||||
@@ -315,7 +315,7 @@ export default
|
|||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
dataTitle: 'Provisioning Callback URL',
|
dataTitle: 'Provisioning Callback URL',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
host_config_key: {
|
host_config_key: {
|
||||||
label: 'Host Config Key',
|
label: 'Host Config Key',
|
||||||
@@ -329,7 +329,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataTitle: "Host Config Key",
|
dataTitle: "Host Config Key",
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
label: 'Labels',
|
label: 'Labels',
|
||||||
@@ -343,7 +343,7 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
awPopOver: "<p>Optional labels that describe this job template, such as 'dev' or 'test'. Labels can be used to group and filter job templates and completed jobs in the Tower display.</p>",
|
awPopOver: "<p>Optional labels that describe this job template, such as 'dev' or 'test'. Labels can be used to group and filter job templates and completed jobs in the Tower display.</p>",
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
variables: {
|
variables: {
|
||||||
label: 'Extra Variables',
|
label: 'Extra Variables',
|
||||||
@@ -367,14 +367,14 @@ export default
|
|||||||
variable: 'ask_variables_on_launch',
|
variable: 'ask_variables_on_launch',
|
||||||
text: 'Prompt on launch'
|
text: 'Prompt on launch'
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit' // TODO: get working
|
ngDisabled: '!job_template_obj.summary_fields.user_capabilities.edit' // TODO: get working
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: { //for now always generates <button> tags
|
buttons: { //for now always generates <button> tags
|
||||||
add_survey: {
|
add_survey: {
|
||||||
ngClick: 'addSurvey()',
|
ngClick: 'addSurvey()',
|
||||||
ngShow: 'job_type.value !== "scan" && !survey_exists && canEdit',
|
ngShow: 'job_type.value !== "scan" && !survey_exists && job_template_obj.summary_fields.user_capabilities.edit',
|
||||||
awFeature: 'surveys',
|
awFeature: 'surveys',
|
||||||
awToolTip: 'Surveys allow users to be prompted at job launch with a series of questions related to the job. This allows for variables to be defined that affect the playbook run at time of launch.',
|
awToolTip: 'Surveys allow users to be prompted at job launch with a series of questions related to the job. This allows for variables to be defined that affect the playbook run at time of launch.',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top'
|
||||||
@@ -382,25 +382,25 @@ export default
|
|||||||
edit_survey: {
|
edit_survey: {
|
||||||
ngClick: 'editSurvey()',
|
ngClick: 'editSurvey()',
|
||||||
awFeature: 'surveys',
|
awFeature: 'surveys',
|
||||||
ngShow: 'job_type.value !== "scan" && survey_exists && canEdit'
|
ngShow: 'job_type.value !== "scan" && survey_exists && job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
view_survey: {
|
view_survey: {
|
||||||
ngClick: 'editSurvey()',
|
ngClick: 'editSurvey()',
|
||||||
awFeature: 'surveys',
|
awFeature: 'surveys',
|
||||||
ngShow: 'job_type.value !== "scan" && survey_exists && !canEdit'
|
ngShow: 'job_type.value !== "scan" && survey_exists && !job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: "job_templates_form.$invalid || can_edit!==true",//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
ngDisabled: "job_templates_form.$invalid || can_edit!==true",//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
||||||
ngShow: 'canEdit'
|
ngShow: 'job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -425,7 +425,7 @@ export default
|
|||||||
awToolTip: 'Add a permission',
|
awToolTip: 'Add a permission',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD',
|
buttonContent: '+ ADD',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'job_template_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -26,30 +26,30 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!organization_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!organization_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: { //for now always generates <button> tags
|
buttons: { //for now always generates <button> tags
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'organization_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!organization_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'organization_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ export default
|
|||||||
awToolTip: 'Add a permission',
|
awToolTip: 'Add a permission',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD',
|
buttonContent: '+ ADD',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'organization_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -53,7 +53,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataTitle: 'Organization',
|
dataTitle: 'Organization',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
scm_type: {
|
scm_type: {
|
||||||
label: 'SCM Type',
|
label: 'SCM Type',
|
||||||
@@ -64,7 +64,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
hasSubForm: true,
|
hasSubForm: true,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
missing_path_alert: {
|
missing_path_alert: {
|
||||||
type: 'alertblock',
|
type: 'alertblock',
|
||||||
@@ -87,7 +87,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataTitle: 'Project Base Path',
|
dataTitle: 'Project Base Path',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
local_path: {
|
local_path: {
|
||||||
label: 'Playbook Directory',
|
label: 'Playbook Directory',
|
||||||
@@ -105,7 +105,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataTitle: 'Project Path',
|
dataTitle: 'Project Path',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
scm_url: {
|
scm_url: {
|
||||||
label: 'SCM URL',
|
label: 'SCM URL',
|
||||||
@@ -122,7 +122,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataTitle: 'SCM URL',
|
dataTitle: 'SCM URL',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
scm_branch: {
|
scm_branch: {
|
||||||
labelBind: "scmBranchLabel",
|
labelBind: "scmBranchLabel",
|
||||||
@@ -131,7 +131,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
subForm: 'sourceSubForm',
|
subForm: 'sourceSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
credential: {
|
credential: {
|
||||||
label: 'SCM Credential',
|
label: 'SCM Credential',
|
||||||
@@ -143,7 +143,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
subForm: 'sourceSubForm',
|
subForm: 'sourceSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: 'SCM Update Options',
|
label: 'SCM Update Options',
|
||||||
@@ -161,7 +161,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options stack-inline',
|
labelClass: 'checkbox-options stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
}, {
|
}, {
|
||||||
name: 'scm_delete_on_update',
|
name: 'scm_delete_on_update',
|
||||||
label: 'Delete on Update',
|
label: 'Delete on Update',
|
||||||
@@ -174,7 +174,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options stack-inline',
|
labelClass: 'checkbox-options stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
}, {
|
}, {
|
||||||
name: 'scm_update_on_launch',
|
name: 'scm_update_on_launch',
|
||||||
label: 'Update on Launch',
|
label: 'Update on Launch',
|
||||||
@@ -186,7 +186,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
labelClass: 'checkbox-options stack-inline',
|
labelClass: 'checkbox-options stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
scm_update_cache_timeout: {
|
scm_update_cache_timeout: {
|
||||||
@@ -206,23 +206,23 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
dataTitle: 'Cache Timeout',
|
dataTitle: 'Cache Timeout',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!canEdit' // TODO: get working
|
ngDisabled: '!project_obj.summary_fields.user_capabilities.edit' // TODO: get working
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!project_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'project_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
awToolTip: 'Add a permission',
|
awToolTip: 'Add a permission',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD',
|
buttonContent: '+ ADD',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'project_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!team_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!team_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -47,23 +47,23 @@ export default
|
|||||||
reqExpression: "orgrequired",
|
reqExpression: "orgrequired",
|
||||||
init: true
|
init: true
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!team_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'team_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!team_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'team_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ export default
|
|||||||
awToolTip: 'Add user to team',
|
awToolTip: 'Add user to team',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD',
|
buttonContent: '+ ADD',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'team_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: true,
|
capitalize: true,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
last_name: {
|
last_name: {
|
||||||
label: 'Last Name',
|
label: 'Last Name',
|
||||||
@@ -35,7 +35,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: true,
|
capitalize: true,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
label: 'Email',
|
label: 'Email',
|
||||||
@@ -43,7 +43,7 @@ export default
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
label: 'Username',
|
label: 'Username',
|
||||||
@@ -53,7 +53,7 @@ export default
|
|||||||
init: true
|
init: true
|
||||||
},
|
},
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -68,7 +68,7 @@ export default
|
|||||||
reqExpression: "orgrequired",
|
reqExpression: "orgrequired",
|
||||||
init: true
|
init: true
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
label: 'Password',
|
label: 'Password',
|
||||||
@@ -80,7 +80,7 @@ export default
|
|||||||
ngChange: "clearPWConfirm('password_confirm')",
|
ngChange: "clearPWConfirm('password_confirm')",
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
chkPass: true,
|
chkPass: true,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
password_confirm: {
|
password_confirm: {
|
||||||
label: 'Confirm Password',
|
label: 'Confirm Password',
|
||||||
@@ -92,7 +92,7 @@ export default
|
|||||||
awPassMatch: true,
|
awPassMatch: true,
|
||||||
associated: 'password',
|
associated: 'password',
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
user_type: {
|
user_type: {
|
||||||
label: 'User Type',
|
label: 'User Type',
|
||||||
@@ -101,23 +101,23 @@ export default
|
|||||||
disableChooseOption: true,
|
disableChooseOption: true,
|
||||||
ngModel: 'user_type',
|
ngModel: 'user_type',
|
||||||
ngShow: 'current_user["is_superuser"]',
|
ngShow: 'current_user["is_superuser"]',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: {
|
buttons: {
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!user_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngDisabled: true,
|
ngDisabled: true,
|
||||||
ngShow: 'canEdit'
|
ngShow: 'user_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -28,16 +28,6 @@ function InventoriesEdit($scope, $rootScope, $compile, $location,
|
|||||||
fld, json_data, data,
|
fld, json_data, data,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('inventory') + inventory_id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.formLabelSize = null;
|
form.formLabelSize = null;
|
||||||
form.formFieldSize = null;
|
form.formFieldSize = null;
|
||||||
$scope.inventory_id = inventory_id;
|
$scope.inventory_id = inventory_id;
|
||||||
|
|||||||
@@ -17,14 +17,12 @@ function InventoriesList($scope, $rootScope, $location, $log,
|
|||||||
Find, Empty, $state) {
|
Find, Empty, $state) {
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('inventory'));
|
Rest.setUrl(GetBasePath('inventory'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,21 +7,10 @@
|
|||||||
export default
|
export default
|
||||||
['$state', '$stateParams', '$scope', 'GroupForm', 'CredentialList', 'inventoryScriptsListObject', 'ToggleNotification', 'ParseVariableString',
|
['$state', '$stateParams', '$scope', 'GroupForm', 'CredentialList', 'inventoryScriptsListObject', 'ToggleNotification', 'ParseVariableString',
|
||||||
'ParseTypeChange', 'GenerateForm', 'LookUpInit', 'RelatedSearchInit', 'RelatedPaginateInit', 'NotificationsListInit',
|
'ParseTypeChange', 'GenerateForm', 'LookUpInit', 'RelatedSearchInit', 'RelatedPaginateInit', 'NotificationsListInit',
|
||||||
'GroupManageService','GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'groupData', 'inventorySourceData', 'Rest',
|
'GroupManageService','GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'groupData', 'inventorySourceData',
|
||||||
function($state, $stateParams, $scope, GroupForm, CredentialList, InventoryScriptsList, ToggleNotification, ParseVariableString,
|
function($state, $stateParams, $scope, GroupForm, CredentialList, InventoryScriptsList, ToggleNotification, ParseVariableString,
|
||||||
ParseTypeChange, GenerateForm, LookUpInit, RelatedSearchInit, RelatedPaginateInit, NotificationsListInit,
|
ParseTypeChange, GenerateForm, LookUpInit, RelatedSearchInit, RelatedPaginateInit, NotificationsListInit,
|
||||||
GroupManageService, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions, groupData, inventorySourceData, Rest){
|
GroupManageService, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions, groupData, inventorySourceData){
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('groups') + $stateParams.group_id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
form = GroupForm();
|
form = GroupForm();
|
||||||
|
|
||||||
@@ -267,6 +256,7 @@
|
|||||||
$scope.credential_name = inventorySourceData.summary_fields.credential.name;
|
$scope.credential_name = inventorySourceData.summary_fields.credential.name;
|
||||||
}
|
}
|
||||||
$scope = angular.extend($scope, groupData);
|
$scope = angular.extend($scope, groupData);
|
||||||
|
$scope.group_obj = groupData;
|
||||||
|
|
||||||
// instantiate lookup fields
|
// instantiate lookup fields
|
||||||
if (inventorySourceData.source !== 'custom'){
|
if (inventorySourceData.source !== 'custom'){
|
||||||
|
|||||||
@@ -7,16 +7,6 @@
|
|||||||
export default
|
export default
|
||||||
['$state', '$stateParams', '$scope', 'HostForm', 'ParseTypeChange', 'GenerateForm', 'HostManageService', 'host', 'GetBasePath', 'Rest',
|
['$state', '$stateParams', '$scope', 'HostForm', 'ParseTypeChange', 'GenerateForm', 'HostManageService', 'host', 'GetBasePath', 'Rest',
|
||||||
function($state, $stateParams, $scope, HostForm, ParseTypeChange, GenerateForm, HostManageService, host, GetBasePath, Rest){
|
function($state, $stateParams, $scope, HostForm, ParseTypeChange, GenerateForm, HostManageService, host, GetBasePath, Rest){
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('hosts') + $stateParams.host_id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
form = HostForm;
|
form = HostForm;
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ export default
|
|||||||
form = inventoryScriptsFormObject,
|
form = inventoryScriptsFormObject,
|
||||||
url = GetBasePath('inventory_scripts');
|
url = GetBasePath('inventory_scripts');
|
||||||
|
|
||||||
$scope.canEdit = true;
|
|
||||||
|
|
||||||
generator.inject(form, {
|
generator.inject(form, {
|
||||||
mode: 'add' ,
|
mode: 'add' ,
|
||||||
scope:scope,
|
scope:scope,
|
||||||
|
|||||||
@@ -24,19 +24,6 @@ export default
|
|||||||
master = {},
|
master = {},
|
||||||
url = GetBasePath('inventory_scripts');
|
url = GetBasePath('inventory_scripts');
|
||||||
|
|
||||||
|
|
||||||
$scope.canEditInvScripts = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('inventory_scripts') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEditInvScripts = true;
|
|
||||||
} else {
|
|
||||||
$scope.canEditInvScripts = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.inventory_script = inventory_script;
|
$scope.inventory_script = inventory_script;
|
||||||
generator.inject(form, {
|
generator.inject(form, {
|
||||||
mode: 'edit' ,
|
mode: 'edit' ,
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ export default function() {
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEditInvScripts'
|
ngDisabled: '!inventory_script_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEditInvScripts'
|
ngDisabled: '!inventory_script_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -44,7 +44,7 @@ export default function() {
|
|||||||
sourceModel: 'organization',
|
sourceModel: 'organization',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
ngClick: 'lookUpOrganization()',
|
ngClick: 'lookUpOrganization()',
|
||||||
ngDisabled: '!canEditInvScripts'
|
ngDisabled: '!inventory_script_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
script: {
|
script: {
|
||||||
label: 'Custom Script',
|
label: 'Custom Script',
|
||||||
@@ -54,7 +54,7 @@ export default function() {
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
awDropFile: true,
|
awDropFile: true,
|
||||||
ngDisabled: '!canEditInvScripts',
|
ngDisabled: '!inventory_script_obj.summary_fields.user_capabilities.edit',
|
||||||
rows: 10,
|
rows: 10,
|
||||||
awPopOver: "<p>Drag and drop your custom inventory script file here or create one in the field to import your custom inventory. " +
|
awPopOver: "<p>Drag and drop your custom inventory script file here or create one in the field to import your custom inventory. " +
|
||||||
"<br><br> Script must begin with a hashbang sequence: i.e.... #!/usr/bin/env python</p>",
|
"<br><br> Script must begin with a hashbang sequence: i.e.... #!/usr/bin/env python</p>",
|
||||||
@@ -67,16 +67,16 @@ export default function() {
|
|||||||
buttons: { //for now always generates <button> tags
|
buttons: { //for now always generates <button> tags
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEditInvScripts'
|
ngShow: 'inventory_script_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEditInvScripts'
|
ngShow: '!inventory_script_obj.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: 'custom_inventory_form.$pristine || custom_inventory_form.$invalid || !canEdit', //Disable when $pristine or $invalid, optional
|
ngDisabled: 'custom_inventory_form.$pristine || custom_inventory_form.$invalid || !canEdit', //Disable when $pristine or $invalid, optional
|
||||||
ngShow: 'canEditInvScripts'
|
ngShow: 'inventory_script_obj.summary_fields.user_capabilities.edit'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,14 +19,12 @@ export default
|
|||||||
view = GenerateList;
|
view = GenerateList;
|
||||||
|
|
||||||
scope.canAdd = false;
|
scope.canAdd = false;
|
||||||
scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('inventory_scripts'));
|
Rest.setUrl(GetBasePath('inventory_scripts'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
scope.canAdd = true;
|
scope.canAdd = true;
|
||||||
scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -46,16 +46,6 @@ export default
|
|||||||
checkSCMStatus, getPlaybooks, callback,
|
checkSCMStatus, getPlaybooks, callback,
|
||||||
choicesCount = 0;
|
choicesCount = 0;
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('job_templates') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// remove "type" field from search options
|
// remove "type" field from search options
|
||||||
CredentialList = _.cloneDeep(CredentialList);
|
CredentialList = _.cloneDeep(CredentialList);
|
||||||
CredentialList.fields.kind.noSearch = true;
|
CredentialList.fields.kind.noSearch = true;
|
||||||
|
|||||||
@@ -22,14 +22,12 @@ export default
|
|||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('job_templates'));
|
Rest.setUrl(GetBasePath('job_templates'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,16 +25,6 @@ export default
|
|||||||
master = {},
|
master = {},
|
||||||
url = GetBasePath('notification_templates');
|
url = GetBasePath('notification_templates');
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('notification_templates') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.notification_template = notification_template;
|
$scope.notification_template = notification_template;
|
||||||
generator.inject(form, {
|
generator.inject(form, {
|
||||||
mode: 'edit' ,
|
mode: 'edit' ,
|
||||||
|
|||||||
@@ -25,14 +25,12 @@ export default
|
|||||||
});
|
});
|
||||||
|
|
||||||
scope.canAdd = false;
|
scope.canAdd = false;
|
||||||
scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('notification_templates'));
|
Rest.setUrl(GetBasePath('notification_templates'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
scope.canAdd = true;
|
scope.canAdd = true;
|
||||||
scope.canEdit = true;;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ export default function() {
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -47,7 +47,7 @@ export default function() {
|
|||||||
reqExpression: "organizationrequired",
|
reqExpression: "organizationrequired",
|
||||||
init: "true"
|
init: "true"
|
||||||
},
|
},
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
notification_type: {
|
notification_type: {
|
||||||
label: 'Type',
|
label: 'Type',
|
||||||
@@ -58,14 +58,14 @@ export default function() {
|
|||||||
ngOptions: 'type.label for type in notification_type_options track by type.value',
|
ngOptions: 'type.label for type in notification_type_options track by type.value',
|
||||||
ngChange: 'typeChange()',
|
ngChange: 'typeChange()',
|
||||||
hasSubForm: true,
|
hasSubForm: true,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
label: 'Username',
|
label: 'Username',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
|
|
||||||
host: {
|
host: {
|
||||||
@@ -77,7 +77,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
sender: {
|
sender: {
|
||||||
label: 'Sender Email',
|
label: 'Sender Email',
|
||||||
@@ -88,7 +88,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
recipients: {
|
recipients: {
|
||||||
label: 'Recipient List',
|
label: 'Recipient List',
|
||||||
@@ -105,7 +105,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
labelBind: 'passwordLabel',
|
labelBind: 'passwordLabel',
|
||||||
@@ -117,7 +117,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
port: {
|
port: {
|
||||||
labelBind: 'portLabel',
|
labelBind: 'portLabel',
|
||||||
@@ -132,7 +132,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc'",
|
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc'",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
channels: {
|
channels: {
|
||||||
label: 'Destination Channels',
|
label: 'Destination Channels',
|
||||||
@@ -149,7 +149,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'slack'",
|
ngShow: "notification_type.value == 'slack'",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
rooms: {
|
rooms: {
|
||||||
label: 'Destination Channels',
|
label: 'Destination Channels',
|
||||||
@@ -166,7 +166,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat'",
|
ngShow: "notification_type.value == 'hipchat'",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
token: {
|
token: {
|
||||||
labelBind: 'tokenLabel',
|
labelBind: 'tokenLabel',
|
||||||
@@ -178,7 +178,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'slack' || notification_type.value == 'pagerduty' || notification_type.value == 'hipchat'",
|
ngShow: "notification_type.value == 'slack' || notification_type.value == 'pagerduty' || notification_type.value == 'hipchat'",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
account_token: {
|
account_token: {
|
||||||
label: 'Account Token',
|
label: 'Account Token',
|
||||||
@@ -190,7 +190,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
from_number: {
|
from_number: {
|
||||||
label: 'Source Phone Number',
|
label: 'Source Phone Number',
|
||||||
@@ -203,7 +203,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
to_numbers: {
|
to_numbers: {
|
||||||
label: 'Destination SMS Number',
|
label: 'Destination SMS Number',
|
||||||
@@ -220,7 +220,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
account_sid: {
|
account_sid: {
|
||||||
label: 'Account SID',
|
label: 'Account SID',
|
||||||
@@ -231,7 +231,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
subdomain: {
|
subdomain: {
|
||||||
label: 'Pagerduty subdomain',
|
label: 'Pagerduty subdomain',
|
||||||
@@ -242,7 +242,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'pagerduty' ",
|
ngShow: "notification_type.value == 'pagerduty' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
service_key: {
|
service_key: {
|
||||||
label: 'API Service/Integration Key',
|
label: 'API Service/Integration Key',
|
||||||
@@ -253,7 +253,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'pagerduty' ",
|
ngShow: "notification_type.value == 'pagerduty' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
client_name: {
|
client_name: {
|
||||||
label: 'Client Identifier',
|
label: 'Client Identifier',
|
||||||
@@ -264,7 +264,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'pagerduty' ",
|
ngShow: "notification_type.value == 'pagerduty' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
message_from: {
|
message_from: {
|
||||||
label: 'Label to be shown with notification',
|
label: 'Label to be shown with notification',
|
||||||
@@ -275,7 +275,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
api_url: {
|
api_url: {
|
||||||
label: 'API URL',
|
label: 'API URL',
|
||||||
@@ -287,7 +287,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
label: 'Notification Color',
|
label: 'Notification Color',
|
||||||
@@ -300,14 +300,14 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
notify: {
|
notify: {
|
||||||
label: 'Notify Channel',
|
label: 'Notify Channel',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
label: 'Target URL',
|
label: 'Target URL',
|
||||||
@@ -318,7 +318,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'webhook' ",
|
ngShow: "notification_type.value == 'webhook' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
label: 'HTTP Headers',
|
label: 'HTTP Headers',
|
||||||
@@ -339,7 +339,7 @@ export default function() {
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
ngShow: "notification_type.value == 'webhook' ",
|
ngShow: "notification_type.value == 'webhook' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
label: 'IRC Server Address',
|
label: 'IRC Server Address',
|
||||||
@@ -350,7 +350,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
nickname: {
|
nickname: {
|
||||||
label: 'IRC Nick',
|
label: 'IRC Nick',
|
||||||
@@ -361,7 +361,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
targets: {
|
targets: {
|
||||||
label: 'Destination Channels or Users',
|
label: 'Destination Channels or Users',
|
||||||
@@ -378,14 +378,14 @@ export default function() {
|
|||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
use_ssl: {
|
use_ssl: {
|
||||||
label: 'SSL Connection',
|
label: 'SSL Connection',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'irc'",
|
ngShow: "notification_type.value == 'irc'",
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: 'Options',
|
label: 'Options',
|
||||||
@@ -398,14 +398,14 @@ export default function() {
|
|||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
labelClass: 'checkbox-options stack-inline',
|
labelClass: 'checkbox-options stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
}, {
|
}, {
|
||||||
name: 'use_ssl',
|
name: 'use_ssl',
|
||||||
label: 'Use SSL',
|
label: 'Use SSL',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'email'",
|
ngShow: "notification_type.value == 'email'",
|
||||||
labelClass: 'checkbox-options stack-inline',
|
labelClass: 'checkbox-options stack-inline',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -413,15 +413,15 @@ export default function() {
|
|||||||
buttons: { //for now always generates <button> tags
|
buttons: { //for now always generates <button> tags
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()',
|
ngClick: 'formSave()',
|
||||||
ngShow: 'canEdit', //$scope.function to call on click, optional
|
ngShow: 'notification_template.summary_fields.user_capabilities.edit', //$scope.function to call on click, optional
|
||||||
ngDisabled: true //Disable when $pristine or $invalid, optional
|
ngDisabled: true //Disable when $pristine or $invalid, optional
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,16 +25,6 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
id = $stateParams.organization_id,
|
id = $stateParams.organization_id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('organizations') + id);
|
|
||||||
Rest.options()
|
|
||||||
.success(function(data) {
|
|
||||||
if (data.actions.PUT) {
|
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.$parent.activeMode = 'edit';
|
$scope.$parent.activeMode = 'edit';
|
||||||
|
|
||||||
$scope.$parent.activeCard = parseInt(id);
|
$scope.$parent.activeCard = parseInt(id);
|
||||||
|
|||||||
@@ -18,14 +18,12 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('organizations'));
|
Rest.setUrl(GetBasePath('organizations'));
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -32,13 +32,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="SurveyMaker-content">
|
<div class="SurveyMaker-content">
|
||||||
<div class="SurveyMaker-questionPanel" ng-show="canEdit">
|
<div class="SurveyMaker-questionPanel" ng-show="job_template_obj.summary_fields.user_capabilities.edit">
|
||||||
<div id="survey_maker_question_form"></div>
|
<div id="survey_maker_question_form"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="SurveyMaker-separatorPanel" ng-show="canEdit">
|
<div class="SurveyMaker-separatorPanel" ng-show="job_template_obj.summary_fields.user_capabilities.edit">
|
||||||
<div class="SurveyMaker-contentSeparator"></div>
|
<div class="SurveyMaker-contentSeparator"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="SurveyMaker-previewPanel" ng-class="{'SurveyMaker-previewPanel--viewOnly': !canEdit}">
|
<div class="SurveyMaker-previewPanel" ng-class="{'SurveyMaker-previewPanel--viewOnly': !job_template_obj.summary_fields.user_capabilities.edit}">
|
||||||
<div style="display: flex; flex-direction: column; width: 100%;">
|
<div style="display: flex; flex-direction: column; width: 100%;">
|
||||||
<div class="SurveyMaker-panelHeader">PREVIEW</div>
|
<div class="SurveyMaker-panelHeader">PREVIEW</div>
|
||||||
<div class="SurveyMaker-panelBody">
|
<div class="SurveyMaker-panelBody">
|
||||||
@@ -56,13 +56,13 @@
|
|||||||
<i>{{question.question_description}}</i>
|
<i>{{question.question_description}}</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="SurveyMaker-previewInputRow">
|
<div class="SurveyMaker-previewInputRow">
|
||||||
<span dnd-handle class="SurveyMaker-reorderButton" data-placement="top" aw-tool-tip="Drag to reorder question" data-original-title="" title="" ng-show="canEdit">
|
<span dnd-handle class="SurveyMaker-reorderButton" data-placement="top" aw-tool-tip="Drag to reorder question" data-original-title="" title="" ng-show="job_template_obj.summary_fields.user_capabilities.edit">
|
||||||
<i class="fa fa-ellipsis-v"></i>
|
<i class="fa fa-ellipsis-v"></i>
|
||||||
<span> </span>
|
<span> </span>
|
||||||
<i class="fa fa-ellipsis-v"></i>
|
<i class="fa fa-ellipsis-v"></i>
|
||||||
</span>
|
</span>
|
||||||
<survey-question class="SurveyMaker-previewInput" preview="true" question="question" ng-required="question.required" ng-disabled=true></survey-question>
|
<survey-question class="SurveyMaker-previewInput" preview="true" question="question" ng-required="question.required" ng-disabled=true></survey-question>
|
||||||
<div class="SurveyMaker-previewActions" ng-show="canEdit">
|
<div class="SurveyMaker-previewActions" ng-show="job_template_obj.summary_fields.user_capabilities.edit">
|
||||||
<button class="List-actionButton" data-placement="top" ng-class="{'SurveyMaker-previewActions--selected' : editQuestionIndex == $index}" ng-click="editQuestion($index)" aw-tool-tip="Edit question" data-original-title="" title="">
|
<button class="List-actionButton" data-placement="top" ng-class="{'SurveyMaker-previewActions--selected' : editQuestionIndex == $index}" ng-click="editQuestion($index)" aw-tool-tip="Edit question" data-original-title="" title="">
|
||||||
<i class="fa fa-pencil"></i>
|
<i class="fa fa-pencil"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -80,10 +80,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="SurveyMaker-panelFooter">
|
<div class="SurveyMaker-panelFooter">
|
||||||
<div class="Form-buttons">
|
<div class="Form-buttons">
|
||||||
<button id="survey-delete-button" class="btn btn-sm SurveyMaker-deleteButton" ng-show="survey_exists && canEdit" ng-click="showDeleteOverlay('survey')">DELETE SURVEY</button>
|
<button id="survey-delete-button" class="btn btn-sm SurveyMaker-deleteButton" ng-show="survey_exists && job_template_obj.summary_fields.user_capabilities.edit" ng-click="showDeleteOverlay('survey')">DELETE SURVEY</button>
|
||||||
<button id="survey-close-button" class="btn btn-sm Form-buttonDefault" ng-click="closeSurvey('survey-modal-dialog')" ng-show="canEdit">CANCEL</button>
|
<button id="survey-close-button" class="btn btn-sm Form-buttonDefault" ng-click="closeSurvey('survey-modal-dialog')" ng-show="job_template_obj.summary_fields.user_capabilities.edit">CANCEL</button>
|
||||||
<button id="survey-close-button" class="btn btn-sm Form-buttonDefault" ng-click="closeSurvey('survey-modal-dialog')" ng-show="!canEdit">CLOSE</button>
|
<button id="survey-close-button" class="btn btn-sm Form-buttonDefault" ng-click="closeSurvey('survey-modal-dialog')" ng-show="!job_template_obj.summary_fields.user_capabilities.edit">CLOSE</button>
|
||||||
<button id="survey-save-button" class="btn btn-sm Form-saveButton" ng-click="saveSurvey()" ng-disabled="survey_questions.length < 1 || !can_edit || editQuestionIndex !== null" ng-show="canEdit">SAVE</button>
|
<button id="survey-save-button" class="btn btn-sm Form-saveButton" ng-click="saveSurvey()" ng-disabled="survey_questions.length < 1 || !can_edit || editQuestionIndex !== null" ng-show="job_template_obj.summary_fields.user_capabilities.edit">SAVE</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -50,14 +50,12 @@ export default [
|
|||||||
url += "schedules/";
|
url += "schedules/";
|
||||||
|
|
||||||
$scope.canAdd = false;
|
$scope.canAdd = false;
|
||||||
$scope.canEdit = false;
|
|
||||||
|
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.POST) {
|
if (data.actions.POST) {
|
||||||
$scope.canAdd = true;
|
$scope.canAdd = true;
|
||||||
$scope.canEdit = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user