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

fix(coral): Make all env available when using prefix in ACL request #1145

Merged
merged 1 commit into from
May 11, 2023
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 @@ -5,13 +5,23 @@ import { ExtendedEnvironment } from "src/app/features/topics/acl-request/queries
interface EnvironmentFieldProps {
environments: ExtendedEnvironment[];
selectedTopic?: string;
prefixed?: boolean;
}

const getOptions = (
environments: ExtendedEnvironment[],
prefixed: boolean,
topicName?: string
) => {
return environments.map((env) => {
if (prefixed) {
return (
<Option key={env.id} value={env.id}>
{env.name}
</Option>
);
}

if (env.topicNames.length === 0) {
return (
<Option key={env.id} value={env.id} disabled>
Expand Down Expand Up @@ -39,6 +49,7 @@ const getOptions = (
const EnvironmentField = ({
environments,
selectedTopic,
prefixed = false,
}: EnvironmentFieldProps) => {
return (
<NativeSelect
Expand All @@ -47,7 +58,7 @@ const EnvironmentField = ({
placeholder={"-- Please select --"}
required
>
{getOptions(environments, selectedTopic)}
{getOptions(environments, prefixed, selectedTopic)}
</NativeSelect>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const TopicProducerForm = ({
<EnvironmentField
environments={environments}
selectedTopic={topicname}
prefixed={aclPatternType === "PREFIXED"}
/>
</GridItem>

Expand Down