mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-23 05:39:05 +00:00
meeting page frontend fixes
This commit is contained in:
@@ -19,7 +19,11 @@ import { FaCheckCircle, FaExclamationCircle } from "react-icons/fa";
|
||||
import { useRoomIcsSync, useRoomIcsStatus } from "../../../lib/apiHooks";
|
||||
import { toaster } from "../../../components/ui/toaster";
|
||||
import { roomAbsoluteUrl } from "../../../lib/routesClient";
|
||||
import { assertExists } from "../../../lib/utils";
|
||||
import {
|
||||
assertExists,
|
||||
assertExistsAndNonEmptyString,
|
||||
parseNonEmptyString,
|
||||
} from "../../../lib/utils";
|
||||
|
||||
interface ICSSettingsProps {
|
||||
roomName: string;
|
||||
@@ -80,7 +84,7 @@ export default function ICSSettings({
|
||||
const handleCopyRoomUrl = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(
|
||||
roomAbsoluteUrl(assertExists(roomName)),
|
||||
roomAbsoluteUrl(assertExistsAndNonEmptyString(roomName)),
|
||||
);
|
||||
setJustCopied(true);
|
||||
|
||||
@@ -194,7 +198,7 @@ export default function ICSSettings({
|
||||
<HStack gap={0} position="relative" width="100%">
|
||||
<Input
|
||||
ref={roomUrlInputRef}
|
||||
value={roomAbsoluteUrl(roomName)}
|
||||
value={roomAbsoluteUrl(parseNonEmptyString(roomName))}
|
||||
readOnly
|
||||
onClick={handleRoomUrlClick}
|
||||
cursor="pointer"
|
||||
|
||||
@@ -4,12 +4,13 @@ import type { components } from "../../../reflector-api";
|
||||
type Room = components["schemas"]["Room"];
|
||||
import { RoomTable } from "./RoomTable";
|
||||
import { RoomCards } from "./RoomCards";
|
||||
import { NonEmptyString } from "../../../lib/utils";
|
||||
|
||||
interface RoomListProps {
|
||||
title: string;
|
||||
rooms: Room[];
|
||||
linkCopied: string;
|
||||
onCopyUrl: (roomName: string) => void;
|
||||
onCopyUrl: (roomName: NonEmptyString) => void;
|
||||
onEdit: (roomId: string, roomData: any) => void;
|
||||
onDelete: (roomId: string) => void;
|
||||
emptyMessage?: string;
|
||||
|
||||
@@ -25,6 +25,7 @@ type Meeting = components["schemas"]["Meeting"];
|
||||
type CalendarEventResponse = components["schemas"]["CalendarEventResponse"];
|
||||
import { RoomActionsMenu } from "./RoomActionsMenu";
|
||||
import { MEETING_DEFAULT_TIME_MINUTES } from "../../../[roomName]/[meetingId]/constants";
|
||||
import { NonEmptyString, parseNonEmptyString } from "../../../lib/utils";
|
||||
|
||||
// Custom icon component that combines calendar and refresh icons
|
||||
const CalendarSyncIcon = () => (
|
||||
@@ -57,7 +58,7 @@ const CalendarSyncIcon = () => (
|
||||
interface RoomTableProps {
|
||||
rooms: Room[];
|
||||
linkCopied: string;
|
||||
onCopyUrl: (roomName: string) => void;
|
||||
onCopyUrl: (roomName: NonEmptyString) => void;
|
||||
onEdit: (roomId: string, roomData: any) => void;
|
||||
onDelete: (roomId: string) => void;
|
||||
loading?: boolean;
|
||||
@@ -292,7 +293,9 @@ export function RoomTable({
|
||||
) : (
|
||||
<IconButton
|
||||
aria-label="Copy URL"
|
||||
onClick={() => onCopyUrl(room.name)}
|
||||
onClick={() =>
|
||||
onCopyUrl(parseNonEmptyString(room.name))
|
||||
}
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
>
|
||||
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
} from "../../lib/apiHooks";
|
||||
import { RoomList } from "./_components/RoomList";
|
||||
import { PaginationPage } from "../browse/_components/Pagination";
|
||||
import { assertExists } from "../../lib/utils";
|
||||
import { assertExists, NonEmptyString } from "../../lib/utils";
|
||||
import ICSSettings from "./_components/ICSSettings";
|
||||
import { roomAbsoluteUrl } from "../../lib/routesClient";
|
||||
|
||||
@@ -187,7 +187,7 @@ export default function RoomsList() {
|
||||
items: topicOptions,
|
||||
});
|
||||
|
||||
const handleCopyUrl = (roomName: string) => {
|
||||
const handleCopyUrl = (roomName: NonEmptyString) => {
|
||||
navigator.clipboard.writeText(roomAbsoluteUrl(roomName)).then(() => {
|
||||
setLinkCopied(roomName);
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user