diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-12-21 23:30:50 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-12-21 23:30:50 +0000 |
commit | 06cef29a62fbab4174b669a6d5e2059f1f5d8756 (patch) | |
tree | d7539e2836ff95ddeae32d5d351bb9d624e12037 /spec/fixtures | |
parent | 88094c44f5dc5d88f378a9c3a055687a7d09e6f1 (diff) | |
parent | 95aae95a1cbb55facd127c74d6c044b13533f3fe (diff) | |
download | gitlab-ce-06cef29a62fbab4174b669a6d5e2059f1f5d8756.tar.gz |
Merge branch '44984-use-serializer-for-issuable-sidebar' into 'master'
Resolve "Create a serializer to render issuables sidebar"
Closes #44984
See merge request gitlab-org/gitlab-ce!23379
Diffstat (limited to 'spec/fixtures')
8 files changed, 166 insertions, 40 deletions
diff --git a/spec/fixtures/api/schemas/entities/issuable_sidebar_todo.json b/spec/fixtures/api/schemas/entities/issuable_sidebar_todo.json new file mode 100644 index 00000000000..b77e60ece12 --- /dev/null +++ b/spec/fixtures/api/schemas/entities/issuable_sidebar_todo.json @@ -0,0 +1,8 @@ +{ + "type": ["object", "null"], + "properties" : { + "id": { "type": "integer" }, + "delete_path": { "type": "string" } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/api/schemas/entities/issue_sidebar.json b/spec/fixtures/api/schemas/entities/issue_sidebar.json index 682e345d5f5..93adb493d1b 100644 --- a/spec/fixtures/api/schemas/entities/issue_sidebar.json +++ b/spec/fixtures/api/schemas/entities/issue_sidebar.json @@ -2,20 +2,46 @@ "type": "object", "properties" : { "id": { "type": "integer" }, - "iid": { "type": "integer" }, - "subscribed": { "type": "boolean" }, - "time_estimate": { "type": "integer" }, - "total_time_spent": { "type": "integer" }, - "human_time_estimate": { "type": ["integer", "null"] }, - "human_total_time_spent": { "type": ["integer", "null"] }, - "participants": { - "type": "array", - "items": { "$ref": "../public_api/v4/user/basic.json" } + "type": { "type": "string" }, + "author_id": { "type": "integer" }, + "project_id": { "type": "integer" }, + "discussion_locked": { "type": ["boolean", "null"] }, + "due_date": { "type": "date" }, + "confidential": { "type": "boolean" }, + "reference": { "type": "string" }, + "current_user": { + "allOf": [ + { "$ref": "../public_api/v4/user/basic.json" }, + { "type": "object", + "properties" : { + "todo": { "$ref": "issuable_sidebar_todo.json" }, + "can_edit": { "type": "boolean" }, + "can_move": { "type": "boolean" }, + "can_admin_label": { "type": "boolean" } + } + } + ] + }, + "milestone": { + "oneOf": [ + { "type": "null" }, + { "$ref": "../public_api/v4/milestone.json" } + ] }, - "assignees": { + "labels": { "type": "array", - "items": { "$ref": "../public_api/v4/user/basic.json" } - } - }, - "additionalProperties": false + "items": { "$ref": "label.json" } + }, + "issuable_json_path": { "type": "string" }, + "namespace_path": { "type": "string" }, + "project_path": { "type": "string" }, + "project_full_path": { "type": "string" }, + "project_issuables_path": { "type": "string" }, + "create_todo_path": { "type": "string" }, + "project_milestones_path": { "type": "string" }, + "project_labels_path": { "type": "string" }, + "toggle_subscription_path": { "type": "string" }, + "move_issue_path": { "type": "string" }, + "projects_autocomplete_path": { "type": "string" } + } } diff --git a/spec/fixtures/api/schemas/entities/issue_sidebar_extras.json b/spec/fixtures/api/schemas/entities/issue_sidebar_extras.json new file mode 100644 index 00000000000..11be903b083 --- /dev/null +++ b/spec/fixtures/api/schemas/entities/issue_sidebar_extras.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties" : { + "subscribed": { "type": "boolean" }, + "time_estimate": { "type": "integer" }, + "total_time_spent": { "type": "integer" }, + "human_time_estimate": { "type": ["integer", "null"] }, + "human_total_time_spent": { "type": ["integer", "null"] }, + "participants": { + "type": "array", + "items": { "$ref": "../public_api/v4/user/basic.json" } + }, + "assignees": { + "type": "array", + "items": { "$ref": "../public_api/v4/user/basic.json" } + } + } +} diff --git a/spec/fixtures/api/schemas/entities/merge_request_basic.json b/spec/fixtures/api/schemas/entities/merge_request_basic.json index cf257ac00de..4c04c838cb8 100644 --- a/spec/fixtures/api/schemas/entities/merge_request_basic.json +++ b/spec/fixtures/api/schemas/entities/merge_request_basic.json @@ -4,15 +4,9 @@ "state": { "type": "string" }, "merge_status": { "type": "string" }, "source_branch_exists": { "type": "boolean" }, - "time_estimate": { "type": "integer" }, - "total_time_spent": { "type": "integer" }, - "human_time_estimate": { "type": ["string", "null"] }, - "human_total_time_spent": { "type": ["string", "null"] }, "merge_error": { "type": ["string", "null"] }, "rebase_in_progress": { "type": "boolean" }, "assignee_id": { "type": ["integer", "null"] }, - "subscribed": { "type": ["boolean", "null"] }, - "participants": { "type": "array" }, "allow_collaboration": { "type": "boolean"}, "allow_maintainer_to_push": { "type": "boolean"}, "assignee": { diff --git a/spec/fixtures/api/schemas/entities/merge_request_sidebar.json b/spec/fixtures/api/schemas/entities/merge_request_sidebar.json new file mode 100644 index 00000000000..7e9e048a9fd --- /dev/null +++ b/spec/fixtures/api/schemas/entities/merge_request_sidebar.json @@ -0,0 +1,56 @@ +{ + "type": "object", + "properties" : { + "id": { "type": "integer" }, + "type": { "type": "string" }, + "author_id": { "type": "integer" }, + "project_id": { "type": "integer" }, + "discussion_locked": { "type": ["boolean", "null"] }, + "reference": { "type": "string" }, + "current_user": { + "allOf": [ + { "$ref": "../public_api/v4/user/basic.json" }, + { "type": "object", + "properties" : { + "todo": { "$ref": "issuable_sidebar_todo.json" }, + "can_edit": { "type": "boolean" }, + "can_move": { "type": "boolean" }, + "can_admin_label": { "type": "boolean" } + } + } + ] + }, + "milestone": { + "oneOf": [ + { "type": "null" }, + { "$ref": "../public_api/v4/milestones.json" } + ] + }, + "labels": { + "type": "array", + "items": { "$ref": "label.json" } + }, + "assignee": { + "allOf": [ + { "$ref": "../public_api/v4/user/basic.json" }, + { "type": "object", + "properties" : { + "can_merge": { "type": "boolean" } + } + } + ] + }, + "issuable_json_path": { "type": "string" }, + "namespace_path": { "type": "string" }, + "project_path": { "type": "string" }, + "project_full_path": { "type": "string" }, + "project_issuables_path": { "type": "string" }, + "create_todo_path": { "type": "string" }, + "project_milestones_path": { "type": "string" }, + "project_labels_path": { "type": "string" }, + "toggle_subscription_path": { "type": "string" }, + "move_issue_path": { "type": "string" }, + "projects_autocomplete_path": { "type": "string" } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/api/schemas/entities/merge_request_sidebar_extras.json b/spec/fixtures/api/schemas/entities/merge_request_sidebar_extras.json new file mode 100644 index 00000000000..682e345d5f5 --- /dev/null +++ b/spec/fixtures/api/schemas/entities/merge_request_sidebar_extras.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties" : { + "id": { "type": "integer" }, + "iid": { "type": "integer" }, + "subscribed": { "type": "boolean" }, + "time_estimate": { "type": "integer" }, + "total_time_spent": { "type": "integer" }, + "human_time_estimate": { "type": ["integer", "null"] }, + "human_total_time_spent": { "type": ["integer", "null"] }, + "participants": { + "type": "array", + "items": { "$ref": "../public_api/v4/user/basic.json" } + }, + "assignees": { + "type": "array", + "items": { "$ref": "../public_api/v4/user/basic.json" } + } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/api/schemas/public_api/v4/milestone.json b/spec/fixtures/api/schemas/public_api/v4/milestone.json new file mode 100644 index 00000000000..6ca2e88ae91 --- /dev/null +++ b/spec/fixtures/api/schemas/public_api/v4/milestone.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "properties" : { + "id": { "type": "integer" }, + "iid": { "type": "integer" }, + "project_id": { "type": ["integer", "null"] }, + "group_id": { "type": ["integer", "null"] }, + "title": { "type": "string" }, + "description": { "type": ["string", "null"] }, + "state": { "type": "string" }, + "created_at": { "type": "date" }, + "updated_at": { "type": "date" }, + "start_date": { "type": "date" }, + "due_date": { "type": "date" }, + "web_url": { "type": "string" } + }, + "required": [ + "id", "iid", "title", "description", "state", + "state", "created_at", "updated_at", "start_date", "due_date" + ], + "additionalProperties": false +} diff --git a/spec/fixtures/api/schemas/public_api/v4/milestones.json b/spec/fixtures/api/schemas/public_api/v4/milestones.json index 448e97d6c85..dcbc1910bfe 100644 --- a/spec/fixtures/api/schemas/public_api/v4/milestones.json +++ b/spec/fixtures/api/schemas/public_api/v4/milestones.json @@ -1,25 +1,6 @@ { "type": "array", "items": { - "type": "object", - "properties" : { - "id": { "type": "integer" }, - "iid": { "type": "integer" }, - "project_id": { "type": ["integer", "null"] }, - "group_id": { "type": ["integer", "null"] }, - "title": { "type": "string" }, - "description": { "type": ["string", "null"] }, - "state": { "type": "string" }, - "created_at": { "type": "date" }, - "updated_at": { "type": "date" }, - "start_date": { "type": "date" }, - "due_date": { "type": "date" }, - "web_url": { "type": "string" } - }, - "required": [ - "id", "iid", "title", "description", "state", - "state", "created_at", "updated_at", "start_date", "due_date" - ], - "additionalProperties": false + "$ref": "./milestone.json" } } |