diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 00:08:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 00:08:13 +0300 |
commit | 680fd17700f55b3718e4d1de56631b4a8f9e6d6c (patch) | |
tree | 7920a5c1a5b70cf0e25ed2214538b1758d092142 /app/assets | |
parent | ff82d09c6a72dc280aed1bba50553e7f1f169f0f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/render_gfm.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/render_metrics.js | 47 |
2 files changed, 0 insertions, 53 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_gfm.js b/app/assets/javascripts/behaviors/markdown/render_gfm.js index 3b55611a8fa..333858f717c 100644 --- a/app/assets/javascripts/behaviors/markdown/render_gfm.js +++ b/app/assets/javascripts/behaviors/markdown/render_gfm.js @@ -3,7 +3,6 @@ import highlightCurrentUser from './highlight_current_user'; import { renderKroki } from './render_kroki'; import renderMath from './render_math'; import renderSandboxedMermaid from './render_sandboxed_mermaid'; -import renderMetrics from './render_metrics'; import renderObservability from './render_observability'; import { renderJSONTable } from './render_json_table'; @@ -30,7 +29,6 @@ export function renderGFM(element) { tableEls, userEls, popoverEls, - metricsEls, observabilityEls, ] = [ '.js-syntax-highlight', @@ -40,7 +38,6 @@ export function renderGFM(element) { '[lang="json"][data-lang-params="table"]', '.gfm-project_member', '.gfm-issue, .gfm-work_item, .gfm-merge_request, .gfm-epic', - '.js-render-metrics', '.js-render-observability', ].map((selector) => Array.from(element.querySelectorAll(selector))); @@ -50,9 +47,6 @@ export function renderGFM(element) { renderSandboxedMermaid(mermaidEls); renderJSONTable(tableEls.map((e) => e.parentNode)); highlightCurrentUser(userEls); - if (!window.gon?.features?.removeMonitorMetrics) { - renderMetrics(metricsEls); - } renderObservability(observabilityEls); initPopovers(popoverEls); } diff --git a/app/assets/javascripts/behaviors/markdown/render_metrics.js b/app/assets/javascripts/behaviors/markdown/render_metrics.js deleted file mode 100644 index e7a2a6ce47c..00000000000 --- a/app/assets/javascripts/behaviors/markdown/render_metrics.js +++ /dev/null @@ -1,47 +0,0 @@ -import Vue from 'vue'; -import { createStore } from '~/monitoring/stores/embed_group/'; - -// TODO: Handle copy-pasting - https://gitlab.com/gitlab-org/gitlab-foss/issues/64369. -export default function renderMetrics(elements) { - if (!elements.length) { - return Promise.resolve(); - } - - const wrapperList = []; - - elements.forEach((element) => { - let wrapper; - const { previousElementSibling } = element; - const isFirstElementInGroup = !previousElementSibling?.urls; - - if (isFirstElementInGroup) { - wrapper = document.createElement('div'); - wrapper.urls = [element.dataset.dashboardUrl]; - element.parentNode.insertBefore(wrapper, element); - wrapperList.push(wrapper); - } else { - wrapper = previousElementSibling; - wrapper.urls.push(element.dataset.dashboardUrl); - } - - // Clean up processed element - element.parentNode.removeChild(element); - }); - - return import( - /* webpackChunkName: 'gfm_metrics' */ '~/monitoring/components/embeds/embed_group.vue' - ).then(({ default: EmbedGroup }) => { - const EmbedGroupComponent = Vue.extend(EmbedGroup); - - wrapperList.forEach((wrapper) => { - // eslint-disable-next-line no-new - new EmbedGroupComponent({ - el: wrapper, - store: createStore(), - propsData: { - urls: wrapper.urls, - }, - }); - }); - }); -} |