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: cannot delete endpoint URL #318

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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
4 changes: 0 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/features/providers/components/provider-form.tsx
Original file line number Diff line number Diff line change
@@ -17,8 +17,6 @@ interface Props {
export function ProviderForm({ provider, setProvider }: Props) {
const providerAuthType =
provider.auth_type || getProviderAuthByType(provider.provider_type)
const providerEndpoint =
provider.endpoint || getProviderEndpointByAuthType(provider.provider_type)

const handleProviderType = (provider: AddProviderEndpointRequest) => {
setProvider({
@@ -87,7 +85,7 @@ export function ProviderForm({ provider, setProvider }: Props) {
onChange={(endpoint) => setProvider({ ...provider, endpoint })}
>
<Label>Endpoint</Label>
<Input placeholder="Provider endpoint" value={providerEndpoint} />
<Input placeholder="Provider endpoint" value={provider.endpoint} />
</TextField>
</div>
<div className="py-3">
11 changes: 8 additions & 3 deletions src/routes/route-provider-create.tsx
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import { ProviderDialog } from '@/features/providers/components/provider-dialog'
import { ProviderDialogFooter } from '@/features/providers/components/provider-dialog-footer'
import { ProviderForm } from '@/features/providers/components/provider-form'
import { useMutationCreateProvider } from '@/features/providers/hooks/use-mutation-create-provider'
import { getProviderEndpointByAuthType } from '@/features/providers/lib/utils'
import { DialogContent, Form } from '@stacklok/ui-kit'
import { useState } from 'react'

@@ -20,9 +21,13 @@ const DEFAULT_PROVIDER_STATE = {
}

export function RouteProviderCreate() {
const [provider, setProvider] = useState<AddProviderEndpointRequest>(
DEFAULT_PROVIDER_STATE
)
const [provider, setProvider] = useState<AddProviderEndpointRequest>({
...DEFAULT_PROVIDER_STATE,
endpoint: getProviderEndpointByAuthType(
DEFAULT_PROVIDER_STATE.provider_type
),
})

const { mutateAsync } = useMutationCreateProvider()

const handleSubmit = (event: React.FormEvent) => {

Unchanged files with check annotations Beta

ChatBubbleAvatar,
ChatBubbleMessage,
ChatBubbleTimestamp,
chatBubbleVariant,

Check warning on line 200 in src/components/ui/chat/chat-bubble.tsx

GitHub Actions / Static Checks / ESLint Check

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
chatBubbleMessageVariants,

Check warning on line 201 in src/components/ui/chat/chat-bubble.tsx

GitHub Actions / Static Checks / ESLint Check

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
ChatBubbleAction,
ChatBubbleActionWrapper,
}
confirm: (message: ReactNode, config: Config) => Promise<boolean>
}
export const ConfirmContext = createContext<ConfirmContextType | null>(null)

Check warning on line 37 in src/context/confirm-context.tsx

GitHub Actions / Static Checks / ESLint Check

Fast refresh only works when a file only exports components. Move your React context(s) to a separate file
export function ConfirmProvider({ children }: { children: ReactNode }) {
const [activeQuestion, setActiveQuestion] = useState<Question | null>(null)
</TestQueryClientProvider>
)
export * from '@testing-library/react'

Check warning on line 66 in src/lib/test-utils.tsx

GitHub Actions / Static Checks / ESLint Check

This rule can't verify that `export *` only exports components
export { renderWithProviders as render }

Check warning on line 68 in src/lib/test-utils.tsx

GitHub Actions / Static Checks / ESLint Check

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components