Skip to content

Commit

Permalink
Merge pull request #93 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
kris6673 authored Jan 27, 2025
2 parents 1b8eaca + 77ec401 commit 6443e37
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 41 deletions.
6 changes: 5 additions & 1 deletion src/api/ApiCall.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ export function ApiGetCallWithPagination({
return response.data;
},
getNextPageParam: (lastPage) => {
if (data?.noPagination || data?.manualPagination === false) {
if (
data?.noPagination ||
data?.manualPagination === false ||
data?.tenantFilter === "AllTenants"
) {
return undefined;
}
return lastPage?.Metadata?.nextLink ? { nextLink: lastPage.Metadata.nextLink } : undefined;
Expand Down
18 changes: 16 additions & 2 deletions src/components/CippTable/CippDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ import { ApiGetCallWithPagination } from "../../api/ApiCall";
import { utilTableMode } from "./util-tablemode";
import { utilColumnsFromAPI } from "./util-columnsFromAPI";
import { CIPPTableToptoolbar } from "./CIPPTableToptoolbar";
import { More, MoreHoriz } from "@mui/icons-material";
import { Info, More, MoreHoriz } from "@mui/icons-material";
import { CippOffCanvas } from "../CippComponents/CippOffCanvas";
import { useDialog } from "../../hooks/use-dialog";
import { CippApiDialog } from "../CippComponents/CippApiDialog";
import { getCippError } from "../../utils/get-cipp-error";
import { Box } from "@mui/system";
import { useSettings } from "../../hooks/use-settings";

export const CippDataTable = (props) => {
const {
Expand Down Expand Up @@ -61,6 +63,9 @@ export const CippDataTable = (props) => {
const [actionData, setActionData] = useState({ data: {}, action: {}, ready: false });
const [graphFilterData, setGraphFilterData] = useState({});
const waitingBool = api?.url ? true : false;

const settings = useSettings();

const getRequestData = ApiGetCallWithPagination({
url: api.url,
data: { ...api.data },
Expand Down Expand Up @@ -177,7 +182,11 @@ export const CippDataTable = (props) => {
},
renderEmptyRowsFallback: ({ table }) =>
getRequestData.data?.pages?.[0].Metadata?.QueueMessage ? (
<center>{getRequestData.data?.pages?.[0].Metadata?.QueueMessage}</center>
<Box sx={{ py: 4 }}>
<center>
<Info /> {getRequestData.data?.pages?.[0].Metadata?.QueueMessage}
</center>
</Box>
) : undefined,
onColumnVisibilityChange: setColumnVisibility,
...modeInfo,
Expand All @@ -188,6 +197,11 @@ export const CippDataTable = (props) => {
sx={{ color: action.color }}
key={`actions-list-row-${index}`}
onClick={() => {
if (settings.currentTenant === "AllTenants" && row.original?.Tenant) {
settings.handleUpdate({
currentTenant: row.original.Tenant,
});
}
setActionData({
data: row.original,
action: action,
Expand Down
2 changes: 1 addition & 1 deletion src/data/alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"recommendedRunInterval": "30d"
},
{
"name": "AppCertificateExpiry ",
"name": "AppCertificateExpiry",
"label": "Alert on expiring application certificates",
"recommendedRunInterval": "1d"
},
Expand Down
81 changes: 46 additions & 35 deletions src/pages/cipp/integrations/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,51 +120,62 @@ const Page = () => {
{extension.alertText}
</Alert>
)}
<Stack direction="row" spacing={2} sx={{ mb: 2 }}>
<Stack
direction="row"
spacing={2}
sx={{ mb: 2, display: "flex", alignItems: "center" }}
>
{extension?.hideTestButton !== true && (
<Button
variant="contained"
color="primary"
onClick={() => handleIntegrationTest()}
disabled={actionTestResults?.isLoading}
>
<SvgIcon fontSize="small" style={{ marginRight: "8" }}>
<BeakerIcon />
</SvgIcon>
Test
</Button>
<Box>
<Button
variant="contained"
color="primary"
onClick={() => handleIntegrationTest()}
disabled={actionTestResults?.isLoading}
>
<SvgIcon fontSize="small" style={{ marginRight: "8" }}>
<BeakerIcon />
</SvgIcon>
Test
</Button>
</Box>
)}
{extension?.forceSyncButton && (
<Button
variant="contained"
color="primary"
onClick={() => handleIntegrationSync()}
disabled={actionSyncResults.isLoading}
>
<SvgIcon fontSize="small" style={{ marginRight: "8" }}>
<ArrowPathIcon />
</SvgIcon>
Force Sync
</Button>
<Box>
<Button
variant="contained"
color="primary"
onClick={() => handleIntegrationSync()}
disabled={actionSyncResults.isLoading}
>
<SvgIcon fontSize="small" style={{ marginRight: "8" }}>
<ArrowPathIcon />
</SvgIcon>
Force Sync
</Button>
</Box>
)}
{extension?.links && (
<>
{extension.links.map((link, index) => (
<Button
href={link.url}
target="_blank"
rel="noreferrer"
color="inherit"
key={index}
>
<SvgIcon fontSize="small" style={{ marginRight: "8" }}>
<ArrowTopRightOnSquareIcon />
</SvgIcon>
{link.name}
</Button>
<Box>
<Button
href={link.url}
target="_blank"
rel="noreferrer"
color="inherit"
key={index}
>
<SvgIcon fontSize="small" style={{ marginRight: "8" }}>
<ArrowTopRightOnSquareIcon />
</SvgIcon>
{link.name}
</Button>
</Box>
))}
</>
)}

<CippApiResults apiObject={actionTestResults} />
<CippApiResults apiObject={actionSyncResults} />
</Stack>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/tenant/gdap-management/invites/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const Page = () => {

const createCippDefaults = ApiPostCall({
urlFromData: true,
relatedQueryKeys: ["ListGDAPRoleTemplatesAutocomplete"],
relatedQueryKeys: ["ListGDAPRoleTemplatesAutocomplete", "ListGDAPRoleTemplates"],
});

const templateList = ApiGetCall({
url: "/api/ExecGDAPRoleTemplate",
queryKey: "ListGDAPRoleTemplatesAutocomplete",
queryKey: "ListGDAPRoleTemplates",
});
const selectedTemplate = useWatch({ control: formControl.control, name: "roleMappings" });

Expand Down

0 comments on commit 6443e37

Please sign in to comment.