Skip to content

Chore: Some House Keeping #4214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/api/ApiCall.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
keepPreviousData,
useInfiniteQuery,
useMutation,
useQuery,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CSVReader.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { useCSVReader, lightenDarkenColor, formatFileSize } from "react-papaparse";

const GREY = "#CCC";
Expand Down
1 change: 0 additions & 1 deletion src/components/CippCards/CippBannerListCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ CippBannerListCard.propTypes = {
actionButton: PropTypes.element,
propertyItems: PropTypes.array,
table: PropTypes.object,
actionButton: PropTypes.element,
isFetching: PropTypes.bool,
children: PropTypes.node,
cardLabelBoxActions: PropTypes.element,
Expand Down
4 changes: 2 additions & 2 deletions src/components/CippCards/CippDomainCards.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";
import {
Button,
Collapse,
Expand Down Expand Up @@ -477,7 +477,7 @@ export const CippDomainCards = ({ domain: propDomain = "", fullwidth = false })
waiting: !!domain && enableHttps,
});

// Adjust grid item size based on fullwidth prop
// Adjust Grid size based on fullwidth prop
const gridItemSize = fullwidth ? 12 : 4;

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippCards/CippInfoBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const CippInfoBar = ({ data, isFetching }) => {
}}
>
<Grid container spacing={1}>
<Grid item size={{ xs: 12 }}>
<Grid size={{ xs: 12 }}>
{item?.offcanvas?.propertyItems?.length > 0 && (
<CippPropertyListCard
isFetching={isFetching}
Expand Down
1 change: 0 additions & 1 deletion src/components/CippCards/CippPageCard.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useRouter } from "next/router";
import { Box, Container, Stack, Button, SvgIcon, Typography, Card } from "@mui/material";
import ArrowLeftIcon from "@mui/icons-material/ArrowLeft";
import Head from "next/head";
import { CippHead } from "../CippComponents/CippHead";
const CippPageCard = (props) => {
const {
Expand Down
1 change: 0 additions & 1 deletion src/components/CippCards/CippRemediationCard.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Button, Typography, List, ListItem, SvgIcon } from "@mui/material";
import CippButtonCard from "./CippButtonCard"; // Adjust the import path as needed
import { CippApiDialog } from "../CippComponents/CippApiDialog";
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippCards/CippUniversalSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Results = ({ items = [], searchValue }) => {
</Typography>
<Grid container spacing={2} mt={2}>
{displayedResults.map((item, key) => (
<Grid item size={{ md: 4, sm: 6, xs: 12 }} key={key}>
<Grid size={{ md: 4, sm: 6, xs: 12 }} key={key}>
<ResultsRow match={item} searchValue={searchValue} />
</Grid>
))}
Expand Down
3 changes: 1 addition & 2 deletions src/components/CippComponents/AppApprovalTemplateForm.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { Alert, Skeleton, Stack, Typography, Button, Box } from "@mui/material";
import { ApiGetCall } from "/src/api/ApiCall";
import { CippFormComponent } from "./CippFormComponent";
import { CippApiResults } from "./CippApiResults";
import { Grid } from "@mui/system";
Expand Down
6 changes: 2 additions & 4 deletions src/components/CippComponents/BPASyncDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { useState } from "react";
import { useState } from "react";
import {
Dialog,
DialogContent,
DialogTitle,
Button,
DialogActions,
Alert,
CircularProgress,
} from "@mui/material";
import { CheckCircle, Error, Sync } from "@mui/icons-material";
import { Sync } from "@mui/icons-material";
import { useForm, FormProvider } from "react-hook-form";
import { CippFormTenantSelector } from "./CippFormTenantSelector";
import { ApiPostCall } from "/src/api/ApiCall";
Expand Down
3 changes: 1 addition & 2 deletions src/components/CippComponents/CIPPDeviceCodeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import { useState, useEffect } from "react";
import {
Alert,
Button,
Stack,
Typography,
CircularProgress,
Box,
} from "@mui/material";
import { ApiGetCall, ApiPostCall } from "../../api/ApiCall";
import { ApiGetCall } from "../../api/ApiCall";

/**
* CIPPDeviceCodeButton - A button component for Microsoft 365 OAuth authentication using device code flow
Expand Down
1 change: 0 additions & 1 deletion src/components/CippComponents/CippApiResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import React from "react";
import { CippTableDialog } from "./CippTableDialog";
import { EyeIcon } from "@heroicons/react/24/outline";
import { useDialog } from "../../hooks/use-dialog";
import { useRouter } from "next/router";

const extractAllResults = (data) => {
const results = [];
Expand Down
22 changes: 11 additions & 11 deletions src/components/CippComponents/CippAppPermissionBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ const CippAppPermissionBuilder = ({
<>
<Stack spacing={2}>
<Grid container sx={{ display: "flex", alignItems: "center" }} spacing={2}>
<Grid item size={{ xl: 8, xs: 12 }}>
<Grid size={{ xl: 8, xs: 12 }}>
<CippFormComponent
type="autoComplete"
label="Application Permissions"
Expand All @@ -594,7 +594,7 @@ const CippAppPermissionBuilder = ({
multiple={false}
/>
</Grid>
<Grid item>
<Grid>
<Tooltip title="Add Permission">
<div
onClick={() =>
Expand Down Expand Up @@ -640,7 +640,7 @@ const CippAppPermissionBuilder = ({
</Alert>
)}
<Grid container sx={{ display: "flex", alignItems: "center" }} spacing={2}>
<Grid item size={{ xl: 8, xs: 12 }}>
<Grid size={{ xl: 8, xs: 12 }}>
<CippFormComponent
type="autoComplete"
label="Delegated Permissions"
Expand All @@ -656,7 +656,7 @@ const CippAppPermissionBuilder = ({
multiple={false}
/>
</Grid>
<Grid item sx={{ ms: 2 }}>
<Grid sx={{ ms: 2 }}>
<Tooltip title="Add Permission">
<div
onClick={() =>
Expand Down Expand Up @@ -748,7 +748,7 @@ const CippAppPermissionBuilder = ({
</IconButton>
</Stack>
</Grid>
<Grid item>
<Grid>
<Stack direction="row" spacing={1}>
<Tooltip
title={
Expand Down Expand Up @@ -840,7 +840,7 @@ const CippAppPermissionBuilder = ({
}}
>
<Grid container>
<Grid item size={12}>
<Grid size={12}>
<Typography variant="h4" sx={{ mb: 2 }}>
Import Permission Manifest
</Typography>
Expand All @@ -852,7 +852,7 @@ const CippAppPermissionBuilder = ({
</Grid>
</Grid>
<Grid container>
<Grid item size={12}>
<Grid size={12}>
<FileDropzone
onDrop={onManifestImport}
accept={{
Expand All @@ -872,12 +872,12 @@ const CippAppPermissionBuilder = ({
{importedManifest && (
<>
<Grid container sx={{ mt: 2 }} spacing={2}>
<Grid item size={12}>
<Grid size={12}>
<Alert color="success" icon={<TaskAlt />}>
Manifest is valid. Click Import to apply the permissions.
</Alert>
</Grid>
<Grid item size={12}>
<Grid size={12}>
<Button
variant="contained"
onClick={() => importManifest()}
Expand All @@ -892,7 +892,7 @@ const CippAppPermissionBuilder = ({
</Grid>
</Grid>
<Grid container className="mt-3">
<Grid item size={12}>
<Grid size={12}>
<h4>Preview</h4>
<CippCodeBlock
code={JSON.stringify(importedManifest, null, 2)}
Expand Down Expand Up @@ -1096,7 +1096,7 @@ const CippAppPermissionBuilder = ({
</Grid>

<Grid container sx={{ display: "flex", alignItems: "center" }}>
<Grid item size={{ xl: 1, xs: 12 }}>
<Grid size={{ xl: 1, xs: 12 }}>
<Button
variant="contained"
startIcon={
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippCentralSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const CippCentralSearch = ({ handleClose, open }) => {
filteredItems.length > 0 ? (
<Grid container spacing={2} mt={2}>
{filteredItems.map((item, index) => (
<Grid item size={{ md: 12, sm: 12, xs: 12 }} key={index}>
<Grid size={{ md: 12, sm: 12, xs: 12 }} key={index}>
<Card variant="outlined" sx={{ height: "100%" }}>
<CardActionArea
onClick={() => handleCardClick(item.path)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippCodeBlock.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { atomDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
import SyntaxHighlighter from "react-syntax-highlighter";
import { CippCopyToClipBoard } from "./CippCopyToClipboard";
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippComponentDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const CippComponentDialog = (props) => {
<Dialog fullWidth maxWidth="sm" onClose={createDialog.handleClose} open={createDialog.open}>
<form onSubmit={formHook.handleSubmit(onSubmit)}>
<DialogTitle>{title}</DialogTitle>
<DialogContent>{...children}</DialogContent>
<DialogContent>{children}</DialogContent>
<DialogActions>
<Button color="inherit" onClick={createDialog.handleClose}>
Close
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippDevOptions.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSettings } from "../../hooks/use-settings";
import { Button, Card, CardHeader, Divider, CardContent, SvgIcon } from "@mui/material";
import { CodeBracketIcon, CogIcon } from "@heroicons/react/24/outline";
import { CodeBracketIcon } from "@heroicons/react/24/outline";

export const CippDevOptions = () => {
const settings = useSettings();
Expand Down
1 change: 0 additions & 1 deletion src/components/CippComponents/CippDropzone.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React, { useCallback, useMemo, useState } from "react";
import PropTypes from "prop-types";
//import { CippContentCard } from 'src/components/layout'
import { useDropzone } from "react-dropzone";
Expand Down
1 change: 0 additions & 1 deletion src/components/CippComponents/CippFormContactSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { CippFormComponent } from "./CippFormComponent";
import { useWatch } from "react-hook-form";
import { useSettings } from "../../hooks/use-settings";
Expand Down
81 changes: 40 additions & 41 deletions src/components/CippComponents/CippFormDomainSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
import React from "react";
import { CippFormComponent } from "./CippFormComponent";
import { useWatch } from "react-hook-form";
import { useSettings } from "../../hooks/use-settings";

export const CippFormDomainSelector = ({
formControl,
name,
label,
allTenants = false,
type = "multiple",
...other
}) => {
const currentTenant = useWatch({ control: formControl.control, name: "tenantFilter" });
const selectedTenant = useSettings().currentTenant;
return (
<CippFormComponent
name={name}
label={label}
type="autoComplete"
formControl={formControl}
multiple={false}
api={{
autoSelectFirstItem: true,
tenantFilter: currentTenant ? currentTenant.value : selectedTenant,
queryKey: `listDomains-${currentTenant?.value ? currentTenant.value : selectedTenant}`,
url: "/api/ListGraphRequest",
dataKey: "Results",
labelField: (option) => `${option.id}`,
valueField: "id",
data: {
Endpoint: "domains",
manualPagination: true,
$count: true,
$top: 99,
},
}}
{...other}
/>
);
};
import { CippFormComponent } from "./CippFormComponent";
import { useWatch } from "react-hook-form";
import { useSettings } from "../../hooks/use-settings";

export const CippFormDomainSelector = ({
formControl,
name,
label,
allTenants = false,
type = "multiple",
...other
}) => {
const currentTenant = useWatch({ control: formControl.control, name: "tenantFilter" });
const selectedTenant = useSettings().currentTenant;
return (
<CippFormComponent
name={name}
label={label}
type="autoComplete"
formControl={formControl}
multiple={false}
api={{
autoSelectFirstItem: true,
tenantFilter: currentTenant ? currentTenant.value : selectedTenant,
queryKey: `listDomains-${currentTenant?.value ? currentTenant.value : selectedTenant}`,
url: "/api/ListGraphRequest",
dataKey: "Results",
labelField: (option) => `${option.id}`,
valueField: "id",
data: {
Endpoint: "domains",
manualPagination: true,
$count: true,
$top: 99,
},
}}
{...other}
/>
);
};
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippFormInputArray.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, TextField, IconButton, Typography, SvgIcon } from "@mui/material";
import { TextField, IconButton, Typography, SvgIcon } from "@mui/material";
import { Controller, useFieldArray } from "react-hook-form";
import { Add, Remove } from "@mui/icons-material";

Expand Down
1 change: 0 additions & 1 deletion src/components/CippComponents/CippFormLicenseSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { CippFormComponent } from "./CippFormComponent";
import { getCippLicenseTranslation } from "../../utils/get-cipp-license-translation";
import { useSettings } from "../../hooks/use-settings";
Expand Down
1 change: 0 additions & 1 deletion src/components/CippComponents/CippFormUserSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { CippFormComponent } from "./CippFormComponent";
import { useWatch } from "react-hook-form";
import { useSettings } from "../../hooks/use-settings";
Expand Down
8 changes: 4 additions & 4 deletions src/components/CippComponents/CippGeoLocation.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { Card, CardContent, CardHeader, Skeleton } from "@mui/material";
import { useEffect, useState } from "react";
import { Skeleton } from "@mui/material";
import { Grid } from "@mui/system";
import dynamic from "next/dynamic";
import { ApiPostCall } from "/src/api/ApiCall";
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function CippGeoLocation({ ipAddress, cardProps }) {

return (
<Grid container spacing={2}>
<Grid item size={{ xs: 12, sm: 8 }}>
<Grid size={{ xs: 12, sm: 8 }}>
{geoLookup.isPending ? (
<Skeleton variant="rectangular" height={400} />
) : (
Expand All @@ -78,7 +78,7 @@ export default function CippGeoLocation({ ipAddress, cardProps }) {
</>
)}
</Grid>
<Grid item size={{ xs: 12, sm: 4 }}>
<Grid size={{ xs: 12, sm: 4 }}>
<CippPropertyList
propertyItems={properties}
showDivider={false}
Expand Down
Loading
Loading