diff --git a/awx/ui/client/features/credentials/credentials.strings.js b/awx/ui/client/features/credentials/credentials.strings.js
index 64af74726e..958282aa09 100644
--- a/awx/ui/client/features/credentials/credentials.strings.js
+++ b/awx/ui/client/features/credentials/credentials.strings.js
@@ -27,11 +27,6 @@ function CredentialsStrings (BaseString) {
ns.permissions = {
TITLE: t.s('CREDENTIALS PERMISSIONS')
};
-
- ns.deleteCredential = {
- CONFIRM: t.s('Are you sure you want to delete this credential?'),
- INVALIDATE: t.s('Doing so will invalidate the following:')
- };
}
CredentialsStrings.$inject = ['BaseStringService'];
diff --git a/awx/ui/client/lib/services/base-string.service.js b/awx/ui/client/lib/services/base-string.service.js
index 74d6611956..f086c987a3 100644
--- a/awx/ui/client/lib/services/base-string.service.js
+++ b/awx/ui/client/lib/services/base-string.service.js
@@ -60,6 +60,10 @@ function BaseStringService (namespace) {
this.CANCEL = t.s('CANCEL');
this.SAVE = t.s('SAVE');
this.OK = t.s('OK');
+ this.deleteResource = {
+ USED_BY: resourceType => t.s('The {{ resourceType }} is currently being used by other resources.', { resourceType }),
+ CONFIRM: resourceType => t.s('Are you sure you want to delete this {{ resourceType }}?', { resourceType })
+ };
/**
* This getter searches the extending class' namespace first for a match then falls back to
diff --git a/awx/ui/client/src/credential-types/credential-types.strings.js b/awx/ui/client/src/credential-types/credential-types.strings.js
index ec2e478ef2..037c93a0ce 100644
--- a/awx/ui/client/src/credential-types/credential-types.strings.js
+++ b/awx/ui/client/src/credential-types/credential-types.strings.js
@@ -5,7 +5,6 @@ function CredentialTypesStrings (BaseString) {
let ns = this.credential_types;
ns.deleteCredentialType = {
- CONFIRM: t.s('Are you sure you want to delete this credential type?'),
CREDENTIAL_TYPE_IN_USE: t.s('This credential type is currently being used by one or more credentials. Credentials that use this credential type must be deleted before the credential type can be deleted.')
};
}
diff --git a/awx/ui/client/src/credential-types/list/list.controller.js b/awx/ui/client/src/credential-types/list/list.controller.js
index db44d738c6..6e10b5cb34 100644
--- a/awx/ui/client/src/credential-types/list/list.controller.js
+++ b/awx/ui/client/src/credential-types/list/list.controller.js
@@ -90,7 +90,7 @@ export default ['$rootScope', '$scope', 'Wait', 'CredentialTypesList',
credentialType.getDependentResourceCounts(id)
.then((counts) => {
let credentialTypeInUse = false;
- let deleteModalBody = `
${CredentialTypesStrings.get('deleteCredentialType.CONFIRM')}
`;
+ let deleteModalBody = `${CredentialTypesStrings.get('deleteResource.CONFIRM', 'credential type')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
diff --git a/awx/ui/client/src/credentials/list/credentials-list.controller.js b/awx/ui/client/src/credentials/list/credentials-list.controller.js
index da2b27858b..658bbdaecb 100644
--- a/awx/ui/client/src/credentials/list/credentials-list.controller.js
+++ b/awx/ui/client/src/credentials/list/credentials-list.controller.js
@@ -114,7 +114,7 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', '
credential.getDependentResourceCounts(id)
.then((counts) => {
const invalidateRelatedLines = [];
- let deleteModalBody = `${CredentialsStrings.get('deleteCredential.CONFIRM')}
`;
+ let deleteModalBody = `${CredentialsStrings.get('deleteResource.CONFIRM', 'credential')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
@@ -123,7 +123,7 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', '
});
if (invalidateRelatedLines && invalidateRelatedLines.length > 0) {
- deleteModalBody = `${CredentialsStrings.get('deleteCredential.CONFIRM')} ${CredentialsStrings.get('deleteCredential.INVALIDATE')}
`;
+ deleteModalBody = `${CredentialsStrings.get('deleteResource.USED_BY', 'credential')} ${CredentialsStrings.get('deleteResource.CONFIRM', 'credential')}
`;
invalidateRelatedLines.forEach(invalidateRelatedLine => {
deleteModalBody += invalidateRelatedLine;
});
diff --git a/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js
index ee1783fec8..0846a21561 100644
--- a/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js
+++ b/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js
@@ -101,7 +101,7 @@ function InventoriesList($scope,
inventory.getDependentResourceCounts(id)
.then((counts) => {
const invalidateRelatedLines = [];
- let deleteModalBody = `${InventoryHostsStrings.get('deleteInventory.CONFIRM')}
`;
+ let deleteModalBody = `${InventoryHostsStrings.get('deleteResource.CONFIRM', 'inventory')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
@@ -110,7 +110,7 @@ function InventoriesList($scope,
});
if (invalidateRelatedLines && invalidateRelatedLines.length > 0) {
- deleteModalBody = `${InventoryHostsStrings.get('deleteInventory.CONFIRM')} ${InventoryHostsStrings.get('deleteInventory.INVALIDATE')}
`;
+ deleteModalBody = `${InventoryHostsStrings.get('deleteResource.USED_BY', 'inventory')} ${InventoryHostsStrings.get('deleteResource.CONFIRM', 'inventory')}
`;
invalidateRelatedLines.forEach(invalidateRelatedLine => {
deleteModalBody += invalidateRelatedLine;
});
diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/list/sources-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/list/sources-list.controller.js
index b65c0433aa..ef8c505943 100644
--- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/list/sources-list.controller.js
+++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/list/sources-list.controller.js
@@ -143,7 +143,7 @@
inventorySource.getDependentResourceCounts(inventory_source.id)
.then((counts) => {
const invalidateRelatedLines = [];
- let deleteModalBody = `${InventoryHostsStrings.get('deleteSource.CONFIRM')}
`;
+ let deleteModalBody = `${InventoryHostsStrings.get('deleteResource.CONFIRM', 'inventory source')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
@@ -152,7 +152,7 @@
});
if (invalidateRelatedLines && invalidateRelatedLines.length > 0) {
- deleteModalBody = `${InventoryHostsStrings.get('deleteSource.CONFIRM')} ${InventoryHostsStrings.get('deleteSource.INVALIDATE')}
`;
+ deleteModalBody = `${InventoryHostsStrings.get('deleteResource.USED_BY', 'inventory source')} ${InventoryHostsStrings.get('deleteResource.CONFIRM', 'inventory source')}
`;
invalidateRelatedLines.forEach(invalidateRelatedLine => {
deleteModalBody += invalidateRelatedLine;
});
diff --git a/awx/ui/client/src/inventories-hosts/inventory-hosts.strings.js b/awx/ui/client/src/inventories-hosts/inventory-hosts.strings.js
index 0744be46db..c64b73a933 100644
--- a/awx/ui/client/src/inventories-hosts/inventory-hosts.strings.js
+++ b/awx/ui/client/src/inventories-hosts/inventory-hosts.strings.js
@@ -4,16 +4,6 @@ function InventoryHostsStrings (BaseString) {
let t = this.t;
let ns = this['inventory-hosts'];
- ns.deleteInventory = {
- CONFIRM: t.s('Are you sure you want to delete this inventory?'),
- INVALIDATE: t.s('Doing so will invalidate the following:')
- };
-
- ns.deleteSource = {
- CONFIRM: t.s('Are you sure you want to delete this inventory source?'),
- INVALIDATE: t.s('Doing so will invalidate the following:')
- };
-
ns.deletegroup = {
GROUP: count => t.p(count, 'group', 'groups'),
HOST: count => t.p(count, 'host', 'hosts'),
diff --git a/awx/ui/client/src/inventory-scripts/inventory-scripts.strings.js b/awx/ui/client/src/inventory-scripts/inventory-scripts.strings.js
index 9b3fccd4af..0760b60add 100644
--- a/awx/ui/client/src/inventory-scripts/inventory-scripts.strings.js
+++ b/awx/ui/client/src/inventory-scripts/inventory-scripts.strings.js
@@ -1,13 +1,5 @@
function InventoryScriptsStrings (BaseString) {
BaseString.call(this, 'inventory_scripts');
-
- let t = this.t;
- let ns = this.inventory_scripts;
-
- ns.deleteInventoryScript = {
- CONFIRM: t.s('Are you sure you want to delete this inventory script?'),
- INVALIDATE: t.s('Doing so will invalidate the following:')
- };
}
InventoryScriptsStrings.$inject = ['BaseStringService'];
diff --git a/awx/ui/client/src/inventory-scripts/list/list.controller.js b/awx/ui/client/src/inventory-scripts/list/list.controller.js
index b6630b7c2a..a9d1140fb0 100644
--- a/awx/ui/client/src/inventory-scripts/list/list.controller.js
+++ b/awx/ui/client/src/inventory-scripts/list/list.controller.js
@@ -80,7 +80,7 @@ export default ['$rootScope', '$scope', 'Wait', 'InventoryScriptsList',
inventoryScript.getDependentResourceCounts(id)
.then((counts) => {
const invalidateRelatedLines = [];
- let deleteModalBody = `${InventoryScriptsStrings.get('deleteInventoryScript.CONFIRM')}
`;
+ let deleteModalBody = `${InventoryScriptsStrings.get('deleteResource.CONFIRM', 'inventory script')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
@@ -89,7 +89,7 @@ export default ['$rootScope', '$scope', 'Wait', 'InventoryScriptsList',
});
if (invalidateRelatedLines && invalidateRelatedLines.length > 0) {
- deleteModalBody = `${InventoryScriptsStrings.get('deleteInventoryScript.CONFIRM')} ${InventoryScriptsStrings.get('deleteInventoryScript.INVALIDATE')}
`;
+ deleteModalBody = `${InventoryScriptsStrings.get('deleteResource.USED_BY', 'inventory script')} ${InventoryScriptsStrings.get('deleteResource.CONFIRM', 'inventory script')}
`;
invalidateRelatedLines.forEach(invalidateRelatedLine => {
deleteModalBody += invalidateRelatedLine;
});
diff --git a/awx/ui/client/src/projects/list/projects-list.controller.js b/awx/ui/client/src/projects/list/projects-list.controller.js
index 267eebe887..f129fe5f7a 100644
--- a/awx/ui/client/src/projects/list/projects-list.controller.js
+++ b/awx/ui/client/src/projects/list/projects-list.controller.js
@@ -206,7 +206,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
project.getDependentResourceCounts(id)
.then((counts) => {
const invalidateRelatedLines = [];
- let deleteModalBody = `${ProjectsStrings.get('deleteProject.CONFIRM')}
`;
+ let deleteModalBody = `${ProjectsStrings.get('deleteResource.CONFIRM', 'project')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
@@ -215,7 +215,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
});
if (invalidateRelatedLines && invalidateRelatedLines.length > 0) {
- deleteModalBody = `${ProjectsStrings.get('deleteProject.CONFIRM')} ${ProjectsStrings.get('deleteProject.INVALIDATE')}
`;
+ deleteModalBody = `${ProjectsStrings.get('deleteResource.USED_BY', 'project')} ${ProjectsStrings.get('deleteResource.CONFIRM', 'project')}
`;
invalidateRelatedLines.forEach(invalidateRelatedLine => {
deleteModalBody += invalidateRelatedLine;
});
diff --git a/awx/ui/client/src/projects/projects.strings.js b/awx/ui/client/src/projects/projects.strings.js
index 84566d12e7..37e4141a7b 100644
--- a/awx/ui/client/src/projects/projects.strings.js
+++ b/awx/ui/client/src/projects/projects.strings.js
@@ -1,13 +1,5 @@
function ProjectsStrings (BaseString) {
BaseString.call(this, 'projects');
-
- let t = this.t;
- let ns = this.projects;
-
- ns.deleteProject = {
- CONFIRM: t.s('Are you sure you want to delete this project?'),
- INVALIDATE: t.s('Doing so will invalidate the following:')
- };
}
ProjectsStrings.$inject = ['BaseStringService'];
diff --git a/awx/ui/client/src/templates/list/templates-list.controller.js b/awx/ui/client/src/templates/list/templates-list.controller.js
index bd25143132..a0575730fd 100644
--- a/awx/ui/client/src/templates/list/templates-list.controller.js
+++ b/awx/ui/client/src/templates/list/templates-list.controller.js
@@ -154,7 +154,7 @@ export default ['$scope', '$rootScope',
Prompt({
hdr: i18n._('Delete'),
resourceName: $filter('sanitize')(template.name),
- body: TemplatesStrings.get('workflowJobTemplates.deleteWorkflowJobTemplate.CONFIRM'),
+ body: TemplatesStrings.get('deleteResource.CONFIRM', 'workflow job template'),
action: action,
actionText: 'DELETE'
});
@@ -164,7 +164,7 @@ export default ['$scope', '$rootScope',
jobTemplate.getDependentResourceCounts(template.id)
.then((counts) => {
const invalidateRelatedLines = [];
- let deleteModalBody = `${TemplatesStrings.get('jobTemplates.deleteJobTemplate.CONFIRM')}
`;
+ let deleteModalBody = `${TemplatesStrings.get('deleteResource.CONFIRM', 'job template')}
`;
counts.forEach(countObj => {
if(countObj.count && countObj.count > 0) {
@@ -173,7 +173,7 @@ export default ['$scope', '$rootScope',
});
if (invalidateRelatedLines && invalidateRelatedLines.length > 0) {
- deleteModalBody = `${TemplatesStrings.get('jobTemplates.deleteJobTemplate.CONFIRM')} ${TemplatesStrings.get('jobTemplates.deleteJobTemplate.INVALIDATE')}
`;
+ deleteModalBody = `${TemplatesStrings.get('deleteResource.USED_BY', 'job template')} ${TemplatesStrings.get('deleteResource.CONFIRM', 'job template')}
`;
invalidateRelatedLines.forEach(invalidateRelatedLine => {
deleteModalBody += invalidateRelatedLine;
});
diff --git a/awx/ui/client/src/templates/templates.strings.js b/awx/ui/client/src/templates/templates.strings.js
index 2391ea8134..8eada73742 100644
--- a/awx/ui/client/src/templates/templates.strings.js
+++ b/awx/ui/client/src/templates/templates.strings.js
@@ -1,21 +1,5 @@
function TemplatesStrings (BaseString) {
BaseString.call(this, 'templates');
-
- let t = this.t;
- let ns = this.templates;
-
- ns.jobTemplates = {
- deleteJobTemplate: {
- CONFIRM: t.s('Are you sure you want to delete this job template?'),
- INVALIDATE: t.s('Doing so will invalidate the following:')
- }
- };
-
- ns.workflowJobTemplates = {
- deleteWorkflowJobTemplate: {
- CONFIRM: t.s('Are you sure you want to delete this workflow job template?')
- }
- };
}
TemplatesStrings.$inject = ['BaseStringService'];