From 11e252bd20d306136045b0ecba2f31ef2d75540c Mon Sep 17 00:00:00 2001 From: izzy lyseggen Date: Thu, 17 Jun 2021 11:35:00 +0100 Subject: [PATCH] fix(frontend): hide globals commit from notif the warning on main commit when you don't have permission --- packages/frontend/src/views/StreamMain.vue | 42 +++++++++++----------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/packages/frontend/src/views/StreamMain.vue b/packages/frontend/src/views/StreamMain.vue index 55c3e91bd..2de23e4de 100644 --- a/packages/frontend/src/views/StreamMain.vue +++ b/packages/frontend/src/views/StreamMain.vue @@ -90,33 +90,27 @@
- The last commit of this stream is on the + The last commitNotif of this stream is on the - {{ stream.commit.branchName }} + {{ commitNotif.branchName }} branch, see - {{ stream.commit.message }} + {{ commitNotif.message }}
@@ -315,7 +309,7 @@ export default { }, description: { query: gql` - query($id: String!) { + query ($id: String!) { stream(id: $id) { id description @@ -329,15 +323,17 @@ export default { }, update: (data) => data.stream.description }, - stream: { + commitNotif: { query: gql` - query($id: String!) { + query ($id: String!) { stream(id: $id) { id - commit { - branchName - id - message + commits { + items { + id + message + branchName + } } } } @@ -346,13 +342,15 @@ export default { return { id: this.$route.params.streamId } + }, + update(data) { + return data.stream.commits.items.filter((c) => !c.branchName.startsWith('globals'))[0] } - //update: (data) => data.stream.description }, $subscribe: { branchCreated: { query: gql` - subscription($streamId: String!) { + subscription ($streamId: String!) { branchCreated(streamId: $streamId) } `, @@ -370,7 +368,7 @@ export default { }, branchDeleted: { query: gql` - subscription($streamId: String!) { + subscription ($streamId: String!) { branchDeleted(streamId: $streamId) } `,