pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/Drop-OSS/drop/commit/72ae7a2884552407796982e2bf7e6dc78d7c639c

b69241e157469407.css" /> Various bug fixes (#102) · Drop-OSS/drop@72ae7a2 · GitHub
Skip to content

Commit 72ae7a2

Browse files
authored
Various bug fixes (#102)
* feat: set lang in html head * fix: add # in front of git ref * fix: remove unused vars from example env * fix: package name and license field * fix: enable sourcemap for client and server * fix: emojis not showing in prod this is extremely cursed, but it works * chore: refactor auth manager * feat: disable invitations if simple auth disabled * feat: add drop version to footer * feat: translate auth endpoints * chore: move oidc module * feat: add weekly tasks enabled object cleanup as weekly task * feat: add timestamp to task log msgs * feat: add guard to prevent invalid progress % * fix: add missing global scope to i18n components * feat: set base url for i18n * feat: switch task log to json format * ci: run ci on develop branch only * fix: UserWidget text not updating #109 * fix: EXTERNAL_URL being computed at build * feat: add basic language outlines for translation * feat: add more english dialects
1 parent 9f5a3b3 commit 72ae7a2

File tree

43 files changed

+571
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+571
-223
lines changed

.env.example

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
DATABASE_URL="postgres://drop:drop@127.0.0.1:5432/drop"
22

3-
CLIENT_CERTIFICATES="./.data/ca"
4-
5-
FS_BACKEND_PATH="./.data/objects"
6-
73
GIANT_BOMB_API_KEY=""
84

5+
EXTERNAL_URL="localhost:3000"

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: CI
22

3-
on: [pull_request, push]
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
410

511
jobs:
612
typecheck:

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
],
3232
"i18n-ally.extract.ignoredByFiles": {
3333
"pages/admin/library/sources/index.vue": ["Filesystem"],
34-
"components/NewsArticleCreateButton.vue": ["[", "`", "Enter"]
34+
"components/NewsArticleCreateButton.vue": ["[", "`", "Enter"],
35+
"server/api/v1/auth/signin/simple.post.ts": ["boolean | undefined"]
3536
}
3637
}

components/EmojiText.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ const props = defineProps<{
99
emoji: string;
1010
}>();
1111
12-
const emojiEl = ref<HTMLElement | null>(null);
13-
1412
const url = computed(() => {
15-
return `/api/v1/emojis/${twemoji.convert.toCodePoint(props.emoji)}.svg`;
13+
return `/twemoji/${twemoji.convert.toCodePoint(props.emoji)}.svg`;
1614
});
1715
</script>

