stable

Clone or download

Read-only

feat: Initiate display of project restrictions

This change targets the site administrators for ONLYOFFICE document servers administration. No functional changes are expected for end users: they are still able to edit document in OO (according to project restriction). Go to site admin ยป ONLYOFFICE. *Note:* in order to test this contribution, you will need to manually update the following tables: * plugin_onlyoffice_document_server * plugin_onlyoffice_document_server_project_restriction The restriction is readonly. Update will come in dedicated contributions. Project restriction =================== Note: it has been decided to not reuse existing mechanism for resources restriction (plugins, git mirrors, โ€ฆ) because behavior is differing here: * one project cannot use more than one server * servers cannot be unrestricted if there are more than one server Integrating those limits in existing mechanism while keeping it generic is not worth it. One server is configured ------------------------ (Default situation since we cannot add more than one server yet.) If server is not restricted, then: * A badge is displayed in the table telling us that all projects can use the server. * The restrict modal displays a checkbox to allow all projects. This checkbox is checked, but disabled. If server is restricted, then: * The badge in the table displays the number of allowed projects. * The restrict modal displays a checkbox to allow all projects. This checkbox is unchecked, but disabled. The list of allowed projects (if any) is also displayed. Two (or more) servers are configured ------------------------------------ Every servers are considered restricted, this means that: * The badge in the table always displays the number of allowed projects. * The restrict modal does not display the checkbox anymore (we cannot unrestrict a server when there are more than one). The list of allowed projects is still displayed. Bonus: Missing secret badge =========================== If a server is configured without a secret, a warning badge is displayed to bring attention to the administrator. This behavior is changed because having no secret is not a normal situation (there is only two ways to end up in this situation: manipulate the database by hand or have broken configuration with previous config-set usage). No need to display a check mark for every server in a normal situation, it clutters the interface. Part of story #29981: restrict an OnlyOffice server to some projects only Change-Id: I7c5c4f72259728fc3bc2ca0f58f6c589a99c6b17

Modified Files

Name
M plugins/onlyoffice/include/Administration/OnlyOfficeAdminSettingsPresenter.php +6 โˆ’2 Go to diff View file
M plugins/onlyoffice/include/Administration/OnlyOfficeServerPresenter.php +19 โˆ’2 Go to diff View file
A plugins/onlyoffice/include/Administration/RestrictedProjectPresenter.php +44 โˆ’0 Go to diff View file
M plugins/onlyoffice/include/DocumentServer/DocumentServer.php +5 โˆ’5 Go to diff View file
M plugins/onlyoffice/include/DocumentServer/DocumentServerDao.php +44 โˆ’12 Go to diff View file
A plugins/onlyoffice/include/DocumentServer/RestrictedProject.php +33 โˆ’0 Go to diff View file
M plugins/onlyoffice/scripts/onlyoffice-siteadmin.ts +1 โˆ’4 Go to diff View file
M plugins/onlyoffice/site-content/fr_FR/LC_MESSAGES/tuleap-onlyoffice.po +35 โˆ’5 Go to diff View file
M plugins/onlyoffice/site-content/pr_BR/LC_MESSAGES/tuleap-onlyoffice.po +32 โˆ’3 Go to diff View file
M plugins/onlyoffice/templates/site-admin.mustache +115 โˆ’16 Go to diff View file
M plugins/onlyoffice/tests/unit/Administration/OnlyOfficeAvailabilityCheckerTest.php +9 โˆ’1 Go to diff View file
M plugins/onlyoffice/tests/unit/DocumentServer/DocumentServerTest.php +8 โˆ’1 Go to diff View file
M src/themes/tlp/src/scss/components/_tables.scss +4 โˆ’0 Go to diff View file