Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pull] main from coder:main #74

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

Merged
merged 2 commits into from
Jun 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,15 @@ export const CreateWorkspacePageViewExperimental: FC<

<div className="flex flex-col gap-9">
{parameters.map((parameter, index) => {
const parameterField = `rich_parameter_values.${index}`;
const currentParameterValueIndex =
form.values.rich_parameter_values?.findIndex(
(p) => p.name === parameter.name,
) ?? -1;
const parameterFieldIndex =
currentParameterValueIndex !== -1
? currentParameterValueIndex
: index;
const parameterField = `rich_parameter_values.${parameterFieldIndex}`;
const isPresetParameter = presetParameterNames.includes(
parameter.name,
);
Expand All @@ -629,8 +637,13 @@ export const CreateWorkspacePageViewExperimental: FC<
return null;
}

// Get the form value by parameter name to ensure correct value mapping
const formValue =
form.values?.rich_parameter_values?.[index]?.value || "";
currentParameterValueIndex !== -1
? form.values?.rich_parameter_values?.[
currentParameterValueIndex
]?.value || ""
: "";

return (
<DynamicParameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { useFormik } from "formik";
import { Plus, Trash, TriangleAlert } from "lucide-react";
import { type FC, type KeyboardEventHandler, useId, useState } from "react";
import { docs } from "utils/docs";
import { isEveryoneGroup } from "utils/groups";
import { isUUID } from "utils/uuid";
import * as Yup from "yup";
import { ExportPolicyButton } from "./ExportPolicyButton";
Expand Down Expand Up @@ -259,15 +260,17 @@ export const IdpGroupSyncForm: FC<IdpGroupSyncFormProps> = ({
className="min-w-60 max-w-3xl"
value={coderGroups}
onChange={setCoderGroups}
options={groups.map((group) => ({
label: group.display_name || group.name,
value: group.id,
}))}
options={groups
.filter((group) => !isEveryoneGroup(group))
.map((group) => ({
label: group.display_name || group.name,
value: group.id,
}))}
hidePlaceholderWhenSelected
placeholder="Select group"
emptyIndicator={
<p className="text-center text-md text-content-primary">
All groups selected
No more groups to select
</p>
}
/>
Expand Down
Loading