feat: add web-based admin interface for resource and room management#224
feat: add web-based admin interface for resource and room management#224xXRoxXeRXx wants to merge 9 commits intonextcloud:mainfrom
Conversation
- Added complete Vue 3 frontend with Vite build system - Implemented admin UI for Buildings, Stories, Rooms, and Resources - Fixed Vue reactivity issues with dropdown selections (buildingOptions/storyOptions as data properties) - Added professional CSS styling with Nextcloud theme integration - Implemented cache invalidation via IRoomManager/IResourceManager - Fixed getAllRooms() and getAllResources() to return actual data - Added AdminController with optional manager dependencies - Cleaned up excessive debug logging for production - Added routes for REST API endpoints - Created AdminSettings integration
…and equipment flags (phone, video, TV, projector, whiteboard, wheelchair accessible)
…dation - Removed HTML5 required attributes from all form fields (Gebäude, Stockwerke, Räume, Ressourcen) - Added placeholder='Pflichtfeld' for visual indication of required fields - Implemented programmatic validation in addBuilding(), addStory(), addRoom(), addResource() - Prevents red border issue on input fields after successful form submission - Provides clear German error messages via alert() dialogs
- Implemented translation system following Nextcloud standards (like integration_mattermost) - Created l10n files: de_DE.js, de_DE.json, en.js, en.json - Wrapped t() and n() functions with auto-injection of app name in adminSettings.js - All UI strings now translatable (50+ translation keys) - Removed hardcoded German strings from Vue template - Fixed UTF-8 encoding issues for German umlauts - Supports automatic language detection based on Nextcloud user settings - German translations: Gebäude, Stockwerke, Räume, Ressourcen, etc. - English translations: Buildings, Stories, Rooms, Resources, etc.
Add SPDX-FileCopyrightText and SPDX-License-Identifier headers to all frontend source files according to Nextcloud contribution guidelines. Files updated: - src/CalendarResourceAdmin.vue - src/adminSettings.js - l10n/de_DE.js All files use AGPL-3.0-or-later license to match the project license. Signed-off-by: Marcel Meyer <meyerm@strato.de>
lib/Controller/AdminController.php
Outdated
| @@ -0,0 +1,265 @@ | |||
| <?php | |||
There was a problem hiding this comment.
| <?php | |
| <?php | |
| declare(strict_types=1); |
lib/Controller/AdminController.php
Outdated
| @@ -0,0 +1,265 @@ | |||
| <?php | |||
|
|
|||
lib/Settings/AdminSection.php
Outdated
| @@ -0,0 +1,32 @@ | |||
| <?php | |||
There was a problem hiding this comment.
| <?php | |
| <?php | |
| declare(strict_types=1); |
lib/Settings/AdminSettings.php
Outdated
| @@ -0,0 +1,49 @@ | |||
| <?php | |||
There was a problem hiding this comment.
| <?php | |
| <?php | |
| declare(strict_types=1); |
lib/Settings/AdminSection.php
Outdated
| @@ -0,0 +1,32 @@ | |||
| <?php | |||
|
|
|||
lib/Settings/AdminSettings.php
Outdated
| @@ -0,0 +1,49 @@ | |||
| <?php | |||
|
|
|||
package.json
Outdated
| @@ -0,0 +1,18 @@ | |||
| { | |||
| "name": "calendar-resource-management-frontend", | |||
There was a problem hiding this comment.
| "name": "calendar-resource-management-frontend", | |
| "name": "calendar-resource-management", |
Addresses code review feedback from @kesselb in nextcloud#224: - Add SPDX-FileCopyrightText and SPDX-License-Identifier to: * lib/Controller/AdminController.php * lib/Settings/AdminSection.php * lib/Settings/AdminSettings.php - Add declare(strict_types=1) to all PHP files - Rename package.json name to 'calendar-resource-management' References: nextcloud#58 Signed-off-by: Marcel Meyer <meyerm@strato.de>
This commit addresses all CI failures in nextcloud#224: 1. REUSE Compliance: - Add Apache-2.0 license file to LICENSES/ - Add SPDX headers to: routes.php, vite.config.mjs, css file - Add .license files for JSON and lock files - Add license field to package.json 2. XML Schema Compliance: - Move <icon> element before <category> in info.xml 3. PHP Coding Style: - Run composer cs:fix on all PHP files - Apply PSR-12 formatting standards All files now comply with Nextcloud contribution requirements. Signed-off-by: Marcel Meyer <meyerm@strato.de>
|
Hi @xXRoxXeRXx Thank you for taking the time to create this PR. We are not against this change but there are a few changes, I will send a review soon |
appinfo/routes.php
Outdated
|
|
||
| return [ | ||
| 'routes' => [ | ||
| // API-Endpunkte für Räume und Ressourcen |
There was a problem hiding this comment.
All comments should be in English
appinfo/routes.php
Outdated
|
|
||
| declare(strict_types=1); | ||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Marcel Meyer <meyerm@strato.de> |
There was a problem hiding this comment.
All copy rights should be:
/**
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
*/
css/calendar-resource-admin.css
Outdated
There was a problem hiding this comment.
Please do not mimify the css it makes it hard to read
l10n/de.json
Outdated
There was a problem hiding this comment.
Do not include translation files in the PR, we have a service that creates these they should not be manually created.
src/CalendarResourceAdmin.vue
Outdated
| return; | ||
| } | ||
|
|
||
| const response = await fetch(OC.generateUrl('/apps/calendar_resource_management/admin/buildings'), { |
There was a problem hiding this comment.
Calls like this should be in a separate file with a unified transmitter method instead of all being embedded in the vue file
Example
https://github.com/nextcloud/calendar/blob/main/src/services/proposalService.ts
commit_msg.txt
Outdated
package-lock.json.license
Outdated
There was a problem hiding this comment.
This should not be needed
src/CalendarResourceAdmin.vue
Outdated
| id: building.id, | ||
| label: building.name | ||
| })); | ||
| console.log('Buildings loaded:', this.buildings); |
There was a problem hiding this comment.
Please remove the console.log s use console.debug instead, if needed
src/CalendarResourceAdmin.vue
Outdated
| }, | ||
| async addBuilding() { | ||
| if (!this.newBuildingName) { | ||
| alert(this.t('Please enter a building name!')); |
There was a problem hiding this comment.
Use showError from https://github.com/nextcloud-libraries/nextcloud-dialogs
src/CalendarResourceAdmin.vue
Outdated
| }, | ||
| async addStory() { | ||
| if (!this.newStoryName) { | ||
| alert(this.t('Please enter a story name!')); |
src/CalendarResourceAdmin.vue
Outdated
| await this.loadStories(); // Also reload stories as they might be affected | ||
| }, | ||
| async deleteStory(id) { | ||
| if (!confirm(this.t('Do you really want to delete this story?'))) { |
src/CalendarResourceAdmin.vue
Outdated
| this.loadRooms(); | ||
| }, | ||
| async deleteRoom(id) { | ||
| await fetch(OC.generateUrl(`/apps/calendar_resource_management/admin/rooms/${id}`), { |
- Translate all comments to English - Update SPDX copyright to Nextcloud GmbH and Nextcloud contributors - Remove CSS file, inject styles via JS bundle (inlineCSS) - Replace calendar icon with meeting room icon - Remove l10n files (handled by Transifex) - Extract API calls into src/services/adminService.js - Use @nextcloud/axios instead of fetch() - Use @nextcloud/router instead of OC.generateUrl() - Replace alert() with showError() from @nextcloud/dialogs - Replace confirm() with NcDialog component - Remove console.log statements - Remove commit_msg.txt and package-lock.json.license - Remove LICENSES/Apache-2.0.txt (not needed) - Remove <javascript> tag from info.xml - Add npm scripts (build, dev, watch, lint, stylelint) - Use createAppConfig() from @nextcloud/vite-config - Remove manual registerService() calls (auto DI) - Hide table headers when no data (v-if) - Use strict equality (===) for comparisons - Rename appName to appId to avoid createAppConfig collision
|
Hi @SebastianKrupinski @hamza221, Thank you for the thorough review! I've addressed all feedback points in commit 00ca29e Changes made: Please let me know if there's anything else that needs adjustment. |
|
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.) |
Summary
This PR implements a comprehensive web-based admin interface for managing calendar resources and rooms, addressing the feature request in #58. The interface allows delegated admins to manage buildings, stories, rooms, and resources without requiring command-line access.
Changes
New Features
Backend Improvements
AdminControllerwith REST API endpoints for all CRUD operationsBuildingServicefor building managementIRoomManagerandIResourceManager(prevents errors when Calendar app is not installed)Frontend
CalendarResourceAdmin.vue,adminSettings.jsl10n/de_DE.js,l10n/de_DE.jsonDatabase Schema Extensions
RoomModel:room_number(VARCHAR)contact_person_user_id(VARCHAR)capacity(INTEGER)has_phone(BOOLEAN)has_video_conferencing(BOOLEAN)has_tv(BOOLEAN)has_projector(BOOLEAN)has_whiteboard(BOOLEAN)Code Quality
Testing
Tested on:
Screenshots
Checklist