fix(settings): save the guest allowlist again and add a default quota selector#1602
Open
ernolf wants to merge 1 commit into
Open
fix(settings): save the guest allowlist again and add a default quota selector#1602ernolf wants to merge 1 commit into
ernolf wants to merge 1 commit into
Conversation
… selector - the allowlist NcSelect used @input, which @nextcloud/vue 9 no longer emits, so editing the allowed apps was never saved - rework the allowlist into a read-only chip list with an edit (pencil) button and a confirm (check) button that applies and saves; editing uses a draft, so closing the dropdown no longer saves - add a "Default quota for new guest accounts" selector (the preset-derived default shown with its value, Unlimited, common sizes, or a custom size with a required unit) - add Config getters/setters and SettingsController plumbing for guest_quota, reading the preset default via IAppConfig::getDetails() - cover the new quota config methods with unit tests - document the default quota and its Quick presets source in the README - fix three README links that still pointed to the removed `master` branch (now `main`) Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes to the Guests admin settings page (
src/views/GuestSettings.vueand the config plumbing behind it):1. Fix: allowlist changes are not saved
Fixes #1591. (This is also the allowlist-selector remainder of #995, which was closed after #1598 — but #1598 only fixed the on/off switches; the allowlist
NcSelectitself still used@input="saveConfig", which @nextcloud/vue 9 no longer emits, the same Vue 3 migration regression as #1323.) So editing the list of allowed apps sent noPUT /apps/guests/configand was lost on reload.The selector is reworked to match the inline-edit pattern used in the Accounts management:
NcSelect; edits go to a draft. A confirm (check) button applies the draft and saves. Closing the dropdown no longer saves on its own, and the save no longer relies on the dead@inputevent.2. Feature: default quota for new guest accounts
Adds a quota selector to the Guests tab, mirroring the Accounts quota field:
500→500 KB / 500 MB / 500 GB); a unit is required so the stored value is unambiguous.IAppConfig::getDetails(). Selecting it removes the override so the preset default applies again.Backend:
ConfiggainsgetGuestQuota(),hasGuestQuotaOverride(),getGuestQuotaDefault()andsetGuestQuota();SettingsController::getConfig()returnsguestQuota(thedefaultsentinel when no override is stored) andguestQuotaDefault, andsetConfig()accepts and validatesguestQuota(computerFileSize). The existingGuestManageralready appliesguest_quotaon guest creation, so no behaviour change there.Closes #1601
Testing
Notes
The allowlist fix is also relevant to the 4.7 line (same as fix(settings): use @update:modelValue so admin switches save again #1598); a backport may be wanted.
New user-facing strings are added in the usual places for translation.
Also corrects three README links that still pointed to the removed
masterbranch (nowmain).The content of this PR was partly generated using AI
Screenshots: