summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstance Okoghenun <cokoghenun@gitlab.com>2018-02-16 12:38:50 +0100
committerConstance Okoghenun <cokoghenun@gitlab.com>2018-02-16 12:38:50 +0100
commit523f1f7cf484bea334c365ca21ab3dd492613b55 (patch)
tree4a35ead9e47a178cd361adadedb46cded412e612
parentc94f25e16649d74288dd167b8428739b4f7b9b22 (diff)
downloadgitlab-ce-523f1f7cf484bea334c365ca21ab3dd492613b55.tar.gz
Removed prometheus_metrics webpack bundle tagprometheus-bundle-tag-refactor
-rw-r--r--app/assets/javascripts/pages/projects/services/edit/index.js7
-rw-r--r--app/assets/javascripts/prometheus_metrics/index.js6
-rw-r--r--app/views/projects/services/prometheus/_show.html.haml3
-rw-r--r--config/webpack.config.js1
4 files changed, 7 insertions, 10 deletions
diff --git a/app/assets/javascripts/pages/projects/services/edit/index.js b/app/assets/javascripts/pages/projects/services/edit/index.js
index 434a7e44277..5c73171e62e 100644
--- a/app/assets/javascripts/pages/projects/services/edit/index.js
+++ b/app/assets/javascripts/pages/projects/services/edit/index.js
@@ -1,6 +1,13 @@
import IntegrationSettingsForm from '~/integrations/integration_settings_form';
+import PrometheusMetrics from '~/prometheus_metrics/prometheus_metrics';
export default () => {
+ const prometheusSettingsWrapper = document.querySelector('.js-prometheus-metrics-monitoring');
const integrationSettingsForm = new IntegrationSettingsForm('.js-integration-settings-form');
integrationSettingsForm.init();
+
+ if (prometheusSettingsWrapper) {
+ const prometheusMetrics = new PrometheusMetrics('.js-prometheus-metrics-monitoring');
+ prometheusMetrics.loadActiveMetrics();
+ }
};
diff --git a/app/assets/javascripts/prometheus_metrics/index.js b/app/assets/javascripts/prometheus_metrics/index.js
deleted file mode 100644
index a0c43c5abe1..00000000000
--- a/app/assets/javascripts/prometheus_metrics/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import PrometheusMetrics from './prometheus_metrics';
-
-$(() => {
- const prometheusMetrics = new PrometheusMetrics('.js-prometheus-metrics-monitoring');
- prometheusMetrics.loadActiveMetrics();
-});
diff --git a/app/views/projects/services/prometheus/_show.html.haml b/app/views/projects/services/prometheus/_show.html.haml
index b0cb5ce5e8f..5f38ecd6820 100644
--- a/app/views/projects/services/prometheus/_show.html.haml
+++ b/app/views/projects/services/prometheus/_show.html.haml
@@ -1,6 +1,3 @@
-- content_for :page_specific_javascripts do
- = webpack_bundle_tag('prometheus_metrics')
-
.row.prepend-top-default.append-bottom-default.prometheus-metrics-monitoring.js-prometheus-metrics-monitoring
.col-lg-3
%h4.prepend-top-0
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 3c581a156dd..4e0ae90f8ef 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -83,7 +83,6 @@ var config = {
pipelines_times: './pipelines/pipelines_times.js',
profile: './profile/profile_bundle.js',
project_import_gl: './projects/project_import_gitlab_project.js',
- prometheus_metrics: './prometheus_metrics',
protected_branches: './protected_branches',
protected_tags: './protected_tags',
registry_list: './registry/index.js',