diff --git a/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue b/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue index e8af3a2a7f38e08625c910212f4399661771a48a..78bf3ac43d3ac61adea208c7e44fb58cb68ab045 100644 --- a/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue +++ b/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue @@ -25,6 +25,7 @@ import { fetchPolicies } from '~/lib/graphql'; import axios from '~/lib/utils/axios_utils'; import { scrollUp } from '~/lib/utils/scroll_utils'; import { getParameterByName } from '~/lib/utils/url_utility'; +import { __ } from '~/locale'; import { OPERATORS_IS, OPERATORS_IS_NOT_OR, @@ -163,12 +164,14 @@ export default { }, dropdownItems() { return [ - { href: this.rssPath, text: i18n.rssLabel }, - { href: this.calendarPath, text: i18n.calendarLabel }, + { href: this.rssPath, text: __('Subscribe to RSS feed') }, + { href: this.calendarPath, text: __('Subscribe to calendar') }, ]; }, emptyStateDescription() { - return this.hasSearch ? this.$options.i18n.noSearchResultsDescription : undefined; + return this.hasSearch + ? __('To widen your search, change or remove filters above') + : undefined; }, emptyStateSvgPath() { return this.hasSearch @@ -177,8 +180,8 @@ export default { }, emptyStateTitle() { return this.hasSearch - ? this.$options.i18n.noSearchResultsTitle - : this.$options.i18n.noSearchNoFilterTitle; + ? __('Sorry, your filter produced no results') + : __('Please select at least one filter to see results'); }, hasSearch() { return Boolean(this.searchQuery || Object.keys(this.urlFilterParams).length); diff --git a/app/assets/javascripts/issues/list/components/empty_state_with_any_issues.vue b/app/assets/javascripts/issues/list/components/empty_state_with_any_issues.vue index a9ad2db5dd312d296c01fd1882e2cfcd0db964b3..4650390a7ff170269da1bbc80a0b6cf76aa9c71e 100644 --- a/app/assets/javascripts/issues/list/components/empty_state_with_any_issues.vue +++ b/app/assets/javascripts/issues/list/components/empty_state_with_any_issues.vue @@ -1,9 +1,7 @@ <script> import { GlButton, GlEmptyState } from '@gitlab/ui'; -import { i18n } from '../constants'; export default { - i18n, components: { GlButton, GlEmptyState, @@ -25,37 +23,37 @@ export default { <template> <gl-empty-state v-if="hasSearch" - :description="$options.i18n.noSearchResultsDescription" - :title="$options.i18n.noSearchResultsTitle" + :description="__('To widen your search, change or remove filters above')" + :title="__('Sorry, your filter produced no results')" :svg-path="emptyStateSvgPath" :svg-height="150" data-testid="issuable-empty-state" > <template #actions> <gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm"> - {{ $options.i18n.newIssueLabel }} + {{ __('New issue') }} </gl-button> </template> </gl-empty-state> <gl-empty-state v-else-if="isOpenTab" - :description="$options.i18n.noOpenIssuesDescription" - :title="$options.i18n.noOpenIssuesTitle" + :description="__('To keep this project going, create a new issue')" + :title="__('There are no open issues')" :svg-path="emptyStateSvgPath" :svg-height="null" data-testid="issuable-empty-state" > <template #actions> <gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm"> - {{ $options.i18n.newIssueLabel }} + {{ __('New issue') }} </gl-button> </template> </gl-empty-state> <gl-empty-state v-else - :title="$options.i18n.noClosedIssuesTitle" + :title="__('There are no closed issues')" :svg-path="emptyStateSvgPath" :svg-height="150" data-testid="issuable-empty-state" diff --git a/app/assets/javascripts/issues/list/components/empty_state_without_any_issues.vue b/app/assets/javascripts/issues/list/components/empty_state_without_any_issues.vue index 0b3c43f2ffa1f6153578dee644a12bd51da861dc..7725203fd7877a514111ce9ff81ae60314291143 100644 --- a/app/assets/javascripts/issues/list/components/empty_state_without_any_issues.vue +++ b/app/assets/javascripts/issues/list/components/empty_state_without_any_issues.vue @@ -2,14 +2,18 @@ import { GlButton, GlDisclosureDropdown, GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui'; import { helpPagePath } from '~/helpers/help_page_helper'; import CsvImportExportButtons from '~/issuable/components/csv_import_export_buttons.vue'; +import { s__ } from '~/locale'; import NewResourceDropdown from '~/vue_shared/components/new_resource_dropdown/new_resource_dropdown.vue'; import GitlabExperiment from '~/experimentation/components/gitlab_experiment.vue'; -import { i18n } from '../constants'; import { hasNewIssueDropdown } from '../has_new_issue_dropdown_mixin'; import EmptyStateWithoutAnyIssuesExperiment from './empty_state_without_any_issues_experiment.vue'; export default { - i18n, + i18n: { + jiraIntegrationMessage: s__( + 'JiraService|%{jiraDocsLinkStart}Enable the Jira integration%{jiraDocsLinkEnd} to view your Jira issues in GitLab.', + ), + }, issuesHelpPagePath: helpPagePath('user/project/issues/index'), components: { CsvImportExportButtons, @@ -84,7 +88,7 @@ export default { <template #control> <div> <gl-empty-state - :title="$options.i18n.noIssuesTitle" + :title="__('Use issues to collaborate on ideas, solve problems, and plan work')" :svg-path="emptyStateSvgPath" :svg-height="150" data-testid="issuable-empty-state" @@ -96,10 +100,12 @@ export default { :data-track-label="isProject && 'learn_more_project_issues_empty_list'" :data-track-experiment="isProject && 'issues_mrs_empty_state'" > - {{ $options.i18n.noIssuesDescription }} + {{ __('Learn more about issues.') }} </gl-link> <p v-if="canCreateProjects"> - <strong>{{ $options.i18n.noGroupIssuesSignedInDescription }}</strong> + <strong>{{ + __('Issues exist in projects, so to create an issue, first create a project.') + }}</strong> </p> </template> <template #actions> @@ -113,7 +119,7 @@ export default { variant="confirm" class="gl-mx-2 gl-mb-3" > - {{ $options.i18n.newProjectLabel }} + {{ __('New project') }} </gl-button> <gl-button v-if="showNewIssueLink" @@ -124,13 +130,13 @@ export default { data-track-label="new_issue_project_issues_empty_list" data-track-experiment="issues_mrs_empty_state" > - {{ $options.i18n.newIssueLabel }} + {{ __('New issue') }} </gl-button> <gl-disclosure-dropdown v-if="showCsvButtons" class="gl-mx-2 gl-mb-3" - :toggle-text="$options.i18n.importIssues" + :toggle-text="__('Import issues')" data-testid="import-issues-dropdown" > <csv-import-export-buttons @@ -152,7 +158,7 @@ export default { </gl-empty-state> <hr /> <p class="gl-text-center gl-font-weight-bold gl-mb-0"> - {{ $options.i18n.jiraIntegrationTitle }} + {{ s__('JiraService|Using Jira for issue tracking?') }} </p> <p class="gl-text-center gl-mb-0"> <gl-sprintf :message="$options.i18n.jiraIntegrationMessage"> @@ -169,7 +175,7 @@ export default { </gl-sprintf> </p> <p class="gl-text-center gl-text-secondary"> - {{ $options.i18n.jiraIntegrationSecondaryMessage }} + {{ s__('JiraService|This feature requires a Premium plan.') }} </p> </div> </template> @@ -178,16 +184,16 @@ export default { <gl-empty-state v-else - :title="$options.i18n.noIssuesTitle" + :title="__('Use issues to collaborate on ideas, solve problems, and plan work')" :svg-path="emptyStateSvgPath" :svg-height="null" - :primary-button-text="$options.i18n.noIssuesSignedOutButtonText" + :primary-button-text="__('Register / Sign In')" :primary-button-link="signInPath" data-testid="issuable-empty-state" > <template #description> <gl-link :href="$options.issuesHelpPagePath"> - {{ $options.i18n.noIssuesDescription }} + {{ __('Learn more about issues.') }} </gl-link> </template> </gl-empty-state> diff --git a/app/assets/javascripts/issues/list/components/empty_state_without_any_issues_experiment.vue b/app/assets/javascripts/issues/list/components/empty_state_without_any_issues_experiment.vue index 8bf50e30112ce289e5f6bbd85cf44ad820c3dd26..41715b6876dea77b47a122d4c009f29452c0eeb1 100644 --- a/app/assets/javascripts/issues/list/components/empty_state_without_any_issues_experiment.vue +++ b/app/assets/javascripts/issues/list/components/empty_state_without_any_issues_experiment.vue @@ -4,11 +4,9 @@ import { TYPE_ISSUE } from '~/issues/constants'; import { helpPagePath } from '~/helpers/help_page_helper'; import IssuableByEmail from '~/issuable/components/issuable_by_email.vue'; import CsvImportModal from '~/issuable/components/csv_import_modal.vue'; -import { i18n } from '../constants'; import GlCardEmptyStateExperiment from './gl_card_empty_state_experiment.vue'; export default { - i18n, issuesHelpPagePath: helpPagePath('user/project/issues/index'), components: { GlCardEmptyStateExperiment, @@ -74,7 +72,7 @@ export default { ></iframe> <h1 class="gl-font-size-h-display gl-max-w-75 gl-m-auto gl-pt-8"> - {{ $options.i18n.noIssuesTitle }} + {{ __('Use issues to collaborate on ideas, solve problems, and plan work') }} </h1> <p class="gl-max-w-75 gl-m-auto gl-pt-4 gl-pb-5"> diff --git a/app/assets/javascripts/issues/list/components/issue_card_statistics.vue b/app/assets/javascripts/issues/list/components/issue_card_statistics.vue index 4906cec526a2007e6961955c11faaece72c2808b..b3fd37dbc8ad93682943af4ae0186202b58473d9 100644 --- a/app/assets/javascripts/issues/list/components/issue_card_statistics.vue +++ b/app/assets/javascripts/issues/list/components/issue_card_statistics.vue @@ -45,7 +45,7 @@ export default { v-if="issue.mergeRequestsCount" v-gl-tooltip class="gl-display-none gl-sm-display-block" - :title="$options.i18n.relatedMergeRequests" + :title="__('Related merge requests')" data-testid="merge-requests" > <gl-icon name="merge-request" /> diff --git a/app/assets/javascripts/issues/list/components/issues_list_app.vue b/app/assets/javascripts/issues/list/components/issues_list_app.vue index 86eebda60fb53426e49b57a5e74cc75082ff7300..2259944104e07a82d0424012c140a0bea1b4ddc1 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -36,6 +36,7 @@ import { fetchPolicies } from '~/lib/graphql'; import { isPositiveInteger } from '~/lib/utils/number_utils'; import { scrollUp } from '~/lib/utils/scroll_utils'; import { getParameterByName, joinPaths } from '~/lib/utils/url_utility'; +import { __ } from '~/locale'; import { OPERATORS_IS, OPERATORS_IS_NOT, @@ -222,12 +223,12 @@ export default { subscribeDropdownOptions: { items: [ { - text: i18n.rssLabel, + text: __('Subscribe to RSS feed'), href: this.rssPath, extraAttrs: { 'data-testid': 'subscribe-rss' }, }, { - text: i18n.calendarLabel, + text: __('Subscribe to calendar'), href: this.calendarPath, extraAttrs: { 'data-testid': 'subscribe-calendar' }, }, @@ -736,7 +737,7 @@ export default { }); }) .catch((error) => { - this.issuesError = this.$options.i18n.reorderError; + this.issuesError = __('An error occurred while reordering issues.'); Sentry.captureException(error); }); }, @@ -887,7 +888,7 @@ export default { this.refetchIssuables(); }) .catch((error) => { - this.issuesError = this.$options.i18n.deleteError; + this.issuesError = __('An error occurred while deleting an issuable.'); Sentry.captureException(error); }); }, @@ -989,14 +990,14 @@ export default { data-testid="list-view-type" @click="switchViewType($options.ISSUES_LIST_VIEW_KEY)" > - {{ $options.i18n.listLabel }} + {{ __('List') }} </gl-button> <gl-button :variant="isGridView ? 'confirm' : 'default'" data-testid="grid-view-type" @click="switchViewType($options.ISSUES_GRID_VIEW_KEY)" > - {{ $options.i18n.gridLabel }} + {{ __('Grid') }} </gl-button> </gl-button-group> </local-storage-sync> @@ -1007,7 +1008,7 @@ export default { class="gl-flex-grow-1" @click="handleBulkUpdateClick" > - {{ $options.i18n.editIssues }} + {{ __('Bulk edit') }} </gl-button> <slot name="new-issuable-button"> <gl-button @@ -1016,7 +1017,7 @@ export default { variant="confirm" class="gl-flex-grow-1" > - {{ $options.i18n.newIssueLabel }} + {{ __('New issue') }} </gl-button> </slot> <new-resource-dropdown diff --git a/app/assets/javascripts/issues/list/constants.js b/app/assets/javascripts/issues/list/constants.js index 00c2ee0863dc232e6462d6700856d5b842623bb5..2c87203ab6801884b877a9567b092a2801d51831 100644 --- a/app/assets/javascripts/issues/list/constants.js +++ b/app/assets/javascripts/issues/list/constants.js @@ -89,47 +89,19 @@ export const CLOSED_MOVED = __('Closed (moved)'); export const i18n = { actionsLabel: __('Actions'), - calendarLabel: __('Subscribe to calendar'), closed: CLOSED, closedMoved: CLOSED_MOVED, confidentialNo: __('No'), confidentialYes: __('Yes'), downvotes: __('Downvotes'), - editIssues: __('Bulk edit'), errorFetchingCounts: __('An error occurred while getting issue counts'), errorFetchingIssues: __('An error occurred while loading issues'), - importIssues: __('Import issues'), issueRepositioningMessage: __( 'Issues are being rebalanced at the moment, so manual reordering is disabled.', ), - jiraIntegrationMessage: s__( - 'JiraService|%{jiraDocsLinkStart}Enable the Jira integration%{jiraDocsLinkEnd} to view your Jira issues in GitLab.', - ), - jiraIntegrationSecondaryMessage: s__('JiraService|This feature requires a Premium plan.'), - jiraIntegrationTitle: s__('JiraService|Using Jira for issue tracking?'), - newIssueLabel: __('New issue'), - newProjectLabel: __('New project'), - noClosedIssuesTitle: __('There are no closed issues'), - noGroupIssuesSignedInDescription: __( - 'Issues exist in projects, so to create an issue, first create a project.', - ), - noOpenIssuesDescription: __('To keep this project going, create a new issue'), - noOpenIssuesTitle: __('There are no open issues'), - noIssuesDescription: __('Learn more about issues.'), - noIssuesTitle: __('Use issues to collaborate on ideas, solve problems, and plan work'), - noIssuesSignedOutButtonText: __('Register / Sign In'), - noSearchNoFilterTitle: __('Please select at least one filter to see results'), - noSearchResultsDescription: __('To widen your search, change or remove filters above'), - noSearchResultsTitle: __('Sorry, your filter produced no results'), - relatedMergeRequests: __('Related merge requests'), - reorderError: __('An error occurred while reordering issues.'), - deleteError: __('An error occurred while deleting an issuable.'), - rssLabel: __('Subscribe to RSS feed'), upvotes: __('Upvotes'), titles: __('Titles'), descriptions: __('Descriptions'), - listLabel: __('List'), - gridLabel: __('Grid'), }; export const urlSortParams = { diff --git a/ee/spec/frontend/issues/list/components/new_issue_dropdown_spec.js b/ee/spec/frontend/issues/list/components/new_issue_dropdown_spec.js index d0e4a2d2641a9b0fc0729a5dd934e430ec20ffd2..5b6a850d0a871a73066ccb68aa55d00a813aa603 100644 --- a/ee/spec/frontend/issues/list/components/new_issue_dropdown_spec.js +++ b/ee/spec/frontend/issues/list/components/new_issue_dropdown_spec.js @@ -29,12 +29,12 @@ describe('NewIssueDropdown component', () => { }); it('renders a split dropdown with newIssue label', () => { - expect(findButton().text()).toBe(NewIssueDropdown.i18n.newIssueLabel); - expect(findButton().props('href')).toBe(NewIssueDropdown.i18n.newIssuePath); + expect(findButton().text()).toBe('New issue'); + expect(findButton().attributes('href')).toBe(NEW_ISSUE_PATH); }); it('renders dropdown with New Issue item', () => { - expect(findDropdownItem(0).props('item').text).toBe(NewIssueDropdown.i18n.newIssueLabel); + expect(findDropdownItem(0).props('item').text).toBe('New issue'); expect(findDropdownItem(0).props('item').href).toBe(NEW_ISSUE_PATH); }); diff --git a/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js b/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js index 6df27451976b5709442f605286ef683423d57705..0947e3fd83df13bdf2fb7209205815a63134fbbc 100644 --- a/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js +++ b/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js @@ -24,7 +24,6 @@ import getIssuesCountsQuery from '~/issues/dashboard/queries/get_issues_counts.q import { CREATED_DESC, defaultTypeTokenOptions, - i18n, TYPE_TOKEN_KEY_RESULT_OPTION, TYPE_TOKEN_OBJECTIVE_OPTION, UPDATED_DESC, @@ -89,13 +88,13 @@ describe('IssuesDashboardApp component', () => { defaultQueryResponse.data.issues.nodes[0].weight = 5; } - const findCalendarButton = () => wrapper.findByRole('link', { name: i18n.calendarLabel }); + const findCalendarButton = () => wrapper.findByRole('link', { name: 'Subscribe to calendar' }); const findDisclosureDropdown = () => wrapper.findComponent(GlDisclosureDropdown); const findEmptyState = () => wrapper.findComponent(GlEmptyState); const findIssuableList = () => wrapper.findComponent(IssuableList); const findIssueCardStatistics = () => wrapper.findComponent(IssueCardStatistics); const findIssueCardTimeInfo = () => wrapper.findComponent(IssueCardTimeInfo); - const findRssButton = () => wrapper.findByRole('link', { name: i18n.rssLabel }); + const findRssButton = () => wrapper.findByRole('link', { name: 'Subscribe to RSS feed' }); const mountComponent = ({ provide = {}, @@ -236,9 +235,9 @@ describe('IssuesDashboardApp component', () => { it('renders empty state', () => { expect(findEmptyState().props()).toMatchObject({ - description: i18n.noSearchResultsDescription, + description: 'To widen your search, change or remove filters above', svgPath: defaultProvide.emptyStateWithFilterSvgPath, - title: i18n.noSearchResultsTitle, + title: 'Sorry, your filter produced no results', }); }); }); @@ -261,7 +260,7 @@ describe('IssuesDashboardApp component', () => { expect(findEmptyState().props()).toMatchObject({ description: null, svgPath: defaultProvide.emptyStateWithoutFilterSvgPath, - title: i18n.noSearchNoFilterTitle, + title: 'Please select at least one filter to see results', }); }); }); @@ -333,8 +332,8 @@ describe('IssuesDashboardApp component', () => { describe('errors', () => { describe.each` error | mountOption | message - ${'fetching issues'} | ${'issuesQueryHandler'} | ${i18n.errorFetchingIssues} - ${'fetching issue counts'} | ${'issuesCountsQueryHandler'} | ${i18n.errorFetchingCounts} + ${'fetching issues'} | ${'issuesQueryHandler'} | ${'An error occurred while loading issues'} + ${'fetching issue counts'} | ${'issuesCountsQueryHandler'} | ${'An error occurred while getting issue counts'} `('when there is an error $error', ({ mountOption, message }) => { beforeEach(async () => { setWindowLocation(locationSearch); diff --git a/spec/frontend/issues/list/components/empty_state_with_any_issues_spec.js b/spec/frontend/issues/list/components/empty_state_with_any_issues_spec.js index d0d20ef03e1f7dff5b1ff0ff3e72875c62fed543..8f632ed12c55619e358f36d5776a918aef371e35 100644 --- a/spec/frontend/issues/list/components/empty_state_with_any_issues_spec.js +++ b/spec/frontend/issues/list/components/empty_state_with_any_issues_spec.js @@ -1,17 +1,10 @@ import { GlEmptyState } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import EmptyStateWithAnyIssues from '~/issues/list/components/empty_state_with_any_issues.vue'; -import IssuesListApp from '~/issues/list/components/issues_list_app.vue'; describe('EmptyStateWithAnyIssues component', () => { let wrapper; - const defaultProvide = { - emptyStateSvgPath: 'empty/state/svg/path', - newIssuePath: 'new/issue/path', - showNewIssueLink: false, - }; - const findGlEmptyState = () => wrapper.findComponent(GlEmptyState); const mountComponent = (props = {}) => { @@ -21,7 +14,11 @@ describe('EmptyStateWithAnyIssues component', () => { isOpenTab: true, ...props, }, - provide: defaultProvide, + provide: { + emptyStateSvgPath: 'empty/state/svg/path', + newIssuePath: 'new/issue/path', + showNewIssueLink: false, + }, }); }; @@ -32,9 +29,9 @@ describe('EmptyStateWithAnyIssues component', () => { it('shows empty state', () => { expect(findGlEmptyState().props()).toMatchObject({ - description: IssuesListApp.i18n.noSearchResultsDescription, - title: IssuesListApp.i18n.noSearchResultsTitle, - svgPath: defaultProvide.emptyStateSvgPath, + description: 'To widen your search, change or remove filters above', + title: 'Sorry, your filter produced no results', + svgPath: 'empty/state/svg/path', }); }); }); @@ -46,9 +43,9 @@ describe('EmptyStateWithAnyIssues component', () => { it('shows empty state', () => { expect(findGlEmptyState().props()).toMatchObject({ - description: IssuesListApp.i18n.noOpenIssuesDescription, - title: IssuesListApp.i18n.noOpenIssuesTitle, - svgPath: defaultProvide.emptyStateSvgPath, + description: 'To keep this project going, create a new issue', + title: 'There are no open issues', + svgPath: 'empty/state/svg/path', }); }); }); @@ -60,8 +57,8 @@ describe('EmptyStateWithAnyIssues component', () => { it('shows empty state', () => { expect(findGlEmptyState().props()).toMatchObject({ - title: IssuesListApp.i18n.noClosedIssuesTitle, - svgPath: defaultProvide.emptyStateSvgPath, + title: 'There are no closed issues', + svgPath: 'empty/state/svg/path', }); }); }); diff --git a/spec/frontend/issues/list/components/empty_state_without_any_issues_spec.js b/spec/frontend/issues/list/components/empty_state_without_any_issues_spec.js index ab3e90e40ab657cec74ec9c316e93f3f6f9a0265..956fd485d28b3720a545db7de2d934f65c4fa2f8 100644 --- a/spec/frontend/issues/list/components/empty_state_without_any_issues_spec.js +++ b/spec/frontend/issues/list/components/empty_state_without_any_issues_spec.js @@ -5,7 +5,6 @@ import CsvImportExportButtons from '~/issuable/components/csv_import_export_butt import EmptyStateWithoutAnyIssues from '~/issues/list/components/empty_state_without_any_issues.vue'; import EmptyStateWithoutAnyIssuesExperiment from '~/issues/list/components/empty_state_without_any_issues_experiment.vue'; import NewResourceDropdown from '~/vue_shared/components/new_resource_dropdown/new_resource_dropdown.vue'; -import { i18n } from '~/issues/list/constants'; import GitlabExperiment from '~/experimentation/components/gitlab_experiment.vue'; describe('EmptyStateWithoutAnyIssues component', () => { @@ -36,12 +35,12 @@ describe('EmptyStateWithoutAnyIssues component', () => { const findGlEmptyState = () => wrapper.findComponent(GlEmptyState); const findGlLink = () => wrapper.findComponent(GlLink); const findIssuesHelpPageLink = () => - wrapper.findByRole('link', { name: i18n.noIssuesDescription }); + wrapper.findByRole('link', { name: 'Learn more about issues.' }); const findJiraDocsLink = () => wrapper.findByRole('link', { name: 'Enable the Jira integration' }); const findNewResourceDropdown = () => wrapper.findComponent(NewResourceDropdown); - const findNewIssueLink = () => wrapper.findByRole('link', { name: i18n.newIssueLabel }); - const findNewProjectLink = () => wrapper.findByRole('link', { name: i18n.newProjectLabel }); + const findNewIssueLink = () => wrapper.findByRole('link', { name: 'New issue' }); + const findNewProjectLink = () => wrapper.findByRole('link', { name: 'New project' }); const mountComponent = ({ props = {}, provide = {} } = {}) => { wrapper = mountExtended(EmptyStateWithoutAnyIssues, { @@ -66,7 +65,7 @@ describe('EmptyStateWithoutAnyIssues component', () => { mountComponent(); expect(findGlEmptyState().props()).toMatchObject({ - title: i18n.noIssuesTitle, + title: 'Use issues to collaborate on ideas, solve problems, and plan work', svgPath: defaultProvide.emptyStateSvgPath, }); }); @@ -85,7 +84,9 @@ describe('EmptyStateWithoutAnyIssues component', () => { it('renders', () => { mountComponent({ provide: { canCreateProjects: true } }); - expect(findGlEmptyState().text()).toContain(i18n.noGroupIssuesSignedInDescription); + expect(findGlEmptyState().text()).toContain( + 'Issues exist in projects, so to create an issue, first create a project.', + ); }); }); @@ -94,7 +95,7 @@ describe('EmptyStateWithoutAnyIssues component', () => { mountComponent({ provide: { canCreateProjects: false } }); expect(findGlEmptyState().text()).not.toContain( - i18n.noGroupIssuesSignedInDescription, + 'Issues exist in projects, so to create an issue, first create a project.', ); }); }); @@ -271,9 +272,11 @@ describe('EmptyStateWithoutAnyIssues component', () => { it('shows Jira integration information', () => { const paragraphs = wrapper.findAll('p'); - expect(paragraphs.at(1).text()).toContain(i18n.jiraIntegrationTitle); - expect(paragraphs.at(2).text()).toMatchInterpolatedText(i18n.jiraIntegrationMessage); - expect(paragraphs.at(3).text()).toContain(i18n.jiraIntegrationSecondaryMessage); + expect(paragraphs.at(1).text()).toContain('Using Jira for issue tracking?'); + expect(paragraphs.at(2).text()).toMatchInterpolatedText( + 'Enable the Jira integration to view your Jira issues in GitLab.', + ); + expect(paragraphs.at(3).text()).toContain('This feature requires a Premium plan.'); }); it('renders Jira integration docs link', () => { @@ -304,16 +307,16 @@ describe('EmptyStateWithoutAnyIssues component', () => { it('renders empty state', () => { expect(findGlEmptyState().props()).toMatchObject({ - title: i18n.noIssuesTitle, + title: 'Use issues to collaborate on ideas, solve problems, and plan work', svgPath: defaultProvide.emptyStateSvgPath, - primaryButtonText: i18n.noIssuesSignedOutButtonText, + primaryButtonText: 'Register / Sign In', primaryButtonLink: defaultProvide.signInPath, }); }); it('renders issues docs link', () => { expect(findGlLink().attributes('href')).toBe(EmptyStateWithoutAnyIssues.issuesHelpPagePath); - expect(findGlLink().text()).toBe(i18n.noIssuesDescription); + expect(findGlLink().text()).toBe('Learn more about issues.'); }); }); }); diff --git a/spec/frontend/issues/list/components/issue_card_statistics_spec.js b/spec/frontend/issues/list/components/issue_card_statistics_spec.js index 180d4ab7eb670af135d7c1e7f6fbe6fb5cca0ec9..e097d6b0ad023a4fd19eb6d4567285a9d780fc69 100644 --- a/spec/frontend/issues/list/components/issue_card_statistics_spec.js +++ b/spec/frontend/issues/list/components/issue_card_statistics_spec.js @@ -1,7 +1,6 @@ import { GlIcon } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import IssueCardStatistics from '~/issues/list/components/issue_card_statistics.vue'; -import { i18n } from '~/issues/list/constants'; describe('IssueCardStatistics CE component', () => { let wrapper; @@ -41,7 +40,7 @@ describe('IssueCardStatistics CE component', () => { const mergeRequests = findMergeRequests(); expect(mergeRequests.text()).toBe('1'); - expect(mergeRequests.attributes('title')).toBe(i18n.relatedMergeRequests); + expect(mergeRequests.attributes('title')).toBe('Related merge requests'); expect(mergeRequests.findComponent(GlIcon).props('name')).toBe('merge-request'); }); @@ -49,7 +48,7 @@ describe('IssueCardStatistics CE component', () => { const upvotes = findUpvotes(); expect(upvotes.text()).toBe('5'); - expect(upvotes.attributes('title')).toBe(i18n.upvotes); + expect(upvotes.attributes('title')).toBe('Upvotes'); expect(upvotes.findComponent(GlIcon).props('name')).toBe('thumb-up'); }); @@ -57,7 +56,7 @@ describe('IssueCardStatistics CE component', () => { const downvotes = findDownvotes(); expect(downvotes.text()).toBe('9'); - expect(downvotes.attributes('title')).toBe(i18n.downvotes); + expect(downvotes.attributes('title')).toBe('Downvotes'); expect(downvotes.findComponent(GlIcon).props('name')).toBe('thumb-down'); }); }); diff --git a/spec/frontend/issues/list/components/issues_list_app_spec.js b/spec/frontend/issues/list/components/issues_list_app_spec.js index 5e1764a9fd43bcf4d1f476262656efd7ea488a24..bfb0bd2e02a48afac6dd3c8dd6ce2350a3755f8a 100644 --- a/spec/frontend/issues/list/components/issues_list_app_spec.js +++ b/spec/frontend/issues/list/components/issues_list_app_spec.js @@ -501,7 +501,7 @@ describe('CE IssuesListApp component', () => { it('shows an alert to tell the user that manual reordering is disabled', () => { expect(createAlert).toHaveBeenCalledWith({ - message: IssuesListApp.i18n.issueRepositioningMessage, + message: 'Issues are being rebalanced at the moment, so manual reordering is disabled.', variant: VARIANT_INFO, }); }); @@ -729,8 +729,8 @@ describe('CE IssuesListApp component', () => { describe('errors', () => { describe.each` error | mountOption | message - ${'fetching issues'} | ${'issuesQueryResponse'} | ${IssuesListApp.i18n.errorFetchingIssues} - ${'fetching issue counts'} | ${'issuesCountsQueryResponse'} | ${IssuesListApp.i18n.errorFetchingCounts} + ${'fetching issues'} | ${'issuesQueryResponse'} | ${'An error occurred while loading issues'} + ${'fetching issue counts'} | ${'issuesCountsQueryResponse'} | ${'An error occurred while getting issue counts'} `('when there is an error $error', ({ mountOption, message }) => { beforeEach(() => { wrapper = mountComponent({ @@ -899,7 +899,9 @@ describe('CE IssuesListApp component', () => { findIssuableList().vm.$emit('reorder', { oldIndex: 0, newIndex: 1 }); await waitForPromises(); - expect(findIssuableList().props('error')).toBe(IssuesListApp.i18n.reorderError); + expect(findIssuableList().props('error')).toBe( + 'An error occurred while reordering issues.', + ); expect(Sentry.captureException).toHaveBeenCalledWith( new Error('Request failed with status code 500'), ); @@ -944,7 +946,7 @@ describe('CE IssuesListApp component', () => { it('shows an alert to tell the user that manual reordering is disabled', () => { expect(createAlert).toHaveBeenCalledWith({ - message: IssuesListApp.i18n.issueRepositioningMessage, + message: 'Issues are being rebalanced at the moment, so manual reordering is disabled.', variant: VARIANT_INFO, }); });