diff --git a/apps/web/src/routes/projects/[projectId]/branches/[branchId]/stack/[changeId]/+page.svelte b/apps/web/src/routes/projects/[projectId]/branches/[branchId]/stack/[changeId]/+page.svelte index 3049692ce9..8a7d2b3f78 100644 --- a/apps/web/src/routes/projects/[projectId]/branches/[branchId]/stack/[changeId]/+page.svelte +++ b/apps/web/src/routes/projects/[projectId]/branches/[branchId]/stack/[changeId]/+page.svelte @@ -10,7 +10,7 @@ let patch: any = {}; let stack: any = {}; let status: any = {}; - let chats: any = []; + let events: any = []; let key: any = ''; let uuid: any = ''; @@ -256,7 +256,7 @@ } function fetchAndUpdateChat() { - fetch(env.PUBLIC_APP_HOST + 'api/chat_messages/' + data.projectId + '/chats/' + data.changeId, { + fetch(env.PUBLIC_APP_HOST + 'api/patch_events/' + data.projectId + '/patch/' + data.changeId, { method: 'GET', headers: { 'X-AUTH-TOKEN': key || '' @@ -266,7 +266,7 @@ .then((data) => { console.log(data); setTimeout(() => { - chats = data; + events = data; setTimeout(() => { scrollToBottom(); }, 150); // I don't know how to DOM in Svelte, but it takes a second @@ -342,6 +342,7 @@ .then((data) => { console.log('sign off', data); getPatchStatus(); + fetchAndUpdateChat(); }); } } @@ -469,11 +470,13 @@ {/if} {/if}
- {#if !status[data.changeId].last_signoff} - - {/if} - {#if status[data.changeId].last_signoff || !status[data.changeId].last_reviewed} - + {#if status[data.changeId]} + {#if !status[data.changeId].last_signoff} + + {/if} + {#if status[data.changeId].last_signoff || !status[data.changeId].last_reviewed} + + {/if} {/if}
@@ -535,30 +538,85 @@

Chat

- {#each chats as chat} -
-
-
- + {#each events as event} + {#if event.event_type === 'chat'} +
+
+
+ +
+
{event.object.created_at}
-
{chat.created_at}
+ {#if event.object.diff_patch_array} +
+
{event.object.diff_path}
+ + +
+ {/if} +
{event.object.comment}
+ {#if event.object.issue} + {#if event.object.resolved} +
resolved
+ {:else} + + {/if} + {/if}
- {#if chat.diff_patch_array} -
-
{chat.diff_path}
- - + {/if} + {#if event.event_type === 'issue_status'} + {#if event.data.resolution} +
+
+ {event.user.email} resolved issue {event.object.uuid.substr(0, 8)} +
+
+ {event.created_at} +
{/if} -
{chat.comment}
- {#if chat.issue} - {#if chat.resolved} -
resolved
- {:else} - - {/if} + {/if} + + {#if event.event_type === 'patch_status'} + {#if event.data.status} +
+
+ {event.user.email} + signed off +
+
+ {event.created_at} +
+
+ {:else} +
+
+ {event.user.email} + requested changes +
+
+ {event.created_at} +
+
{/if} -
+ {/if} + + {#if event.event_type === 'patch_version'} +
+
+ new patch version: v{event.object.version} +
+
+ {event.created_at} +
+
+ {/if} {/each}
@@ -580,6 +638,40 @@ {/if}