Commit 47953953 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '329333-always-show-email-issue-to-project' into 'master'

Always show "email issue" button on group/project issues list refactor

See merge request gitlab-org/gitlab!83100
parents 16586dd0 8502d30e
...@@ -260,6 +260,9 @@ export default { ...@@ -260,6 +260,9 @@ export default {
showCsvButtons() { showCsvButtons() {
return this.isProject && this.isSignedIn; return this.isProject && this.isSignedIn;
}, },
showIssuableByEmail() {
return this.initialEmail && this.isSignedIn;
},
showNewIssueDropdown() { showNewIssueDropdown() {
return !this.isProject && this.hasAnyProjects; return !this.isProject && this.hasAnyProjects;
}, },
...@@ -624,8 +627,9 @@ export default { ...@@ -624,8 +627,9 @@ export default {
</script> </script>
<template> <template>
<div v-if="hasAnyIssues"> <div>
<issuable-list <issuable-list
v-if="hasAnyIssues"
:namespace="fullPath" :namespace="fullPath"
recent-searches-storage-key="issues" recent-searches-storage-key="issues"
:search-input-placeholder="$options.i18n.searchPlaceholder" :search-input-placeholder="$options.i18n.searchPlaceholder"
...@@ -768,50 +772,50 @@ export default { ...@@ -768,50 +772,50 @@ export default {
</template> </template>
</issuable-list> </issuable-list>
<issuable-by-email v-if="initialEmail" class="gl-text-center gl-pt-5 gl-pb-7" /> <template v-else-if="isSignedIn">
</div> <gl-empty-state
:description="$options.i18n.noIssuesSignedInDescription"
:title="$options.i18n.noIssuesSignedInTitle"
:svg-path="emptyStateSvgPath"
>
<template #actions>
<gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm">
{{ $options.i18n.newIssueLabel }}
</gl-button>
<csv-import-export-buttons
v-if="showCsvButtons"
class="gl-mr-3"
:export-csv-path="exportCsvPathWithQuery"
:issuable-count="currentTabCount"
/>
<new-issue-dropdown v-if="showNewIssueDropdown" />
</template>
</gl-empty-state>
<hr />
<p class="gl-text-center gl-font-weight-bold gl-mb-0">
{{ $options.i18n.jiraIntegrationTitle }}
</p>
<p class="gl-text-center gl-mb-0">
<gl-sprintf :message="$options.i18n.jiraIntegrationMessage">
<template #jiraDocsLink="{ content }">
<gl-link :href="jiraIntegrationPath">{{ content }}</gl-link>
</template>
</gl-sprintf>
</p>
<p class="gl-text-center gl-text-gray-500">
{{ $options.i18n.jiraIntegrationSecondaryMessage }}
</p>
</template>
<div v-else-if="isSignedIn">
<gl-empty-state <gl-empty-state
:description="$options.i18n.noIssuesSignedInDescription" v-else
:title="$options.i18n.noIssuesSignedInTitle" :description="$options.i18n.noIssuesSignedOutDescription"
:title="$options.i18n.noIssuesSignedOutTitle"
:svg-path="emptyStateSvgPath" :svg-path="emptyStateSvgPath"
> :primary-button-text="$options.i18n.noIssuesSignedOutButtonText"
<template #actions> :primary-button-link="signInPath"
<gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm"> />
{{ $options.i18n.newIssueLabel }}
</gl-button>
<csv-import-export-buttons
v-if="showCsvButtons"
class="gl-mr-3"
:export-csv-path="exportCsvPathWithQuery"
:issuable-count="currentTabCount"
/>
<new-issue-dropdown v-if="showNewIssueDropdown" />
</template>
</gl-empty-state>
<hr />
<p class="gl-text-center gl-font-weight-bold gl-mb-0">
{{ $options.i18n.jiraIntegrationTitle }}
</p>
<p class="gl-text-center gl-mb-0">
<gl-sprintf :message="$options.i18n.jiraIntegrationMessage">
<template #jiraDocsLink="{ content }">
<gl-link :href="jiraIntegrationPath">{{ content }}</gl-link>
</template>
</gl-sprintf>
</p>
<p class="gl-text-center gl-text-gray-500">
{{ $options.i18n.jiraIntegrationSecondaryMessage }}
</p>
</div>
<gl-empty-state <issuable-by-email v-if="showIssuableByEmail" class="gl-text-center gl-pt-5 gl-pb-7" />
v-else </div>
:description="$options.i18n.noIssuesSignedOutDescription"
:title="$options.i18n.noIssuesSignedOutTitle"
:svg-path="emptyStateSvgPath"
:primary-button-text="$options.i18n.noIssuesSignedOutButtonText"
:primary-button-link="signInPath"
/>
</template> </template>
...@@ -452,13 +452,26 @@ describe('CE IssuesListApp component', () => { ...@@ -452,13 +452,26 @@ describe('CE IssuesListApp component', () => {
}); });
describe('IssuableByEmail component', () => { describe('IssuableByEmail component', () => {
describe.each([true, false])(`when issue creation by email is enabled=%s`, (enabled) => { describe.each`
it(`${enabled ? 'renders' : 'does not render'}`, () => { initialEmail | hasAnyIssues | isSignedIn | exists
wrapper = mountComponent({ provide: { initialEmail: enabled } }); ${false} | ${false} | ${false} | ${false}
${false} | ${true} | ${false} | ${false}
expect(findIssuableByEmail().exists()).toBe(enabled); ${false} | ${false} | ${true} | ${false}
}); ${false} | ${true} | ${true} | ${false}
}); ${true} | ${false} | ${false} | ${false}
${true} | ${true} | ${false} | ${false}
${true} | ${false} | ${true} | ${true}
${true} | ${true} | ${true} | ${true}
`(
`when issue creation by email is enabled=$initialEmail`,
({ initialEmail, hasAnyIssues, isSignedIn, exists }) => {
it(`${initialEmail ? 'renders' : 'does not render'}`, () => {
wrapper = mountComponent({ provide: { initialEmail, hasAnyIssues, isSignedIn } });
expect(findIssuableByEmail().exists()).toBe(exists);
});
},
);
}); });
describe('empty states', () => { describe('empty states', () => {
......
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