diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-11-21 16:20:32 +0100 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2018-11-27 09:18:48 +0100 |
commit | 0bf740fa324df2971d0f38d4ff814095a2af4c83 (patch) | |
tree | db0fd4ac5b0c08b8bc281d67377f5c9917cffa0c /app/assets/javascripts/pages | |
parent | 8ef51157950366f64cbd41ccf070e1facd104cae (diff) | |
download | gitlab-ce-0bf740fa324df2971d0f38d4ff814095a2af4c83.tar.gz |
Replace `=== true` with `parseBoolean()`
Diffstat (limited to 'app/assets/javascripts/pages')
3 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js b/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js index d9cf62db3f7..674b807edbe 100644 --- a/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js +++ b/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js @@ -1,5 +1,6 @@ import $ from 'jquery'; import { truncate } from '../../../lib/utils/text_utility'; +import { parseBoolean } from '~/lib/utils/common_utils'; const MAX_MESSAGE_LENGTH = 500; const MESSAGE_CELL_SELECTOR = '.abuse-reports .message'; @@ -26,7 +27,7 @@ export default class AbuseReports { const $messageCellElement = $(this); const originalMessage = $messageCellElement.data('originalMessage'); if (!originalMessage) return; - if ($messageCellElement.data('messageTruncated') === 'true') { + if (parseBoolean($messageCellElement.data('messageTruncated'))) { $messageCellElement.data('messageTruncated', 'false'); $messageCellElement.text(originalMessage); } else { diff --git a/app/assets/javascripts/pages/profiles/two_factor_auths/index.js b/app/assets/javascripts/pages/profiles/two_factor_auths/index.js index 417935e2ad0..10cd8ecfbc9 100644 --- a/app/assets/javascripts/pages/profiles/two_factor_auths/index.js +++ b/app/assets/javascripts/pages/profiles/two_factor_auths/index.js @@ -1,9 +1,10 @@ import $ from 'jquery'; import U2FRegister from '~/u2f/register'; +import { parseBoolean } from '~/lib/utils/common_utils'; document.addEventListener('DOMContentLoaded', () => { const twoFactorNode = document.querySelector('.js-two-factor-auth'); - const skippable = twoFactorNode.dataset.twoFactorSkippable === 'true'; + const skippable = parseBoolean(twoFactorNode.dataset.twoFactorSkippable); if (skippable) { const button = `<a class="btn btn-sm btn-warning float-right" data-method="patch" href="${ twoFactorNode.dataset.two_factor_skip_url diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue index 1edd076604c..22512a6f12a 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue @@ -3,6 +3,7 @@ import Vue from 'vue'; import Cookies from 'js-cookie'; import Translate from '../../../../../vue_shared/translate'; import illustrationSvg from '../icons/intro_illustration.svg'; +import { parseBoolean } from '~/lib/utils/common_utils'; Vue.use(Translate); @@ -13,7 +14,7 @@ export default { data() { return { docsUrl: document.getElementById('pipeline-schedules-callout').dataset.docsUrl, - calloutDismissed: Cookies.get(cookieKey) === 'true', + calloutDismissed: parseBoolean(Cookies.get(cookieKey)), }; }, created() { |