Skip to content

Commit

Permalink
Merge pull request #140 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
pull[bot] authored Mar 4, 2025
2 parents db166d1 + 7e0ef97 commit 5737c4d
Show file tree
Hide file tree
Showing 9 changed files with 783 additions and 45 deletions.
2 changes: 1 addition & 1 deletion public/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "7.2.3"
"version": "7.3.0"
}
6 changes: 5 additions & 1 deletion src/components/CippCards/CippUserInfoCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,14 @@ export const CippUserInfoCard = (props) => {
value={isFetching ? <Skeleton variant="text" width={100} /> : user?.jobTitle || "N/A"}
/>
<PropertyListItem
divider
label="Department"
value={isFetching ? <Skeleton variant="text" width={100} /> : user?.department || "N/A"}
/>
<PropertyListItem
divider
label="Manager"
value={isFetching ? <Skeleton variant="text" width={100} /> : user?.manager?.displayName || "N/A"}
/>
<PropertyListItem
label="Address"
value={
Expand Down
13 changes: 12 additions & 1 deletion src/components/CippFormPages/CippAddEditUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const CippAddEditUser = (props) => {
InputProps={{
endAdornment: <InputAdornment position="end">@</InputAdornment>,
}}
name="mailNickname"
name="username"
formControl={formControl}
/>
</Grid>
Expand Down Expand Up @@ -291,6 +291,17 @@ const CippAddEditUser = (props) => {
multiple={false}
/>
</Grid>
{userSettingsDefaults?.userAttributes?.some((attribute) => attribute.value === "sponsor") && (
<Grid item xs={12}>
<CippFormUserSelector
formControl={formControl}
name="setSponsor"
label="Set Sponsor"
valueField="userPrincipalName"
multiple={false}
/>
</Grid>
)}
<Grid item xs={12}>
<CippFormUserSelector
formControl={formControl}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippSettings/CippCacheSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const CippCacheSettings = () => {
api={{
url: "/api/ListTenants",
confirmText:
"This will clear the cache used by CIPP. This will slow down some aspects of the application, and should only be used when instructed to do so by support.",
"This will clear the cache used by CIPP. This will slow down some aspects of the application, and should only be used when instructed to do so by support. This will delete any cache tables including pending audit logs that have not yet been processed. Are you sure you want to continue?",
type: "POST",
data: { ClearCache: true },
replacementBehaviour: "removeNulls",
Expand Down
6 changes: 5 additions & 1 deletion src/components/CippTable/CippDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ export const CippDataTable = (props) => {
data: memoizedData,
state: {
columnVisibility,
showSkeletons: getRequestData.isFetching ? getRequestData.isFetching : isFetching,
showSkeletons: getRequestData.isFetchingNextPage
? false
: getRequestData.isFetching
? getRequestData.isFetching
: isFetching,
},
renderEmptyRowsFallback: ({ table }) =>
getRequestData.data?.pages?.[0].Metadata?.QueueMessage ? (
Expand Down
15 changes: 11 additions & 4 deletions src/layouts/side-nav-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export const SideNavItem = (props) => {
sx={{
display: "flex",
alignItems: "center",
width: "100%",
px: `${indent * 6}px`,
}}
>
<ButtonBase
Expand All @@ -161,11 +163,10 @@ export const SideNavItem = (props) => {
fontSize: fontSize,
fontWeight: 500,
justifyContent: "flex-start",
px: `${indent * 6}px`,
py: "12px",
textAlign: "left",
whiteSpace: "nowrap",
width: "100%",
width: "calc(100% - 20px)", // Adjust the width to leave space for the bookmark icon
py: "12px",
}}
{...linkProps}
>
Expand All @@ -191,6 +192,12 @@ export const SideNavItem = (props) => {
flexGrow: 1,
mx: "12px",
transition: "opacity 250ms ease-in-out",
whiteSpace: "nowrap",
...(hovered && {
maxWidth: "calc(100% - 45px)", // Adjust the width to leave space for the bookmark icon
overflow: "hidden",
textOverflow: "ellipsis",
}),
...(active && {
color: "primary.main",
}),
Expand Down Expand Up @@ -223,7 +230,7 @@ export const SideNavItem = (props) => {
fontSize: 16,
transition: "opacity 250ms ease-in-out",
cursor: "pointer",
mx: 1,
mr: 1,
display: hovered ? "block" : "none",
}}
>
Expand Down
32 changes: 25 additions & 7 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ import {
BugReport as BugReportIcon,
Feedback as FeedbackIcon,
AutoStories,
Gavel,
} from "@mui/icons-material";
import { SvgIcon } from "@mui/material";
import discordIcon from "../../public/discord-mark-blue.svg";
import React from "react";
import { usePathname } from "next/navigation";
import { useRouter } from "next/router";
TimeAgo.addDefaultLocale(en);

const ReactQueryDevtoolsProduction = React.lazy(() =>
Expand All @@ -45,39 +47,55 @@ const App = (props) => {
const getLayout = Component.getLayout ?? ((page) => page);
const preferredTheme = useMediaPredicate("(prefers-color-scheme: dark)") ? "dark" : "light";
const pathname = usePathname();
const route = useRouter();

const speedDialActions = [
{
id: "license",
icon: <Gavel />,
name: "License",
href: "/license",
onClick: () => route.push("/license"),
},
{
id: "bug-report",
icon: <BugReportIcon />,
name: "Report Bug",
href: "https://github.com/KelvinTegelaar/CIPP/issues/new?template=bug.yml",
onClick: () => window.open("https://github.com/KelvinTegelaar/CIPP/issues/new?template=bug.yml", "_blank")
onClick: () =>
window.open("https://github.com/KelvinTegelaar/CIPP/issues/new?template=bug.yml", "_blank"),
},
{
id: "feature-request",
icon: <FeedbackIcon />,
name: "Request Feature",
href: "https://github.com/KelvinTegelaar/CIPP/issues/new?template=feature.yml",
onClick: () => window.open("https://github.com/KelvinTegelaar/CIPP/issues/new?template=feature.yml", "_blank")
onClick: () =>
window.open(
"https://github.com/KelvinTegelaar/CIPP/issues/new?template=feature.yml",
"_blank"
),
},
{
id: "discord",
icon: (
<SvgIcon component={discordIcon} viewBox="0 0 127.14 96.36" sx={{ fontSize: '1.5rem' }}>
</SvgIcon>
<SvgIcon
component={discordIcon}
viewBox="0 0 127.14 96.36"
sx={{ fontSize: "1.5rem" }}
></SvgIcon>
),
name: "Join the Discord!",
href: "https://discord.gg/cyberdrain",
onClick: () => window.open("https://discord.gg/cyberdrain", "_blank")
onClick: () => window.open("https://discord.gg/cyberdrain", "_blank"),
},
{
id: "documentation",
icon: <AutoStories />,
name: "Check the Documentation",
href: `https://docs.cipp.app/user-documentation/${pathname}`,
onClick: () => window.open(`https://docs.cipp.app/user-documentation/${pathname}`, "_blank")
}
onClick: () => window.open(`https://docs.cipp.app/user-documentation/${pathname}`, "_blank"),
},
];

return (
Expand Down
38 changes: 9 additions & 29 deletions src/pages/cipp/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Page = () => {
{ value: "otherMails", label: "otherMails" },
{ value: "showInAddressList", label: "showInAddressList" },
{ value: "state", label: "state" },
{ value: "sponsor", label: "sponsor" },
];

const pageSizes = [
Expand Down Expand Up @@ -65,30 +66,15 @@ const Page = () => {
<Grid size={{ xs: 12, lg: 8 }}>
<Stack spacing={3}>
<CippPropertyListCard
layout="two"
showDivider={false}
title="General Settings"
propertyItems={[
{
label: "Added Attributes when creating a new user",
value: (
<CippFormComponent
type="autoComplete"
options={addedAttributes}
sx={{ width: "250px" }}
name="userAttributes"
formControl={formcontrol}
multiple={true}
/>
),
},
{
label: "Default new user usage location",
value: (
<CippFormComponent
type="autoComplete"
creatable={false}
sx={{ width: "250px" }}
disableClearable={true}
name="usageLocation"
formControl={formcontrol}
Expand All @@ -105,7 +91,7 @@ const Page = () => {
value: (
<CippFormComponent
type="autoComplete"
sx={{ width: "250px" }}

disableClearable={true}
defaultValue={{ value: "25", label: "25" }}
name="tablePageSize"
Expand All @@ -119,21 +105,15 @@ const Page = () => {
),
},
{
label: "Menu Favourites",
label: "Added Attributes when creating a new user",
value: (
<CippFormComponent
type="autoComplete"
sx={{ width: "250px" }}
disableClearable={true}
name="userSettingsDefaults.favourites"
options={addedAttributes}

name="userAttributes"
formControl={formcontrol}
multiple={false}
options={[
{ value: "25", label: "25" },
{ value: "50", label: "50" },
{ value: "100", label: "100" },
{ value: "250", label: "250" },
]}
multiple={true}
/>
),
},
Expand Down Expand Up @@ -293,10 +273,10 @@ const Page = () => {
<CippPropertyListCard
title={`CIPP Roles for ${auth?.data?.clientPrincipal?.userDetails}`}
propertyItems={(auth?.data?.clientPrincipal?.userRoles ?? [])
.filter((role) => !['anonymous', 'authenticated'].includes(role))
.filter((role) => !["anonymous", "authenticated"].includes(role))
.map((role) => ({
label: "",
value: getCippFormatting(role,"role"),
value: getCippFormatting(role, "role"),
}))}
showDivider={false}
/>
Expand Down
Loading

0 comments on commit 5737c4d

Please sign in to comment.