Skip to content

Commit caeed9f

Browse files
committed
default column sort for most recent consent.
1 parent 7157ea3 commit caeed9f

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

components/enterprise-applications/app-role-permissions-grid/AppRolePermissionsGrid.tsx

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,42 @@ export default function AppRolePermissionsGrid() {
165165
);
166166
}
167167

168+
type SortDirection = "ascending" | "descending";
169+
interface SortState {
170+
sortColumn: string | undefined;
171+
sortDirection: SortDirection;
172+
}
173+
174+
const defaultSortState: SortState = {
175+
sortColumn: "createdDateTime",
176+
sortDirection: "descending",
177+
};
178+
168179
return (
169180
<div>
181+
182+
<div>
183+
<Caption1 style={{ margin: "6px" }}>
184+
EntraOps Classifications
185+
<InfoLabel
186+
info={
187+
<Link
188+
target="_blank"
189+
href={"https://github.com/Cloud-Architekt/AzurePrivilegedIAM"}
190+
>
191+
Courtesy Cloud-Architekt (Thomas Naunheim)
192+
</Link>
193+
}
194+
></InfoLabel>
195+
</Caption1>
196+
</div>
197+
170198
{!isAuthenticated && (
171199
<div style={{ margin: "6px" }}>
172200
<InfoLabel
173201
info={<>Until sign-in this screen returns sample data. </>}
174202
>
175-
<Subtitle2>Demo Mode</Subtitle2>
203+
<Subtitle2>Example Mode</Subtitle2>
176204
</InfoLabel>
177205
</div>
178206
)}
@@ -194,6 +222,8 @@ export default function AppRolePermissionsGrid() {
194222
/>
195223
</div>
196224

225+
226+
197227
<ExportCSVButton<GridItem> data={filteredItems} disabled={filteredItems.length === 0} fileName="appRolePermissions.csv" />
198228

199229
<DataGrid
@@ -202,7 +232,7 @@ export default function AppRolePermissionsGrid() {
202232
columns={columns}
203233
sortable
204234
getRowId={(item) => item.displayName}
205-
// defaultSortState={defaultSortState}
235+
defaultSortState={defaultSortState}
206236
style={{ marginBottom: "10px" }}
207237
>
208238
<DataGridHeader>
@@ -222,22 +252,6 @@ export default function AppRolePermissionsGrid() {
222252
)}
223253
</DataGridBody>
224254
</DataGrid>
225-
226-
<div>
227-
<Caption1 style={{ margin: "6px" }}>
228-
EntraOps Classifications
229-
<InfoLabel
230-
info={
231-
<Link
232-
target="_blank"
233-
href={"https://github.com/Cloud-Architekt/AzurePrivilegedIAM"}
234-
>
235-
Courtesy Cloud-Architekt (Thomas Naunheim)
236-
</Link>
237-
}
238-
></InfoLabel>
239-
</Caption1>
240-
</div>
241255
</div>
242256
);
243257
}

0 commit comments

Comments
 (0)