From 2a66365d71fd5a1efe0668ae46c72f60bbf3c97a Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sat, 27 Aug 2022 11:04:31 +0200 Subject: [PATCH] Move output to build dir Signed-off-by: Carl Schwan --- Makefile | 2 +- css/explore.css.map | 1 - css/explore.scss | 64 -------------------------------- src/components/AdminSettings.vue | 15 +++++++- templates/admin.php | 2 +- webpack.config.js | 2 + 6 files changed, 18 insertions(+), 68 deletions(-) delete mode 100644 css/explore.css.map delete mode 100644 css/explore.scss diff --git a/Makefile b/Makefile index 03b58207e2..7e55a1bb39 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,7 @@ appstore: # on macOS there is no option "--parents" for the "cp" command mkdir -p $(appstore_sign_dir)/$(app_name)/js/build $(appstore_sign_dir)/$(app_name)/js/admin cp js/build/app.min.js $(appstore_sign_dir)/$(app_name)/js/build - cp js/admin/Admin.js $(appstore_sign_dir)/$(app_name)/js/admin + cp js/build/news-admin-settings.js* $(appstore_sign_dir)/$(app_name)/js/build # export the key and cert to a file mkdir -p $(cert_dir) diff --git a/css/explore.css.map b/css/explore.css.map deleted file mode 100644 index 711109ae31..0000000000 --- a/css/explore.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sourceRoot":"","sources":["explore.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAAA;AAAA;AAGA;EACI;;;AAGJ;EACI;EACA;EACA;;AAEH;EACI;EACA;EACH;EACG;EACH;;AAEA;EACI;EACA;EACA;EACA;;AAEH;EACI;;AAEH;EAEI;;AAKN;EACI;EACA;;AAEH;EACI;;AAIL;EACI;EACH;EACA;EACA;EACA","file":"explore.css"} \ No newline at end of file diff --git a/css/explore.scss b/css/explore.scss deleted file mode 100644 index d459ae8255..0000000000 --- a/css/explore.scss +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt - * @copyright 2020, Jan C. Borchardt, https://jancborchardt.net - * @copyright Bernhard Posselt 2014 - */ - -/** - * Explore styles - */ -.explore #app-content-wrapper { - height: 100%; -} - -#explore { - height: 100%; - width: 100%; - padding: 45px 0 45px 45px; - - .grid-item { - width: 300px; - border: 2px solid var(--color-border); - border-radius: var(--border-radius-large); - margin: 0 24px 24px 0; - padding: 24px; - - .explore-title { - background-repeat: no-repeat; - background-position: 0 center; - background-size: 24px; - padding-left: 32px; - - a { - word-wrap: break-word; - - &:hover, - &:focus { - text-decoration: underline; - } - } - } - - .explore-logo { - text-align: center; - margin-top: 25px; - - img { - width: 100%; - } - } - - .explore-subscribe { - margin-top: 16px; - max-width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - } -} diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index b822829f9f..d0baa3150f 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -57,11 +57,22 @@ import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadi import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js' import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js' import { loadState } from '@nextcloud/initial-state' -import { showError } from '@nextcloud/dialogs' +import { showError, showSuccess } from '@nextcloud/dialogs' import axios from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' import confirmPassword from '@nextcloud/password-confirmation' +function debounce(func, wait) { + let timeout + + return function executedFunction(...args) { + clearTimeout(timeout); + timeout = setTimeout(() => { func.apply(this, args); }, wait); + } +} + +const successMessage = debounce(() => showSuccess(t('news', 'Successfuly updated news configuration')), 500) + export default { name: 'AdminSettings', components: { @@ -108,6 +119,8 @@ export default { if (status !== 'ok') { showError(errorMessage) console.error(errorMessage, error) + } else { + successMessage() } }, }, diff --git a/templates/admin.php b/templates/admin.php index 5a3cba7116..56c6498a6f 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -2,7 +2,7 @@ declare(strict_types=1); // SPDX-FileCopyrightText: 2022 Carl Schwan // SPDX-Licence-Identifier: AGPL-3.0-or-later -\OCP\Util::addScript('news', 'news-admin-settings'); +\OCP\Util::addScript('news', 'build/news-admin-settings'); ?>
diff --git a/webpack.config.js b/webpack.config.js index 136a214c54..c329f79d1d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,5 +7,7 @@ const webpackConfig = require('@nextcloud/webpack-vue-config') webpackConfig.entry = { 'admin-settings': path.join(__dirname, 'src', 'main-admin.js'), } +webpackConfig.output.path = path.resolve('./js/build/') +webpackConfig.output.publicPath = path.join('/apps/', process.env.npm_package_name, '/js/build/') module.exports = webpackConfig