Skip to content

Commit 5927d58

Browse files
Merge pull request #3040 from Ren-Roros-Digital/ViewRoomList
feat: added view rooms in Room Lists
2 parents 8fa9809 + 9f0012a commit 5927d58

File tree

2 files changed

+66
-2
lines changed

2 files changed

+66
-2
lines changed

src/pages/email/resources/management/room-lists/index.js

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,45 @@ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"
33

44
const Page = () => {
55
const pageTitle = "Room Lists";
6+
const apiUrl = "/api/ListRoomLists"
7+
8+
const actions = [
9+
{
10+
label: "View included Rooms",
11+
link: `/email/resources/management/room-lists/list/view?roomAddress=[emailAddress]`,
12+
color: "info",
13+
},
14+
];
15+
16+
const offCanvas = {
17+
extendedInfoFields: [
18+
"id",
19+
"emailAddress",
20+
"displayName",
21+
"phone",
22+
"placeId",
23+
"geoCoordinates",
24+
"address.city",
25+
"address.countryOrRegion",
26+
],
27+
actions: actions,
28+
};
29+
30+
const simpleColumns = [
31+
"displayName",
32+
"geoCoordinates",
33+
"placeId",
34+
"address.city",
35+
"address.countryOrRegion",
36+
];
637

738
return (
839
<CippTablePage
940
title={pageTitle}
10-
apiUrl="/api/ListRoomLists"
11-
simpleColumns={["displayName", "geoCoordinates", "placeId"]}
41+
apiUrl={apiUrl}
42+
actions={actions}
43+
offCanvas={offCanvas}
44+
simpleColumns={simpleColumns}
1245
/>
1346
);
1447
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Layout as DashboardLayout } from "/src/layouts/index.js";
2+
import { useRouter } from "next/router";
3+
import { useSettings } from "/src/hooks/use-settings";
4+
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
5+
6+
const Page = () => {
7+
const userSettingsDefaults = useSettings();
8+
const router = useRouter();
9+
const { roomAddress } = router.query;
10+
const pageTitle = `Rooms included in ${roomAddress}`;
11+
12+
return (
13+
<CippTablePage
14+
title={pageTitle}
15+
apiUrl= "/api/ListGraphRequest"
16+
apiData={{
17+
Endpoint: `/places/${roomAddress}/microsoft.graph.roomlist/rooms`,
18+
tenantFilter: userSettingsDefaults.currentTenant,
19+
AsApp: true,
20+
manualPagination: true,
21+
$count: true,
22+
$top: 999,
23+
}}
24+
apiDataKey="Results"
25+
/>
26+
);
27+
};
28+
29+
Page.getLayout = (page) => <DashboardLayout>{page}</DashboardLayout>;
30+
31+
export default Page;

0 commit comments

Comments
 (0)