This commit is contained in:
Timothy J. Baek 2024-10-01 21:48:15 -07:00
parent 5933d7a216
commit 3e012f0219
5 changed files with 18 additions and 7 deletions

View File

@ -65,7 +65,7 @@ def upgrade():
user_id=doc.user_id,
description=doc.name,
meta={
"legacy": True,
"document": True,
"tags": json.loads(doc.content or "{}").get("tags", []),
},
name=doc.title,

View File

@ -114,7 +114,7 @@
files = [
...files,
{
type: e?.detail?.meta?.legacy ? 'file' : 'project',
type: e?.detail?.meta?.document ? 'file' : 'project',
...e.detail,
status: 'processed'
}

View File

@ -111,11 +111,11 @@
{project.name}
</div>
{#if project?.meta?.legacy}
{#if project?.meta?.document}
<div
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs px-1"
>
Legacy Document
Document
</div>
{:else}
<div

View File

@ -113,10 +113,17 @@
<hr class=" border-gray-50 dark:border-gray-850 my-2.5" />
<div class="my-3 mb-5 grid md:grid-cols-2 gap-2">
<div class="my-3 mb-5 grid lg:grid-cols-2 xl:grid-cols-3 gap-2">
{#each filteredProjects as project}
<button
class=" flex space-x-4 cursor-pointer text-left w-full px-4 py-3 border border-gray-50 dark:border-gray-850 hover:bg-gray-50 dark:hover:bg-gray-850 rounded-xl"
on:click={() => {
if (project?.meta?.document) {
toast.error($i18n.t('Documents cannot be edited, please create a new project.'));
} else {
goto(`/workspace/projects/${project.id}`);
}
}}
>
<div class=" w-full">
<div class="flex items-center justify-between -mt-1">
@ -139,11 +146,11 @@
<div class="mt-5 flex justify-between">
<div>
{#if project?.meta?.legacy}
{#if project?.meta?.document}
<div
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs font-bold px-1"
>
{$i18n.t('Legacy Document')}
{$i18n.t('Document')}
</div>
{:else}
<div

View File

@ -37,6 +37,10 @@
><button
class="self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
type="button"
on:click={(e) => {
e.stopPropagation();
show = true;
}}
>
<EllipsisHorizontal className="size-5" />
</button>