Commit 7c29b328 authored by Eulyeon Ko's avatar Eulyeon Ko

Remove subscribe_disabled_description field

subscribe_disabled_description field should be rather passed via
data attributes to frontend components.
parent d506a4fb
......@@ -73,12 +73,9 @@ module Types
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue'
field :emails_disabled, GraphQL::BOOLEAN_TYPE, null: false, complexity: 5,
field :emails_disabled, GraphQL::BOOLEAN_TYPE, null: false,
method: :project_emails_disabled?,
description: 'Indicates if a project has email notifications disabled'
field :subscribe_disabled_description, GraphQL::STRING_TYPE, null: false,
method: :subscribe_disabled_description,
description: 'Message to display when the project has email notifications disabled'
field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5,
description: 'Indicates the currently logged in user is subscribed to the issue'
field :time_estimate, GraphQL::INT_TYPE, null: false,
......
# frozen_string_literal: true
class IssuePresenter < Gitlab::View::Presenter::Delegated
include NotificationsHelper
presents :issue
def issue_path
......@@ -16,10 +14,6 @@ class IssuePresenter < Gitlab::View::Presenter::Delegated
def project_emails_disabled?
issue.project.emails_disabled?
end
def subscribe_disabled_description
notification_description(:owner_disabled)
end
end
IssuePresenter.prepend_if_ee('EE::IssuePresenter')
......@@ -7525,11 +7525,6 @@ type EpicIssue implements CurrentUserTodos & Noteable {
"""
statusPagePublishedIncident: Boolean
"""
Message to display when the project has email notifications disabled
"""
subscribeDisabledDescription: String!
"""
Indicates the currently logged in user is subscribed to the issue
"""
......@@ -10044,11 +10039,6 @@ type Issue implements CurrentUserTodos & Noteable {
"""
statusPagePublishedIncident: Boolean
"""
Message to display when the project has email notifications disabled
"""
subscribeDisabledDescription: String!
"""
Indicates the currently logged in user is subscribed to the issue
"""
......
......@@ -20746,24 +20746,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subscribeDisabledDescription",
"description": "Message to display when the project has email notifications disabled",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subscribed",
"description": "Indicates the currently logged in user is subscribed to the issue",
......@@ -27393,24 +27375,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subscribeDisabledDescription",
"description": "Message to display when the project has email notifications disabled",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subscribed",
"description": "Indicates the currently logged in user is subscribed to the issue",
......@@ -1234,7 +1234,6 @@ Relationship between an epic and an issue.
| `slaDueAt` | Time | Timestamp of when the issue SLA expires. |
| `state` | IssueState! | State of the issue |
| `statusPagePublishedIncident` | Boolean | Indicates whether an issue is published to the status page |
| `subscribeDisabledDescription` | String! | Message to display when the project has email notifications disabled |
| `subscribed` | Boolean! | Indicates the currently logged in user is subscribed to the issue |
| `taskCompletionStatus` | TaskCompletionStatus! | Task completion status of the issue |
| `timeEstimate` | Int! | Time estimate of the issue |
......@@ -1500,7 +1499,6 @@ Represents a recorded measurement (object count) for the Admins.
| `slaDueAt` | Time | Timestamp of when the issue SLA expires. |
| `state` | IssueState! | State of the issue |
| `statusPagePublishedIncident` | Boolean | Indicates whether an issue is published to the status page |
| `subscribeDisabledDescription` | String! | Message to display when the project has email notifications disabled |
| `subscribed` | Boolean! | Indicates the currently logged in user is subscribed to the issue |
| `taskCompletionStatus` | TaskCompletionStatus! | Task completion status of the issue |
| `timeEstimate` | Int! | Time estimate of the issue |
......
......@@ -16,7 +16,7 @@ RSpec.describe GitlabSchema.types['Issue'] do
it 'has specific fields' do
fields = %i[id iid title description state reference author assignees updated_by participants labels milestone due_date
confidential discussion_locked upvotes downvotes user_notes_count user_discussions_count web_path web_url relative_position
emails_disabled subscribe_disabled_description subscribed time_estimate total_time_spent human_time_estimate human_total_time_spent closed_at created_at updated_at task_completion_status
emails_disabled subscribed time_estimate total_time_spent human_time_estimate human_total_time_spent closed_at created_at updated_at task_completion_status
designs design_collection alert_management_alert severity current_user_todos]
fields.each do |field_name|
......
......@@ -35,6 +35,12 @@ RSpec.describe IssuePresenter do
end
end
describe '#issue_path' do
it 'returns correct path' do
expect(presenter.issue_path).to eq("/#{group.name}/#{project.name}/-/issues/#{issue.iid}")
end
end
describe '#project_emails_disabled?' do
subject { presenter.project_emails_disabled? }
......@@ -50,17 +56,4 @@ RSpec.describe IssuePresenter do
it { is_expected.to be(true) }
end
end
describe '#subscribe_disabled_description' do
subject { presenter.subscribe_disabled_description }
it 'returns correct message' do
is_expected.to equal('Notifications have been disabled by the project or group owner')
end
end
describe '#issue_path' do
it 'returns correct path' do
expect(presenter.issue_path).to eq("/#{group.name}/#{project.name}/-/issues/#{issue.iid}")
end
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