Scope Meet team members and add mailbox invite picker.
Deploy Ladill Meet / deploy (push) Successful in 58s
Deploy Ladill Meet / deploy (push) Successful in 58s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,12 +2,26 @@
|
||||
<div class="mx-auto max-w-lg">
|
||||
<h1 class="text-xl font-semibold text-slate-900">Invite team member</h1>
|
||||
|
||||
<form method="POST" action="{{ route('meet.members.store') }}" class="mt-6 space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
|
||||
<form method="POST" x-data action="{{ route('meet.members.store') }}" class="mt-6 space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
|
||||
@csrf
|
||||
|
||||
@if (! empty($mailboxOptions))
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700">From a Ladill mailbox</label>
|
||||
<select x-on:change="if ($event.target.value) { $refs.email.value = $event.target.value }"
|
||||
class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<option value="">Choose a mailbox…</option>
|
||||
@foreach ($mailboxOptions as $address)
|
||||
<option value="{{ $address }}">{{ $address }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="mt-1 text-xs text-slate-500">Or type any email below.</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700">Email address</label>
|
||||
<input type="email" name="email" value="{{ old('email') }}" required
|
||||
<input type="email" name="email" x-ref="email" value="{{ old('email') }}" required
|
||||
class="mt-1 w-full rounded-lg border-slate-300 text-sm"
|
||||
placeholder="colleague@company.com">
|
||||
<p class="mt-1 text-xs text-slate-500">They will receive an email to accept and join your Meet organization.</p>
|
||||
|
||||
@@ -2,17 +2,59 @@
|
||||
// Shared Ladill app launcher — IDENTICAL across every app/service.
|
||||
// Driven by config/ladill_launcher.php (fully-extracted apps only) + icons
|
||||
// from public/images/launcher-icons/. Omits the current app (matched by
|
||||
// APP_URL host). To replicate elsewhere, copy this file + the config +
|
||||
// the launcher-icons folder verbatim.
|
||||
// APP_URL host). Scoped team members only see apps they can access; the
|
||||
// launcher is hidden entirely when they only have one app (or none).
|
||||
$sidebar = (bool) ($sidebar ?? false);
|
||||
$selfHost = parse_url((string) config('app.url'), PHP_URL_HOST);
|
||||
$allowedSlugs = \App\Support\StaffUx::allowedAppSlugs(auth()->user());
|
||||
$launcherApps = array_values(array_filter(
|
||||
config('ladill_launcher.apps', []),
|
||||
fn (array $app) => parse_url($app['url'], PHP_URL_HOST) !== $selfHost
|
||||
function (array $app) use ($selfHost, $allowedSlugs) {
|
||||
if (parse_url($app['url'], PHP_URL_HOST) === $selfHost) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($allowedSlugs === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$host = (string) parse_url($app['url'], PHP_URL_HOST);
|
||||
$root = (string) config('app.platform_domain', 'ladill.com');
|
||||
$suffix = '.'.$root;
|
||||
if (! str_ends_with($host, $suffix)) {
|
||||
return false;
|
||||
}
|
||||
$sub = substr($host, 0, -strlen($suffix));
|
||||
|
||||
foreach ($allowedSlugs as $slug) {
|
||||
if ($slug === $sub || str_starts_with($sub, $slug)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Launcher URLs may use marketing hostnames — match by known slug keys.
|
||||
$slug = match (true) {
|
||||
str_starts_with($host, 'care.') => 'care',
|
||||
str_starts_with($host, 'meet.') => 'meet',
|
||||
str_starts_with($host, 'queue.') => 'queue',
|
||||
str_starts_with($host, 'frontdesk.') => 'frontdesk',
|
||||
str_starts_with($host, 'mail.') => 'mail',
|
||||
str_starts_with($host, 'email.') => 'email',
|
||||
default => explode('.', $host)[0] ?? null,
|
||||
};
|
||||
|
||||
return $slug && in_array($slug, $allowedSlugs, true);
|
||||
}
|
||||
));
|
||||
|
||||
// Single-app staff: no launcher (they already are in their only app).
|
||||
if ($allowedSlugs !== null && count($allowedSlugs) <= 1) {
|
||||
$launcherApps = [];
|
||||
}
|
||||
|
||||
$launcherOverflows = count($launcherApps) > 15;
|
||||
@endphp
|
||||
@if (! empty($launcherApps))
|
||||
@if (! empty($launcherApps) && \App\Support\StaffUx::showProductHub(auth()->user()))
|
||||
<div class="relative" x-data="{
|
||||
appsOpen: false,
|
||||
showScrollMore: {{ $launcherOverflows ? 'true' : 'false' }},
|
||||
|
||||
Reference in New Issue
Block a user