From 76d7ad5575b48c0da83f0ed73ae6a62fb31655c0 Mon Sep 17 00:00:00 2001 From: Sasan Jaghori Date: Sat, 5 Oct 2024 10:27:44 +0200 Subject: [PATCH 1/5] remove wrong comment --- services/src/db/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/db/database.ts b/services/src/db/database.ts index d5499c17..a5bf1b7a 100644 --- a/services/src/db/database.ts +++ b/services/src/db/database.ts @@ -1,4 +1,4 @@ -import type { DB } from 'kysely-codegen' // this is the Database interface we defined earlier +import type { DB } from 'kysely-codegen' import SQLite from 'better-sqlite3' import { Kysely, SqliteDialect } from 'kysely' import 'better-sqlite3' From f418b00d980f2450d342a08482fc74d78f90018c Mon Sep 17 00:00:00 2001 From: Sasan Jaghori Date: Sat, 5 Oct 2024 10:28:06 +0200 Subject: [PATCH 2/5] adds copy to clipboard button --- src/components/copy/CopyClipboard.svelte | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/components/copy/CopyClipboard.svelte diff --git a/src/components/copy/CopyClipboard.svelte b/src/components/copy/CopyClipboard.svelte new file mode 100644 index 00000000..9f967f81 --- /dev/null +++ b/src/components/copy/CopyClipboard.svelte @@ -0,0 +1,25 @@ + + +
+ +
From 9297d083d89cdc3a29207614e1e0a69b53a634ab Mon Sep 17 00:00:00 2001 From: Sasan Jaghori Date: Sat, 5 Oct 2024 10:28:29 +0200 Subject: [PATCH 3/5] adds shadcn badge component --- src/components/ui/badge/badge.svelte | 18 ++++++++++++++++++ src/components/ui/badge/index.ts | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/components/ui/badge/badge.svelte create mode 100644 src/components/ui/badge/index.ts diff --git a/src/components/ui/badge/badge.svelte b/src/components/ui/badge/badge.svelte new file mode 100644 index 00000000..0a96b6ed --- /dev/null +++ b/src/components/ui/badge/badge.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/src/components/ui/badge/index.ts b/src/components/ui/badge/index.ts new file mode 100644 index 00000000..f7e14db9 --- /dev/null +++ b/src/components/ui/badge/index.ts @@ -0,0 +1,21 @@ +import { type VariantProps, tv } from 'tailwind-variants' + +export { default as Badge } from './badge.svelte' + +export const badgeVariants = tv({ + base: 'focus:ring-ring inline-flex select-none items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2', + variants: { + variant: { + default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent', + secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent', + destructive: + 'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent', + outline: 'text-foreground' + } + }, + defaultVariants: { + variant: 'default' + } +}) + +export type Variant = VariantProps['variant'] From 15fe95a38cb8009160fd5e3da4394cb735648d48 Mon Sep 17 00:00:00 2001 From: Sasan Jaghori Date: Sat, 5 Oct 2024 10:29:21 +0200 Subject: [PATCH 4/5] adds page titles --- .../projects/[slug]/keys/+page.svelte | 13 ++++++++++++- .../projects/[slug]/languages/+page.svelte | 5 +++++ .../projects/[slug]/translations/+page.svelte | 16 +++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/routes/(authenticated)/projects/[slug]/keys/+page.svelte b/src/routes/(authenticated)/projects/[slug]/keys/+page.svelte index 0bdfd492..f4ef554b 100644 --- a/src/routes/(authenticated)/projects/[slug]/keys/+page.svelte +++ b/src/routes/(authenticated)/projects/[slug]/keys/+page.svelte @@ -1 +1,12 @@ -keys + + + + {pageTitle(data.project.name, 'Keys')} + + +This page will display all keys. It will also give the option to add or delete keys. diff --git a/src/routes/(authenticated)/projects/[slug]/languages/+page.svelte b/src/routes/(authenticated)/projects/[slug]/languages/+page.svelte index 72cab76f..524fd364 100644 --- a/src/routes/(authenticated)/projects/[slug]/languages/+page.svelte +++ b/src/routes/(authenticated)/projects/[slug]/languages/+page.svelte @@ -12,6 +12,7 @@ import LanguageTable from '$components/container/language/LanguageTable.svelte' import { Button } from '$components/ui/button' import { Check, Plus } from 'lucide-svelte' + import { pageTitle } from '$lib/utils/page-title' export let data: PageData @@ -58,6 +59,10 @@ } + + {pageTitle(data.project.name, 'Languages')} + +
diff --git a/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte b/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte index a9d988f7..771ac078 100644 --- a/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte +++ b/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte @@ -1 +1,15 @@ -Translation + + + + {pageTitle(data.project.name, 'Translations')} + + + + + From 98b4cdede994174a602bbf9b5948f5ee69dc414a Mon Sep 17 00:00:00 2001 From: Sasan Jaghori Date: Sat, 5 Oct 2024 10:31:04 +0200 Subject: [PATCH 5/5] WIP: adds translations key table and draft search component --- .../translations/TranslationsKeyTable.svelte | 91 +++++++++++++++++++ .../search-input/SearchInput.svelte | 11 +++ .../projects/[slug]/translations/+page.svelte | 10 ++ 3 files changed, 112 insertions(+) create mode 100644 src/components/container/translations/TranslationsKeyTable.svelte create mode 100644 src/components/search-input/SearchInput.svelte diff --git a/src/components/container/translations/TranslationsKeyTable.svelte b/src/components/container/translations/TranslationsKeyTable.svelte new file mode 100644 index 00000000..ba4679ec --- /dev/null +++ b/src/components/container/translations/TranslationsKeyTable.svelte @@ -0,0 +1,91 @@ + + + + + + {#each translationData as keyValue} + + +
+ {keyValue.key} + +
+
+
+ + {#each keyValue.translations as translation} + + {translation.langCode} + +
+ + {#if translation.isDefault} + Default + {/if} + {#if !translation.text} + + {/if} +
+
+
+ {/each} + {/each} +
diff --git a/src/components/search-input/SearchInput.svelte b/src/components/search-input/SearchInput.svelte new file mode 100644 index 00000000..4942ed3f --- /dev/null +++ b/src/components/search-input/SearchInput.svelte @@ -0,0 +1,11 @@ + + +
+ + +
diff --git a/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte b/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte index 771ac078..ba654249 100644 --- a/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte +++ b/src/routes/(authenticated)/projects/[slug]/translations/+page.svelte @@ -1,6 +1,8 @@