diff options
author | Jared Tabor <jaredevantabor@users.noreply.github.com> | 2018-08-08 19:40:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-08 19:40:32 +0200 |
commit | 86a1f9c0adffa7e82c7807aafb1eab3eb74230d1 (patch) | |
tree | 525dcd8ca3c65dfde1255023e4c180dbe6a57fa1 | |
parent | Merge pull request #2784 from jlmitch5/fixClusterLicenseInfo (diff) | |
parent | Sanitizes ng-toast message for copy resources (via string file) (diff) | |
download | awx-86a1f9c0adffa7e82c7807aafb1eab3eb74230d1.tar.xz awx-86a1f9c0adffa7e82c7807aafb1eab3eb74230d1.zip |
Merge pull request #2779 from jaredevantabor/fix-2778
Sanitizes text in toast message for copying resources
-rw-r--r-- | awx/ui/client/lib/services/base-string.service.js | 8 |
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; |