diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-29 00:07:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-29 00:07:10 +0300 |
commit | a955f4024d40663f4b1affd74a346ffc96a92371 (patch) | |
tree | 7ed63c2c6451791b95cef89a49e33852b4c310ea | |
parent | 0e08747b3d348b6c0effae19fe7050af327c05e2 (diff) |
Add latest changes from gitlab-org/gitlab@master
8 files changed, 148 insertions, 3 deletions
diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 798bcacb367..469c1d0676c 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -450,7 +450,7 @@ extends: .use-pg14 services: - !reference [.db-services-with-auto-explain, services] - - name: clickhouse/clickhouse-server:23-alpine + - name: clickhouse/clickhouse-server:23.11.3.23-alpine alias: clickhouse variables: CLICKHOUSE_USER: clickhouse diff --git a/app/assets/javascripts/vue_shared/components/help_page_link/help_page_link.stories.js b/app/assets/javascripts/vue_shared/components/help_page_link/help_page_link.stories.js new file mode 100644 index 00000000000..0576e9796fc --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/help_page_link/help_page_link.stories.js @@ -0,0 +1,35 @@ +import HelpPageLink from './help_page_link.vue'; + +export default { + component: HelpPageLink, + title: 'vue_shared/help_page_link', +}; + +const Template = (args, { argTypes }) => ({ + components: { HelpPageLink }, + props: Object.keys(argTypes), + template: '<help-page-link v-bind="$props">link</help-page-link>', +}); + +export const Default = Template.bind({}); +Default.args = { + href: 'user/usage_quotas', +}; + +export const LinkWithAnAnchor = Template.bind({}); +LinkWithAnAnchor.args = { + ...Default.args, + anchor: 'namespace-storage-limit', +}; + +export const LinkWithAnchorInPath = Template.bind({}); +LinkWithAnchorInPath.args = { + ...Default.args, + href: 'user/usage_quotas#namespace-storage-limit', +}; + +export const CustomAttributes = Template.bind({}); +CustomAttributes.args = { + ...Default.args, + target: '_blank', +}; diff --git a/app/assets/javascripts/vue_shared/components/help_page_link/help_page_link.vue b/app/assets/javascripts/vue_shared/components/help_page_link/help_page_link.vue new file mode 100644 index 00000000000..11b269855ad --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/help_page_link/help_page_link.vue @@ -0,0 +1,44 @@ +<script> +import { GlLink } from '@gitlab/ui'; +import { helpPagePath } from '~/helpers/help_page_helper'; + +/** + * Component to link to GitLab docs. + * + * @example + * <help-page-link href="user/usage_quotas"> + * Usage Quotas help. + * <help-page-link> + */ +export default { + name: 'HelpPageLink', + components: { + GlLink, + }, + props: { + href: { + type: String, + required: true, + }, + anchor: { + type: String, + required: false, + default: null, + }, + }, + computed: { + compiledHref() { + return helpPagePath(this.href, { anchor: this.anchor }); + }, + attributes() { + const { href, anchor, ...attrs } = this.$attrs; + return attrs; + }, + }, +}; +</script> +<template> + <gl-link v-bind="attributes" :href="compiledHref" v-on="$listeners"> + <slot></slot> + </gl-link> +</template> diff --git a/db/post_migrate/20231228043653_rename_old_index_to_new_index_in_catalog_resources.rb b/db/post_migrate/20231228043653_rename_old_index_to_new_index_in_catalog_resources.rb new file mode 100644 index 00000000000..6569e624c78 --- /dev/null +++ b/db/post_migrate/20231228043653_rename_old_index_to_new_index_in_catalog_resources.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RenameOldIndexToNewIndexInCatalogResources < Gitlab::Database::Migration[2.2] + milestone '16.8' + + enable_lock_retries! + + OLD_INDEX_NAME = 'index_catalog_resources_on_search_vector_triagram' + NEW_INDEX_NAME = 'index_catalog_resources_on_search_vector' + + def change + rename_index :catalog_resources, OLD_INDEX_NAME, NEW_INDEX_NAME + end +end diff --git a/db/schema_migrations/20231228043653 b/db/schema_migrations/20231228043653 new file mode 100644 index 00000000000..1b5983ef534 --- /dev/null +++ b/db/schema_migrations/20231228043653 @@ -0,0 +1 @@ +a2b8c055b7ac4d4f4a3a6927061b268ab6f45e17df4363b65e01041274fed09f
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index d3d5c6d8551..199729020a5 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -32125,7 +32125,7 @@ CREATE INDEX index_catalog_resource_versions_on_resource_id_and_released_at ON c CREATE UNIQUE INDEX index_catalog_resources_on_project_id ON catalog_resources USING btree (project_id); -CREATE INDEX index_catalog_resources_on_search_vector_triagram ON catalog_resources USING gin (search_vector); +CREATE INDEX index_catalog_resources_on_search_vector ON catalog_resources USING gin (search_vector); CREATE INDEX index_catalog_resources_on_state ON catalog_resources USING btree (state); diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fb8a9ffe7f7..ee4d1e9bcd7 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -52437,7 +52437,7 @@ msgstr "" msgid "UsageQuota|Learn more about usage quotas." msgstr "" -msgid "UsageQuota|Local proxy used for frequently-accessed upstream Docker images. %{linkStart}More information%{linkEnd}" +msgid "UsageQuota|Local proxy used for frequently-accessed upstream Docker images." msgstr "" msgid "UsageQuota|Month" diff --git a/spec/frontend/vue_shared/components/help_page_link/help_page_link_spec.js b/spec/frontend/vue_shared/components/help_page_link/help_page_link_spec.js new file mode 100644 index 00000000000..5c17558b9cf --- /dev/null +++ b/spec/frontend/vue_shared/components/help_page_link/help_page_link_spec.js @@ -0,0 +1,51 @@ +import { shallowMount, Wrapper } from '@vue/test-utils'; // eslint-disable-line no-unused-vars +import { GlLink } from '@gitlab/ui'; +import HelpPageLink from '~/vue_shared/components/help_page_link/help_page_link.vue'; +import { helpPagePath } from '~/helpers/help_page_helper'; + +/** @type { Wrapper } */ +let wrapper; + +const createComponent = (props = {}, slots = {}) => { + wrapper = shallowMount(HelpPageLink, { + propsData: { + ...props, + }, + slots, + stubs: { + GlLink: true, + }, + }); +}; + +const findGlLink = () => wrapper.findComponent(GlLink); + +describe('HelpPageLink', () => { + it('renders a link', () => { + const href = 'user/usage_quotas'; + createComponent({ href }); + + const link = findGlLink(); + const expectedHref = helpPagePath(href, { anchor: null }); + expect(link.attributes().href).toBe(expectedHref); + }); + + it('adds the anchor', () => { + const href = 'user/usage_quotas'; + const anchor = 'namespace-storage-limit'; + createComponent({ href, anchor }); + + const link = findGlLink(); + const expectedHref = helpPagePath(href, { anchor }); + expect(link.attributes().href).toBe(expectedHref); + }); + + it('renders slot content', () => { + const href = 'user/usage_quotas'; + const slotContent = 'slot content'; + createComponent({ href }, { default: slotContent }); + + const link = findGlLink(); + expect(link.text()).toBe(slotContent); + }); +}); |