Skip to content

Commit

Permalink
fix(ui): list goals not using the connection type (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalgrg519 authored Feb 5, 2025
1 parent e3f44ee commit dc8a295
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ui/web-v2/src/components/AddGoalSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ const AddGoalModal: FC<AddGoalModalProps> = ({
searchKeyword: '',
status: null,
orderBy: ListGoalsRequest.OrderBy.NAME,
orderDirection: ListGoalsRequest.OrderDirection.ASC
orderDirection: ListGoalsRequest.OrderDirection.ASC,
connectionType
})
).then(() => {
setValue(name, isMulti ? [...watchGoalIds, data.id] : data.id, {
Expand Down
5 changes: 3 additions & 2 deletions ui/web-v2/src/components/EventRateAddUpdateForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export const EventRateAddUpdateForm: FC<EventRateAddUpdateFormProps> = memo(
searchKeyword: '',
status: null,
orderBy: ListGoalsRequest.OrderBy.NAME,
orderDirection: ListGoalsRequest.OrderDirection.ASC
orderDirection: ListGoalsRequest.OrderDirection.ASC,
connectionType: Goal.ConnectionType.OPERATION
})
);
}, [dispatch, featureId, currentEnvironment]);
Expand Down Expand Up @@ -151,7 +152,7 @@ export const EventRateAddUpdateForm: FC<EventRateAddUpdateFormProps> = memo(
const goalOptions = goals.map((goal) => {
return {
value: goal.id,
label: goal.id
label: `${goal.id} (${goal.name})`
};
});

Expand Down
6 changes: 4 additions & 2 deletions ui/web-v2/src/components/ExperimentAddForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export const ExperimentAddForm: FC<ExperimentAddFormProps> = memo(
const goalOptions = goals.map((goal) => {
return {
value: goal.id,
label: `${goal.id}(${goal.name})`
label: `${goal.id} (${goal.name})`
};
});

const methods = useFormContext();
const {
register,
Expand Down Expand Up @@ -116,7 +117,8 @@ export const ExperimentAddForm: FC<ExperimentAddFormProps> = memo(
status: null,
orderBy: ListGoalsRequest.OrderBy.DEFAULT,
orderDirection: ListGoalsRequest.OrderDirection.ASC,
archived: false
archived: false,
connectionType: Goal.ConnectionType.EXPERIMENT
})
);
dispatch(
Expand Down
3 changes: 3 additions & 0 deletions ui/web-v2/src/modules/goals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ interface ListGoalsParams {
archived?: boolean;
orderBy: OrderBy;
orderDirection: OrderDirection;
connectionType?: Goal.ConnectionTypeMap[keyof Goal.ConnectionTypeMap];
}

export const listGoals = createAsyncThunk<
Expand All @@ -81,6 +82,8 @@ export const listGoals = createAsyncThunk<
request.setOrderBy(params.orderBy);
request.setOrderDirection(params.orderDirection);
request.setSearchKeyword(params.searchKeyword);
params.connectionType && request.setConnectionType(params.connectionType);

if (params.status != null) {
const boolValue = new BoolValue();
boolValue.setValue(params.status);
Expand Down

0 comments on commit dc8a295

Please sign in to comment.