diff options
author | Corey Hulen <corey@hulen.com> | 2017-03-27 18:12:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-27 18:12:24 -0700 |
commit | ca8b8d1245026672b1a56d256bb8ff3c8bb1bba9 (patch) | |
tree | fe63702eacaa3743ba24e48c858ab7109feb4a69 /webapp/utils/utils.jsx | |
parent | 022627f9408d739305e93a8acc5f74c5ecdaa229 (diff) | |
download | chat-ca8b8d1245026672b1a56d256bb8ff3c8bb1bba9.tar.gz chat-ca8b8d1245026672b1a56d256bb8ff3c8bb1bba9.tar.bz2 chat-ca8b8d1245026672b1a56d256bb8ff3c8bb1bba9.zip |
Fixing cancel ids for selenium (#5896)
* Fixing ids for selenium
* Fixing ids
* Fixing prop
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r-- | webapp/utils/utils.jsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 16e208409..3bf877781 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -31,11 +31,19 @@ export function isMac() { return navigator.platform.toUpperCase().indexOf('MAC') >= 0; } -export function createSafeId(str) { - if (str === null) { +export function createSafeId(prop) { + if (prop === null) { return null; } + var str = ''; + + if (prop.props && prop.props.defaultMessage) { + str = prop.props.defaultMessage; + } else { + str = prop.toString(); + } + return str.replace(new RegExp(' ', 'g'), '_'); } |