Skip to content

feat: add web-based admin interface for resource and room management#224

Open
xXRoxXeRXx wants to merge 9 commits intonextcloud:mainfrom
xXRoxXeRXx:Webinterface
Open

feat: add web-based admin interface for resource and room management#224
xXRoxXeRXx wants to merge 9 commits intonextcloud:mainfrom
xXRoxXeRXx:Webinterface

Conversation

@xXRoxXeRXx
Copy link
Copy Markdown

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

  • Vue 3 Admin Interface with modern Nextcloud design components (@nextcloud/vue)
  • Multi-language support (German/English) using Nextcloud l10n system
  • CRUD operations for Buildings, Stories, Rooms, and Resources via web UI
  • Real-time cache invalidation for immediate calendar updates
  • Admin delegation support (IDelegatedSettings implementation)
  • Extended room properties:
    • Capacity (number of persons)
    • Contact Person (User ID)
    • Room Number
    • Equipment flags (Phone, Video Conferencing, TV, Projector, Whiteboard)
    • Wheelchair accessibility

Backend Improvements

  • New AdminController with REST API endpoints for all CRUD operations
  • BuildingService for building management
  • Optional dependency injection for IRoomManager and IResourceManager (prevents errors when Calendar app is not installed)
  • Proper error handling and validation
  • Cache invalidation after room/resource creation

Frontend

  • Built with Vue 3 Composition API and Vite
  • Components: CalendarResourceAdmin.vue, adminSettings.js
  • Translation files: l10n/de_DE.js, l10n/de_DE.json
  • Responsive design with Nextcloud variables
  • Form validation with user-friendly German/English error messages

Database Schema Extensions

  • Added optional room properties to 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

  • SPDX license headers added to all new files
  • Follows Nextcloud coding standards
  • No breaking changes to existing CLI functionality
  • Backward compatible with existing data

Testing

Tested on:

  • ✅ Nextcloud 32.0.0
  • ✅ PHP 8.1+
  • ✅ PostgreSQL database

Screenshots

callendar_nextcloud

Checklist

  • Code follows Nextcloud coding standards
  • SPDX headers added to all new files
  • Conventional Commits format used
  • Multi-language support implemented (DE/EN)
  • No breaking changes
  • Tested on production-like environment
  • Admin delegation support added
  • Documentation updated (inline comments)

- 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>
@@ -0,0 +1,265 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<?php
<?php
declare(strict_types=1);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

@@ -0,0 +1,265 @@
<?php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPDX is missing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

@@ -0,0 +1,32 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<?php
<?php
declare(strict_types=1);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

@@ -0,0 +1,49 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<?php
<?php
declare(strict_types=1);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

@@ -0,0 +1,32 @@
<?php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPDX missing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

@@ -0,0 +1,49 @@
<?php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPDX missing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

package.json Outdated
@@ -0,0 +1,18 @@
{
"name": "calendar-resource-management-frontend",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "calendar-resource-management-frontend",
"name": "calendar-resource-management",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 4c25746

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>
@SebastianKrupinski
Copy link
Copy Markdown
Contributor

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


return [
'routes' => [
// API-Endpunkte für Räume und Ressourcen
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All comments should be in English


declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Marcel Meyer <meyerm@strato.de>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All copy rights should be:

/**

  • SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
  • SPDX-License-Identifier: AGPL-3.0-or-later
    */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not mimify the css it makes it hard to read

l10n/de.json Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not include translation files in the PR, we have a service that creates these they should not be manually created.

return;
}

const response = await fetch(OC.generateUrl('/apps/calendar_resource_management/admin/buildings'), {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove please

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed

id: building.id,
label: building.name
}));
console.log('Buildings loaded:', this.buildings);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the console.log s use console.debug instead, if needed

},
async addBuilding() {
if (!this.newBuildingName) {
alert(this.t('Please enter a building name!'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
async addStory() {
if (!this.newStoryName) {
alert(this.t('Please enter a story name!'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

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?'))) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ncDialog instead

this.loadRooms();
},
async deleteRoom(id) {
await fetch(OC.generateUrl(`/apps/calendar_resource_management/admin/rooms/${id}`), {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use of nextcloud/axios is recommended here

- 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
@xXRoxXeRXx
Copy link
Copy Markdown
Author

Hi @SebastianKrupinski @hamza221,

Thank you for the thorough review! I've addressed all feedback points in commit 00ca29e

Changes made:
All comments translated to English (routes.php, AdminController, AdminSettings, Services)
SPDX Copyright → Nextcloud GmbH and Nextcloud contributors in all files
CSS file removed — styles are injected via JS bundle (using vite-plugin-css-injected-by-js through createAppConfig)
App icon replaced — now shows a meeting room/door icon instead of the calendar icon
l10n files removed — will be handled by Transifex
API calls extracted into [adminService.js] using @nextcloud/axios and @nextcloud/router
commit_msg.txt and package-lock.json.license removed
npm scripts added dev, watch, lint, lint:fix, stylelint, stylelint:fix
Standardized vite config — using createAppConfig() from @nextcloud/vite-config
console.log removed — replaced with console.debug where needed
alert() → showError() from @nextcloud/dialogs
confirm() → NcDialog component with proper buttons
fetch() → @nextcloud/axios
Manual registerService() calls removed — using Nextcloud's automatic dependency injection

Please let me know if there's anything else that needs adjustment.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants