Skip to content

Commit

Permalink
Merge pull request #3316 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
bugfixes
  • Loading branch information
JohnDuprey authored Jan 16, 2025
2 parents 2864974 + 51e77b5 commit 904baa0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/components/CippComponents/CippFormLicenseSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { CippFormComponent } from "./CippFormComponent";
import { useWatch } from "react-hook-form";
import { getCippLicenseTranslation } from "../../utils/get-cipp-license-translation";
import { useSettings } from "../../hooks/use-settings";

export const CippFormLicenseSelector = ({
formControl,
Expand All @@ -12,25 +12,26 @@ export const CippFormLicenseSelector = ({
addedField,
...other
}) => {
const currentTenant = useWatch({ control: formControl.control, name: "tenantFilter" });
const userSettingsDefaults = useSettings();
return (
<CippFormComponent
name={name}
label={label}
type="autoComplete"
formControl={formControl}
multiple={multiple}
creatable={false}
api={{
addedField: addedField,
tenantFilter: currentTenant ? currentTenant.value : undefined,
tenantFilter: userSettingsDefaults.currentTenant ?? undefined,
url: "/api/ListGraphRequest",
dataKey: "Results",
labelField: (option) =>
`${getCippLicenseTranslation([option])} (${
option.prepaidUnits.enabled - option.consumedUnits
} available)`,
valueField: "skuId",
queryKey: `ListLicenses-${currentTenant?.value}`,
queryKey: `ListLicenses-${userSettingsDefaults.currentTenant ?? undefined}`,
data: {
Endpoint: "subscribedSkus",
$count: true,
Expand Down
9 changes: 6 additions & 3 deletions src/pages/tenant/gdap-management/roles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ const actions = [
{
label: "Delete Mapping",
icon: <TrashIcon />,
modal: true,
modalUrl: "/api/ExecDeleteGDAPRoleMapping?&GroupId=[GroupId]",
modalMessage:
type: "POST",
url: "/api/ExecDeleteGDAPRoleMapping",
body: {
GroupId: "GroupId",
},
confirmText:
"Are you sure you want to delete this role mapping? (Note: This does not delete the associated security groups or modify any GDAP relationships.)",
},
];
Expand Down

0 comments on commit 904baa0

Please sign in to comment.