diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 21:10:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 21:10:19 +0300 |
commit | b8d021cb606ac86f41a0ef9dacd133a9677f8414 (patch) | |
tree | aee1c216ff06acc7e3587a9a28af95f0392734f4 /app/assets/javascripts/graphql_shared | |
parent | 9dbca64417abbec779a219b9e0df9d289d945032 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/graphql_shared')
4 files changed, 87 insertions, 0 deletions
diff --git a/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql b/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql new file mode 100644 index 00000000000..62119177887 --- /dev/null +++ b/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql @@ -0,0 +1,17 @@ +fragment AlertListItem on AlertManagementAlert { + iid + title + severity + status + startedAt + eventCount + issueIid + assignees { + nodes { + name + username + avatarUrl + webUrl + } + } +} diff --git a/app/assets/javascripts/graphql_shared/fragments/alert_note.fragment.graphql b/app/assets/javascripts/graphql_shared/fragments/alert_note.fragment.graphql new file mode 100644 index 00000000000..74b425717a0 --- /dev/null +++ b/app/assets/javascripts/graphql_shared/fragments/alert_note.fragment.graphql @@ -0,0 +1,17 @@ +#import "~/graphql_shared/fragments/author.fragment.graphql" + +fragment AlertNote on Note { + id + author { + id + state + ...Author + } + body + bodyHtml + createdAt + discussion { + id + } + systemNoteIconName +} diff --git a/app/assets/javascripts/graphql_shared/mutations/update_alert_status.mutation.graphql b/app/assets/javascripts/graphql_shared/mutations/update_alert_status.mutation.graphql new file mode 100644 index 00000000000..42dc388c9d1 --- /dev/null +++ b/app/assets/javascripts/graphql_shared/mutations/update_alert_status.mutation.graphql @@ -0,0 +1,17 @@ +#import "~/graphql_shared/fragments/alert_note.fragment.graphql" + +mutation updateAlertStatus($projectPath: ID!, $status: AlertManagementStatus!, $iid: String!) { + updateAlertStatus(input: { iid: $iid, status: $status, projectPath: $projectPath }) { + errors + alert { + iid + status + endedAt + notes { + nodes { + ...AlertNote + } + } + } + } +} diff --git a/app/assets/javascripts/graphql_shared/queries/get_alerts.query.graphql b/app/assets/javascripts/graphql_shared/queries/get_alerts.query.graphql new file mode 100644 index 00000000000..e94758ef60e --- /dev/null +++ b/app/assets/javascripts/graphql_shared/queries/get_alerts.query.graphql @@ -0,0 +1,36 @@ +#import "~/graphql_shared/fragments/alert.fragment.graphql" + +query getAlerts( + $projectPath: ID! + $statuses: [AlertManagementStatus!] + $sort: AlertManagementAlertSort + $firstPageSize: Int + $lastPageSize: Int + $prevPageCursor: String = "" + $nextPageCursor: String = "" + $searchTerm: String = "" + $assigneeUsername: String = "" +) { + project(fullPath: $projectPath) { + alertManagementAlerts( + search: $searchTerm + assigneeUsername: $assigneeUsername + statuses: $statuses + sort: $sort + first: $firstPageSize + last: $lastPageSize + after: $nextPageCursor + before: $prevPageCursor + ) { + nodes { + ...AlertListItem + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } +} |