Commit 8502d30e authored by Coung Ngo's avatar Coung Ngo Committed by Ezekiel Kigbo

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

Show the "email issue" button even when there are no issues in the
issues list.

The button will not show when the user is signed out, due
to the check in new_issuable_address.

Behind feature flag `vue_issues_list` defaulted off.
parent 72310845
...@@ -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,10 +772,7 @@ export default { ...@@ -768,10 +772,7 @@ 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>
<div v-else-if="isSignedIn">
<gl-empty-state <gl-empty-state
:description="$options.i18n.noIssuesSignedInDescription" :description="$options.i18n.noIssuesSignedInDescription"
:title="$options.i18n.noIssuesSignedInTitle" :title="$options.i18n.noIssuesSignedInTitle"
...@@ -804,7 +805,7 @@ export default { ...@@ -804,7 +805,7 @@ export default {
<p class="gl-text-center gl-text-gray-500"> <p class="gl-text-center gl-text-gray-500">
{{ $options.i18n.jiraIntegrationSecondaryMessage }} {{ $options.i18n.jiraIntegrationSecondaryMessage }}
</p> </p>
</div> </template>
<gl-empty-state <gl-empty-state
v-else v-else
...@@ -814,4 +815,7 @@ export default { ...@@ -814,4 +815,7 @@ export default {
:primary-button-text="$options.i18n.noIssuesSignedOutButtonText" :primary-button-text="$options.i18n.noIssuesSignedOutButtonText"
:primary-button-link="signInPath" :primary-button-link="signInPath"
/> />
<issuable-by-email v-if="showIssuableByEmail" class="gl-text-center gl-pt-5 gl-pb-7" />
</div>
</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}
${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(enabled); 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