Commit 6e5f8dbe authored by Florie Guibert's avatar Florie Guibert

Fix ability for non project member to subscribe to an issue

Review feedback
parent 032a5a20
......@@ -104,6 +104,9 @@ export default {
isLoggedIn() {
return Boolean(gon.current_user_id);
},
canSubscribe() {
return this.emailsDisabled || !this.isLoggedIn;
},
},
methods: {
setSubscribed(subscribed) {
......@@ -176,7 +179,7 @@ export default {
<gl-toggle
:value="subscribed"
:is-loading="isLoading"
:disabled="emailsDisabled || !isLoggedIn"
:disabled="canSubscribe"
class="hide-collapsed gl-ml-auto"
data-testid="subscription-toggle"
:label="$options.i18n.notifications"
......
......@@ -13,7 +13,7 @@ RSpec.describe "User toggles subscription", :js do
visit(project_issue_path(project, issue))
end
it 'toggle does not display' do
it 'does not display the Notification toggle' do
expect(page).not_to have_button('Notifications')
end
end
......
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