diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-12 18:10:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-12 18:10:37 +0300 |
commit | 84dd3070dff9e36897345bbfd8dc1bf3470376ae (patch) | |
tree | 022fb1c625685b0dfbbdb0c4cf576df272d52043 /app/assets/javascripts | |
parent | bbfd13e575237aaa69a49caf1e23ebd878c2f824 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
15 files changed, 80 insertions, 31 deletions
diff --git a/app/assets/javascripts/blob_edit/edit_blob.js b/app/assets/javascripts/blob_edit/edit_blob.js index e73e368fe01..c7f66a357f3 100644 --- a/app/assets/javascripts/blob_edit/edit_blob.js +++ b/app/assets/javascripts/blob_edit/edit_blob.js @@ -5,7 +5,7 @@ import { BLOB_EDITOR_ERROR, BLOB_PREVIEW_ERROR } from './constants'; import TemplateSelectorMediator from '../blob/file_template_mediator'; import { addEditorMarkdownListeners } from '~/lib/utils/text_markdown'; import EditorLite from '~/editor/editor_lite'; -import { FileTemplateExtension } from '~/editor/editor_file_template_ext'; +import { FileTemplateExtension } from '~/editor/extensions/editor_file_template_ext'; import { insertFinalNewline } from '~/lib/utils/text_utility'; export default class EditBlob { @@ -16,7 +16,7 @@ export default class EditBlob { this.configureMonacoEditor(); if (this.options.isMarkdown) { - import('~/editor/editor_markdown_ext') + import('~/editor/extensions/editor_markdown_ext') .then(({ EditorMarkdownExtension: MarkdownExtension } = {}) => { this.editor.use(new MarkdownExtension()); addEditorMarkdownListeners(this.editor); diff --git a/app/assets/javascripts/editor/editor_ci_schema_ext.js b/app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js index 36e2fe22718..05d938c57ce 100644 --- a/app/assets/javascripts/editor/editor_ci_schema_ext.js +++ b/app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js @@ -1,7 +1,7 @@ import Api from '~/api'; import { registerSchema } from '~/ide/utils'; import { EditorLiteExtension } from './editor_lite_extension_base'; -import { EXTENSION_CI_SCHEMA_FILE_NAME_MATCH } from './constants'; +import { EXTENSION_CI_SCHEMA_FILE_NAME_MATCH } from '../constants'; export class CiSchemaExtension extends EditorLiteExtension { /** diff --git a/app/assets/javascripts/editor/editor_file_template_ext.js b/app/assets/javascripts/editor/extensions/editor_file_template_ext.js index f5474318447..f5474318447 100644 --- a/app/assets/javascripts/editor/editor_file_template_ext.js +++ b/app/assets/javascripts/editor/extensions/editor_file_template_ext.js diff --git a/app/assets/javascripts/editor/editor_lite_extension_base.js b/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js index b8d87fa4969..8d350068973 100644 --- a/app/assets/javascripts/editor/editor_lite_extension_base.js +++ b/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js @@ -1,4 +1,4 @@ -import { ERROR_INSTANCE_REQUIRED_FOR_EXTENSION } from './constants'; +import { ERROR_INSTANCE_REQUIRED_FOR_EXTENSION } from '../constants'; export class EditorLiteExtension { constructor({ instance, ...options } = {}) { diff --git a/app/assets/javascripts/editor/editor_markdown_ext.js b/app/assets/javascripts/editor/extensions/editor_markdown_ext.js index 2ce003753f7..2ce003753f7 100644 --- a/app/assets/javascripts/editor/editor_markdown_ext.js +++ b/app/assets/javascripts/editor/extensions/editor_markdown_ext.js diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 8a2b35752ae..cf9ff87f25e 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -103,6 +103,7 @@ class GfmAutoComplete { at: '/', alias: 'commands', searchKey: 'search', + limit: 100, skipSpecialCharacterTest: true, skipMarkdownCharacterTest: true, data: GfmAutoComplete.defaultLoadingData, diff --git a/app/assets/javascripts/pages/dashboard/todos/index/todos.js b/app/assets/javascripts/pages/dashboard/todos/index/todos.js index 6f8d954d798..bd283201eff 100644 --- a/app/assets/javascripts/pages/dashboard/todos/index/todos.js +++ b/app/assets/javascripts/pages/dashboard/todos/index/todos.js @@ -154,7 +154,7 @@ export default class Todos { goToTodoUrl(e) { const todoLink = this.dataset.url; - if (!todoLink || e.target.tagName === 'A' || e.target.tagName === 'IMG') { + if (!todoLink || e.target.closest('a')) { return; } diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js index 90d2df50d5a..40730ec7e60 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js @@ -13,12 +13,12 @@ document.addEventListener('DOMContentLoaded', () => { // eslint-disable-next-line no-new new Vue({ el, - render(createElement) { - return createElement(PipelineSchedulesCallout); - }, provide: { docsUrl, illustrationUrl, }, + render(createElement) { + return createElement(PipelineSchedulesCallout); + }, }); }); diff --git a/app/assets/javascripts/pipeline_editor/components/text_editor.vue b/app/assets/javascripts/pipeline_editor/components/text_editor.vue index fae08ca89f4..b8d49d77ea9 100644 --- a/app/assets/javascripts/pipeline_editor/components/text_editor.vue +++ b/app/assets/javascripts/pipeline_editor/components/text_editor.vue @@ -1,6 +1,6 @@ <script> import EditorLite from '~/vue_shared/components/editor_lite.vue'; -import { CiSchemaExtension } from '~/editor/editor_ci_schema_ext'; +import { CiSchemaExtension } from '~/editor/extensions/editor_ci_schema_ext'; export default { components: { diff --git a/app/assets/javascripts/projects/pipelines/charts/components/app.vue b/app/assets/javascripts/projects/pipelines/charts/components/app.vue index 4d48468ce88..75f5edbfd2b 100644 --- a/app/assets/javascripts/projects/pipelines/charts/components/app.vue +++ b/app/assets/javascripts/projects/pipelines/charts/components/app.vue @@ -7,7 +7,8 @@ import { getDateInPast } from '~/lib/utils/datetime_utility'; import getPipelineCountByStatus from '../graphql/queries/get_pipeline_count_by_status.query.graphql'; import getProjectPipelineStatistics from '../graphql/queries/get_project_pipeline_statistics.query.graphql'; import StatisticsList from './statistics_list.vue'; -import PipelinesAreaChart from './pipelines_area_chart.vue'; +import CiCdAnalyticsAreaChart from './ci_cd_analytics_area_chart.vue'; + import { CHART_CONTAINER_HEIGHT, CHART_DATE_FORMAT, @@ -52,13 +53,19 @@ export default { GlColumnChart, GlSkeletonLoader, StatisticsList, - PipelinesAreaChart, + CiCdAnalyticsAreaChart, + DeploymentFrequencyCharts: () => + import('ee_component/projects/pipelines/charts/components/deployment_frequency_charts.vue'), }, inject: { projectPath: { type: String, default: '', }, + shouldRenderDeploymentFrequencyCharts: { + type: Boolean, + default: false, + }, }, data() { return { @@ -260,6 +267,15 @@ export default { lastYear: __('Pipelines for last year'), }; }, + areaChartOptions: { + xAxis: { + name: s__('Pipeline|Date'), + type: 'category', + }, + yAxis: { + name: s__('Pipeline|Pipelines'), + }, + }, }; </script> <template> @@ -292,12 +308,17 @@ export default { </div> <hr /> <h4 class="gl-my-4">{{ __('Pipelines charts') }}</h4> - <pipelines-area-chart + <ci-cd-analytics-area-chart v-for="(chart, index) in areaCharts" :key="index" :chart-data="chart.data" + :area-chart-options="$options.areaChartOptions" > {{ chart.title }} - </pipelines-area-chart> + </ci-cd-analytics-area-chart> + <template v-if="shouldRenderDeploymentFrequencyCharts"> + <hr /> + <deployment-frequency-charts /> + </template> </div> </template> diff --git a/app/assets/javascripts/projects/pipelines/charts/components/app_legacy.vue b/app/assets/javascripts/projects/pipelines/charts/components/app_legacy.vue index 1a102815e97..915d334f949 100644 --- a/app/assets/javascripts/projects/pipelines/charts/components/app_legacy.vue +++ b/app/assets/javascripts/projects/pipelines/charts/components/app_legacy.vue @@ -1,10 +1,11 @@ <script> import dateFormat from 'dateformat'; import { GlColumnChart } from '@gitlab/ui/dist/charts'; -import { __, sprintf } from '~/locale'; +import { __, s__, sprintf } from '~/locale'; import { getDateInPast } from '~/lib/utils/datetime_utility'; import StatisticsList from './statistics_list.vue'; -import PipelinesAreaChart from './pipelines_area_chart.vue'; +import CiCdAnalyticsAreaChart from './ci_cd_analytics_area_chart.vue'; + import { CHART_CONTAINER_HEIGHT, INNER_CHART_HEIGHT, @@ -19,7 +20,15 @@ export default { components: { StatisticsList, GlColumnChart, - PipelinesAreaChart, + CiCdAnalyticsAreaChart, + DeploymentFrequencyCharts: () => + import('ee_component/projects/pipelines/charts/components/deployment_frequency_charts.vue'), + }, + inject: { + shouldRenderDeploymentFrequencyCharts: { + type: Boolean, + default: false, + }, }, props: { counts: { @@ -112,6 +121,15 @@ export default { lastYear: __('Pipelines for last year'), }; }, + areaChartOptions: { + xAxis: { + name: s__('Pipeline|Date'), + type: 'category', + }, + yAxis: { + name: s__('Pipeline|Pipelines'), + }, + }, }; </script> <template> @@ -140,12 +158,17 @@ export default { </div> <hr /> <h4 class="my-4">{{ __('Pipelines charts') }}</h4> - <pipelines-area-chart + <ci-cd-analytics-area-chart v-for="(chart, index) in areaCharts" :key="index" :chart-data="chart.data" + :area-chart-options="$options.areaChartOptions" > {{ chart.title }} - </pipelines-area-chart> + </ci-cd-analytics-area-chart> + <template v-if="shouldRenderDeploymentFrequencyCharts"> + <hr /> + <deployment-frequency-charts /> + </template> </div> </template> diff --git a/app/assets/javascripts/projects/pipelines/charts/components/pipelines_area_chart.vue b/app/assets/javascripts/projects/pipelines/charts/components/ci_cd_analytics_area_chart.vue index d726196aadf..3590e2c4632 100644 --- a/app/assets/javascripts/projects/pipelines/charts/components/pipelines_area_chart.vue +++ b/app/assets/javascripts/projects/pipelines/charts/components/ci_cd_analytics_area_chart.vue @@ -1,10 +1,10 @@ <script> import { GlAreaChart } from '@gitlab/ui/dist/charts'; -import { s__ } from '~/locale'; import ResizableChartContainer from '~/vue_shared/components/resizable_chart/resizable_chart_container.vue'; import { CHART_CONTAINER_HEIGHT } from '../constants'; export default { + name: 'CiCdAnalyticsAreaChart', components: { GlAreaChart, ResizableChartContainer, @@ -14,14 +14,9 @@ export default { type: Array, required: true, }, - }, - areaChartOptions: { - xAxis: { - name: s__('Pipeline|Date'), - type: 'category', - }, - yAxis: { - name: s__('Pipeline|Pipelines'), + areaChartOptions: { + type: Object, + required: true, }, }, chartContainerHeight: CHART_CONTAINER_HEIGHT, @@ -39,7 +34,7 @@ export default { :height="$options.chartContainerHeight" :data="chartData" :include-legend-avg-max="false" - :option="$options.areaChartOptions" + :option="areaChartOptions" /> </resizable-chart-container> </div> diff --git a/app/assets/javascripts/projects/pipelines/charts/index.js b/app/assets/javascripts/projects/pipelines/charts/index.js index c94a4e6af99..12943e1c3c7 100644 --- a/app/assets/javascripts/projects/pipelines/charts/index.js +++ b/app/assets/javascripts/projects/pipelines/charts/index.js @@ -1,6 +1,7 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createDefaultClient from '~/lib/graphql'; +import { parseBoolean } from '~/lib/utils/common_utils'; import ProjectPipelinesChartsLegacy from './components/app_legacy.vue'; import ProjectPipelinesCharts from './components/app.vue'; @@ -35,6 +36,10 @@ const mountPipelineChartsApp = (el) => { projectPath, } = el.dataset; + const shouldRenderDeploymentFrequencyCharts = parseBoolean( + el.dataset.shouldRenderDeploymentFrequencyCharts, + ); + const parseAreaChartData = (labels, totals, success) => { let parsedData = {}; @@ -61,6 +66,7 @@ const mountPipelineChartsApp = (el) => { apolloProvider, provide: { projectPath, + shouldRenderDeploymentFrequencyCharts, }, render: (createElement) => createElement(ProjectPipelinesCharts, {}), }); @@ -72,6 +78,10 @@ const mountPipelineChartsApp = (el) => { components: { ProjectPipelinesChartsLegacy, }, + provide: { + projectPath, + shouldRenderDeploymentFrequencyCharts, + }, render: (createElement) => createElement(ProjectPipelinesChartsLegacy, { props: { diff --git a/app/assets/javascripts/user_lists/components/user_list_form.vue b/app/assets/javascripts/user_lists/components/user_list_form.vue index 657acb51fee..a0364089d68 100644 --- a/app/assets/javascripts/user_lists/components/user_list_form.vue +++ b/app/assets/javascripts/user_lists/components/user_list_form.vue @@ -41,7 +41,7 @@ export default { ], }, translations: { - formLabel: s__('UserLists|Feature flag list'), + formLabel: s__('UserLists|Feature flag user list'), formSubtitle: s__( 'UserLists|Lists allow you to define a set of users to be used with feature flags. %{linkStart}Read more about feature flag lists.%{linkEnd}', ), diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index cebbc7f2466..4beaa2509d9 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -307,8 +307,7 @@ export default { callback: this.checkStatus, startingInterval: this.startingPollInterval, maxInterval: this.startingPollInterval + secondsToMilliseconds(4 * 60), - hiddenInterval: - window.gon?.features?.widgetVisibilityPolling && secondsToMilliseconds(6 * 60), + hiddenInterval: secondsToMilliseconds(6 * 60), incrementByFactorOf: 2, }); }, |