Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Apr 27, 2024
1 parent 39339d7 commit bb3ef0b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ interface GithubProviderFormProps {
deletable?: boolean
}

export const ProviderForm: React.FC<GithubProviderFormProps> = ({
export const CommonProviderForm: React.FC<GithubProviderFormProps> = ({
isNew,
form,
onSubmit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ interface GitProvidersTableProps {
data: RepositoryProvidersViewProps['providers']
}
const GitProvidersList: React.FC<GitProvidersTableProps> = ({ data }) => {
const kind = useRepositoryKind()
return (
<div className="space-y-8">
{data?.map(item => {
Expand All @@ -100,7 +101,7 @@ const GitProvidersList: React.FC<GitProvidersTableProps> = ({ data }) => {
</div>
</CardTitle>
<Link
href={`github/detail?id=${item.node.id}`}
href={`${kind.toLocaleLowerCase()}/detail?id=${item.node.id}`}
className={buttonVariants({ variant: 'secondary' })}
>
View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ export default function LinkRepositoryForm({
const emptyText = React.useMemo(() => {
switch (providerStatus) {
case RepositoryProviderStatus.Pending:
return 'Synchronizing Repositories...'
return 'Awaiting the next data synchronization'
case RepositoryProviderStatus.Error:
return 'Synchronization Error with Repositories'
return 'Synchronizing error. Please check if the access token is still valid'
default:
return 'No repository found.'
return 'No repository found'
}
}, [providerStatus])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { graphql } from '@/lib/gql/generates'
import { useMutation } from '@/lib/tabby/gql'

import {
ProviderForm,
CommonProviderForm,
RepositoryProviderFormValues,
useRepositoryProviderForm
} from '../../components/common-provider-form'
Expand Down Expand Up @@ -80,7 +80,7 @@ export const UpdateProviderForm: React.FC<UpdateProviderFormProps> = ({
}

return (
<ProviderForm
<CommonProviderForm
onSubmit={onSubmit}
onDelete={handleDeleteRepositoryProvider}
deletable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { graphql } from '@/lib/gql/generates'
import { useMutation } from '@/lib/tabby/gql'

import {
ProviderForm,
CommonProviderForm,
RepositoryProviderFormValues,
useRepositoryProviderForm
} from '../../components/common-provider-form'
Expand Down Expand Up @@ -80,7 +80,7 @@ export const UpdateProviderForm: React.FC<UpdateProviderFormProps> = ({
}

return (
<ProviderForm
<CommonProviderForm
onSubmit={onSubmit}
onDelete={handleDeleteRepositoryProvider}
deletable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RepositoryKind } from '@/lib/gql/generates/graphql'
import { useMutation } from '@/lib/tabby/gql'

import {
ProviderForm,
CommonProviderForm,
RepositoryProviderFormValues,
useRepositoryProviderForm
} from '../../components/common-provider-form'
Expand Down Expand Up @@ -75,7 +75,7 @@ export const NewProvider = () => {

return (
<div className="ml-4">
<ProviderForm isNew form={form} onSubmit={handleSubmit} />
<CommonProviderForm isNew form={form} onSubmit={handleSubmit} />
</div>
)
}

0 comments on commit bb3ef0b

Please sign in to comment.