summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Tabor <jtabor@redhat.com>2018-08-08 04:03:05 +0200
committerJared Tabor <jtabor@redhat.com>2018-08-08 04:03:05 +0200
commit33fa75ea89440c6b55cac8c81280a7846005e17f (patch)
tree6d8423f7275c7f65a346c8eb073ff451a41bd10a
parentMerge pull request #2788 from ryanpetrello/fix-2782 (diff)
downloadawx-33fa75ea89440c6b55cac8c81280a7846005e17f.tar.xz
awx-33fa75ea89440c6b55cac8c81280a7846005e17f.zip
Sanitizes ng-toast message for copy resources (via string file)
-rw-r--r--awx/ui/client/lib/services/base-string.service.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/awx/ui/client/lib/services/base-string.service.js b/awx/ui/client/lib/services/base-string.service.js
index 536e47624c..0956c7c5a1 100644
--- a/awx/ui/client/lib/services/base-string.service.js
+++ b/awx/ui/client/lib/services/base-string.service.js
@@ -1,6 +1,7 @@
import defaults from '~assets/default.strings.json';
let i18n;
+let $filter;
function BaseStringService (namespace) {
const ERROR_NO_NAMESPACE = 'BaseString cannot be extended without providing a namespace';
@@ -72,7 +73,7 @@ function BaseStringService (namespace) {
this.COPY = t.s('COPY');
this.YES = t.s('YES');
this.CLOSE = t.s('CLOSE');
- this.SUCCESSFUL_CREATION = resource => t.s('{{ resource }} successfully created', { resource });
+ this.SUCCESSFUL_CREATION = resource => t.s('{{ resource }} successfully created', { resource: $filter('sanitize')(resource) });
this.deleteResource = {
HEADER: t.s('Delete'),
@@ -135,12 +136,13 @@ function BaseStringService (namespace) {
};
}
-function BaseStringServiceLoader (_i18n_) {
+function BaseStringServiceLoader (_i18n_, _$filter_) {
i18n = _i18n_;
+ $filter = _$filter_;
return BaseStringService;
}
-BaseStringServiceLoader.$inject = ['i18n'];
+BaseStringServiceLoader.$inject = ['i18n', '$filter'];
export default BaseStringServiceLoader;