diff options
author | Devlin Junker <devlin.junker@gmail.com> | 2022-11-11 09:08:17 -0800 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2022-11-17 14:50:53 +0100 |
commit | 095176fd90ed798b55f87903dbb1adb1da248b24 (patch) | |
tree | e94733328db62fd6ef9fa0cb687470a1f18cd04e | |
parent | 234b9759c5691182d7a426d49329c6132c08ea9f (diff) |
fix extraneous import error
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
-rw-r--r-- | package-lock.json | 41 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/components/AdminSettings.vue | 85 |
3 files changed, 94 insertions, 33 deletions
diff --git a/package-lock.json b/package-lock.json index 818520763..7de5669eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "dependencies": { "@nextcloud/axios": "^1.11.0", "@nextcloud/dialogs": "^3.1.2", + "@nextcloud/initial-state": "^2.0.0", "@nextcloud/router": "^2.0.0", "@nextcloud/vue": "^7.0.1", "vue": "^2.6.14", @@ -3228,6 +3229,14 @@ "core-js": "^3.6.4" } }, + "node_modules/@nextcloud/capabilities/node_modules/@nextcloud/initial-state": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.2.1.tgz", + "integrity": "sha512-2TH2DzJBolYHWfbSovTWkByAIg0gdsyuVfZpf5APnJu/9PixXKbnrVFnaEdxjeP262Gok7ARMFFQeSiuzKRQeQ==", + "dependencies": { + "core-js": "^3.6.4" + } + }, "node_modules/@nextcloud/dialogs": { "version": "3.2.0", "license": "GPL-3.0-or-later", @@ -3310,11 +3319,9 @@ } }, "node_modules/@nextcloud/initial-state": { - "version": "1.2.1", - "license": "GPL-3.0-or-later", - "dependencies": { - "core-js": "^3.6.4" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.0.0.tgz", + "integrity": "sha512-xmNP30v/RnkJ2z1HcuEo7YfcLJJa+FdWTwgNldXHOlMeMbl/ESpsGkWL2sULrhYurz64L0JpfwEdi/cHcmyuZQ==" }, "node_modules/@nextcloud/l10n": { "version": "1.6.0", @@ -3500,10 +3507,6 @@ "npm": "^7.0.0 || ^8.0.0" } }, - "node_modules/@nextcloud/vue/node_modules/@nextcloud/initial-state": { - "version": "2.0.0", - "license": "GPL-3.0-or-later" - }, "node_modules/@nextcloud/vue/node_modules/axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", @@ -18523,6 +18526,16 @@ "requires": { "@nextcloud/initial-state": "^1.1.2", "core-js": "^3.6.4" + }, + "dependencies": { + "@nextcloud/initial-state": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.2.1.tgz", + "integrity": "sha512-2TH2DzJBolYHWfbSovTWkByAIg0gdsyuVfZpf5APnJu/9PixXKbnrVFnaEdxjeP262Gok7ARMFFQeSiuzKRQeQ==", + "requires": { + "core-js": "^3.6.4" + } + } } }, "@nextcloud/dialogs": { @@ -18572,10 +18585,9 @@ } }, "@nextcloud/initial-state": { - "version": "1.2.1", - "requires": { - "core-js": "^3.6.4" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.0.0.tgz", + "integrity": "sha512-xmNP30v/RnkJ2z1HcuEo7YfcLJJa+FdWTwgNldXHOlMeMbl/ESpsGkWL2sULrhYurz64L0JpfwEdi/cHcmyuZQ==" }, "@nextcloud/l10n": { "version": "1.6.0", @@ -18718,9 +18730,6 @@ "semver": "^7.3.7" } }, - "@nextcloud/initial-state": { - "version": "2.0.0" - }, "axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", diff --git a/package.json b/package.json index 20d7ae20c..bc0809768 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "dependencies": { "@nextcloud/axios": "^1.11.0", "@nextcloud/dialogs": "^3.1.2", + "@nextcloud/initial-state": "^2.0.0", "@nextcloud/router": "^2.0.0", "@nextcloud/vue": "^7.0.1", "vue": "^2.6.14", diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index ee14dc005..450034140 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -10,46 +10,89 @@ SPDX-Licence-Identifier: AGPL-3.0-or-later <NcCheckboxRadioSwitch type="switch" :checked.sync="useCronUpdates" @update:checked="update('useCronUpdates', useCronUpdates)"> - {{ t('news', 'Use system cron for updates') }} + {{ t("news", "Use system cron for updates") }} </NcCheckboxRadioSwitch> - <p><em>{{ t('news', 'Disable this if you use a custom updater.') }}</em></p> + <p> + <em>{{ + t("news", "Disable this if you use a custom updater.") + }}</em> + </p> <NcTextField :value.sync="autoPurgeCount" :label="t('news', 'Maximum read count per feed')" :label-visible="true" @update:value="update('autoPurgeCount', autoPurgeCount)" /> - <p><em>{{ t('news', 'Defines the maximum amount of articles that can be read per feed which will not be deleted by the cleanup job; if old articles reappear after being read, increase this value; negative values such as -1 will turn this feature off.') }}</em></p> + <p> + <em>{{ + t( + "news", + "Defines the maximum amount of articles that can be read per feed which will not be deleted by the cleanup job; if old articles reappear after being read, increase this value; negative values such as -1 will turn this feature off." + ) + }}</em> + </p> <NcCheckboxRadioSwitch type="switch" :checked.sync="purgeUnread" @update:checked="update('purgeUnread', purgeUnread)"> - {{ t('news', 'Delete unread articles automatically') }} + {{ t("news", "Delete unread articles automatically") }} </NcCheckboxRadioSwitch> - <p><em>{{ t('news', 'Enable this if you also want to delete unread articles.') }}</em></p> + <p> + <em>{{ + t( + "news", + "Enable this if you also want to delete unread articles." + ) + }}</em> + </p> <NcTextField :value.sync="maxRedirects" :label="t('news', 'Maximum redirects')" :label-visible="true" @update:value="update('maxRedirects', maxRedirects)" /> - <p><em>{{ t('news', 'How many redirects the feed fetcher should follow.') }}</em></p> + <p> + <em>{{ + t("news", "How many redirects the feed fetcher should follow.") + }}</em> + </p> <NcTextField :value.sync="feedFetcherTimeout" :label="t('news', 'Feed fetcher timeout')" :label-visible="true" @update:value="update('feedFetcherTimeout', feedFetcherTimeout)" /> - <p><em>{{ t('news', 'Maximum number of seconds to wait for an RSS or Atom feed to load; if it takes longer the update will be aborted.') }}</em></p> + <p> + <em>{{ + t( + "news", + "Maximum number of seconds to wait for an RSS or Atom feed to load; if it takes longer the update will be aborted." + ) + }}</em> + </p> <NcTextField :value.sync="exploreUrl" :label="t('news', 'Explore Service URL')" :label-visible="true" @update:value="update('exploreUrl', exploreUrl)" /> - <p><em>{{ t('news', 'If given, this service\'s URL will be queried for displaying the feeds in the explore feed section. To fall back to the built in explore service, leave this input empty.') }}</em></p> + <p> + <em>{{ + t( + "news", + "If given, this service's URL will be queried for displaying the feeds in the explore feed section. To fall back to the built in explore service, leave this input empty." + ) + }}</em> + </p> <NcTextField :value.sync="updateInterval" :label="t('news', 'Update interval')" :label-visible="true" @update:value="update('updateInterval', updateInterval)" /> - <p><em>{{ t('news', 'Interval in seconds in which the feeds will be updated.') }}</em></p> + <p> + <em>{{ + t( + "news", + "Interval in seconds in which the feeds will be updated." + ) + }}</em> + </p> </NcSettingsSection> </template> @@ -57,7 +100,7 @@ SPDX-Licence-Identifier: AGPL-3.0-or-later import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' 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 { loadState } from '@nextcloud/initial-state' import { showError, showSuccess } from '@nextcloud/dialogs' import axios from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' @@ -73,11 +116,16 @@ function debounce(func, wait) { return function executedFunction(...args) { clearTimeout(timeout) - timeout = setTimeout(() => { func.apply(this, args) }, wait) + timeout = setTimeout(() => { + func.apply(this, args) + }, wait) } } -const successMessage = debounce(() => showSuccess(t('news', 'Successfully updated news configuration')), 500) +const successMessage = debounce( + () => showSuccess(t('news', 'Successfully updated news configuration')), + 500, +) export default { name: 'AdminSettings', @@ -100,10 +148,13 @@ export default { methods: { async update(key, value) { await confirmPassword() - const url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', { - appId: 'news', - key, - }) + const url = generateOcsUrl( + '/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', + { + appId: 'news', + key, + }, + ) if (key === 'useCronUpdates' || key === 'purgeUnread') { value = value ? '1' : '0' } @@ -137,7 +188,7 @@ export default { .news-settings { p { max-width: 700px; - margin-top: .25rem; + margin-top: 0.25rem; margin-bottom: 1rem; } |