Skip to content
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

bugfixes #3316

Merged
merged 4 commits into from
Jan 16, 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
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
Loading