diff --git a/l10n/messages.pot b/l10n/messages.pot index 685520ecd..d4f84560c 100644 --- a/l10n/messages.pot +++ b/l10n/messages.pot @@ -14,6 +14,9 @@ msgstr "" msgid "All files" msgstr "" +msgid "Cancel" +msgstr "" + msgid "Choose" msgstr "" @@ -46,6 +49,12 @@ msgstr "" msgid "Current view selector" msgstr "" +msgid "Enter your name" +msgstr "" + +msgid "Failed to set nickname." +msgstr "" + msgid "Favorites" msgstr "" @@ -61,6 +70,9 @@ msgstr "" msgid "Folder name cannot be empty." msgstr "" +msgid "Guest identification" +msgstr "" + msgid "Home" msgstr "" @@ -94,6 +106,9 @@ msgstr "" msgid "No matching files" msgstr "" +msgid "Please enter a name with at least 2 characters." +msgstr "" + msgid "Recent" msgstr "" @@ -109,8 +124,17 @@ msgstr "" msgid "Size" msgstr "" +msgid "Submit name" +msgstr "" + msgid "Undo" msgstr "" msgid "Upload some content or sync with your devices!" msgstr "" + +msgid "You are currently not identified." +msgstr "" + +msgid "You cannot leave the name empty." +msgstr "" diff --git a/lib/components/PublicAuthPrompt.vue b/lib/components/PublicAuthPrompt.vue new file mode 100644 index 000000000..48bc7306d --- /dev/null +++ b/lib/components/PublicAuthPrompt.vue @@ -0,0 +1,182 @@ + + + + + + + diff --git a/lib/public-auth.ts b/lib/public-auth.ts new file mode 100644 index 000000000..14301ec25 --- /dev/null +++ b/lib/public-auth.ts @@ -0,0 +1,25 @@ +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import type { PublicAuthPromptProps } from './components/PublicAuthPrompt.vue' + +import { defineAsyncComponent } from 'vue' +import { spawnDialog } from '@nextcloud/vue/functions/dialog' + +/** + * Show the public auth prompt dialog + * This is used to ask the current user their nickname + * as well as show some additional contextual information + * @param props The props to pass to the dialog, see PublicAuthPrompt.vue for details + */ +export function showGuestUserPrompt(props: PublicAuthPromptProps) { + return new Promise((resolve) => { + spawnDialog( + defineAsyncComponent(() => import('./components/PublicAuthPrompt.vue')), + props, + resolve, + ) + }) +} diff --git a/package-lock.json b/package-lock.json index 6ae5346c9..d1f9b8af4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@mdi/js": "^7.4.47", "@nextcloud/auth": "^2.4.0", "@nextcloud/axios": "^2.5.1", + "@nextcloud/browser-storage": "^0.4.0", "@nextcloud/event-bus": "^3.3.2", "@nextcloud/files": "^3.10.2", "@nextcloud/initial-state": "^2.2.0", diff --git a/package.json b/package.json index 20d524d68..b94981dda 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@mdi/js": "^7.4.47", "@nextcloud/auth": "^2.4.0", "@nextcloud/axios": "^2.5.1", + "@nextcloud/browser-storage": "^0.4.0", "@nextcloud/event-bus": "^3.3.2", "@nextcloud/files": "^3.10.2", "@nextcloud/initial-state": "^2.2.0", diff --git a/tsconfig.json b/tsconfig.json index 7ccc3a7ce..cb93faf4a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,14 @@ { "extends": "@vue/tsconfig", "compilerOptions": { + "allowImportingTsExtensions": true, "declaration": true, "esModuleInterop": true, "lib": ["DOM", "ESNext"], "outDir": "./dist", "rootDir": "lib/", "module": "ESNext", - "moduleResolution": "Bundler", + "moduleResolution": "bundler", "target": "ESNext", "plugins": [ { "name": "typescript-plugin-css-modules" }