Skip to content

Commit a7be37b

Browse files
Merge pull request #3277 from kris6673/AppConsentRequests-missing-actions
FIX: Re-add actions and add a filter to App Consent Requests
2 parents 9f2ba33 + 103ffd3 commit a7be37b

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

src/pages/tenant/administration/app-consent-requests/index.js

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from "react";
1+
import { useState, useEffect, use } from "react";
22
import { Layout as DashboardLayout } from "/src/layouts/index.js";
33
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
44
import {
@@ -12,6 +12,7 @@ import {
1212
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
1313
import { useForm } from "react-hook-form";
1414
import CippFormComponent from "/src/components/CippComponents/CippFormComponent";
15+
import { useSettings } from "/src/hooks/use-settings";
1516

1617
const simpleColumns = [
1718
"Tenant",
@@ -27,6 +28,7 @@ const apiUrl = "/api/ListAppConsentRequests";
2728
const pageTitle = "App Consent Requests";
2829

2930
const Page = () => {
31+
const tenantFilter = useSettings().currentTenant;
3032
const formControl = useForm({
3133
defaultValues: {
3234
requestStatus: "All",
@@ -89,6 +91,14 @@ const Page = () => {
8991
title={pageTitle}
9092
apiUrl={apiUrl}
9193
simpleColumns={simpleColumns}
94+
filters={[
95+
// Filter for showing only pending requests
96+
{
97+
filterName: "Pending requests",
98+
value: [{ id: "requestStatus", value: "Pending" }],
99+
type: "column",
100+
},
101+
]}
92102
queryKey={`AppConsentRequests-${JSON.stringify(filterParams)}`}
93103
apiData={{
94104
...filterParams,
@@ -103,23 +113,23 @@ const Page = () => {
103113
"reviewedBy", // Reviewed by
104114
"reviewedJustification", // Reviewed Reason
105115
],
106-
actions: [
107-
{
108-
label: "Review in Entra",
109-
link: `https://entra.microsoft.com/[TenantFilter]/#view/Microsoft_AAD_IAM/StartboardApplicationsMenuBlade/~/AccessRequests`,
110-
color: "info",
111-
target: "_blank",
112-
external: true,
113-
},
114-
{
115-
label: "Approve in Entra",
116-
link: "[consentUrl]",
117-
color: "info",
118-
target: "_blank",
119-
external: true,
120-
},
121-
],
122116
}}
117+
actions={[
118+
{
119+
label: "Review in Entra",
120+
link: `https://entra.microsoft.com/${tenantFilter}/#view/Microsoft_AAD_IAM/StartboardApplicationsMenuBlade/~/AccessRequests`,
121+
color: "info",
122+
target: "_blank",
123+
external: true,
124+
},
125+
{
126+
label: "Approve in Entra",
127+
link: "[consentUrl]",
128+
color: "info",
129+
target: "_blank",
130+
external: true,
131+
},
132+
]}
123133
/>
124134
);
125135
};

0 commit comments

Comments
 (0)