-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin page split #796
Admin page split #796
Conversation
* interfaces for the Admin settings (IAdmin) and section (ISection) * SettingsManager service * example setup with LDAP app
@blizzz, thanks for your PR! By analyzing the annotation information on this pull request, we identified @nickvergessen, @DeepDiver1975 and @LukasReschke to be potential reviewers |
Just had a quick look, looks good from a technical point of view. Finally we can get rid of the I will try to transfer the monitoring app to a admin settings page tomorrow, that's the best way to test a new API 😃 |
Is there a fall back for apps we can't adjust in time. We don't have to much time left and we also need to keep 3rdparty apps from the app store in mind. |
The plan is to keep this old-style of collecting the forms supported by stashing them into "Additional Settings". |
</field> | ||
|
||
<index> | ||
<name>admin_sections_id_index</name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💣 💣 💣 💣 💣 💣 💣 💣 - already used in https://github.com/nextcloud/server/pull/796/files#diff-1d1f96f9afa7544b553d6441f7a3c167R2010, this will fail on many databases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be admin_settings_id_index
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LukasReschke this should be admin_settings_id_index. Important catch! 🏆
@@ -0,0 +1,5 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be there, commited by mistake
@@ -64,6 +64,8 @@ | |||
['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], | |||
['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'], | |||
['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], | |||
['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']], | |||
['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet
Went over the code quickly already, not a final review since WIP. But looks already pretty awesome 🚀 |
cc @BernhardPosselt you've shown interest on IRC recently |
I'll test this by porting the SAML app. PR incoming as well. |
* | ||
* E.g.: 70 | ||
*/ | ||
public function getPriority(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need getPriority() min ISection and in IAdmin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One is to sort the Sections in the sidebar, the other to sort the settings forms within the selected section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, forget that we can also group multiple settings from different apps in one section.
Probably just a typo, but we should unify it. Here it says "value between 0 and 100" and for the ISection it says "value between 0 and 99"
I run into a table not found exception when I just switched to this branch. Forget to increase version to trigger db update? |
if I go to the sharing settings I get this error in the nextcloud.log:
|
If I start with a complete fresh installation my app (ServerInfo) doesn't get added to the admin page. I first have to increase the version in the info.xml to run the update for the app at least once. New apps should be added directly. |
If I change the priority, both in the IAdmin and the ISettings implementation and increase the version number in the info.xml the update will add the same app a second time to oc_admin_settings with the new priority. I would expect that it gets replaced. In oc_admin_section nothing change, I still have only one entry with the previous priority. But maybe this is not needed anyway, see my question here #796 (comment) |
Sorry for the many comments. But this was just the stuff I discovered while creating the admin page for the ServerInfo app. Beside that it was super easy and the API feels really good! |
Currently working on switching from OCP\Template to TemplateResponse as return value form IAdmin, because it's nicer and already present in several apps. Changed user_ldap locally successful, now trying to adjust updatenotifications, where i somewhat struggle with autoloading yet. UPDATE: done |
* bump version to ensure tables are created * make updatenotification app use settings api * change IAdmin::render() to getForm() and change return type from Template to TemplateResponse * adjust User_LDAP accordingly, as well as built-in forms * add IDateTimeFormatter to AppFramework/DependencyInjection/DIContainer.php. This is important so that \OC::$server->query() is able to resolve the constructor parameters. We should ensure that all OCP/* stuff that is available from \OC::$server is available here. Kudos to @LukasReschke * make sure apps that have settings info in their info.xml are loaded before triggering adding the settings setup method
Makes this page a single page as implemented in nextcloud/server#796
Makes this page a single page as implemented in nextcloud/server#796
No, they are split up. Some parts are in Server, some are in Additional Setting. And Sharing settings are in Sharing. |
@schiessle wrong link? |
yes, I was to fast and edited my comment right before you commented... Still it seems like we removed here setting parameters from the general admin page which we added in no other place. At least I discovered it for sharing and just at the moment for encryption: https://github.com/nextcloud/server/pull/796/files#diff-7ce542aade9c380d3b2e16162d559256L132 So the encryption settings no longer show the encryption modules. |
@blizzz why do you still see the old link? 😕 Edited the post directly after I created it... This is the correct link: #796 (comment) |
@schiessle thx for re-checking, will fix it. |
@schiessle done |
Conflicts :) |
✌️ |
looks good now 👍 |
LGTM |
Oh. Backporting this is fun 😨 – So many conflicts… |
Backport attempt at #894, let's see… |
Use new admin page module Makes this page a single page as implemented in nextcloud/server#796 specify namespace for autoloader IAdmin is now ISettings
Admin page split
To solve #712
This is not complete, yet, but in a working state with build-in settings and the LDAP one as a 3rd party app using this.
Right now it still does full-page loads, at least there's a route registered to fetch a desired section, needs to be implemented.
Screenshots:
Tasks left:
don't do a full page reload when switching sections(Admin page split #796 (comment))cream on top (and too much for this PR, yet 10): search for settings(postponed)Input already welcome @schiessle @jancborchardt and from others of course, too.