diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f13e0ae1..cfc20b094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Option in room file management to always use system-wide default presentation ([#2662], [#2746]) +- Option in room file management to set system-wide default presentation as default ([#2662], [#2746]) + ### Changed - Internal improvements to room authentication flow ([#1409], [#2726]) @@ -674,10 +679,12 @@ You can find the changelog for older versions there [here](https://github.com/TH [#2613]: https://github.com/THM-Health/PILOS/pull/2613 [#2616]: https://github.com/THM-Health/PILOS/pull/2616 [#2660]: https://github.com/THM-Health/PILOS/issues/2660 +[#2662]: https://github.com/THM-Health/PILOS/issues/2662 [#2686]: https://github.com/THM-Health/PILOS/pull/2686 [#2726]: https://github.com/THM-Health/PILOS/pull/2726 [#2728]: https://github.com/THM-Health/PILOS/pull/2728 [#2742]: https://github.com/THM-Health/PILOS/pull/2742 +[#2746]: https://github.com/THM-Health/PILOS/pull/2746 [#2751]: https://github.com/THM-Health/PILOS/issues/2751 [#2752]: https://github.com/THM-Health/PILOS/pull/2752 [#2765]: https://github.com/THM-Health/PILOS/issues/2765 diff --git a/app/Http/Controllers/api/v1/RoomFileController.php b/app/Http/Controllers/api/v1/RoomFileController.php index 2d45bcbf8..dd6500e58 100644 --- a/app/Http/Controllers/api/v1/RoomFileController.php +++ b/app/Http/Controllers/api/v1/RoomFileController.php @@ -5,9 +5,11 @@ use App\Http\Controllers\Controller; use App\Http\Requests\StoreRoomFile; use App\Http\Requests\UpdateRoomFile; +use App\Http\Requests\UpdateRoomSystemDefaultPresentation; use App\Http\Resources\PrivateRoomFile; use App\Models\Room; use App\Models\RoomFile; +use App\Settings\BigBlueButtonSettings; use App\Settings\GeneralSettings; use Illuminate\Http\Request; use Illuminate\Support\Facades\Gate; @@ -67,6 +69,11 @@ public function index(Room $room, Request $request) // If user is allowed to view all files, return PrivateRoomFile resource to show additional information if (Gate::allows('viewAllFiles', $room)) { $additional['default'] = $room->files()->where('default', true)->first(); + $additional['system_default'] = [ + 'file' => app(BigBlueButtonSettings::class)->default_presentation, + 'use_in_meeting' => $room->use_system_default_presentation_in_meeting, + 'use_as_default' => $room->use_system_default_presentation_as_default, + ]; return PrivateRoomFile::collection($resource->paginate(app(GeneralSettings::class)->pagination_page_size))->additional($additional); } @@ -103,22 +110,26 @@ public function store(Room $room, StoreRoomFile $request) public function update(UpdateRoomFile $request, Room $room, RoomFile $file) { if ($request->has('use_in_meeting')) { - $file->use_in_meeting = $request->use_in_meeting; - // If no default file for this room is set, set this file as default - if (! $room->files()->where('default', true)->exists()) { - $file->default = true; - } + $file->use_in_meeting = $request->boolean('use_in_meeting'); } if ($request->has('download')) { - $file->download = $request->download; + $file->download = $request->boolean('download'); } - if ($request->has('default') && $request->default === true) { - // Make other files not the default - $room->files()->update(['default' => false]); - // Set this file as default - $file->default = true; + if ($request->has('default')) { + if ($request->boolean('default') === false) { + $file->default = false; + } else { + // Make other files not the default + $room->files()->whereNot('id', $file->id)->update(['default' => false]); + // Set this file as default + $file->default = true; + + // If a file is set as default, the system default presentation must not be used as default + $room->use_system_default_presentation_as_default = false; + $room->save(); + } } $file->save(); @@ -130,6 +141,33 @@ public function update(UpdateRoomFile $request, Room $room, RoomFile $file) return response()->noContent(); } + public function updateSystemDefault(UpdateRoomSystemDefaultPresentation $request, Room $room) + { + if ($request->has('use_in_meeting')) { + $room->use_system_default_presentation_in_meeting = $request->use_in_meeting; + } + + if ($request->has('default')) { + // Make other files not the default + if ($request->default === true) { + $room->files()->update(['default' => false]); + + // If system default is set as default, it must also be used in the next meeting + $room->use_system_default_presentation_in_meeting = true; + } + + $room->use_system_default_presentation_as_default = $request->default; + } + + $room->save(); + + Log::info('Changed system default presentation settings in room {room}', ['room' => $room->getLogLabel()]); + + $room->updateDefaultFile(); + + return response()->noContent(); + } + /** * Remove the specified file from storage and database. * diff --git a/app/Http/Requests/UpdateRoomSystemDefaultPresentation.php b/app/Http/Requests/UpdateRoomSystemDefaultPresentation.php new file mode 100644 index 000000000..7fa8c5917 --- /dev/null +++ b/app/Http/Requests/UpdateRoomSystemDefaultPresentation.php @@ -0,0 +1,16 @@ + ['required', 'boolean'], + 'default' => ['required', 'boolean'], + ]; + } +} diff --git a/app/Models/Room.php b/app/Models/Room.php index 70591c156..fecac4533 100644 --- a/app/Models/Room.php +++ b/app/Models/Room.php @@ -6,6 +6,7 @@ use App\Enums\RoomUserRole; use App\Enums\RoomVisibility; use App\Observers\RoomObserver; +use App\Settings\BigBlueButtonSettings; use App\Settings\GeneralSettings; use App\Traits\AddsModelNameTrait; use Illuminate\Database\Eloquent\Attributes\ObservedBy; @@ -28,6 +29,8 @@ protected function casts() { $casts = [ 'expert_mode' => 'boolean', + 'use_system_default_presentation_in_meeting' => 'boolean', + 'use_system_default_presentation_as_default' => 'boolean', 'delete_inactive' => 'datetime', ]; @@ -201,7 +204,18 @@ public function updateDefaultFile() $currentDefault->default = false; $currentDefault->save(); } - // If any other files are found that are used in the next meeting, select the first one to become new default + + // If system has a default presentation and the system presentation is always available + // use system default presentation as default presentation for the next meeting + if (app(BigBlueButtonSettings::class)->default_presentation && $this->use_system_default_presentation_in_meeting) { + $this->use_system_default_presentation_as_default = true; + $this->save(); + + return; + } + + // If no default file is explicitly set or the system default is not enabled + // look for the first file that is set to be used in the meeting and set it as default $newDefaultFile = $this->files()->firstWhere('use_in_meeting', true); if ($newDefaultFile != null) { $newDefaultFile->default = true; diff --git a/app/Services/MeetingService.php b/app/Services/MeetingService.php index 5bccd3edb..3b65fe8f0 100644 --- a/app/Services/MeetingService.php +++ b/app/Services/MeetingService.php @@ -104,7 +104,13 @@ public function start(): ?\BigBlueButton\Responses\CreateMeetingResponse $meetingParams->addMeta('bbb-origin', 'PILOS'); $meetingParams->addMeta('pilos-sub-spool-dir', config('recording.spool-sub-directory')); - // get files that should be used in this meeting and add links to the files + // Use system default presentation as default, if explicitly set + $useSystemDefaultFileAsDefault = app(BigBlueButtonSettings::class)->default_presentation && $this->meeting->room->use_system_default_presentation_as_default; + if ($useSystemDefaultFileAsDefault) { + $meetingParams->addPresentation(app(BigBlueButtonSettings::class)->default_presentation); + } + + // Get files that should be used in this meeting and add links to the files $files = $this->meeting->room->files()->where('use_in_meeting', true)->orderBy('default', 'desc')->get(); foreach ($files as $file) { // Create file download url @@ -117,7 +123,12 @@ public function start(): ?\BigBlueButton\Responses\CreateMeetingResponse $meetingParams->addPresentation($fileUrl, null, preg_replace("/[^A-Za-z0-9.-_\(\)]/", '', $file->filename)); } - if (empty($meetingParams->getPresentations()) && app(BigBlueButtonSettings::class)->default_presentation) { + // Add system default presentation + // Only add it, if not already added as default file + // and if no other files are present or the room is set to use the system default in meetings + if (! $useSystemDefaultFileAsDefault && app(BigBlueButtonSettings::class)->default_presentation && ( + empty($files->toArray()) || $this->meeting->room->use_system_default_presentation_in_meeting + )) { $meetingParams->addPresentation(app(BigBlueButtonSettings::class)->default_presentation); } diff --git a/database/migrations/2026_01_19_105554_add_use_system_default_presentation_in_next_meeting_to_rooms_table.php b/database/migrations/2026_01_19_105554_add_use_system_default_presentation_in_next_meeting_to_rooms_table.php new file mode 100644 index 000000000..0898003e7 --- /dev/null +++ b/database/migrations/2026_01_19_105554_add_use_system_default_presentation_in_next_meeting_to_rooms_table.php @@ -0,0 +1,39 @@ +boolean('use_system_default_presentation_in_meeting')->default(true); + $table->boolean('use_system_default_presentation_as_default')->default(true); + }); + + RoomFile::where('default', true) + ->where('use_in_meeting', true) + ->each(function (RoomFile $file) { + $file->room->use_system_default_presentation_as_default = false; + $file->room->save(); + }); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('rooms', function (Blueprint $table) { + $table->dropColumn('use_system_default_presentation_in_meeting'); + $table->dropColumn('use_system_default_presentation_as_default'); + }); + } +}; diff --git a/lang/en/rooms.php b/lang/en/rooms.php index d09571019..762240725 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -107,12 +107,14 @@ 'feature_disabled_system' => ':name is disabled. Please contact the administrator.', 'files' => [ 'confirm_delete' => 'Do you want to delete this file :filename?', - 'default' => 'Default', + 'default' => 'Default presentation', 'delete' => 'Delete file', - 'download_hidden' => 'Download hidden', - 'download_visible' => 'Download visible', + 'download_allowed' => 'Download allowed', + 'download_not_allowed' => 'Download not allowed', 'downloadable' => 'Downloadable', - 'edit' => 'Edit file', + 'configure' => 'Configure file', + 'configure_dialog_title' => 'Configure ":name"', + 'configure_system_default' => 'Configure system-wide default presentation', 'filter' => [ 'all' => 'All files', 'downloadable' => 'Downloadable files', @@ -126,6 +128,8 @@ 'filename' => 'Filename', 'uploaded_at' => 'Added', ], + 'system_default' => 'System-wide default presentation', + 'system_default_description' => 'Automatically used when no other presentation is enabled for the next video conference', 'terms_of_use' => [ 'accept' => 'I accept the terms of use', 'required' => 'You must accept the terms of use before downloading this file.', @@ -134,8 +138,9 @@ 'title' => 'Files', 'upload' => 'Upload files', 'uploaded' => 'File \':name\' uploaded', - 'use_in_next_meeting' => 'Use in the next meeting', - 'use_in_next_meeting_disabled' => 'Not available in video conference', + 'always_available_in_meeting' => 'Always available in next video conference', + 'available_in_next_meeting' => 'Available in next video conference', + 'not_available_in_next_meeting' => 'Not available in next video conference', 'view' => 'View file', ], 'first_and_lastname' => 'First- and last name', diff --git a/resources/css/override/_animations.css b/resources/css/override/_animations.css index 2930e5735..e1f316049 100644 --- a/resources/css/override/_animations.css +++ b/resources/css/override/_animations.css @@ -8,3 +8,8 @@ animation-duration: 0s !important; } } + +.inline-note.p-message-enter-active, +.inline-note.p-message-leave-active { + animation-duration: 0s !important; +} diff --git a/resources/js/components/InlineNote.vue b/resources/js/components/InlineNote.vue index 24f03ceec..43198b660 100644 --- a/resources/js/components/InlineNote.vue +++ b/resources/js/components/InlineNote.vue @@ -8,7 +8,11 @@ defineProps({ diff --git a/resources/js/components/RoomTabFiles.vue b/resources/js/components/RoomTabFiles.vue index d8c0bf02a..b84e6b744 100644 --- a/resources/js/components/RoomTabFiles.vue +++ b/resources/js/components/RoomTabFiles.vue @@ -43,6 +43,20 @@ + +
@@ -199,6 +213,18 @@

{{ item.filename }}

+
+ +
+
@@ -212,14 +238,20 @@ class="flex flex-col items-start gap-2" >
- -

- {{ - $t("rooms.files.download_visible") - }} - {{ - $t("rooms.files.download_hidden") - }} + +

+ +

@@ -228,24 +260,18 @@ class="flex flex-col items-start gap-2" >
- - -

- {{ - $t("rooms.files.use_in_next_meeting") - }} - {{ - $t("rooms.files.use_in_next_meeting_disabled") - }} + +

- {{ $t("rooms.files.default") }} - + v-if="item.download" + severity="success" + :value="$t('rooms.files.download_allowed')" + /> +

@@ -263,7 +289,7 @@ !downloadAgreement && requireAgreement " /> - [ { name: t("rooms.files.sort.filename"), value: "filename" }, { name: t("rooms.files.sort.uploaded_at"), value: "uploaded" }, @@ -400,6 +432,7 @@ function loadData(page = null) { // Fetch successful files.value = response.data.data; defaultFile.value = response.data.default; + systemDefault.value = response.data.system_default; paginator.updateMeta(response.data.meta).then(() => { if (paginator.isOutOfRange()) { loadData(paginator.getLastPage()); diff --git a/resources/js/components/RoomTabFilesEditButton.vue b/resources/js/components/RoomTabFilesConfigureButton.vue similarity index 83% rename from resources/js/components/RoomTabFilesEditButton.vue rename to resources/js/components/RoomTabFilesConfigureButton.vue index 25362cdb5..14ff102ca 100644 --- a/resources/js/components/RoomTabFilesEditButton.vue +++ b/resources/js/components/RoomTabFilesConfigureButton.vue @@ -1,12 +1,12 @@ diff --git a/routes/api.php b/routes/api.php index cd07431a0..c61ad0073 100644 --- a/routes/api.php +++ b/routes/api.php @@ -128,6 +128,7 @@ // File operations Route::middleware('can:manageFiles,room')->scopeBindings()->group(function () { Route::post('rooms/{room}/files', [RoomFileController::class, 'store'])->name('rooms.files.add'); + Route::put('rooms/{room}/files/system_default', [RoomFileController::class, 'updateSystemDefault'])->name('rooms.files.updateSystemDefault'); Route::put('rooms/{room}/files/{file}', [RoomFileController::class, 'update'])->name('rooms.files.update'); Route::delete('rooms/{room}/files/{file}', [RoomFileController::class, 'destroy'])->name('rooms.files.destroy'); }); diff --git a/tests/Frontend/e2e/RoomsViewFiles.cy.js b/tests/Frontend/e2e/RoomsViewFiles.cy.js index 942f32a2c..b2cf6b5c0 100644 --- a/tests/Frontend/e2e/RoomsViewFiles.cy.js +++ b/tests/Frontend/e2e/RoomsViewFiles.cy.js @@ -81,8 +81,8 @@ describe("Rooms View Files", function () { .eq(0) .should("include.text", "File1.pdf") .and("include.text", "Sep 21, 2020, 09:08") - .and("include.text", "rooms.files.download_visible") - .and("include.text", "rooms.files.use_in_next_meeting_disabled") + .and("include.text", "rooms.files.download_allowed") + .and("include.text", "rooms.files.not_available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should( "have.attr", @@ -96,8 +96,8 @@ describe("Rooms View Files", function () { .eq(1) .should("include.text", "File2.pdf") .and("include.text", "Sep 21, 2020, 09:08") - .and("include.text", "rooms.files.download_visible") - .and("include.text", "rooms.files.use_in_next_meeting") + .and("include.text", "rooms.files.download_allowed") + .and("include.text", "rooms.files.available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should( "have.attr", @@ -111,8 +111,8 @@ describe("Rooms View Files", function () { .eq(2) .should("include.text", "File3.pdf") .and("include.text", "Sep 21, 2020, 09:09") - .and("include.text", "rooms.files.download_hidden") - .and("include.text", "rooms.files.use_in_next_meeting_disabled") + .and("include.text", "rooms.files.download_not_allowed") + .and("include.text", "rooms.files.not_available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should( "have.attr", @@ -184,8 +184,8 @@ describe("Rooms View Files", function () { .eq(0) .should("include.text", "File1.pdf") .and("include.text", "Sep 21, 2020, 09:08") - .and("not.include.text", "rooms.files.download_visible") - .and("not.include.text", "rooms.files.use_in_next_meeting_disabled") + .and("not.include.text", "rooms.files.download_allowed") + .and("not.include.text", "rooms.files.not_available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should("not.be.disabled") .and( @@ -197,7 +197,7 @@ describe("Rooms View Files", function () { .and("have.attr", "target", "_blank"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -208,8 +208,8 @@ describe("Rooms View Files", function () { .eq(1) .should("include.text", "File2.pdf") .and("include.text", "Sep 21, 2020, 09:08") - .and("not.include.text", "rooms.files.download_visible") - .and("not.include.text", "rooms.files.use_in_next_meeting") + .and("not.include.text", "rooms.files.download_allowed") + .and("not.include.text", "rooms.files.available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should("not.be.disabled") .and( @@ -221,7 +221,7 @@ describe("Rooms View Files", function () { .and("have.attr", "target", "_blank"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -426,8 +426,8 @@ describe("Rooms View Files", function () { .eq(0) .should("include.text", "File1.pdf") .and("include.text", "Sep 21, 2020, 03:08") - .and("not.include.text", "rooms.files.download_visible") - .and("not.include.text", "rooms.files.use_in_next_meeting_disabled") + .and("not.include.text", "rooms.files.download_allowed") + .and("not.include.text", "rooms.files.not_available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should("not.be.disabled") .and( @@ -439,7 +439,7 @@ describe("Rooms View Files", function () { .and("have.attr", "target", "_blank"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -450,8 +450,8 @@ describe("Rooms View Files", function () { .eq(1) .should("include.text", "File2.pdf") .and("include.text", "Sep 21, 2020, 03:08") - .and("not.include.text", "rooms.files.download_visible") - .and("not.include.text", "rooms.files.use_in_next_meeting") + .and("not.include.text", "rooms.files.download_allowed") + .and("not.include.text", "rooms.files.available_in_next_meeting") .find('[data-test="room-files-view-button"]') .should("not.be.disabled") .and( @@ -463,7 +463,7 @@ describe("Rooms View Files", function () { .and("have.attr", "target", "_blank"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -830,17 +830,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 03:08"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("not.include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(0) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -855,17 +855,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 03:08"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.use_in_next_meeting"); + .should("not.include.text", "rooms.files.available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(1) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -911,17 +911,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("not.include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(0) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -936,17 +936,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.use_in_next_meeting"); + .should("not.include.text", "rooms.files.available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(1) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -1010,17 +1010,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 03:08"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("not.include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(0) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -1035,17 +1035,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 03:08"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.use_in_next_meeting"); + .should("not.include.text", "rooms.files.available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(1) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -1115,17 +1115,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("not.include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("not.include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(0) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -1140,13 +1140,13 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.download_visible"); + .should("not.include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("not.include.text", "rooms.files.use_in_next_meeting"); + .should("not.include.text", "rooms.files.available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -1195,17 +1195,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("include.text", "rooms.files.download_visible"); + .should("include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(0) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -1220,17 +1220,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("include.text", "rooms.files.download_visible"); + .should("include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("include.text", "rooms.files.use_in_next_meeting"); + .should("include.text", "rooms.files.available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(1) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -1245,17 +1245,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:09"); cy.get('[data-test="room-file-item"]') .eq(2) - .should("include.text", "rooms.files.download_hidden"); + .should("include.text", "rooms.files.download_not_allowed"); cy.get('[data-test="room-file-item"]') .eq(2) - .should("include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(2) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(2) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(2) @@ -1299,17 +1299,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("include.text", "rooms.files.download_visible"); + .should("include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(0) - .should("include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(0) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) @@ -1324,17 +1324,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:08"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("include.text", "rooms.files.download_visible"); + .should("include.text", "rooms.files.download_allowed"); cy.get('[data-test="room-file-item"]') .eq(1) - .should("include.text", "rooms.files.use_in_next_meeting"); + .should("include.text", "rooms.files.available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(1) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(1) @@ -1349,17 +1349,17 @@ describe("Rooms View Files", function () { .should("include.text", "Sep 21, 2020, 09:09"); cy.get('[data-test="room-file-item"]') .eq(2) - .should("include.text", "rooms.files.download_hidden"); + .should("include.text", "rooms.files.download_not_allowed"); cy.get('[data-test="room-file-item"]') .eq(2) - .should("include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(2) .find('[data-test="room-files-view-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(2) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(2) diff --git a/tests/Frontend/e2e/RoomsViewFilesFileActions.cy.js b/tests/Frontend/e2e/RoomsViewFilesFileActions.cy.js index 83847c5b9..8519ec22b 100644 --- a/tests/Frontend/e2e/RoomsViewFilesFileActions.cy.js +++ b/tests/Frontend/e2e/RoomsViewFilesFileActions.cy.js @@ -218,10 +218,10 @@ describe("Rooms view files file actions", function () { .should("include.text", "Sep 21, 2020, 09:10"); cy.get('[data-test="room-file-item"]') .eq(3) - .should("include.text", "rooms.files.download_hidden"); + .should("include.text", "rooms.files.download_not_allowed"); cy.get('[data-test="room-file-item"]') .eq(3) - .should("include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.not_available_in_next_meeting"); cy.get('[data-test="room-file-item"]') .eq(4) @@ -231,10 +231,10 @@ describe("Rooms view files file actions", function () { .should("include.text", "Sep 21, 2020, 09:10"); cy.get('[data-test="room-file-item"]') .eq(4) - .should("include.text", "rooms.files.download_hidden"); + .should("include.text", "rooms.files.download_not_allowed"); cy.get('[data-test="room-file-item"]') .eq(4) - .should("include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.not_available_in_next_meeting"); }); it("upload file errors", function () { @@ -511,15 +511,15 @@ describe("Rooms view files file actions", function () { cy.wait("@roomFilesRequest"); - cy.get('[data-test="room-files-edit-dialog"]').should("not.exist"); + cy.get('[data-test="room-files-configure-dialog"]').should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .click(); - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .should("be.visible") - .and("include.text", "rooms.files.edit") + .and("include.text", "rooms.files.configure") .within(() => { cy.get('[data-test="download-field"]') .should("include.text", "rooms.files.downloadable") @@ -528,7 +528,7 @@ describe("Rooms view files file actions", function () { .click(); cy.get('[data-test="use-in-meeting-field"]') - .should("include.text", "rooms.files.use_in_next_meeting") + .should("include.text", "rooms.files.available_in_next_meeting") .find("#use_in_meeting") .should("not.be.checked") .click(); @@ -587,15 +587,15 @@ describe("Rooms view files file actions", function () { }); cy.wait("@roomFilesRequest"); - cy.get('[data-test="room-files-edit-dialog"]').should("not.exist"); + cy.get('[data-test="room-files-configure-dialog"]').should("not.exist"); // Check that file settings were changed cy.get('[data-test="room-file-item"]') .eq(0) - .should("include.text", "rooms.files.download_hidden") - .and("include.text", "rooms.files.use_in_next_meeting") - .and("not.include.text", "rooms.files.download_visible") - .and("not.include.text", "rooms.files.use_in_next_meeting_disabled"); + .should("include.text", "rooms.files.download_not_allowed") + .and("include.text", "rooms.files.available_in_next_meeting") + .and("not.include.text", "rooms.files.download_allowed") + .and("not.include.text", "rooms.files.not_available_in_next_meeting"); }); it("change file settings errors", function () { @@ -606,9 +606,9 @@ describe("Rooms view files file actions", function () { // Check with 404 error (file not found / already deleted) cy.get('[data-test="room-file-item"]') .eq(2) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .click(); - cy.get('[data-test="room-files-edit-dialog"]').should("be.visible"); + cy.get('[data-test="room-files-configure-dialog"]').should("be.visible"); cy.intercept("PUT", "/api/v1/rooms/abc-def-123/files/3", { statusCode: 404, @@ -629,7 +629,7 @@ describe("Rooms view files file actions", function () { }).as("roomFilesRequest"); }); - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .find('[data-test="dialog-save-button"]') .click(); @@ -637,7 +637,7 @@ describe("Rooms view files file actions", function () { cy.wait("@roomFilesRequest"); // Check that file is not shown anymore and dialog is closed - cy.get('[data-test="room-files-edit-dialog"]').should("not.exist"); + cy.get('[data-test="room-files-configure-dialog"]').should("not.exist"); cy.get('[data-test="room-file-item"]').should("have.length", 2); // Check that error message is shown @@ -646,9 +646,9 @@ describe("Rooms view files file actions", function () { // Check with 422 error cy.get('[data-test="room-file-item"]') .eq(1) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .click(); - cy.get('[data-test="room-files-edit-dialog"]').should("be.visible"); + cy.get('[data-test="room-files-configure-dialog"]').should("be.visible"); cy.intercept("PUT", "/api/v1/rooms/abc-def-123/files/2", { statusCode: 422, @@ -661,14 +661,14 @@ describe("Rooms view files file actions", function () { }, }).as("editFileRequest"); - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .find('[data-test="dialog-save-button"]') .click(); cy.wait("@editFileRequest"); // Check that dialog stayed open and error message is shown - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .should("be.visible") .and("include.text", "The Downloadable field is required.") .and("include.text", "The Use in the next meeting field is required.") @@ -682,14 +682,14 @@ describe("Rooms view files file actions", function () { }, }).as("editFileRequest"); - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .find('[data-test="dialog-save-button"]') .click(); cy.wait("@editFileRequest"); // Check that dialog is still open and 422 error messages are hidden - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .should("be.visible") .and("not.include.text", "The Downloadable field is required.") .and("not.include.text", "The Use in the next meeting field is required.") @@ -702,20 +702,20 @@ describe("Rooms view files file actions", function () { ]); // Close dialog - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .find('[data-test="dialog-cancel-button"]') .click(); - cy.get('[data-test="room-files-edit-dialog"]').should("not.exist"); + cy.get('[data-test="room-files-configure-dialog"]').should("not.exist"); // Check auth errors cy.checkRoomAuthErrors( () => { cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .click(); - cy.get('[data-test="room-files-edit-dialog"]') + cy.get('[data-test="room-files-configure-dialog"]') .should("be.visible") .find('[data-test="dialog-save-button"]') .click(); @@ -1097,7 +1097,7 @@ describe("Rooms view files file actions", function () { .should("not.be.disabled"); cy.get('[data-test="room-file-item"]') .eq(0) - .find('[data-test="room-files-edit-button"]') + .find('[data-test="room-files-configure-button"]') .should("not.exist"); cy.get('[data-test="room-file-item"]') .eq(0) diff --git a/tests/Frontend/fixtures/roomFiles.json b/tests/Frontend/fixtures/roomFiles.json index d889463fd..3a7581b3e 100644 --- a/tests/Frontend/fixtures/roomFiles.json +++ b/tests/Frontend/fixtures/roomFiles.json @@ -29,6 +29,11 @@ } ], "default": 2, + "system_default": { + "file": "Default.pdf", + "use_in_meeting": true, + "use_as_default": false + }, "meta": { "current_page": 1, "from": 1, diff --git a/tests/Frontend/fixtures/roomFilesNoDetails.json b/tests/Frontend/fixtures/roomFilesNoDetails.json index 7723fd8fd..c316cb124 100644 --- a/tests/Frontend/fixtures/roomFilesNoDetails.json +++ b/tests/Frontend/fixtures/roomFilesNoDetails.json @@ -13,6 +13,11 @@ "url": "https://example.com/files/File2.pdf?signature=def456" } ], + "system_default": { + "file": "Default.pdf", + "use_in_meeting": true, + "use_as_default": false + }, "meta": { "current_page": 1, "from": 1,