diff --git a/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue b/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue index 95e648bda3c694839ea0e79833e2cb1a308ba496..08072908c4d4147ae8e31f91ddb55caabec96f16 100644 --- a/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue +++ b/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue @@ -5,6 +5,7 @@ import { mapActions, mapState } from 'vuex'; import { createAlert, VARIANT_INFO } from '~/alert'; import { historyReplaceState } from '~/lib/utils/common_utils'; import { s__ } from '~/locale'; +import { helpPagePath } from '~/helpers/help_page_helper'; import { SHOW_DELETE_SUCCESS_ALERT } from '~/packages_and_registries/shared/constants'; import { getQueryParams, extractFilterAndSorting } from '~/packages_and_registries/shared/utils'; @@ -34,11 +35,9 @@ export default { computed: { ...mapState({ emptyListIllustration: (state) => state.config.emptyListIllustration, - emptyListHelpUrl: (state) => state.config.emptyListHelpUrl, filter: (state) => state.filter, isGroupPage: (state) => state.config.isGroupPage, selectedType: (state) => state.selectedType, - packageHelpUrl: (state) => state.config.packageHelpUrl, packagesCount: (state) => state.pagination?.total, }), emptySearch() { @@ -92,12 +91,13 @@ export default { i18n: { widenFilters: s__('PackageRegistry|To widen your search, change or remove the filters above.'), }, + terraformRegistryHelpUrl: helpPagePath('user/packages/terraform_module_registry/index'), }; </script> <template> <div> - <infrastructure-title :help-url="packageHelpUrl" :count="packagesCount" /> + <infrastructure-title :help-url="$options.terraformRegistryHelpUrl" :count="packagesCount" /> <infrastructure-search v-if="packagesCount > 0" @update="requestPackagesList" /> <package-list @page:changed="onPageChanged" @package:delete="onPackageDeleteRequest"> @@ -107,7 +107,9 @@ export default { <gl-sprintf v-if="!emptySearch" :message="$options.i18n.widenFilters" /> <gl-sprintf v-else :message="noResultsText"> <template #noPackagesLink="{ content }"> - <gl-link :href="emptyListHelpUrl" target="_blank">{{ content }}</gl-link> + <gl-link :href="$options.terraformRegistryHelpUrl" target="_blank">{{ + content + }}</gl-link> </template> </gl-sprintf> </template> diff --git a/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/state.js b/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/state.js index 60f02eddc9f222603631b0bc75602f7c14269d95..503e2883cbb9062ab623943a76a86477ad0aa5a6 100644 --- a/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/state.js +++ b/app/assets/javascripts/packages_and_registries/infrastructure_registry/list/stores/state.js @@ -9,7 +9,6 @@ export default () => ({ * resourceId: String, * pageType: String, * emptyListIllustration: String, - * emptyListHelpUrl: String, * comingSoon: { projectPath: String, suggestedContributions : String } | null; * } */ diff --git a/app/views/groups/infrastructure_registry/index.html.haml b/app/views/groups/infrastructure_registry/index.html.haml index 2e308fc345724971134baa03a5ac0b0db78720c4..e95cf1ed19b17a2703850439c2edfde11014a524 100644 --- a/app/views/groups/infrastructure_registry/index.html.haml +++ b/app/views/groups/infrastructure_registry/index.html.haml @@ -1,9 +1,5 @@ - page_title _("Terraform Module Registry") -.row - .col-12 - #js-vue-packages-list{ data: { resource_id: @group.id, - page_type: 'groups', - empty_list_help_url: help_page_path('user/infrastructure/index'), - empty_list_illustration: image_path('illustrations/empty-state/empty-terraform-register-lg.svg'), - package_help_url: help_page_path('user/infrastructure/index') } } +#js-vue-packages-list{ data: { resource_id: @group.id, + page_type: 'groups', + empty_list_illustration: image_path('illustrations/empty-state/empty-terraform-register-lg.svg') } } diff --git a/app/views/projects/packages/infrastructure_registry/index.html.haml b/app/views/projects/packages/infrastructure_registry/index.html.haml index 187a116e9729fdf693366745a223e464abf40165..2979c937714acab7b3179903767a1301e804e589 100644 --- a/app/views/projects/packages/infrastructure_registry/index.html.haml +++ b/app/views/projects/packages/infrastructure_registry/index.html.haml @@ -1,9 +1,5 @@ - page_title _("Terraform Module Registry") -.row - .col-12 - #js-vue-packages-list{ data: { resource_id: @project.id, - page_type: 'project', - empty_list_help_url: help_page_path('user/infrastructure/index'), - empty_list_illustration: image_path('illustrations/empty-state/empty-terraform-register-lg.svg'), - package_help_url: help_page_path('user/infrastructure/index') } } +#js-vue-packages-list{ data: { resource_id: @project.id, + page_type: 'project', + empty_list_illustration: image_path('illustrations/empty-state/empty-terraform-register-lg.svg') } } diff --git a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap index 6af5dd49f63f7130f627bb5dab47a4f1fb63780b..8604dfb97f700c695eb2951156b3dcdc1c0746ec 100644 --- a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap +++ b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap @@ -4,7 +4,7 @@ exports[`packages_list_app renders 1`] = ` <div> <infrastructure-title-stub count="1" - helpurl="foo" + helpurl="/help/user/packages/terraform_module_registry/index" /> <infrastructure-search-stub /> <div> @@ -36,7 +36,7 @@ exports[`packages_list_app renders 1`] = ` Learn how to <b-link-stub class="gl-link" - href="helpUrl" + href="/help/user/packages/terraform_module_registry/index" target="_blank" > publish and share your packages diff --git a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js index c477c070ad0e90e59b670c2daad0b02ffe46813f..30542721329afad5769106b717121aeec1159833 100644 --- a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js +++ b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js @@ -4,6 +4,7 @@ import Vue from 'vue'; // eslint-disable-next-line no-restricted-imports import Vuex from 'vuex'; import setWindowLocation from 'helpers/set_window_location_helper'; +import { helpPagePath } from '~/helpers/help_page_helper'; import { createAlert, VARIANT_INFO } from '~/alert'; import * as commonUtils from '~/lib/utils/common_utils'; import PackageListApp from '~/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue'; @@ -29,7 +30,6 @@ describe('packages_list_app', () => { }; const GlLoadingIcon = { name: 'gl-loading-icon', template: '<div>loading</div>' }; - const emptyListHelpUrl = 'helpUrl'; const findEmptyState = () => wrapper.findComponent(GlEmptyState); const findListComponent = () => wrapper.findComponent(PackageList); const findInfrastructureSearch = () => wrapper.findComponent(InfrastructureSearch); @@ -41,8 +41,6 @@ describe('packages_list_app', () => { config: { resourceId: 'project_id', emptyListIllustration: 'helpSvg', - emptyListHelpUrl, - packageHelpUrl: 'foo', isGroupPage, }, filter, @@ -150,7 +148,9 @@ describe('packages_list_app', () => { it('generate the correct empty list link', () => { const link = findListComponent().findComponent(GlLink); - expect(link.attributes('href')).toBe(emptyListHelpUrl); + expect(link.attributes('href')).toBe( + helpPagePath('user/packages/terraform_module_registry/index'), + ); expect(link.text()).toBe('publish and share your packages'); }); diff --git a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/stores/mutations_spec.js b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/stores/mutations_spec.js index afd7a7e5439f8bacb08c9497b10a885ebd86913f..30d32ddcd0f5a5d382978cad4b3f2fb2abd1ea76 100644 --- a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/stores/mutations_spec.js +++ b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/stores/mutations_spec.js @@ -17,7 +17,6 @@ describe('Mutations Registry Store', () => { pageType: 'groups', userCanDelete: '', emptyListIllustration: 'foo', - emptyListHelpUrl: 'baz', }; const expectedState = {