diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-01 12:13:32 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-01 12:13:32 +0000 |
commit | 6c7d90ede4d2890b2ca740239cd9a5338f12ba34 (patch) | |
tree | 59a0fde813364a626fe201dc58316dee001f96e1 /app/assets | |
parent | 3cb9e9a5070184e59cb6ff33a4ce381ed14a6fe5 (diff) | |
download | gitlab-ce-6c7d90ede4d2890b2ca740239cd9a5338f12ba34.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
18 files changed, 128 insertions, 54 deletions
diff --git a/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue b/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue index 413163c8536..aaf2ff313a0 100644 --- a/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue +++ b/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue @@ -117,7 +117,7 @@ export default { <p> <gl-sprintf :message="s__('AdminUsers|To confirm, type %{username}')"> <template #username> - <code>{{ username }}</code> + <code class="gl-white-space-pre-wrap">{{ username }}</code> </template> </gl-sprintf> </p> diff --git a/app/assets/javascripts/content_editor/content_editor.stories.js b/app/assets/javascripts/content_editor/content_editor.stories.js index 8f2ce8feb5d..9329bbcb2c7 100644 --- a/app/assets/javascripts/content_editor/content_editor.stories.js +++ b/app/assets/javascripts/content_editor/content_editor.stories.js @@ -2,7 +2,7 @@ import { ContentEditor } from './index'; export default { component: ContentEditor, - title: 'Components/Content Editor', + title: 'content_editor/components/content_editor', }; const Template = (_, { argTypes }) => ({ diff --git a/app/assets/javascripts/content_editor/extensions/table_of_contents.js b/app/assets/javascripts/content_editor/extensions/table_of_contents.js index 9c0316ddc08..9e31158837e 100644 --- a/app/assets/javascripts/content_editor/extensions/table_of_contents.js +++ b/app/assets/javascripts/content_editor/extensions/table_of_contents.js @@ -1,4 +1,5 @@ -import { Node, nodeInputRule } from '@tiptap/core'; +import { Node } from '@tiptap/core'; +import { InputRule } from 'prosemirror-inputrules'; import { s__ } from '~/locale'; import { PARSE_HTML_PRIORITY_HIGHEST } from '../constants'; @@ -32,6 +33,19 @@ export default Node.create({ }, addInputRules() { - return inputRuleRegExps.map((regex) => nodeInputRule(regex, this.type)); + const { type } = this; + + return inputRuleRegExps.map( + (regex) => + new InputRule(regex, (state, match, start, end) => { + const { tr } = state; + + if (match) { + tr.replaceWith(start - 1, end, type.create()); + } + + return tr; + }), + ); }, }); diff --git a/app/assets/javascripts/diffs/components/diff_row.vue b/app/assets/javascripts/diffs/components/diff_row.vue index 737c4d8f33c..4e33a02ca0e 100644 --- a/app/assets/javascripts/diffs/components/diff_row.vue +++ b/app/assets/javascripts/diffs/components/diff_row.vue @@ -1,4 +1,9 @@ <script> +/* eslint-disable vue/no-v-html */ +/** +NOTE: This file uses v-html over v-safe-html for performance reasons, see: +https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57842 +* */ import { memoize } from 'lodash'; import { isLoggedIn } from '~/lib/utils/common_utils'; import { @@ -267,7 +272,9 @@ export default { ]" class="diff-td line_content with-coverage left-side" data-testid="left-content" - v-html="$options.lineContent(props.line.left) /* eslint-disable-line vue/no-v-html */" + v-html=" + $options.lineContent(props.line.left) /* v-html for performance, see top of file */ + " ></div> </template> <template @@ -389,7 +396,9 @@ export default { }, ]" class="diff-td line_content with-coverage right-side parallel" - v-html="$options.lineContent(props.line.right) /* eslint-disable-line vue/no-v-html */" + v-html=" + $options.lineContent(props.line.right) /* v-html for performance, see top of file */ + " ></div> </template> <template v-else> diff --git a/app/assets/javascripts/packages_and_registries/settings/project/components/registry_settings_app.vue b/app/assets/javascripts/packages_and_registries/settings/project/components/registry_settings_app.vue index bf286c84d5f..7be3bba7cae 100644 --- a/app/assets/javascripts/packages_and_registries/settings/project/components/registry_settings_app.vue +++ b/app/assets/javascripts/packages_and_registries/settings/project/components/registry_settings_app.vue @@ -95,7 +95,7 @@ export default { <gl-sprintf :message=" __( - 'Save space and find images in the container Registry. remove unneeded tags and keep only the ones you want. %{linkStart}How does cleanup work?%{linkEnd}', + 'Save storage space by automatically deleting tags from the container registry and keeping the ones you want. %{linkStart}How does cleanup work?%{linkEnd}', ) " > diff --git a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue index f204f0ebfaa..7fd63acbede 100644 --- a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue +++ b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue @@ -1,6 +1,7 @@ <script> import { GlSafeHtmlDirective } from '@gitlab/ui'; import { glEmojiTag } from '~/emoji'; +import { mergeUrlParams } from '~/lib/utils/url_utility'; import { s__ } from '~/locale'; import AddRequest from './add_request.vue'; @@ -123,6 +124,9 @@ export default { const fileName = this.requests[0].truncatedUrl; return `${fileName}_perf_bar_${Date.now()}.json`; }, + flamegraphPath() { + return mergeUrlParams({ performance_bar: 'flamegraph' }, window.location.href); + }, }, mounted() { this.currentRequest = this.requestId; @@ -175,6 +179,11 @@ export default { s__('PerformanceBar|Download') }}</a> </div> + <div v-if="currentRequest.details" id="peek-flamegraph" class="view"> + <a class="gl-text-blue-200" :href="flamegraphPath">{{ + s__('PerformanceBar|Flamegraph') + }}</a> + </div> <a v-if="statsUrl" class="gl-text-blue-200 view" :href="statsUrl">{{ s__('PerformanceBar|Stats') }}</a> diff --git a/app/assets/javascripts/related_issues/components/issue_token.vue b/app/assets/javascripts/related_issues/components/issue_token.vue index 9665ed173b9..840a6750cd2 100644 --- a/app/assets/javascripts/related_issues/components/issue_token.vue +++ b/app/assets/javascripts/related_issues/components/issue_token.vue @@ -48,7 +48,7 @@ export default { <template> <div :class="{ - 'issue-token': isCondensed, + 'issue-token gl-display-inline-flex gl-align-items-stretch gl-max-w-full gl-line-height-24 gl-white-space-nowrap': isCondensed, 'flex-row issuable-info-container': !isCondensed, }" > @@ -57,7 +57,7 @@ export default { ref="link" v-gl-tooltip :class="{ - 'issue-token-link': isCondensed, + 'issue-token-link gl-display-inline-flex gl-min-w-0 gl-text-gray-500': isCondensed, 'issuable-main-info': !isCondensed, }" :href="computedPath" @@ -69,19 +69,19 @@ export default { v-if="hasTitle" ref="title" :class="{ - 'issue-token-title issue-token-end': isCondensed, + 'issue-token-title issue-token-end gl-overflow-hidden gl-display-flex gl-align-items-baseline gl-text-gray-500 gl-pl-3': isCondensed, 'issue-title block-truncated': !isCondensed, - 'issue-token-title-standalone': !canRemove, + 'gl-rounded-top-right-small gl-rounded-bottom-right-small gl-pr-3': !canRemove, }" class="js-issue-token-title" > - <span class="issue-token-title-text">{{ title }}</span> + <span class="gl-text-truncate">{{ title }}</span> </component> <component :is="innerComponentType" ref="reference" :class="{ - 'issue-token-reference': isCondensed, + 'issue-token-reference gl-display-flex gl-align-items-center gl-rounded-top-left-small gl-rounded-bottom-left-small gl-px-3': isCondensed, 'issuable-info': !isCondensed, }" > @@ -103,7 +103,7 @@ export default { ref="removeButton" v-gl-tooltip :class="{ - 'issue-token-remove-button': isCondensed, + 'issue-token-remove-button gl-display-flex gl-align-items-center gl-px-3 gl-border-0 gl-rounded-top-right-small gl-rounded-bottom-right-small gl-text-gray-500': isCondensed, 'btn btn-default': !isCondensed, }" :title="removeButtonLabel" diff --git a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue index fedd2519958..35476cc411e 100644 --- a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue +++ b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue @@ -1,4 +1,5 @@ <script> +import { GlLink } from '@gitlab/ui'; import createFlash from '~/flash'; import { fetchPolicies } from '~/lib/graphql'; import { updateHistory } from '~/lib/utils/url_utility'; @@ -6,6 +7,7 @@ import { formatNumber, sprintf, __ } from '~/locale'; import RunnerFilteredSearchBar from '../components/runner_filtered_search_bar.vue'; import RunnerList from '../components/runner_list.vue'; import RunnerManualSetupHelp from '../components/runner_manual_setup_help.vue'; +import RunnerName from '../components/runner_name.vue'; import RunnerPagination from '../components/runner_pagination.vue'; import RunnerTypeHelp from '../components/runner_type_help.vue'; import { statusTokenConfig } from '../components/search_tokens/status_token_config'; @@ -23,10 +25,12 @@ import { captureException } from '../sentry_utils'; export default { name: 'AdminRunnersApp', components: { + GlLink, RunnerFilteredSearchBar, RunnerList, RunnerManualSetupHelp, RunnerTypeHelp, + RunnerName, RunnerPagination, }, props: { @@ -150,7 +154,13 @@ export default { {{ __('No runners found') }} </div> <template v-else> - <runner-list :runners="runners.items" :loading="runnersLoading" /> + <runner-list :runners="runners.items" :loading="runnersLoading"> + <template #runner-name="{ runner }"> + <gl-link :href="runner.adminUrl"> + <runner-name :runner="runner" /> + </gl-link> + </template> + </runner-list> <runner-pagination v-model="search.pagination" :page-info="runners.pageInfo" /> </template> </div> diff --git a/app/assets/javascripts/runner/components/cells/runner_actions_cell.vue b/app/assets/javascripts/runner/components/cells/runner_actions_cell.vue index 863f0ab995f..e26bdbf1aea 100644 --- a/app/assets/javascripts/runner/components/cells/runner_actions_cell.vue +++ b/app/assets/javascripts/runner/components/cells/runner_actions_cell.vue @@ -1,7 +1,6 @@ <script> import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui'; import createFlash from '~/flash'; -import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { __, s__ } from '~/locale'; import runnerDeleteMutation from '~/runner/graphql/runner_delete.mutation.graphql'; import runnerUpdateMutation from '~/runner/graphql/runner_update.mutation.graphql'; @@ -37,13 +36,6 @@ export default { }; }, computed: { - runnerNumericalId() { - return getIdFromGraphQLId(this.runner.id); - }, - runnerUrl() { - // TODO implement using webUrl from the API - return `${gon.gitlab_url || ''}/admin/runners/${this.runnerNumericalId}`; - }, isActive() { return this.runner.active; }, @@ -119,7 +111,7 @@ export default { }, }, awaitRefetchQueries: true, - refetchQueries: ['getRunners'], + refetchQueries: ['getRunners', 'getGroupRunners'], }); if (errors && errors.length) { throw new Error(errors.join(' ')); @@ -147,12 +139,20 @@ export default { <template> <gl-button-group> + <!-- + This button appears for administratos: those with + access to the adminUrl. More advanced permissions policies + will allow more granular permissions. + + See https://gitlab.com/gitlab-org/gitlab/-/issues/334802 + --> <gl-button + v-if="runner.adminUrl" v-gl-tooltip.hover.viewport + :href="runner.adminUrl" :title="$options.i18n.I18N_EDIT" :aria-label="$options.i18n.I18N_EDIT" icon="pencil" - :href="runnerUrl" data-testid="edit-runner" /> <gl-button diff --git a/app/assets/javascripts/runner/components/cells/runner_name_cell.vue b/app/assets/javascripts/runner/components/cells/runner_summary_cell.vue index 797a3359147..886b5cb29fc 100644 --- a/app/assets/javascripts/runner/components/cells/runner_name_cell.vue +++ b/app/assets/javascripts/runner/components/cells/runner_summary_cell.vue @@ -1,12 +1,11 @@ <script> -import { GlLink } from '@gitlab/ui'; -import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; +import RunnerName from '../runner_name.vue'; export default { components: { - GlLink, TooltipOnTruncate, + RunnerName, }, props: { runner: { @@ -15,26 +14,18 @@ export default { }, }, computed: { - runnerNumericalId() { - return getIdFromGraphQLId(this.runner.id); - }, - runnerUrl() { - // TODO implement using webUrl from the API - return `${gon.gitlab_url || ''}/admin/runners/${this.runnerNumericalId}`; - }, description() { return this.runner.description; }, - shortSha() { - return this.runner.shortSha; - }, }, }; </script> <template> <div> - <gl-link :href="runnerUrl"> #{{ runnerNumericalId }} ({{ shortSha }})</gl-link> + <slot :runner="runner" name="runner-name"> + <runner-name :runner="runner" /> + </slot> <tooltip-on-truncate class="gl-display-block" :title="description" truncate-target="child"> <div class="gl-text-truncate"> {{ description }} diff --git a/app/assets/javascripts/runner/components/runner_list.vue b/app/assets/javascripts/runner/components/runner_list.vue index 69a1f106ca8..3f6ea389288 100644 --- a/app/assets/javascripts/runner/components/runner_list.vue +++ b/app/assets/javascripts/runner/components/runner_list.vue @@ -5,7 +5,7 @@ import { formatNumber, __, s__ } from '~/locale'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import { RUNNER_JOB_COUNT_LIMIT } from '../constants'; import RunnerActionsCell from './cells/runner_actions_cell.vue'; -import RunnerNameCell from './cells/runner_name_cell.vue'; +import RunnerSummaryCell from './cells/runner_summary_cell.vue'; import RunnerTypeCell from './cells/runner_type_cell.vue'; import RunnerTags from './runner_tags.vue'; @@ -35,7 +35,7 @@ export default { GlSkeletonLoader, TimeAgo, RunnerActionsCell, - RunnerNameCell, + RunnerSummaryCell, RunnerTags, RunnerTypeCell, }, @@ -77,7 +77,7 @@ export default { }, fields: [ tableField({ key: 'type', label: __('Type/State') }), - tableField({ key: 'name', label: s__('Runners|Runner'), width: 30 }), + tableField({ key: 'summary', label: s__('Runners|Runner'), width: 30 }), tableField({ key: 'version', label: __('Version') }), tableField({ key: 'ipAddress', label: __('IP Address') }), tableField({ key: 'projectCount', label: __('Projects'), width: 5 }), @@ -107,8 +107,12 @@ export default { <runner-type-cell :runner="item" /> </template> - <template #cell(name)="{ item }"> - <runner-name-cell :runner="item" /> + <template #cell(summary)="{ item, index }"> + <runner-summary-cell :runner="item"> + <template #runner-name="{ runner }"> + <slot name="runner-name" :runner="runner" :index="index"></slot> + </template> + </runner-summary-cell> </template> <template #cell(version)="{ item: { version } }"> diff --git a/app/assets/javascripts/runner/components/runner_name.vue b/app/assets/javascripts/runner/components/runner_name.vue new file mode 100644 index 00000000000..8e495125e03 --- /dev/null +++ b/app/assets/javascripts/runner/components/runner_name.vue @@ -0,0 +1,18 @@ +<script> +import { getIdFromGraphQLId } from '~/graphql_shared/utils'; + +export default { + props: { + runner: { + type: Object, + required: true, + }, + }, + methods: { + getIdFromGraphQLId, + }, +}; +</script> +<template> + <span>#{{ getIdFromGraphQLId(runner.id) }} ({{ runner.shortSha }})</span> +</template> diff --git a/app/assets/javascripts/runner/graphql/get_group_runners.query.graphql b/app/assets/javascripts/runner/graphql/get_group_runners.query.graphql index a601ee8d611..3e5109b1ac4 100644 --- a/app/assets/javascripts/runner/graphql/get_group_runners.query.graphql +++ b/app/assets/javascripts/runner/graphql/get_group_runners.query.graphql @@ -24,8 +24,11 @@ query getGroupRunners( search: $search sort: $sort ) { - nodes { - ...RunnerNode + edges { + webUrl + node { + ...RunnerNode + } } pageInfo { ...PageInfo diff --git a/app/assets/javascripts/runner/graphql/get_runners.query.graphql b/app/assets/javascripts/runner/graphql/get_runners.query.graphql index 9f837197558..51a91b9eb96 100644 --- a/app/assets/javascripts/runner/graphql/get_runners.query.graphql +++ b/app/assets/javascripts/runner/graphql/get_runners.query.graphql @@ -25,6 +25,7 @@ query getRunners( ) { nodes { ...RunnerNode + adminUrl } pageInfo { ...PageInfo diff --git a/app/assets/javascripts/runner/group_runners/group_runners_app.vue b/app/assets/javascripts/runner/group_runners/group_runners_app.vue index 42e1a9e1de9..083b2666b7b 100644 --- a/app/assets/javascripts/runner/group_runners/group_runners_app.vue +++ b/app/assets/javascripts/runner/group_runners/group_runners_app.vue @@ -1,13 +1,17 @@ <script> +import { GlLink } from '@gitlab/ui'; import createFlash from '~/flash'; import { fetchPolicies } from '~/lib/graphql'; import { updateHistory } from '~/lib/utils/url_utility'; import { formatNumber, sprintf, s__ } from '~/locale'; + import RunnerFilteredSearchBar from '../components/runner_filtered_search_bar.vue'; import RunnerList from '../components/runner_list.vue'; import RunnerManualSetupHelp from '../components/runner_manual_setup_help.vue'; +import RunnerName from '../components/runner_name.vue'; import RunnerPagination from '../components/runner_pagination.vue'; import RunnerTypeHelp from '../components/runner_type_help.vue'; + import { statusTokenConfig } from '../components/search_tokens/status_token_config'; import { typeTokenConfig } from '../components/search_tokens/type_token_config'; import { @@ -27,9 +31,11 @@ import { captureException } from '../sentry_utils'; export default { name: 'GroupRunnersApp', components: { + GlLink, RunnerFilteredSearchBar, RunnerList, RunnerManualSetupHelp, + RunnerName, RunnerTypeHelp, RunnerPagination, }, @@ -51,6 +57,7 @@ export default { return { search: fromUrlQueryToSearch(), runners: { + webUrls: [], items: [], pageInfo: {}, }, @@ -68,8 +75,10 @@ export default { }, update(data) { const { runners } = data?.group || {}; + return { - items: runners?.nodes || [], + webUrls: runners?.edges.map(({ webUrl }) => webUrl) || [], + items: runners?.edges.map(({ node }) => node) || [], pageInfo: runners?.pageInfo || {}, }; }, @@ -163,7 +172,13 @@ export default { {{ __('No runners found') }} </div> <template v-else> - <runner-list :runners="runners.items" :loading="runnersLoading" /> + <runner-list :runners="runners.items" :loading="runnersLoading"> + <template #runner-name="{ runner, index }"> + <gl-link :href="runners.webUrls[index]"> + <runner-name :runner="runner" /> + </gl-link> + </template> + </runner-list> <runner-pagination v-model="search.pagination" :page-info="runners.pageInfo" /> </template> </div> diff --git a/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.stories.js b/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.stories.js index d2afc02233e..294e5bd9f90 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.stories.js +++ b/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.stories.js @@ -4,7 +4,7 @@ import TodoButton from './todo_button.vue'; export default { component: TodoButton, - title: 'vue_shared/components/todo_toggle/todo_button', + title: 'vue_shared/components/sidebar/todo_toggle/todo_button', }; const Template = (args, { argTypes }) => ({ diff --git a/app/assets/stylesheets/framework/secondary_navigation_elements.scss b/app/assets/stylesheets/framework/secondary_navigation_elements.scss index 06eebb95438..685f1f413e6 100644 --- a/app/assets/stylesheets/framework/secondary_navigation_elements.scss +++ b/app/assets/stylesheets/framework/secondary_navigation_elements.scss @@ -1,6 +1,6 @@ // For tabbed navigation links, scrolling tabs, etc. For all top/main navigation, // please check nav.scss -.nav-links:not(.quick-links) { +.nav-links { display: flex; padding: 0; margin: 0; diff --git a/app/assets/stylesheets/page_bundles/_ide_theme_overrides.scss b/app/assets/stylesheets/page_bundles/_ide_theme_overrides.scss index 0ae3e03e72c..25a565ce2ba 100644 --- a/app/assets/stylesheets/page_bundles/_ide_theme_overrides.scss +++ b/app/assets/stylesheets/page_bundles/_ide_theme_overrides.scss @@ -44,7 +44,7 @@ background-color: var(--ide-background, $badge-bg); } - .nav-links:not(.quick-links) li:not(.md-header-toolbar) a, + .nav-links li:not(.md-header-toolbar) a, .gl-tabs-nav li a, .dropdown-menu-inner-content, .file-row .file-row-icon svg, @@ -52,7 +52,7 @@ color: var(--ide-text-color-secondary, $gl-text-color-secondary); } - .nav-links:not(.quick-links) li:not(.md-header-toolbar), + .nav-links li:not(.md-header-toolbar), .gl-tabs-nav li { &:hover a, &.active a, @@ -148,7 +148,7 @@ .md blockquote, .md table:not(.code) tbody td, .md table:not(.code) tr th, - .nav-links:not(.quick-links), + .nav-links, .gl-tabs-nav, .common-note-form .md-area.is-focused .nav-links { border-color: var(--ide-border-color-alt, $white-dark); @@ -311,7 +311,7 @@ border-color: var(--ide-background, $border-color); background-color: var(--ide-dropdown-background, $white); - .nav-links:not(.quick-links) { + .nav-links { background-color: var(--ide-dropdown-hover-background, $white); border-color: var(--ide-dropdown-hover-background, $border-color); } |