From fba991dc482f726f7f5afd0ef4facbc1552e8d3c Mon Sep 17 00:00:00 2001 From: Simon Knox Date: Thu, 6 Jun 2019 08:03:30 +1000 Subject: Add feature flag and dashboard endpoint First part of FE for Prometheus API Dashboard endpoint fetches all info except for chart results Renders empty groups after loading --- app/assets/javascripts/lib/utils/invalid_url.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/assets/javascripts/lib/utils/invalid_url.js (limited to 'app/assets/javascripts/lib/utils') diff --git a/app/assets/javascripts/lib/utils/invalid_url.js b/app/assets/javascripts/lib/utils/invalid_url.js new file mode 100644 index 00000000000..481bd059fc9 --- /dev/null +++ b/app/assets/javascripts/lib/utils/invalid_url.js @@ -0,0 +1,6 @@ +/** + * Invalid URL that ensures we don't make a network request + * Can be used as a default value for URLs. Using an empty + * string can still result in request being made to the current page + */ +export default 'https://invalid'; -- cgit v1.2.1 From 3d8163dcf6070a9e73fa1e8e31a65375ff5770d2 Mon Sep 17 00:00:00 2001 From: Brandon Labuschagne Date: Thu, 13 Jun 2019 19:15:25 +0000 Subject: Disable unnecessary ESLint i18n offences Unnecessary offences include false positives as well as flagged errors which have follow up issues in order to be addressed. Not all issues have been addressed before this being submitted in the spirit of results and iteration. --- app/assets/javascripts/lib/utils/autosave.js | 1 + app/assets/javascripts/lib/utils/notify.js | 2 ++ 2 files changed, 3 insertions(+) (limited to 'app/assets/javascripts/lib/utils') diff --git a/app/assets/javascripts/lib/utils/autosave.js b/app/assets/javascripts/lib/utils/autosave.js index 023c336db02..37896626053 100644 --- a/app/assets/javascripts/lib/utils/autosave.js +++ b/app/assets/javascripts/lib/utils/autosave.js @@ -29,4 +29,5 @@ export const updateDraft = (autosaveKey, text) => { }; export const getDiscussionReplyKey = (noteableType, discussionId) => + /* eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings */ ['Note', capitalizeFirstCharacter(noteableType), discussionId, 'Reply'].join('/'); diff --git a/app/assets/javascripts/lib/utils/notify.js b/app/assets/javascripts/lib/utils/notify.js index d93873e0214..e7f6255e5f1 100644 --- a/app/assets/javascripts/lib/utils/notify.js +++ b/app/assets/javascripts/lib/utils/notify.js @@ -12,6 +12,7 @@ function notificationGranted(message, opts, onclick) { } function notifyPermissions() { + /* eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings */ if ('Notification' in window) { return Notification.requestPermission(); } @@ -24,6 +25,7 @@ function notifyMe(message, body, icon, onclick) { icon: icon, }; // Let's check if the browser supports notifications + /* eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings */ if (!('Notification' in window)) { // do nothing } else if (Notification.permission === 'granted') { -- cgit v1.2.1