1
- import { useState , useEffect } from "react" ;
1
+ import { useState , useEffect , use } from "react" ;
2
2
import { Layout as DashboardLayout } from "/src/layouts/index.js" ;
3
3
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx" ;
4
4
import {
@@ -12,6 +12,7 @@ import {
12
12
import ExpandMoreIcon from "@mui/icons-material/ExpandMore" ;
13
13
import { useForm } from "react-hook-form" ;
14
14
import CippFormComponent from "/src/components/CippComponents/CippFormComponent" ;
15
+ import { useSettings } from "/src/hooks/use-settings" ;
15
16
16
17
const simpleColumns = [
17
18
"Tenant" ,
@@ -27,6 +28,7 @@ const apiUrl = "/api/ListAppConsentRequests";
27
28
const pageTitle = "App Consent Requests" ;
28
29
29
30
const Page = ( ) => {
31
+ const tenantFilter = useSettings ( ) . currentTenant ;
30
32
const formControl = useForm ( {
31
33
defaultValues : {
32
34
requestStatus : "All" ,
@@ -89,6 +91,14 @@ const Page = () => {
89
91
title = { pageTitle }
90
92
apiUrl = { apiUrl }
91
93
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
+ ] }
92
102
queryKey = { `AppConsentRequests-${ JSON . stringify ( filterParams ) } ` }
93
103
apiData = { {
94
104
...filterParams ,
@@ -103,23 +113,23 @@ const Page = () => {
103
113
"reviewedBy" , // Reviewed by
104
114
"reviewedJustification" , // Reviewed Reason
105
115
] ,
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
- ] ,
122
116
} }
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
+ ] }
123
133
/>
124
134
) ;
125
135
} ;
0 commit comments