feat(admin): add admin settings for file sharing options#136
Conversation
Admins can now configure which sharing options (upload, public link, internal link) are available to users, and which one is pre-selected by default in the send files dialog. If nothing is configured, behavior is unchanged: all three options are available and the upload option is pre-selected. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Ritou <thomas@ritou.me>
9ddc97f to
d465960
Compare
There was a problem hiding this comment.
thanks for the PR, it works beautifully!
one thing to note is that the restriction is made only in the frontend. The php backend still allows the requests to pass without checking the admin config.
The config values should be fetched and checks should be performed in
| $adminConfig = [ | ||
| 'send_type_enabled_file' => $this->config->getAppValue(Application::APP_ID, 'send_type_enabled_file', '1') === '1', | ||
| 'send_type_enabled_public_link' => $this->config->getAppValue(Application::APP_ID, 'send_type_enabled_public_link', '1') === '1', | ||
| 'send_type_enabled_internal_link' => $this->config->getAppValue(Application::APP_ID, 'send_type_enabled_internal_link', '1') === '1', | ||
| 'send_type_default' => $this->config->getAppValue(Application::APP_ID, 'send_type_default', ''), | ||
| ]; | ||
| $this->initialStateService->provideInitialState('admin-config', $adminConfig); |
There was a problem hiding this comment.
this would read and inject these values in every page of nextcloud so is a bit wasteful
it would be better to add a #[NoAdminRequired] path in ConfigController.php to read them from the filesplugin.js file
| send_type_default: '', | ||
| } | ||
| try { | ||
| adminConfig = loadState('integration_zulip', 'admin-config', adminConfig) |
There was a problem hiding this comment.
generateUrl() can be done here and then an axios request to read the admin config values
| <div v-if="enabledSendTypes.length > 1" class="default-type-section"> | ||
| <h3>{{ t('integration_zulip', 'Default sharing option') }}</h3> | ||
| <p class="settings-hint"> | ||
| {{ t('integration_zulip', 'Select which option is pre-selected when users open the sharing dialog.') }} |
There was a problem hiding this comment.
what do you think about having this section still visible when only one send option is available?
it could just show that one option selected to be more explicit but maybe that is already quite evident from the list above?
There was a problem hiding this comment.
I think it's pretty obvious, that's why it's hidden. But maybe a better UI design would be to have this part always visible and to disable unavailable choices?
There was a problem hiding this comment.
yeah that could work too.
but it's just a nitpick, feel free to ignore if the current design feels good to you.
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
Thank you for your code review. I don't have much time available right now but I will improve my PR with your insights as soon as possible. |
This is my answer to #128
Admins can now configure which sharing options (upload, public link, internal link) are available to users, and which one is pre-selected by default in the send files dialog.
If nothing is configured, behavior is unchanged: all three options are available and the upload option is pre-selected.
Assisted-by: Claude Sonnet 4.6 noreply@anthropic.com
🤖 AI (if applicable)