Skip to content

Commit

Permalink
add pages
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Nov 21, 2024
1 parent c8f7474 commit 464113c
Show file tree
Hide file tree
Showing 9 changed files with 398 additions and 265 deletions.
459 changes: 236 additions & 223 deletions src/components/CippWizard/CippWizardOffboarding.jsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/layouts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const items = [
path: "/tenant/administration/appapproval",
},
{ title: "IP Database", path: "/tenant/tools/geoiplookup" },
{ title: "Tenant Lookup", path: "/tenant/administration/tenantlookup" },
{ title: "Tenant Lookup", path: "/tenant/tools/tenantlookup" },
{
title: "Individual Domain Check",
path: "/tenant/standards/individual-domains",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Page = () => {
title: "Select the users to offboard",
name: "user",
placeholder: "Select User",
type: "multiple",
api: {
url: "/api/ListGraphRequest",
dataKey: "Results",
Expand Down
1 change: 0 additions & 1 deletion src/pages/identity/reports/mfa-report/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"
const Page = () => {
const pageTitle = "MFA Report";
const apiUrl = "/api/ListMFAUsers";

const simpleColumns = [
"UPN",
"AccountEnabled",
Expand Down
33 changes: 19 additions & 14 deletions src/pages/identity/reports/risk-detections/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";

Expand All @@ -16,18 +15,18 @@ const Page = () => {

const offCanvas = {
extendedInfoFields: [
"userId",
"userDisplayName",
"userPrincipalName",
"detectedDateTime",
"location",
"ipAddress",
"riskLevel",
"riskState",
"riskDetail",
"riskEventType",
"detectionTimingType",
"activity"
"userId",
"userDisplayName",
"userPrincipalName",
"detectedDateTime",
"location",
"ipAddress",
"riskLevel",
"riskState",
"riskDetail",
"riskEventType",
"detectionTimingType",
"activity",
],
actions: actions,
};
Expand All @@ -43,7 +42,7 @@ const Page = () => {
"riskType",
"riskEventType",
"detectionTimingType",
"activity"
"activity",
];

// Note to Developer: Add necessary filter logic here
Expand All @@ -63,6 +62,12 @@ const Page = () => {
<CippTablePage
title={pageTitle}
apiUrl={apiUrl}
apiData={{
Endpoint: "identityProtection/riskDetections",
manualPagination: true,
$count: true,
$top: 999,
}}
apiDataKey="Results"
actions={actions}
offCanvas={offCanvas}
Expand Down
16 changes: 5 additions & 11 deletions src/pages/tenant/administration/authentication-methods/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";

Expand All @@ -7,27 +6,22 @@ const Page = () => {
const apiUrl = "/api/ListGraphRequest";

// Columns configuration based on provided structure
const simpleColumns = [
"id",
"state",
"includeTargets",
"excludeTargets",
];
const simpleColumns = ["id", "state", "includeTargets", "excludeTargets"];

const actions = [
{
label: "Enable Policy",
type: "POST",
url: "/api/SetAuthMethod",
data: { state: "enabled", id: "id", TenantFilter: "defaultDomainName" },
data: { state: "enabled", id: "id" },
confirmText: "Are you sure you want to enable this policy?",
multiPost: false,
},
{
label: "Disable Policy",
type: "POST",
url: "/api/SetAuthMethod",
data: { state: "disabled", id: "id", TenantFilter: "defaultDomainName" },
data: { state: "disabled", id: "id" },
confirmText: "Are you sure you want to disable this policy?",
multiPost: false,
},
Expand All @@ -44,11 +38,11 @@ const Page = () => {
apiUrl={apiUrl}
apiData={{
Endpoint: "authenticationMethodsPolicy",
TenantFilter: "defaultDomainName", // Dynamically pass tenant here
}}
apiDataKey="Results"
apiDataKey="Results.0.authenticationMethodConfigurations"
simpleColumns={simpleColumns}
offCanvas={offCanvas}
actions={actions}
dynamicColumns={false}
/>
);
Expand Down
6 changes: 2 additions & 4 deletions src/pages/tenant/administration/enterprise-apps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"
const Page = () => {
const pageTitle = "Enterprise Applications";
const apiUrl = "/api/ListGraphRequest";

const actions = [];

const offCanvas = {
Expand All @@ -24,7 +23,6 @@ const Page = () => {
];

const apiParams = {
TenantFilter: "tenant?.defaultDomainName", // dynamically use the tenant filter
Endpoint: "servicePrincipals",
Parameters: {
$filter: "tags/any(t:t eq 'WindowsAzureActiveDirectoryIntegratedApp')",
Expand All @@ -37,15 +35,15 @@ const Page = () => {
<CippTablePage
title={pageTitle}
apiUrl={apiUrl}
apiData={apiParams}
apiDataKey="Results"
actions={actions}
offCanvas={offCanvas}
simpleColumns={simpleColumns}
params={apiParams} // Adding API parameters here
/>
);
};

Page.getLayout = (page) => <DashboardLayout>{page}</DashboardLayout>;

export default Page;
export default Page;
20 changes: 9 additions & 11 deletions src/pages/tenant/administration/partner-relationships/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";

Expand All @@ -11,18 +10,17 @@ const Page = () => {

// Columns definition based on provided structure
const simpleColumns = [
"Tenant", // Tenant name
"TenantInfo.displayName", // Partner name
"isServiceProvider", // Service provider status
"isInMultiTenantOrganization", // Multi-tenant status
"TenantInfo" // Partner information
"Tenant", // Tenant name
"TenantInfo.displayName", // Partner name
"isServiceProvider", // Service provider status
"isInMultiTenantOrganization", // Multi-tenant status
"TenantInfo", // Partner information
];

// API Data configuration for the request
const apiData = {
Endpoint: "policies/crossTenantAccessPolicy/partners", // API endpoint for partner relationships
ReverseTenantLookup: true, // Reverse lookup for tenant details
TenantFilter: "defaultTenantId", // Tenant customerId (can be replaced dynamically if needed)
Endpoint: "policies/crossTenantAccessPolicy/partners", // API endpoint for partner relationships
ReverseTenantLookup: true, // Reverse lookup for tenant details
};

return (
Expand All @@ -31,8 +29,8 @@ const Page = () => {
apiUrl={apiUrl}
apiDataKey="Results"
simpleColumns={simpleColumns}
apiData={apiData} // Corrected API data passed here
dynamicColumns={false} // No dynamic column toggling
apiData={apiData} // Corrected API data passed here
dynamicColumns={false} // No dynamic column toggling
/>
);
};
Expand Down
125 changes: 125 additions & 0 deletions src/pages/tenant/tools/tenantlookup/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import {
Box,
Button,
Container,
Grid,
Typography,
CircularProgress,
Skeleton,
Link,
} from "@mui/material";
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { useForm, useWatch } from "react-hook-form";
import CippButtonCard from "../../../../components/CippCards/CippButtonCard";
import { Search } from "@mui/icons-material";
import CippFormComponent from "../../../../components/CippComponents/CippFormComponent";
import { ApiGetCall } from "../../../../api/ApiCall";

const Page = () => {
const formControl = useForm({ mode: "onBlur" });
const domain = useWatch({ control: formControl.control, name: "domain" });
const getGeoIP = ApiGetCall({
url: "/api/ListExternalTenantInfo",
data: { tenant: domain },
queryKey: `tenant-${domain}`,
waiting: false,
});

return (
<Box
sx={{
flexGrow: 1,
py: 4,
}}
>
<Container maxWidth={false}>
<Grid container spacing={3}>
<Grid item xs={4}>
<CippButtonCard
title="Tenant lookup"
cardSx={{ display: "flex", flexDirection: "column", height: "100%" }}
>
<Grid container spacing={2}>
<Grid item xs={8}>
<CippFormComponent
formControl={formControl}
name="domain"
type="textField"
placeholder="Domain name"
required
/>
</Grid>
<Grid item xs={4}>
<Button
type="submit"
onClick={() => getGeoIP.refetch()}
variant="contained"
startIcon={<Search />}
>
Check
</Button>
</Grid>
</Grid>
</CippButtonCard>
</Grid>

{/* Results Card */}
{getGeoIP.isFetching ? (
<Grid item xs={8}>
<CippButtonCard title="Fetching Results">
<Grid container spacing={2}>
<Grid item xs={12} textAlign="center">
<Skeleton width={"100%"} />
</Grid>
</Grid>
</CippButtonCard>
</Grid>
) : getGeoIP.data ? (
<Grid item xs={8}>
<CippButtonCard title="Geo IP Results">
<Grid container spacing={2}>
<Grid item xs={6}>
<Typography variant="body1">
<strong>Tenant Name:</strong> {domain}
</Typography>
<Typography variant="body1">
<strong>Tenant Id:</strong> {getGeoIP.data?.GraphRequest?.tenantId}
</Typography>
<Typography variant="body1">
<strong>Default Domain Name:</strong>{" "}
{getGeoIP.data?.GraphRequest?.defaultDomainName}
</Typography>
<Typography variant="body1">
<strong>Tenant Brand Name :</strong>{" "}
{getGeoIP.data?.GraphRequest?.federationBrandName
? getGeoIP.data?.GraphRequest?.federationBrandName
: "N/A"}
</Typography>
</Grid>
<Grid item xs={6}>
<Typography variant="body1">
<strong>domains:</strong>
</Typography>
<Typography variant="body1">
{getGeoIP.data?.Domains?.map((domain) => (
<li>
<Link href={`https://${domain}`} target="_blank">
{domain}
</Link>
</li>
))}
</Typography>
</Grid>
</Grid>
</CippButtonCard>
</Grid>
) : null}
</Grid>
</Container>
</Box>
);
};

Page.getLayout = (page) => <DashboardLayout>{page}</DashboardLayout>;

export default Page;

0 comments on commit 464113c

Please sign in to comment.