Skip to content

Commit 8104cd0

Browse files
Merge pull request KelvinTegelaar#4885 from kris6673/labels-are-cool
Display group type in labels for clarity
2 parents 6ca6d5e + 1e1a4f8 commit 8104cd0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/CippComponents/CippUserActions.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import {
2222
import { getCippLicenseTranslation } from "../../utils/get-cipp-license-translation";
2323
import { useSettings } from "/src/hooks/use-settings.js";
2424
import { usePermissions } from "../../hooks/use-permissions";
25-
import { Stack, Grid, Tooltip, Box } from "@mui/material";
25+
import { Tooltip, Box } from "@mui/material";
2626
import CippFormComponent from "./CippFormComponent";
27-
import { useForm, useWatch } from "react-hook-form";
27+
import { useWatch } from "react-hook-form";
2828

2929
// Separate component for Out of Office form to avoid hook issues
3030
const OutOfOfficeForm = ({ formControl }) => {
@@ -321,7 +321,10 @@ export const useCippUserActions = () => {
321321
validators: { required: "Please select a group" },
322322
api: {
323323
url: "/api/ListGroups",
324-
labelField: "displayName",
324+
labelField: (option) =>
325+
option?.calculatedGroupType
326+
? `${option.displayName} (${option.calculatedGroupType})`
327+
: option?.displayName ?? "",
325328
valueField: "id",
326329
addedField: {
327330
groupType: "calculatedGroupType",

0 commit comments

Comments
 (0)