mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-23 01:05:27 +00:00
Fix org selectors
This commit is contained in:
@@ -500,6 +500,7 @@ export default function GeneralPage() {
|
|||||||
onAutoProvisionChange={(checked) => {
|
onAutoProvisionChange={(checked) => {
|
||||||
form.setValue("autoProvision", checked);
|
form.setValue("autoProvision", checked);
|
||||||
}}
|
}}
|
||||||
|
orgId={orgId as string}
|
||||||
roleMappingMode={roleMappingMode}
|
roleMappingMode={roleMappingMode}
|
||||||
onRoleMappingModeChange={(data) => {
|
onRoleMappingModeChange={(data) => {
|
||||||
setRoleMappingMode(data);
|
setRoleMappingMode(data);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -681,6 +681,9 @@ export default function PoliciesPage() {
|
|||||||
control: form.control,
|
control: form.control,
|
||||||
name: "orgMapping"
|
name: "orgMapping"
|
||||||
}}
|
}}
|
||||||
|
orgId={
|
||||||
|
editingPolicy?.orgId || policyFormOrgId
|
||||||
|
}
|
||||||
roleMappingFieldIdPrefix="admin-idp-policy-role"
|
roleMappingFieldIdPrefix="admin-idp-policy-role"
|
||||||
roleMappingMode={policyRoleMappingMode}
|
roleMappingMode={policyRoleMappingMode}
|
||||||
onRoleMappingModeChange={
|
onRoleMappingModeChange={
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ type AutoProvisionConfigWidgetProps = {
|
|||||||
roleMappingFieldIdPrefix?: string;
|
roleMappingFieldIdPrefix?: string;
|
||||||
showFreeformRoleNamesHint?: boolean;
|
showFreeformRoleNamesHint?: boolean;
|
||||||
autoProvisionSwitchId?: string;
|
autoProvisionSwitchId?: string;
|
||||||
|
orgId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AutoProvisionConfigWidget({
|
export default function AutoProvisionConfigWidget({
|
||||||
@@ -67,7 +68,8 @@ export default function AutoProvisionConfigWidget({
|
|||||||
showAutoProvisionSwitch = true,
|
showAutoProvisionSwitch = true,
|
||||||
roleMappingFieldIdPrefix = "org-idp-auto-provision",
|
roleMappingFieldIdPrefix = "org-idp-auto-provision",
|
||||||
showFreeformRoleNamesHint = false,
|
showFreeformRoleNamesHint = false,
|
||||||
autoProvisionSwitchId = "auto-provision-toggle"
|
autoProvisionSwitchId = "auto-provision-toggle",
|
||||||
|
orgId
|
||||||
}: AutoProvisionConfigWidgetProps) {
|
}: AutoProvisionConfigWidgetProps) {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const { isPaidUser } = usePaidStatus();
|
const { isPaidUser } = usePaidStatus();
|
||||||
@@ -106,6 +108,7 @@ export default function AutoProvisionConfigWidget({
|
|||||||
showFreeformRoleNamesHint={
|
showFreeformRoleNamesHint={
|
||||||
showFreeformRoleNamesHint
|
showFreeformRoleNamesHint
|
||||||
}
|
}
|
||||||
|
orgId={orgId}
|
||||||
roleMappingMode={roleMappingMode}
|
roleMappingMode={roleMappingMode}
|
||||||
onRoleMappingModeChange={onRoleMappingModeChange}
|
onRoleMappingModeChange={onRoleMappingModeChange}
|
||||||
roles={roles}
|
roles={roles}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import { useEnvContext } from "@app/hooks/useEnvContext";
|
|||||||
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { RolesSelector } from "./roles-selector";
|
import { RolesSelector } from "./roles-selector";
|
||||||
import { useParams } from "next/navigation";
|
|
||||||
|
|
||||||
export type RoleMappingRoleOption = {
|
export type RoleMappingRoleOption = {
|
||||||
roleId: number;
|
roleId: number;
|
||||||
@@ -40,6 +39,8 @@ export type RoleMappingConfigFieldsProps = {
|
|||||||
fieldIdPrefix?: string;
|
fieldIdPrefix?: string;
|
||||||
/** When true, show extra hint for global default policies (no org role list). */
|
/** When true, show extra hint for global default policies (no org role list). */
|
||||||
showFreeformRoleNamesHint?: boolean;
|
showFreeformRoleNamesHint?: boolean;
|
||||||
|
/** Org ID to use for role lookup. Falls back to URL params when not provided. */
|
||||||
|
orgId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RoleMappingConfigFields({
|
export default function RoleMappingConfigFields({
|
||||||
@@ -55,14 +56,13 @@ export default function RoleMappingConfigFields({
|
|||||||
rawExpression,
|
rawExpression,
|
||||||
onRawExpressionChange,
|
onRawExpressionChange,
|
||||||
fieldIdPrefix = "role-mapping",
|
fieldIdPrefix = "role-mapping",
|
||||||
showFreeformRoleNamesHint = false
|
showFreeformRoleNamesHint = false,
|
||||||
|
orgId
|
||||||
}: RoleMappingConfigFieldsProps) {
|
}: RoleMappingConfigFieldsProps) {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const { env } = useEnvContext();
|
const { env } = useEnvContext();
|
||||||
const { isPaidUser } = usePaidStatus();
|
const { isPaidUser } = usePaidStatus();
|
||||||
|
|
||||||
const { orgId } = useParams();
|
|
||||||
|
|
||||||
const supportsMultipleRolesPerUser = isPaidUser(tierMatrix.fullRbac);
|
const supportsMultipleRolesPerUser = isPaidUser(tierMatrix.fullRbac);
|
||||||
const showSingleRoleDisclaimer =
|
const showSingleRoleDisclaimer =
|
||||||
!env.flags.disableEnterpriseFeatures &&
|
!env.flags.disableEnterpriseFeatures &&
|
||||||
@@ -242,6 +242,7 @@ export default function RoleMappingConfigFields({
|
|||||||
showFreeformRoleNamesHint={
|
showFreeformRoleNamesHint={
|
||||||
showFreeformRoleNamesHint
|
showFreeformRoleNamesHint
|
||||||
}
|
}
|
||||||
|
orgId={orgId}
|
||||||
supportsMultipleRolesPerUser={
|
supportsMultipleRolesPerUser={
|
||||||
supportsMultipleRolesPerUser
|
supportsMultipleRolesPerUser
|
||||||
}
|
}
|
||||||
@@ -318,7 +319,8 @@ function BuilderRuleRow({
|
|||||||
supportsMultipleRolesPerUser,
|
supportsMultipleRolesPerUser,
|
||||||
showRemoveButton,
|
showRemoveButton,
|
||||||
onChange,
|
onChange,
|
||||||
onRemove
|
onRemove,
|
||||||
|
orgId
|
||||||
}: {
|
}: {
|
||||||
rule: MappingBuilderRule;
|
rule: MappingBuilderRule;
|
||||||
roleOptions: Tag[];
|
roleOptions: Tag[];
|
||||||
@@ -330,10 +332,10 @@ function BuilderRuleRow({
|
|||||||
showRemoveButton: boolean;
|
showRemoveButton: boolean;
|
||||||
onChange: (rule: MappingBuilderRule) => void;
|
onChange: (rule: MappingBuilderRule) => void;
|
||||||
onRemove: () => void;
|
onRemove: () => void;
|
||||||
|
orgId?: string;
|
||||||
}) {
|
}) {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const [activeTagIndex, setActiveTagIndex] = useState<number | null>(null);
|
const [activeTagIndex, setActiveTagIndex] = useState<number | null>(null);
|
||||||
const { orgId } = useParams();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user