Skip to content

Commit

Permalink
Move output to build dir
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan committed Aug 29, 2022
1 parent 3211da9 commit dca6ca0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion css/explore.css.map

This file was deleted.

64 changes: 0 additions & 64 deletions css/explore.scss

This file was deleted.

2 changes: 1 addition & 1 deletion css/mobile.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@media only screen and (max-width: $breakpoint_mobile) {
@media only screen and (max-width: 1024px) {
#app-content .utils .date {
display: none;
}
Expand Down
20 changes: 19 additions & 1 deletion src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,27 @@ 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'

/**
*
* @param func
* @param wait
*/
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: {
Expand Down Expand Up @@ -108,6 +124,8 @@ export default {
if (status !== 'ok') {
showError(errorMessage)
console.error(errorMessage, error)
} else {
successMessage()
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
declare(strict_types=1);
// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
// SPDX-Licence-Identifier: AGPL-3.0-or-later
\OCP\Util::addScript('news', 'news-admin-settings');
\OCP\Util::addScript('news', 'build/news-admin-settings');
?>

<div id="vue-admin-news"></div>
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dca6ca0

Please sign in to comment.