Skip to content

Commit

Permalink
fix: allow to select multiple projects / features in webhooks form
Browse files Browse the repository at this point in the history
Fix #905
  • Loading branch information
ptitFicus committed Nov 21, 2024
1 parent 3fb89ff commit 951661a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions izanami-frontend/src/components/FeatureSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { Loader } from "./Loader";

export function FeatureSelector(props: {
id?: string;
value?: string;
value?: string[];
onChange?: (v: string[]) => void;
}) {
const { tenant } = useParams();
const { value, onChange } = props;
const { onChange } = props;

const featureQuery = useQuery(tenantFeaturesKey(tenant!), () =>
findFeatures(tenant!)
Expand All @@ -31,9 +31,9 @@ export function FeatureSelector(props: {
inputId={props.id ?? undefined}
isMulti
value={
value
? options.find(({ value }) => props.value?.includes(value ?? ""))
: undefined
props.value
? options.filter(({ value }) => props.value?.includes(value ?? ""))
: []
}
onChange={(newValue) => {
onChange?.(newValue.map(({ value }) => value!));
Expand Down
10 changes: 5 additions & 5 deletions izanami-frontend/src/components/ProjectSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { Loader } from "./Loader";

export function ProjectSelector(props: {
id?: string;
value?: string;
value?: string[];
onChange?: (v: string[]) => void;
}) {
const { tenant } = useParams();
const { value, onChange } = props;
const { onChange } = props;

const tenantQuery = useQuery(tenantQueryKey(tenant!), () =>
queryTenant(tenant!)
Expand All @@ -32,9 +32,9 @@ export function ProjectSelector(props: {
inputId={props.id ?? undefined}
isMulti
value={
value
? options.find(({ value }) => props.value?.includes(value ?? ""))
: undefined
props.value
? options.filter(({ value }) => props.value?.includes(value ?? ""))
: []
}
onChange={(newValue) => {
onChange?.(newValue.map(({ value }) => value));
Expand Down

0 comments on commit 951661a

Please sign in to comment.