Commit c61cd206 authored by Amy Qualls's avatar Amy Qualls

Revise "to-dos" to "to-do items" for styling

Bring our API definitions completely up to GitLab tone and style
parent 1e8a063d
...@@ -21,7 +21,7 @@ module Mutations ...@@ -21,7 +21,7 @@ module Mutations
field :todo, field :todo,
Types::TodoType, Types::TodoType,
null: true, null: true,
description: "The todo after mutation." description: "The to-do item after mutation."
field :issue, field :issue,
Types::IssueType, Types::IssueType,
......
...@@ -14,7 +14,7 @@ module Mutations ...@@ -14,7 +14,7 @@ module Mutations
field :todo, Types::TodoType, field :todo, Types::TodoType,
null: true, null: true,
description: 'The to-do created.' description: 'The to-do item created.'
def resolve(target_id:) def resolve(target_id:)
id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id) id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id)
......
...@@ -10,12 +10,12 @@ module Mutations ...@@ -10,12 +10,12 @@ module Mutations
field :updated_ids, field :updated_ids,
[::Types::GlobalIDType[::Todo]], [::Types::GlobalIDType[::Todo]],
null: false, null: false,
deprecated: { reason: 'Use todos', milestone: '13.2' }, deprecated: { reason: 'Use to-do items', milestone: '13.2' },
description: 'Ids of the updated todos.' description: 'IDs of the updated to-do items.'
field :todos, [::Types::TodoType], field :todos, [::Types::TodoType],
null: false, null: false,
description: 'Updated todos.' description: 'Updated to-do items.'
def resolve def resolve
authorize!(current_user) authorize!(current_user)
......
...@@ -10,11 +10,11 @@ module Mutations ...@@ -10,11 +10,11 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Todo], ::Types::GlobalIDType[::Todo],
required: true, required: true,
description: 'The global ID of the to-do to mark as done.' description: 'The global ID of the to-do item to mark as done.'
field :todo, Types::TodoType, field :todo, Types::TodoType,
null: false, null: false,
description: 'The requested to-do.' description: 'The requested to-do item.'
def resolve(id:) def resolve(id:)
todo = authorized_find!(id: id) todo = authorized_find!(id: id)
......
...@@ -10,11 +10,11 @@ module Mutations ...@@ -10,11 +10,11 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Todo], ::Types::GlobalIDType[::Todo],
required: true, required: true,
description: 'The global ID of the to-do to restore.' description: 'The global ID of the to-do item to restore.'
field :todo, Types::TodoType, field :todo, Types::TodoType,
null: false, null: false,
description: 'The requested to-do.' description: 'The requested to-do item.'
def resolve(id:) def resolve(id:)
todo = authorized_find!(id: id) todo = authorized_find!(id: id)
......
...@@ -10,16 +10,16 @@ module Mutations ...@@ -10,16 +10,16 @@ module Mutations
argument :ids, argument :ids,
[::Types::GlobalIDType[::Todo]], [::Types::GlobalIDType[::Todo]],
required: true, required: true,
description: 'The global IDs of the to-dos to restore (a maximum of 50 is supported at once).' description: 'The global IDs of the to-do items to restore (a maximum of 50 is supported at once).'
field :updated_ids, [::Types::GlobalIDType[Todo]], field :updated_ids, [::Types::GlobalIDType[Todo]],
null: false, null: false,
description: 'The IDs of the updated to-do items.', description: 'The IDs of the updated to-do items.',
deprecated: { reason: 'Use todos', milestone: '13.2' } deprecated: { reason: 'Use to-do items', milestone: '13.2' }
field :todos, [::Types::TodoType], field :todos, [::Types::TodoType],
null: false, null: false,
description: 'Updated to-dos.' description: 'Updated to-do items.'
def resolve(ids:) def resolve(ids:)
check_update_amount_limit!(ids) check_update_amount_limit!(ids)
...@@ -46,7 +46,7 @@ module Mutations ...@@ -46,7 +46,7 @@ module Mutations
end end
def raise_too_many_todos_requested_error def raise_too_many_todos_requested_error
raise Gitlab::Graphql::Errors::ArgumentError, 'Too many to-dos requested.' raise Gitlab::Graphql::Errors::ArgumentError, 'Too many to-do items requested.'
end end
def check_update_amount_limit!(ids) def check_update_amount_limit!(ids)
......
...@@ -112,7 +112,7 @@ module Types ...@@ -112,7 +112,7 @@ module Types
field :todos, field :todos,
Types::TodoType.connection_type, Types::TodoType.connection_type,
null: true, null: true,
description: 'To-dos of the current user for the alert.', description: 'To-do items of the current user for the alert.',
resolver: Resolvers::TodoResolver resolver: Resolvers::TodoResolver
field :details_url, field :details_url,
......
...@@ -8,10 +8,10 @@ module Types ...@@ -8,10 +8,10 @@ module Types
field_class Types::BaseField field_class Types::BaseField
field :current_user_todos, Types::TodoType.connection_type, field :current_user_todos, Types::TodoType.connection_type,
description: 'Todos for the current user.', description: 'To-do items for the current user.',
null: false do null: false do
argument :state, Types::TodoStateEnum, argument :state, Types::TodoStateEnum,
description: 'State of the todos.', description: 'State of the to-do items.',
required: false required: false
end end
......
...@@ -10,42 +10,42 @@ module Types ...@@ -10,42 +10,42 @@ module Types
authorize :read_todo authorize :read_todo
field :id, GraphQL::ID_TYPE, field :id, GraphQL::ID_TYPE,
description: 'ID of the to-do', description: 'ID of the to-do item',
null: false null: false
field :project, Types::ProjectType, field :project, Types::ProjectType,
description: 'The project this to-do is associated with', description: 'The project this to-do item is associated with',
null: true, null: true,
authorize: :read_project authorize: :read_project
field :group, Types::GroupType, field :group, Types::GroupType,
description: 'Group this to-do is associated with', description: 'Group this to-do item is associated with',
null: true, null: true,
authorize: :read_group authorize: :read_group
field :author, Types::UserType, field :author, Types::UserType,
description: 'The author of this to-do', description: 'The author of this to-do item',
null: false null: false
field :action, Types::TodoActionEnum, field :action, Types::TodoActionEnum,
description: 'Action of the to-do', description: 'Action of the to-do item',
null: false null: false
field :target_type, Types::TodoTargetEnum, field :target_type, Types::TodoTargetEnum,
description: 'Target type of the to-do', description: 'Target type of the to-do item',
null: false null: false
field :body, GraphQL::STRING_TYPE, field :body, GraphQL::STRING_TYPE,
description: 'Body of the to-do', description: 'Body of the to-do item',
null: false, null: false,
calls_gitaly: true # TODO This is only true when `target_type` is `Commit`. See https://gitlab.com/gitlab-org/gitlab/issues/34757#note_234752665 calls_gitaly: true # TODO This is only true when `target_type` is `Commit`. See https://gitlab.com/gitlab-org/gitlab/issues/34757#note_234752665
field :state, Types::TodoStateEnum, field :state, Types::TodoStateEnum,
description: 'State of the to-do', description: 'State of the to-do item',
null: false null: false
field :created_at, Types::TimeType, field :created_at, Types::TimeType,
description: 'Timestamp this to-do was created', description: 'Timestamp this to-do item was created',
null: false null: false
def project def project
......
...@@ -31,7 +31,7 @@ module Types ...@@ -31,7 +31,7 @@ module Types
description: 'Web path of the user' description: 'Web path of the user'
field :todos, Types::TodoType.connection_type, null: false, field :todos, Types::TodoType.connection_type, null: false,
resolver: Resolvers::TodoResolver, resolver: Resolvers::TodoResolver,
description: 'Todos of the user' description: 'To-do items of the user'
field :group_memberships, Types::GroupMemberType.connection_type, null: true, field :group_memberships, Types::GroupMemberType.connection_type, null: true,
description: 'Group memberships of the user' description: 'Group memberships of the user'
field :group_count, GraphQL::INT_TYPE, null: true, field :group_count, GraphQL::INT_TYPE, null: true,
......
...@@ -350,7 +350,7 @@ type AlertManagementAlert implements Noteable { ...@@ -350,7 +350,7 @@ type AlertManagementAlert implements Noteable {
title: String title: String
""" """
To-dos of the current user for the alert. To-do items of the current user for the alert.
""" """
todos( todos(
""" """
...@@ -1017,7 +1017,7 @@ type AlertSetAssigneesPayload { ...@@ -1017,7 +1017,7 @@ type AlertSetAssigneesPayload {
issue: Issue issue: Issue
""" """
The todo after mutation. The to-do item after mutation.
""" """
todo: Todo todo: Todo
} }
...@@ -1067,7 +1067,7 @@ type AlertTodoCreatePayload { ...@@ -1067,7 +1067,7 @@ type AlertTodoCreatePayload {
issue: Issue issue: Issue
""" """
The todo after mutation. The to-do item after mutation.
""" """
todo: Todo todo: Todo
} }
...@@ -1734,7 +1734,7 @@ type BoardEpic implements CurrentUserTodos & Noteable { ...@@ -1734,7 +1734,7 @@ type BoardEpic implements CurrentUserTodos & Noteable {
createdAt: Time createdAt: Time
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -1758,7 +1758,7 @@ type BoardEpic implements CurrentUserTodos & Noteable { ...@@ -1758,7 +1758,7 @@ type BoardEpic implements CurrentUserTodos & Noteable {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -4515,7 +4515,7 @@ type CreateAlertIssuePayload { ...@@ -4515,7 +4515,7 @@ type CreateAlertIssuePayload {
issue: Issue issue: Issue
""" """
The todo after mutation. The to-do item after mutation.
""" """
todo: Todo todo: Todo
} }
...@@ -5480,7 +5480,7 @@ type CreateTestCasePayload { ...@@ -5480,7 +5480,7 @@ type CreateTestCasePayload {
interface CurrentUserTodos { interface CurrentUserTodos {
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -5504,7 +5504,7 @@ interface CurrentUserTodos { ...@@ -5504,7 +5504,7 @@ interface CurrentUserTodos {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -6622,7 +6622,7 @@ A single design ...@@ -6622,7 +6622,7 @@ A single design
""" """
type Design implements CurrentUserTodos & DesignFields & Noteable { type Design implements CurrentUserTodos & DesignFields & Noteable {
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -6646,7 +6646,7 @@ type Design implements CurrentUserTodos & DesignFields & Noteable { ...@@ -6646,7 +6646,7 @@ type Design implements CurrentUserTodos & DesignFields & Noteable {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -8580,7 +8580,7 @@ type Epic implements CurrentUserTodos & Noteable { ...@@ -8580,7 +8580,7 @@ type Epic implements CurrentUserTodos & Noteable {
createdAt: Time createdAt: Time
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -8604,7 +8604,7 @@ type Epic implements CurrentUserTodos & Noteable { ...@@ -8604,7 +8604,7 @@ type Epic implements CurrentUserTodos & Noteable {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -9260,7 +9260,7 @@ type EpicIssue implements CurrentUserTodos & Noteable { ...@@ -9260,7 +9260,7 @@ type EpicIssue implements CurrentUserTodos & Noteable {
createdAt: Time! createdAt: Time!
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -9284,7 +9284,7 @@ type EpicIssue implements CurrentUserTodos & Noteable { ...@@ -9284,7 +9284,7 @@ type EpicIssue implements CurrentUserTodos & Noteable {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -12471,7 +12471,7 @@ type Issue implements CurrentUserTodos & Noteable { ...@@ -12471,7 +12471,7 @@ type Issue implements CurrentUserTodos & Noteable {
createdAt: Time! createdAt: Time!
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -12495,7 +12495,7 @@ type Issue implements CurrentUserTodos & Noteable { ...@@ -12495,7 +12495,7 @@ type Issue implements CurrentUserTodos & Noteable {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -14554,7 +14554,7 @@ type MergeRequest implements CurrentUserTodos & Noteable { ...@@ -14554,7 +14554,7 @@ type MergeRequest implements CurrentUserTodos & Noteable {
createdAt: Time! createdAt: Time!
""" """
Todos for the current user. To-do items for the current user.
""" """
currentUserTodos( currentUserTodos(
""" """
...@@ -14578,7 +14578,7 @@ type MergeRequest implements CurrentUserTodos & Noteable { ...@@ -14578,7 +14578,7 @@ type MergeRequest implements CurrentUserTodos & Noteable {
last: Int last: Int
""" """
State of the todos. State of the to-do items.
""" """
state: TodoStateEnum state: TodoStateEnum
): TodoConnection! ): TodoConnection!
...@@ -24925,47 +24925,47 @@ Representing a to-do entry ...@@ -24925,47 +24925,47 @@ Representing a to-do entry
""" """
type Todo { type Todo {
""" """
Action of the to-do Action of the to-do item
""" """
action: TodoActionEnum! action: TodoActionEnum!
""" """
The author of this to-do The author of this to-do item
""" """
author: User! author: User!
""" """
Body of the to-do Body of the to-do item
""" """
body: String! body: String!
""" """
Timestamp this to-do was created Timestamp this to-do item was created
""" """
createdAt: Time! createdAt: Time!
""" """
Group this to-do is associated with Group this to-do item is associated with
""" """
group: Group group: Group
""" """
ID of the to-do ID of the to-do item
""" """
id: ID! id: ID!
""" """
The project this to-do is associated with The project this to-do item is associated with
""" """
project: Project project: Project
""" """
State of the to-do State of the to-do item
""" """
state: TodoStateEnum! state: TodoStateEnum!
""" """
Target type of the to-do Target type of the to-do item
""" """
targetType: TodoTargetEnum! targetType: TodoTargetEnum!
} }
...@@ -25030,7 +25030,7 @@ type TodoCreatePayload { ...@@ -25030,7 +25030,7 @@ type TodoCreatePayload {
errors: [String!]! errors: [String!]!
""" """
The to-do created. The to-do item created.
""" """
todo: Todo todo: Todo
} }
...@@ -25065,7 +25065,7 @@ input TodoMarkDoneInput { ...@@ -25065,7 +25065,7 @@ input TodoMarkDoneInput {
clientMutationId: String clientMutationId: String
""" """
The global ID of the to-do to mark as done. The global ID of the to-do item to mark as done.
""" """
id: TodoID! id: TodoID!
} }
...@@ -25085,7 +25085,7 @@ type TodoMarkDonePayload { ...@@ -25085,7 +25085,7 @@ type TodoMarkDonePayload {
errors: [String!]! errors: [String!]!
""" """
The requested to-do. The requested to-do item.
""" """
todo: Todo! todo: Todo!
} }
...@@ -25100,7 +25100,7 @@ input TodoRestoreInput { ...@@ -25100,7 +25100,7 @@ input TodoRestoreInput {
clientMutationId: String clientMutationId: String
""" """
The global ID of the to-do to restore. The global ID of the to-do item to restore.
""" """
id: TodoID! id: TodoID!
} }
...@@ -25115,7 +25115,7 @@ input TodoRestoreManyInput { ...@@ -25115,7 +25115,7 @@ input TodoRestoreManyInput {
clientMutationId: String clientMutationId: String
""" """
The global IDs of the to-dos to restore (a maximum of 50 is supported at once). The global IDs of the to-do items to restore (a maximum of 50 is supported at once).
""" """
ids: [TodoID!]! ids: [TodoID!]!
} }
...@@ -25135,14 +25135,14 @@ type TodoRestoreManyPayload { ...@@ -25135,14 +25135,14 @@ type TodoRestoreManyPayload {
errors: [String!]! errors: [String!]!
""" """
Updated to-dos. Updated to-do items.
""" """
todos: [Todo!]! todos: [Todo!]!
""" """
The IDs of the updated to-do items. Deprecated in 13.2: Use todos. The IDs of the updated to-do items. Deprecated in 13.2: Use to-do items.
""" """
updatedIds: [TodoID!]! @deprecated(reason: "Use todos. Deprecated in 13.2.") updatedIds: [TodoID!]! @deprecated(reason: "Use to-do items. Deprecated in 13.2.")
} }
""" """
...@@ -25160,7 +25160,7 @@ type TodoRestorePayload { ...@@ -25160,7 +25160,7 @@ type TodoRestorePayload {
errors: [String!]! errors: [String!]!
""" """
The requested to-do. The requested to-do item.
""" """
todo: Todo! todo: Todo!
} }
...@@ -25232,14 +25232,14 @@ type TodosMarkAllDonePayload { ...@@ -25232,14 +25232,14 @@ type TodosMarkAllDonePayload {
errors: [String!]! errors: [String!]!
""" """
Updated todos. Updated to-do items.
""" """
todos: [Todo!]! todos: [Todo!]!
""" """
Ids of the updated todos. Deprecated in 13.2: Use todos. IDs of the updated to-do items. Deprecated in 13.2: Use to-do items.
""" """
updatedIds: [TodoID!]! @deprecated(reason: "Use todos. Deprecated in 13.2.") updatedIds: [TodoID!]! @deprecated(reason: "Use to-do items. Deprecated in 13.2.")
} }
""" """
...@@ -25509,7 +25509,7 @@ type UpdateAlertStatusPayload { ...@@ -25509,7 +25509,7 @@ type UpdateAlertStatusPayload {
issue: Issue issue: Issue
""" """
The todo after mutation. The to-do item after mutation.
""" """
todo: Todo todo: Todo
} }
...@@ -26839,7 +26839,7 @@ type User { ...@@ -26839,7 +26839,7 @@ type User {
status: UserStatus status: UserStatus
""" """
Todos of the user To-do items of the user
""" """
todos( todos(
""" """
......
This diff is collapsed.
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