diff --git a/REUSE.toml b/REUSE.toml index 2faaf3fbdbd..c7d06791dd8 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -178,7 +178,7 @@ SPDX-FileCopyrightText = "2020 Nextcloud GmbH and Nextcloud contributors" SPDX-License-Identifier = "AGPL-3.0-or-later" [[annotations]] -path = ["cypress/tsconfig.json", "cypress/fixtures/appstore/apps.json", "dist/icons.css"] +path = ["cypress/tsconfig.json", "cypress/fixtures/appstore/apps.json", "dist/*.css"] precedence = "aggregate" SPDX-FileCopyrightText = "2022 Nextcloud GmbH and Nextcloud contributors" SPDX-License-Identifier = "AGPL-3.0-or-later" diff --git a/apps/sharebymail/lib/Settings/Admin.php b/apps/sharebymail/lib/Settings/Admin.php index 8f27bbff6d6..af0526e80dc 100644 --- a/apps/sharebymail/lib/Settings/Admin.php +++ b/apps/sharebymail/lib/Settings/Admin.php @@ -26,6 +26,8 @@ class Admin implements IDelegatedSettings { $this->initialState->provideInitialState('sendPasswordMail', $this->settingsManager->sendPasswordByMail()); $this->initialState->provideInitialState('replyToInitiator', $this->settingsManager->replyToInitiator()); + \OCP\Util::addStyle('sharebymail', 'admin-settings'); + \OCP\Util::addScript('sharebymail', 'admin-settings'); return new TemplateResponse('sharebymail', 'settings-admin', [], ''); } diff --git a/apps/sharebymail/src/components/AdminSettings.vue b/apps/sharebymail/src/components/AdminSettings.vue index 4d5678441c6..24832d9fc76 100644 --- a/apps/sharebymail/src/components/AdminSettings.vue +++ b/apps/sharebymail/src/components/AdminSettings.vue @@ -7,17 +7,11 @@ - + {{ t('sharebymail', 'Send password by mail') }} - + {{ t('sharebymail', 'Reply to initiator') }} @@ -27,6 +21,7 @@ import axios from '@nextcloud/axios' import { showError } from '@nextcloud/dialogs' import { loadState } from '@nextcloud/initial-state' +import { t } from '@nextcloud/l10n' import { confirmPassword } from '@nextcloud/password-confirmation' import { generateOcsUrl } from '@nextcloud/router' import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch' @@ -40,6 +35,10 @@ export default { NcSettingsSection, }, + setup() { + return { t } + }, + data() { return { sendPasswordMail: loadState('sharebymail', 'sendPasswordMail'), @@ -47,6 +46,16 @@ export default { } }, + watch: { + sendPasswordMail(newValue) { + this.update('sendpasswordmail', newValue) + }, + + replyToInitiator(newValue) { + this.update('replyToInitiator', newValue) + }, + }, + methods: { async update(key, value) { await confirmPassword() diff --git a/apps/sharebymail/src/main-admin.js b/apps/sharebymail/src/main-admin.js deleted file mode 100644 index dd3f6574adf..00000000000 --- a/apps/sharebymail/src/main-admin.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -import { getCSPNonce } from '@nextcloud/auth' -import { translate as t } from '@nextcloud/l10n' -import Vue from 'vue' -import AdminSettings from './components/AdminSettings.vue' - -__webpack_nonce__ = getCSPNonce() - -Vue.mixin({ - methods: { - t, - }, -}) - -const AdminSettingsView = Vue.extend(AdminSettings) -new AdminSettingsView().$mount('#vue-admin-sharebymail') diff --git a/apps/sharebymail/src/settings-admin.ts b/apps/sharebymail/src/settings-admin.ts new file mode 100644 index 00000000000..04a9c60148d --- /dev/null +++ b/apps/sharebymail/src/settings-admin.ts @@ -0,0 +1,10 @@ +/** + * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { createApp } from 'vue' +import AdminSettings from './components/AdminSettings.vue' + +const app = createApp(AdminSettings) +app.mount('#vue-admin-sharebymail') diff --git a/apps/sharebymail/templates/settings-admin.php b/apps/sharebymail/templates/settings-admin.php index 1db46617fb3..771d99e82c1 100644 --- a/apps/sharebymail/templates/settings-admin.php +++ b/apps/sharebymail/templates/settings-admin.php @@ -3,7 +3,6 @@ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ - -\OCP\Util::addScript('sharebymail', 'vue-settings-admin-sharebymail'); ?> +
diff --git a/build/frontend-legacy/apps/sharebymail b/build/frontend/apps/sharebymail similarity index 100% rename from build/frontend-legacy/apps/sharebymail rename to build/frontend/apps/sharebymail diff --git a/build/frontend/vite.config.mts b/build/frontend/vite.config.mts index 10ccd81e06b..20ba69403cc 100644 --- a/build/frontend/vite.config.mts +++ b/build/frontend/vite.config.mts @@ -7,6 +7,7 @@ import { createAppConfig } from '@nextcloud/vite-config' import { resolve } from 'node:path' export default createAppConfig({ + 'admin-settings': resolve(import.meta.dirname, 'apps/sharebymail/src', 'settings-admin.ts'), }, { emptyOutputDirectory: { additionalDirectories: [resolve(import.meta.dirname, '../..', 'dist')],