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

[Bug Fix]: Error while saving a new configuration for a newly created variant in the playground #1562

Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions agenta-web/src/components/Playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ const Playground: React.FC = () => {
}
getHelpers={(helpers) => (variantHelpers.current[variant.variantName] = helpers)}
tabID={tabID}
fetchData={fetchData}
/>
),
closable: !variant.persistent,
Expand Down
3 changes: 3 additions & 0 deletions agenta-web/src/components/Playground/ViewNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface Props {
onStateChange: (isDirty: boolean) => void
compareMode: boolean
tabID: React.MutableRefObject<string>
fetchData: () => Promise<void>
}

const useStyles = createUseStyles({
Expand All @@ -46,6 +47,7 @@ const ViewNavigation: React.FC<Props> = ({
onStateChange,
compareMode,
tabID,
fetchData,
}) => {
const classes = useStyles()
const router = useRouter()
Expand Down Expand Up @@ -245,6 +247,7 @@ const ViewNavigation: React.FC<Props> = ({
setIsDrawerOpen={setIsDrawerOpen}
isDrawerOpen={isDrawerOpen}
historyStatus={historyStatus}
fetchData={fetchData}
/>
</Col>
</Row>
Expand Down
3 changes: 3 additions & 0 deletions agenta-web/src/components/Playground/Views/ParametersView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface Props {
error: boolean
}>
>
fetchData: () => Promise<void>
}

const useStyles = createUseStyles({
Expand Down Expand Up @@ -90,6 +91,7 @@ const ParametersView: React.FC<Props> = ({
setIsDrawerOpen,
historyStatus,
setHistoryStatus,
fetchData,
}) => {
const classes = useStyles()
const posthog = usePostHogAg()
Expand Down Expand Up @@ -127,6 +129,7 @@ const ParametersView: React.FC<Props> = ({
content: "Changes saved successfully!",
onClose: () => handlePersistVariant(variant.variantName),
})
fetchData()
onStateChange(false)
res(true)
})
Expand Down
Loading