components/LanguageSelector.vue

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
class="grid w-full cursor-default grid-cols-1 rounded-md bg-zinc-900 py-1.5 pr-2 pl-3 text-left text-zinc-300 outline-1 -outline-offset-1 outline-zinc-700 focus:outline-2 focus:-outline-offset-2 focus:outline-blue-600 sm:text-sm/6"
1010
>
1111
<span class="col-start-1 row-start-1 flex items-center gap-3 pr-6">
12-
<span alt="" class="-mt-0.5 shrink-0 rounded-full">{{
13-
localeToEmoji(wiredLocale)
14-
}}</span>
12+
<EmojiText
13+
:emoji="localeToEmoji(wiredLocale)"
14+
class="-mt-0.5 shrink-0 max-w-6"
15+
/>
1516
<span class="block truncate">{{
1617
currentLocaleInformation?.name ?? wiredLocale
1718
}}</span>
@@ -46,9 +47,10 @@
4647
]"
4748
>
4849
<div class="flex items-center">
49-
<span class="-mt-0.5 shrink-0 rounded-full">
50-
{{ localeToEmoji(listLocale.code) }}
51-
</span>
50+
<EmojiText
51+
:emoji="localeToEmoji(listLocale.code)"
52+
class="-mt-0.5 shrink-0 max-w-6"
53+
/>
5254
<span
5355
:class="[
5456
selected ? 'font-semibold' : 'font-normal',
@@ -106,21 +108,50 @@ import {
106108
} from "@headlessui/vue";
107109
import { ChevronUpDownIcon } from "@heroicons/vue/16/solid";
108110
import { ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline";
111+
import type { Locale } from "vue-i18n";
112+
113+
const { locales, locale: currLocale, setLocale } = useI18n();
109114
110-
const { locales, locale, setLocale } = useI18n();
115+
function changeLocale(locale: Locale) {
116+
setLocale(locale);
117+
118+
// dynamically update the HTML attributes for language and direction
119+
// this is necessary for proper rendering of the page in the new language
120+
useHead({
121+
htmlAttrs: {
122+
lang: locale,
123+
dir: locales.value.find((l) => l.code === locale)?.dir || "ltr",
124+
},
125+
});
126+
}
111127
112128
function localeToEmoji(local: string): string {
113129
switch (local) {
130+
// Default locale
114131
case "en":
132+
case "en-us":
133+
return "🇺🇸";
134+
115135
case "en-gb":
136+
return "🇬🇧";
116137
case "en-ca":
138+
return "🇨🇦";
117139
case "en-au":
118-
case "en-us": {
119-
return "🇺🇸";
120-
}
121-
case "en-pirate": {
140+
return "🇦🇺";
141+
case "en-pirate":
122142
return "🏴‍☠️";
123-
}
143+
case "fr":
144+
return "🇫🇷";
145+
case "de":
146+
return "🇩🇪";
147+
case "es":
148+
return "🇪🇸";
149+
case "it":
150+
return "🇮🇹";
151+
case "zh":
152+
return "🇨🇳";
153+
case "zh-tw":
154+
return "🇹🇼";
124155
125156
default: {
126157
return "";
@@ -130,10 +161,10 @@ function localeToEmoji(local: string): string {
130161
131162
const wiredLocale = computed({
132163
get() {
133-
return locale.value;
164+
return currLocale.value;
134165
},
135166
set(v) {
136-
setLocale(v);
167+
changeLocale(v);
137168
},
138169
});
139170
const currentLocaleInformation = computed(() =>

components/UserFooter.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<footer class="bg-zinc-950" aria-labelledby="footer-heading">
33
<h2 id="footer-heading" class="sr-only">{{ $t("footer.footer") }}</h2>
44
<div class="mx-auto max-w-7xl px-6 py-16 sm:py-24 lg:px-8">
5+
<!-- Drop Info -->
56
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
67
<div class="space-y-8">
78
<DropWordmark class="h-10" />
@@ -24,6 +25,8 @@
2425
</NuxtLink>
2526
</div>
2627
</div>
28+
29+
<!-- Foot links -->
2730
<div class="mt-16 grid grid-cols-2 gap-8 xl:col-span-2 xl:mt-0">
2831
<div class="md:grid md:grid-cols-2 md:gap-8">
2932
<div>
@@ -86,6 +89,21 @@
8689
</div>
8790
</div>
8891
</div>
92+
93+
<div class="flex items-center justify-center xl:col-span-3 mt-8">
94+
<p
95+
class="text-xs text-zinc-700 hover:text-zinc-400 transition-colors duration-200 cursor-default select-none"
96+
>
97+
<i18n-t keypath="footer.version" tag="p" scope="global">
98+
<template #version>
99+
<span>{{ versionInfo.version }}</span>
100+
</template>
101+
<template #gitRef>
102+
<span>{{ versionInfo.gitRef }}</span>
103+
</template>
104+
</i18n-t>
105+
</p>
106+
</div>
89107
</div>
90108
</div>
91109
</footer>
@@ -96,6 +114,8 @@ import { IconsDiscordLogo, IconsGithubLogo } from "#components";
96114
97115
const { t } = useI18n();
98116
117+
const versionInfo = await $dropFetch("/api/v1");
118+
99119
const navigation = {
100120
games: [
101121
{ name: t("store.recentlyAdded"), href: "#" },

components/UserHeader/UserWidget.vue

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,21 @@ import { useObject } from "~/composables/objects";
8585
import type { NavigationItem } from "~/composables/types";
8686
8787
const user = useUser();
88-
const { t } = useI18n();
8988
90-
const navigation: NavigationItem[] = [
91-
user.value?.admin
92-
? {
93-
label: t("userHeader.profile.admin"),
94-
route: "/admin",
95-
prefix: "",
96-
}
97-
: undefined,
98-
{
99-
label: t("userHeader.profile.settings"),
100-
route: "/account",
101-
prefix: "",
102-
},
103-
].filter((e) => e !== undefined);
89+
const navigation = computed<NavigationItem[]>(() =>
90+
[
91+
user.value?.admin
92+
? {
93+
label: $t("userHeader.profile.admin"),
94+
route: "/admin",
95+
prefix: "",
96+
}
97+
: undefined,
98+
{
99+
label: $t("userHeader.profile.settings"),
100+
route: "/account",
101+
prefix: "",
102+
},
103+
].filter((e) => e !== undefined),
104+
);
104105
</script>

i18n/i18n.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ export default defineI18nConfig(() => {
2121
// https://vue-i18n.intlify.dev/guide/essentials/datetime.html
2222
datetimeFormats: {
2323
"en-us": defaultDateTimeFormat,
24+
"en-gb": defaultDateTimeFormat,
25+
"en-au": defaultDateTimeFormat,
2426
"en-pirate": defaultDateTimeFormat,
27+
fr: defaultDateTimeFormat,
28+
de: defaultDateTimeFormat,
29+
it: defaultDateTimeFormat,
30+
es: defaultDateTimeFormat,
31+
zh: defaultDateTimeFormat,
32+
"zh-tw": defaultDateTimeFormat,
2533
},
2634
};
2735
});

i18n/locales/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

i18n/locales/en_au.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy