Skip to content

Commit 0139eaa

Browse files
committed
[UI] redesign chat table agents/conv list & fixes (#886)
1 parent 25246e0 commit 0139eaa

18 files changed

Lines changed: 1830 additions & 398 deletions

File tree

services/app/src/lib/components/tables/ActionTable.svelte

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,13 @@
422422

423423
{#if row[column.id]?.error}
424424
{@const error = row[column.id]?.error}
425-
<div class="flex h-full w-full items-center p-2">
426-
<span class="break-words text-sm text-[#D92D20]">
427-
{typeof error === 'string'
428-
? error
429-
: error?.message
430-
? String(error.message)
431-
: 'Error'}
432-
</span>
433-
</div>
425+
<p class="h-min overflow-auto whitespace-pre-line p-2 text-[#D92D20]">
426+
{typeof error === 'string'
427+
? error
428+
: error?.message
429+
? String(error.message)
430+
: 'Error'}
431+
</p>
434432
{:else if editMode}
435433
{#if column.dtype === 'image' || column.dtype === 'audio' || column.dtype === 'document'}
436434
<FileSelect

services/app/src/lib/components/tables/ChatTable.svelte

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,13 @@
420420

421421
{#if row[column.id]?.error}
422422
{@const error = row[column.id]?.error}
423-
<div class="flex h-full w-full items-center p-2">
424-
<span class="break-words text-sm text-[#D92D20]">
425-
{typeof error === 'string'
426-
? error
427-
: error?.message
428-
? String(error.message)
429-
: 'Error'}
430-
</span>
431-
</div>
423+
<p class="h-min overflow-auto whitespace-pre-line p-2 text-[#D92D20]">
424+
{typeof error === 'string'
425+
? error
426+
: error?.message
427+
? String(error.message)
428+
: 'Error'}
429+
</p>
432430
{:else if editMode}
433431
{#if column.dtype === 'image' || column.dtype === 'audio' || column.dtype === 'document'}
434432
<FileSelect

services/app/src/lib/components/tables/KnowledgeTable.svelte

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,13 @@
409409

410410
{#if row[column.id]?.error}
411411
{@const error = row[column.id]?.error}
412-
<div class="flex h-full w-full items-center p-2">
413-
<span class="break-words text-sm text-[#D92D20]">
414-
{typeof error === 'string'
415-
? error
416-
: error?.message
417-
? String(error.message)
418-
: 'Error'}
419-
</span>
420-
</div>
412+
<p class="h-min overflow-auto whitespace-pre-line p-2 text-[#D92D20]">
413+
{typeof error === 'string'
414+
? error
415+
: error?.message
416+
? String(error.message)
417+
: 'Error'}
418+
</p>
421419
{:else if editMode}
422420
{#if column.dtype === 'image' || column.dtype === 'audio' || column.dtype === 'document'}
423421
<FileSelect
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<script lang="ts">
2+
interface Props {
3+
class?: string | undefined | null;
4+
}
5+
6+
let { class: className = undefined }: Props = $props();
7+
</script>
8+
9+
<svg
10+
width="11"
11+
height="12"
12+
viewBox="0 0 11 12"
13+
fill="none"
14+
xmlns="http://www.w3.org/2000/svg"
15+
class={className}
16+
>
17+
<path
18+
d="M6.38587 1.5C6.38587 2.05229 5.92479 2.5 5.35602 2.5C4.78726 2.5 4.32617 2.05229 4.32617 1.5C4.32617 0.947711 4.78726 0.5 5.35602 0.5C5.92479 0.5 6.38587 0.947711 6.38587 1.5Z"
19+
stroke="#475467"
20+
stroke-linecap="round"
21+
stroke-linejoin="round"
22+
/>
23+
<path d="M5.35547 2.5V4.42857" stroke="#475467" stroke-linecap="round" stroke-linejoin="round" />
24+
<path
25+
d="M6.90009 9.125C6.90009 9.125 6.41459 9.62497 5.35532 9.62497C4.29605 9.62497 3.81055 9.125 3.81055 9.125"
26+
stroke="#475467"
27+
stroke-linecap="round"
28+
stroke-linejoin="round"
29+
/>
30+
<path
31+
d="M3.62303 7.23228C3.50115 7.23228 3.40234 7.13635 3.40234 7.018C3.40234 6.89965 3.50115 6.80371 3.62303 6.80371"
32+
stroke="#475467"
33+
stroke-linecap="round"
34+
stroke-linejoin="round"
35+
/>
36+
<path
37+
d="M3.62305 7.23228C3.74493 7.23228 3.84373 7.13635 3.84373 7.018C3.84373 6.89965 3.74493 6.80371 3.62305 6.80371"
38+
stroke="#475467"
39+
stroke-linecap="round"
40+
stroke-linejoin="round"
41+
/>
42+
<path
43+
d="M7.08396 7.23228C6.96208 7.23228 6.86328 7.13635 6.86328 7.018C6.86328 6.89965 6.96208 6.80371 7.08396 6.80371"
44+
stroke="#475467"
45+
stroke-linecap="round"
46+
stroke-linejoin="round"
47+
/>
48+
<path
49+
d="M7.08594 7.23228C7.20782 7.23228 7.30662 7.13635 7.30662 7.018C7.30662 6.89965 7.20782 6.80371 7.08594 6.80371"
50+
stroke="#475467"
51+
stroke-linecap="round"
52+
stroke-linejoin="round"
53+
/>
54+
<path
55+
d="M0.5 9.60672V6.17815C0.5 5.23138 1.29042 4.46387 2.26545 4.46387H8.44455C9.41961 4.46387 10.21 5.23138 10.21 6.17815V9.60672C10.21 10.5535 9.41961 11.321 8.44455 11.321H2.26545C1.29042 11.321 0.5 10.5535 0.5 9.60672Z"
56+
stroke="#475467"
57+
stroke-linecap="round"
58+
stroke-linejoin="round"
59+
/>
60+
</svg>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<svg viewBox="0 0 188 86" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-full w-full">
2+
<g clip-path="url(#clip0_8680_64057)">
3+
<path
4+
d="M0 4C0 1.79086 1.79086 0 4 0H184C186.209 0 188 1.79086 188 4V82C188 84.2091 186.209 86 184 86H4C1.79086 86 0 84.2091 0 82V4Z"
5+
fill="#CAE7FD"
6+
/>
7+
<g filter="url(#filter0_dd_8680_64057)">
8+
<mask id="path-2-inside-1_8680_64057" fill="white">
9+
<path d="M40 29C40 24.5817 43.5817 21 48 21H140C144.418 21 148 24.5817 148 29V86H40V29Z" />
10+
</mask>
11+
<path
12+
d="M40 29C40 24.5817 43.5817 21 48 21H140C144.418 21 148 24.5817 148 29V86H40V29Z"
13+
fill="white"
14+
/>
15+
<path
16+
d="M39 29C39 24.0294 43.0294 20 48 20H140C144.971 20 149 24.0294 149 29H147C147 25.134 143.866 22 140 22H48C44.134 22 41 25.134 41 29H39ZM148 86H40H148ZM39 86V29C39 24.0294 43.0294 20 48 20V22C44.134 22 41 25.134 41 29V86H39ZM140 20C144.971 20 149 24.0294 149 29V86H147V29C147 25.134 143.866 22 140 22V20Z"
17+
fill="#E4E7EC"
18+
mask="url(#path-2-inside-1_8680_64057)"
19+
/>
20+
</g>
21+
<rect x="50" y="34" width="31" height="9" fill="#E4E7EC" />
22+
<rect x="50" y="46" width="40" height="9" fill="#E4E7EC" />
23+
<rect x="94" y="46" width="40" height="9" fill="#E4E7EC" />
24+
<rect x="50" y="58" width="40" height="9" fill="#E4E7EC" />
25+
<rect x="94" y="58" width="40" height="9" fill="#E4E7EC" />
26+
<rect x="50" y="70" width="40" height="9" fill="#E4E7EC" />
27+
<rect x="94" y="70" width="40" height="9" fill="#E4E7EC" />
28+
<rect x="77.5" y="16.5" width="33" height="9" rx="3.5" fill="#F2F4F7" stroke="#E4E7EC" />
29+
</g>
30+
<defs>
31+
<filter
32+
id="filter0_dd_8680_64057"
33+
x="34"
34+
y="19"
35+
width="120"
36+
height="77"
37+
filterUnits="userSpaceOnUse"
38+
color-interpolation-filters="sRGB"
39+
>
40+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
41+
<feColorMatrix
42+
in="SourceAlpha"
43+
type="matrix"
44+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
45+
result="hardAlpha"
46+
/>
47+
<feMorphology
48+
radius="2"
49+
operator="erode"
50+
in="SourceAlpha"
51+
result="effect1_dropShadow_8680_64057"
52+
/>
53+
<feOffset dy="2" />
54+
<feGaussianBlur stdDeviation="2" />
55+
<feColorMatrix
56+
type="matrix"
57+
values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.06 0"
58+
/>
59+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_8680_64057" />
60+
<feColorMatrix
61+
in="SourceAlpha"
62+
type="matrix"
63+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
64+
result="hardAlpha"
65+
/>
66+
<feMorphology
67+
radius="2"
68+
operator="erode"
69+
in="SourceAlpha"
70+
result="effect2_dropShadow_8680_64057"
71+
/>
72+
<feOffset dy="4" />
73+
<feGaussianBlur stdDeviation="4" />
74+
<feColorMatrix
75+
type="matrix"
76+
values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.1 0"
77+
/>
78+
<feBlend
79+
mode="normal"
80+
in2="effect1_dropShadow_8680_64057"
81+
result="effect2_dropShadow_8680_64057"
82+
/>
83+
<feBlend
84+
mode="normal"
85+
in="SourceGraphic"
86+
in2="effect2_dropShadow_8680_64057"
87+
result="shape"
88+
/>
89+
</filter>
90+
<clipPath id="clip0_8680_64057">
91+
<rect width="188" height="86" fill="white" />
92+
</clipPath>
93+
</defs>
94+
</svg>

services/app/src/routes/(main)/organization/team/+page.server.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,53 @@ export const actions = {
193193
} else {
194194
return leaveOrgBody;
195195
}
196+
},
197+
198+
deify: async ({ cookies, fetch, locals, request }) => {
199+
const data = await request.formData();
200+
const user_id = data.get('user_id');
201+
const activeOrganizationId = cookies.get('activeOrganizationId');
202+
203+
if (typeof user_id !== 'string' || user_id.trim() === '') {
204+
return fail(400, new APIError('Invalid user ID').getSerializable());
205+
}
206+
207+
if (!activeOrganizationId) {
208+
return fail(400, new APIError('No active organization').getSerializable());
209+
}
210+
211+
//* Verify user perms
212+
if (!locals.user) {
213+
return fail(401, new APIError('Unauthorized').getSerializable());
214+
}
215+
216+
const deifyUserRes = await fetch(
217+
`${OWL_URL}/api/v1/organizations/owner?${new URLSearchParams([
218+
['new_owner_id', user_id],
219+
['organization_id', activeOrganizationId]
220+
])}`,
221+
{
222+
method: 'PATCH',
223+
headers: {
224+
...headers,
225+
'x-user-id': locals.user.id
226+
}
227+
}
228+
);
229+
230+
const deifyUserBody = await deifyUserRes.json();
231+
if (!deifyUserRes.ok) {
232+
logger.error('ORGTEAM_TRANSFER_TRANSFER', deifyUserBody);
233+
return fail(
234+
deifyUserRes.status,
235+
new APIError(
236+
'Failed to transfer organization ownership',
237+
deifyUserBody as any
238+
).getSerializable()
239+
);
240+
} else {
241+
return deifyUserBody;
242+
}
196243
}
197244
};
198245

0 commit comments

Comments
 (0)