Commit b88da2bf authored by Coung Ngo's avatar Coung Ngo

Add count to imported Jira issues message

UX designs want to show a count to the user for the number of
imported Jira issues
parent 42603e9b
<script>
import { GlAlert, GlLabel } from '@gitlab/ui';
import { last } from 'lodash';
import { n__ } from '~/locale';
import getIssuesListDetailsQuery from '../queries/get_issues_list_details.query.graphql';
import {
calculateJiraImportLabel,
......@@ -47,6 +49,7 @@ export default {
};
},
update: ({ project }) => ({
importedIssuesCount: last(project.jiraImports.nodes)?.importedIssuesCount,
isInProgress: isInProgress(project.jiraImportStatus),
isFinished: isFinished(project.jiraImportStatus),
label: calculateJiraImportLabel(
......@@ -60,6 +63,13 @@ export default {
},
},
computed: {
finishedMessage() {
return n__(
'%d issue successfully imported with the label',
'%d issues successfully imported with the label',
this.jiraImport.importedIssuesCount,
);
},
labelTarget() {
return `${this.issuesPath}?label_name[]=${encodeURIComponent(this.jiraImport.label.title)}`;
},
......@@ -87,7 +97,7 @@ export default {
{{ __('Import in progress. Refresh page to see newly added issues.') }}
</gl-alert>
<gl-alert v-if="shouldShowFinishedAlert" variant="success" @dismiss="hideFinishedAlert">
{{ __('Issues successfully imported with the label') }}
{{ finishedMessage }}
<gl-label
:background-color="jiraImport.label.color"
scoped
......
#import "~/jira_import/queries/jira_import.fragment.graphql"
query($fullPath: ID!) {
project(fullPath: $fullPath) {
issues {
......@@ -15,7 +13,8 @@ query($fullPath: ID!) {
jiraImportStatus
jiraImports {
nodes {
...JiraImport
importedIssuesCount
jiraProjectKey
}
}
}
......
---
title: Add count to imported Jira issues message
merge_request: 36075
author:
type: added
......@@ -187,6 +187,11 @@ msgid_plural "%d issues selected"
msgstr[0] ""
msgstr[1] ""
msgid "%d issue successfully imported with the label"
msgid_plural "%d issues successfully imported with the label"
msgstr[0] ""
msgstr[1] ""
msgid "%d layer"
msgid_plural "%d layers"
msgstr[0] ""
......@@ -12703,9 +12708,6 @@ msgstr ""
msgid "Issues referenced by merge requests and commits within the default branch will be closed automatically"
msgstr ""
msgid "Issues successfully imported with the label"
msgstr ""
msgid "Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, and other project entities"
msgstr ""
......
......@@ -33,6 +33,7 @@ describe('IssuableListRootApp', () => {
isFinishedAlertShowing,
isInProgressAlertShowing,
jiraImport: {
importedIssuesCount: 1,
isInProgress,
isFinished,
label,
......@@ -77,7 +78,7 @@ describe('IssuableListRootApp', () => {
describe('shows an alert', () => {
it('tells the user the Jira import has finished', () => {
expect(findAlert().text()).toBe('Issues successfully imported with the label');
expect(findAlert().text()).toBe('1 issue successfully imported with the label');
});
it('contains the label title associated with the Jira import', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment