Replace native dialogs with app modals for Events link and unlink.
Deploy Ladill Meet / deploy (push) Successful in 49s
Deploy Ladill Meet / deploy (push) Successful in 49s
Link opens an in-page modal on conference and webinar show pages; unlink uses the shared confirm-dialog component. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Meet\Concerns;
|
||||||
|
|
||||||
|
use App\Models\Room;
|
||||||
|
use App\Services\Integrations\EventsLinkService;
|
||||||
|
use App\Services\Meet\MeetPermissions;
|
||||||
|
use App\Support\EventsSourceLink;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
trait ResolvesEventsLinkContext
|
||||||
|
{
|
||||||
|
/** @return array{canManageEvents: bool, linkableEvents: list<array<string, mixed>>} */
|
||||||
|
protected function eventsLinkContext(Request $request, Room $room): array
|
||||||
|
{
|
||||||
|
$canManageEvents = app(MeetPermissions::class)->can($this->member($request), 'meetings.manage');
|
||||||
|
|
||||||
|
$linkableEvents = $canManageEvents && ! EventsSourceLink::isLinked($room)
|
||||||
|
? app(EventsLinkService::class)->linkableEvents($request->user())
|
||||||
|
: [];
|
||||||
|
|
||||||
|
return compact('canManageEvents', 'linkableEvents');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Meet;
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Meet\Concerns\BuildsMeetIndexPage;
|
use App\Http\Controllers\Meet\Concerns\BuildsMeetIndexPage;
|
||||||
|
use App\Http\Controllers\Meet\Concerns\ResolvesEventsLinkContext;
|
||||||
use App\Http\Controllers\Meet\Concerns\ScopesToAccount;
|
use App\Http\Controllers\Meet\Concerns\ScopesToAccount;
|
||||||
use App\Models\Member;
|
use App\Models\Member;
|
||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
@@ -20,7 +21,7 @@ use Illuminate\View\View;
|
|||||||
|
|
||||||
class ConferenceController extends Controller
|
class ConferenceController extends Controller
|
||||||
{
|
{
|
||||||
use BuildsMeetIndexPage, ScopesToAccount;
|
use BuildsMeetIndexPage, ResolvesEventsLinkContext, ScopesToAccount;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected RoomService $rooms,
|
protected RoomService $rooms,
|
||||||
@@ -124,7 +125,9 @@ class ConferenceController extends Controller
|
|||||||
|
|
||||||
$room->load(['sessions.participants', 'invitations', 'sessions.recordings', 'sessions.aiSummaries', 'sessionFiles']);
|
$room->load(['sessions.participants', 'invitations', 'sessions.recordings', 'sessions.aiSummaries', 'sessionFiles']);
|
||||||
|
|
||||||
return view('meet.conferences.show', compact('room'));
|
extract($this->eventsLinkContext($request, $room));
|
||||||
|
|
||||||
|
return view('meet.conferences.show', compact('room', 'canManageEvents', 'linkableEvents'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateSpeakers(Request $request, Room $room): RedirectResponse
|
public function updateSpeakers(Request $request, Room $room): RedirectResponse
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ use App\Http\Controllers\Meet\Concerns\ScopesToAccount;
|
|||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
use App\Services\Integrations\EventsClient;
|
use App\Services\Integrations\EventsClient;
|
||||||
use App\Services\Integrations\EventsLinkService;
|
use App\Services\Integrations\EventsLinkService;
|
||||||
use App\Support\EventsSourceLink;
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\View\View;
|
|
||||||
|
|
||||||
class EventsLinkController extends Controller
|
class EventsLinkController extends Controller
|
||||||
{
|
{
|
||||||
@@ -21,7 +19,7 @@ class EventsLinkController extends Controller
|
|||||||
protected EventsClient $eventsClient,
|
protected EventsClient $eventsClient,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function show(Request $request, Room $room): View|RedirectResponse
|
public function show(Request $request, Room $room): RedirectResponse
|
||||||
{
|
{
|
||||||
$this->authorizeAbility($request, 'meetings.manage');
|
$this->authorizeAbility($request, 'meetings.manage');
|
||||||
$this->authorizeOwner($request, $room);
|
$this->authorizeOwner($request, $room);
|
||||||
@@ -33,16 +31,9 @@ class EventsLinkController extends Controller
|
|||||||
->withErrors(['events' => 'Ladill Events linking is not configured. Set MEET_API_KEY_EVENTS in Meet (and the matching EVENTS_API_KEY_MEET in Events), then try again.']);
|
->withErrors(['events' => 'Ladill Events linking is not configured. Set MEET_API_KEY_EVENTS in Meet (and the matching EVENTS_API_KEY_MEET in Events), then try again.']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$events = $this->links->linkableEvents($request->user());
|
return redirect()
|
||||||
$expectedType = $room->isConference() ? 'town_hall' : 'webinar';
|
->route($room->isWebinar() ? 'meet.webinars.show' : 'meet.conferences.show', $room)
|
||||||
|
->with('open_events_link_modal', true);
|
||||||
return view('meet.events.link', [
|
|
||||||
'room' => $room,
|
|
||||||
'events' => $events,
|
|
||||||
'expectedType' => $expectedType,
|
|
||||||
'eventsAppUrl' => EventsSourceLink::baseUrl(),
|
|
||||||
'isLinked' => EventsSourceLink::isLinked($room),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request, Room $room): RedirectResponse
|
public function store(Request $request, Room $room): RedirectResponse
|
||||||
@@ -51,11 +42,21 @@ class EventsLinkController extends Controller
|
|||||||
$this->authorizeOwner($request, $room);
|
$this->authorizeOwner($request, $room);
|
||||||
abort_unless($room->isWebinar() || $room->isConference(), 404);
|
abort_unless($room->isWebinar() || $room->isConference(), 404);
|
||||||
|
|
||||||
$validated = $request->validate([
|
$validator = \Illuminate\Support\Facades\Validator::make($request->all(), [
|
||||||
'event_id' => ['required', 'integer', 'min:1'],
|
'event_id' => ['required', 'integer', 'min:1'],
|
||||||
'virtual_session_id' => ['nullable', 'string', 'max:64'],
|
'virtual_session_id' => ['nullable', 'string', 'max:64'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return redirect()
|
||||||
|
->route($room->isWebinar() ? 'meet.webinars.show' : 'meet.conferences.show', $room)
|
||||||
|
->withErrors($validator)
|
||||||
|
->withInput()
|
||||||
|
->with('open_events_link_modal', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$validated = $validator->validated();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->links->link(
|
$this->links->link(
|
||||||
$room,
|
$room,
|
||||||
@@ -64,7 +65,11 @@ class EventsLinkController extends Controller
|
|||||||
$validated['virtual_session_id'] ?? null,
|
$validated['virtual_session_id'] ?? null,
|
||||||
);
|
);
|
||||||
} catch (\RuntimeException $e) {
|
} catch (\RuntimeException $e) {
|
||||||
return back()->withErrors(['events' => $e->getMessage()])->withInput();
|
return redirect()
|
||||||
|
->route($room->isWebinar() ? 'meet.webinars.show' : 'meet.conferences.show', $room)
|
||||||
|
->withErrors(['events' => $e->getMessage()])
|
||||||
|
->withInput()
|
||||||
|
->with('open_events_link_modal', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$route = $room->isWebinar() ? 'meet.webinars.show' : 'meet.conferences.show';
|
$route = $room->isWebinar() ? 'meet.webinars.show' : 'meet.conferences.show';
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Meet;
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Meet\Concerns\BuildsMeetIndexPage;
|
use App\Http\Controllers\Meet\Concerns\BuildsMeetIndexPage;
|
||||||
|
use App\Http\Controllers\Meet\Concerns\ResolvesEventsLinkContext;
|
||||||
use App\Http\Controllers\Meet\Concerns\ScopesToAccount;
|
use App\Http\Controllers\Meet\Concerns\ScopesToAccount;
|
||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
use App\Services\Meet\CalendarService;
|
use App\Services\Meet\CalendarService;
|
||||||
@@ -16,7 +17,7 @@ use Illuminate\View\View;
|
|||||||
|
|
||||||
class WebinarController extends Controller
|
class WebinarController extends Controller
|
||||||
{
|
{
|
||||||
use BuildsMeetIndexPage, ScopesToAccount;
|
use BuildsMeetIndexPage, ResolvesEventsLinkContext, ScopesToAccount;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected RoomService $rooms,
|
protected RoomService $rooms,
|
||||||
@@ -113,7 +114,9 @@ class WebinarController extends Controller
|
|||||||
|
|
||||||
$room->load(['sessions.participants', 'invitations', 'sessions.recordings', 'sessions.aiSummaries', 'sessionFiles']);
|
$room->load(['sessions.participants', 'invitations', 'sessions.recordings', 'sessions.aiSummaries', 'sessionFiles']);
|
||||||
|
|
||||||
return view('meet.webinars.show', compact('room'));
|
extract($this->eventsLinkContext($request, $room));
|
||||||
|
|
||||||
|
return view('meet.webinars.show', compact('room', 'canManageEvents', 'linkableEvents'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function start(Request $request, Room $room): RedirectResponse
|
public function start(Request $request, Room $room): RedirectResponse
|
||||||
|
|||||||
@@ -13,50 +13,12 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($events === [])
|
<div class="mt-6 rounded-2xl border border-slate-200 bg-white p-6">
|
||||||
<div class="mt-6 rounded-2xl border border-slate-200 bg-white p-6 text-sm text-slate-600">
|
@include('meet.partials.events-link-form', [
|
||||||
<p>No virtual or hybrid events found in your Ladill Events account.</p>
|
'room' => $room,
|
||||||
<a href="{{ EventsSourceLink::createEventUrl($room) }}" target="_blank" rel="noopener" class="mt-4 inline-flex btn-primary btn-primary-sm">Create event in Events</a>
|
'events' => $events,
|
||||||
</div>
|
'expectedType' => $expectedType,
|
||||||
@else
|
])
|
||||||
<form method="POST" action="{{ route('meet.events.link.store', $room) }}" class="mt-6 space-y-5">
|
</div>
|
||||||
@csrf
|
|
||||||
|
|
||||||
<div class="rounded-2xl border border-slate-200 bg-white p-6">
|
|
||||||
<label class="block text-sm font-medium text-slate-700">Event</label>
|
|
||||||
<select name="event_id" required class="mt-2 w-full rounded-lg border-slate-300 text-sm">
|
|
||||||
<option value="">Select an event…</option>
|
|
||||||
@foreach ($events as $event)
|
|
||||||
<option value="{{ $event['id'] }}" @selected(old('event_id') == $event['id'])>
|
|
||||||
{{ $event['title'] }} ({{ ucfirst($event['format']) }})
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="rounded-2xl border border-slate-200 bg-white p-6">
|
|
||||||
<label class="block text-sm font-medium text-slate-700">Virtual session slot (optional)</label>
|
|
||||||
<p class="mt-1 text-xs text-slate-500">Pick an empty session matching this {{ $room->isConference() ? 'conference' : 'webinar' }}, or leave blank to attach to the first available {{ $expectedType === 'town_hall' ? 'conference' : 'webinar' }} slot.</p>
|
|
||||||
<select name="virtual_session_id" class="mt-2 w-full rounded-lg border-slate-300 text-sm">
|
|
||||||
<option value="">Auto-assign slot</option>
|
|
||||||
@foreach ($events as $event)
|
|
||||||
@foreach ($event['virtual_sessions'] ?? [] as $session)
|
|
||||||
@php
|
|
||||||
$typeMatch = ($session['meet_room_type'] ?? '') === $expectedType;
|
|
||||||
$available = empty($session['meet_room_uuid']);
|
|
||||||
@endphp
|
|
||||||
@if ($typeMatch)
|
|
||||||
<option value="{{ $session['id'] }}" data-event="{{ $event['id'] }}" @selected(old('virtual_session_id') === $session['id'])>
|
|
||||||
[{{ $event['title'] }}] {{ $session['title'] ?: 'Untitled session' }}{{ $available ? '' : ' (linked)' }}
|
|
||||||
</option>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-primary btn-primary-lg w-full">Link event</button>
|
|
||||||
</form>
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
</x-app-layout>
|
</x-app-layout>
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
$eventsConfigured = EventsSourceLink::isApiConfigured();
|
$eventsConfigured = EventsSourceLink::isApiConfigured();
|
||||||
$createEventUrl = EventsSourceLink::createEventUrl($room);
|
$createEventUrl = EventsSourceLink::createEventUrl($room);
|
||||||
$kind = $room->isConference() ? 'conference' : 'webinar';
|
$kind = $room->isConference() ? 'conference' : 'webinar';
|
||||||
|
$expectedType = $room->isConference() ? 'town_hall' : 'webinar';
|
||||||
|
$linkableEvents = $linkableEvents ?? [];
|
||||||
|
$canManageEvents = $canManageEvents ?? false;
|
||||||
|
$unlinkModalName = 'events-unlink-'.$room->uuid;
|
||||||
|
$linkModalName = 'events-link-'.$room->uuid;
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div class="mt-6 rounded-2xl border {{ $isLinked ? 'border-indigo-200 bg-indigo-50/40' : 'border-amber-200 bg-amber-50/50' }} p-6">
|
<div class="mt-6 rounded-2xl border {{ $isLinked ? 'border-indigo-200 bg-indigo-50/40' : 'border-amber-200 bg-amber-50/50' }} p-6">
|
||||||
@@ -24,12 +29,19 @@
|
|||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@if ($isLinked)
|
@if ($isLinked && $canManageEvents)
|
||||||
<form method="POST" action="{{ route('meet.events.link.destroy', $room) }}" onsubmit="return confirm('Remove the Events link? Registration settings stay in Events but this room will no longer show as linked.');">
|
<x-confirm-dialog
|
||||||
@csrf
|
:name="$unlinkModalName"
|
||||||
@method('DELETE')
|
title="Remove Events link?"
|
||||||
<button type="submit" class="text-xs font-medium text-slate-500 hover:text-slate-700">Unlink</button>
|
message="Registration settings stay in Events but this room will no longer show as linked."
|
||||||
</form>
|
:action="route('meet.events.link.destroy', $room)"
|
||||||
|
method="DELETE"
|
||||||
|
confirm-label="Unlink"
|
||||||
|
>
|
||||||
|
<x-slot:trigger>
|
||||||
|
<button type="button" class="text-xs font-medium text-slate-500 hover:text-slate-700">Unlink</button>
|
||||||
|
</x-slot:trigger>
|
||||||
|
</x-confirm-dialog>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -84,8 +96,14 @@
|
|||||||
<p class="mt-3 text-xs text-slate-500">Programme speakers and panelists are configured on the event programme in Events and sync to this session when linked.</p>
|
<p class="mt-3 text-xs text-slate-500">Programme speakers and panelists are configured on the event programme in Events and sync to this session when linked.</p>
|
||||||
@else
|
@else
|
||||||
<div class="mt-4 flex flex-wrap gap-3">
|
<div class="mt-4 flex flex-wrap gap-3">
|
||||||
@if ($eventsConfigured)
|
@if ($eventsConfigured && $canManageEvents)
|
||||||
<a href="{{ route('meet.events.link', $room) }}" class="btn-primary btn-primary-sm">Link to Ladill Events</a>
|
<button type="button"
|
||||||
|
@click="$dispatch('open-modal', {{ Js::from($linkModalName) }})"
|
||||||
|
class="btn-primary btn-primary-sm">
|
||||||
|
Link to Ladill Events
|
||||||
|
</button>
|
||||||
|
@elseif ($eventsConfigured)
|
||||||
|
<span class="btn-primary btn-primary-sm cursor-not-allowed opacity-50" title="You need manage permission to link events">Link to Ladill Events</span>
|
||||||
@else
|
@else
|
||||||
<span class="btn-primary btn-primary-sm cursor-not-allowed opacity-50" title="Configure MEET_API_KEY_EVENTS to enable linking">Link to Ladill Events</span>
|
<span class="btn-primary btn-primary-sm cursor-not-allowed opacity-50" title="Configure MEET_API_KEY_EVENTS to enable linking">Link to Ladill Events</span>
|
||||||
@endif
|
@endif
|
||||||
@@ -93,3 +111,34 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if (! $isLinked && $eventsConfigured && $canManageEvents)
|
||||||
|
@php
|
||||||
|
$openLinkModal = session('open_events_link_modal')
|
||||||
|
|| $errors->hasAny(['events', 'event_id', 'virtual_session_id']);
|
||||||
|
@endphp
|
||||||
|
<x-modal :name="$linkModalName" maxWidth="lg" :show="$openLinkModal">
|
||||||
|
<div class="px-5 pb-6 pt-2 sm:px-6 sm:pb-6 sm:pt-4">
|
||||||
|
<h2 class="text-lg font-semibold text-slate-900">Link to Ladill Events</h2>
|
||||||
|
<p class="mt-1 text-sm text-slate-500">
|
||||||
|
Choose a virtual or hybrid event. Registration, bulk invitations, speakers, and QR codes will be managed in Events.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
@if ($errors->has('events'))
|
||||||
|
<div class="mt-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700">
|
||||||
|
{{ $errors->first('events') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mt-5">
|
||||||
|
@include('meet.partials.events-link-form', [
|
||||||
|
'room' => $room,
|
||||||
|
'events' => $linkableEvents,
|
||||||
|
'expectedType' => $expectedType,
|
||||||
|
'submitLabel' => 'Link event',
|
||||||
|
'submitClass' => 'btn-primary btn-primary-sm',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-modal>
|
||||||
|
@endif
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
@props([
|
||||||
|
'room',
|
||||||
|
'events' => [],
|
||||||
|
'expectedType' => 'town_hall',
|
||||||
|
'submitLabel' => 'Link event',
|
||||||
|
'submitClass' => 'btn-primary btn-primary-lg w-full',
|
||||||
|
])
|
||||||
|
|
||||||
|
@if ($events === [])
|
||||||
|
<div class="text-sm text-slate-600">
|
||||||
|
<p>No virtual or hybrid events found in your Ladill Events account.</p>
|
||||||
|
<a href="{{ \App\Support\EventsSourceLink::createEventUrl($room) }}" target="_blank" rel="noopener" class="mt-4 inline-flex btn-primary btn-primary-sm">Create event in Events</a>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<form method="POST" action="{{ route('meet.events.link.store', $room) }}" class="space-y-5">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-slate-700">Event</label>
|
||||||
|
<select name="event_id" required class="mt-2 w-full rounded-lg border-slate-300 text-sm">
|
||||||
|
<option value="">Select an event…</option>
|
||||||
|
@foreach ($events as $event)
|
||||||
|
<option value="{{ $event['id'] }}" @selected(old('event_id') == $event['id'])>
|
||||||
|
{{ $event['title'] }} ({{ ucfirst($event['format']) }})
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-slate-700">Virtual session slot (optional)</label>
|
||||||
|
<p class="mt-1 text-xs text-slate-500">Pick an empty session matching this {{ $room->isConference() ? 'conference' : 'webinar' }}, or leave blank to attach to the first available {{ $expectedType === 'town_hall' ? 'conference' : 'webinar' }} slot.</p>
|
||||||
|
<select name="virtual_session_id" class="mt-2 w-full rounded-lg border-slate-300 text-sm">
|
||||||
|
<option value="">Auto-assign slot</option>
|
||||||
|
@foreach ($events as $event)
|
||||||
|
@foreach ($event['virtual_sessions'] ?? [] as $session)
|
||||||
|
@php
|
||||||
|
$typeMatch = ($session['meet_room_type'] ?? '') === $expectedType;
|
||||||
|
$available = empty($session['meet_room_uuid']);
|
||||||
|
@endphp
|
||||||
|
@if ($typeMatch)
|
||||||
|
<option value="{{ $session['id'] }}" data-event="{{ $event['id'] }}" @selected(old('virtual_session_id') === $session['id'])>
|
||||||
|
[{{ $event['title'] }}] {{ $session['title'] ?: 'Untitled session' }}{{ $available ? '' : ' (linked)' }}
|
||||||
|
</option>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" @class([$submitClass])>{{ $submitLabel }}</button>
|
||||||
|
</form>
|
||||||
|
@endif
|
||||||
@@ -2008,6 +2008,57 @@ class MeetWebTest extends TestCase
|
|||||||
->assertDontSee('/qr-codes/create', false);
|
->assertDontSee('/qr-codes/create', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_conference_events_link_uses_app_modals_not_native_confirm(): void
|
||||||
|
{
|
||||||
|
config([
|
||||||
|
'meet.events_api_url' => 'https://events.test/api/service/v1',
|
||||||
|
'meet.events_api_key' => 'test-events-key',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Http::fake([
|
||||||
|
'https://events.test/api/service/v1/events*' => Http::response(['events' => []]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$room = Room::create([
|
||||||
|
'owner_ref' => $this->user->public_id,
|
||||||
|
'organization_id' => $this->organization->id,
|
||||||
|
'host_user_ref' => $this->user->public_id,
|
||||||
|
'title' => 'Leadership conference',
|
||||||
|
'type' => 'town_hall',
|
||||||
|
'status' => 'scheduled',
|
||||||
|
'scheduled_at' => now()->addDay(),
|
||||||
|
'timezone' => 'UTC',
|
||||||
|
'settings' => config('meet.default_settings'),
|
||||||
|
'source' => [
|
||||||
|
'app' => 'events',
|
||||||
|
'entity_type' => 'virtual_session',
|
||||||
|
'entity_id' => 'vs-1',
|
||||||
|
'event_id' => '42',
|
||||||
|
'event_title' => 'Summit',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->actingAs($this->user)
|
||||||
|
->get(route('meet.conferences.show', $room))
|
||||||
|
->assertOk()
|
||||||
|
->assertSee('Remove Events link?', false)
|
||||||
|
->assertSee('data-modal-name="events-unlink-'.$room->uuid.'"', false)
|
||||||
|
->assertDontSee("confirm('Remove the Events link?", false);
|
||||||
|
|
||||||
|
$room->update(['source' => null]);
|
||||||
|
|
||||||
|
$this->actingAs($this->user)
|
||||||
|
->get(route('meet.conferences.show', $room))
|
||||||
|
->assertOk()
|
||||||
|
->assertSee('open-modal', false)
|
||||||
|
->assertSee('data-modal-name="events-link-'.$room->uuid.'"', false)
|
||||||
|
->assertSee('Link to Ladill Events', false);
|
||||||
|
|
||||||
|
$this->actingAs($this->user)
|
||||||
|
->get(route('meet.events.link', $room))
|
||||||
|
->assertRedirect(route('meet.conferences.show', $room));
|
||||||
|
}
|
||||||
|
|
||||||
public function test_afia_chat_returns_reply_when_ai_configured(): void
|
public function test_afia_chat_returns_reply_when_ai_configured(): void
|
||||||
{
|
{
|
||||||
config([
|
config([
|
||||||
|
|||||||
Reference in New Issue
Block a user