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(crux-ui): missing translations in lists #811

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { DyoCard } from '@app/elements/dyo-card'
import DyoCheckbox from '@app/elements/dyo-checkbox'
import DyoIcon from '@app/elements/dyo-icon'
import { DyoList } from '@app/elements/dyo-list'
import { dateSort, sortHeaderBuilder, stringSort, useSorting } from '@app/hooks/use-sorting'
import useTeamRoutes from '@app/hooks/use-team-routes'
import { Instance } from '@app/models'
import { utcDateToLocale } from '@app/utils'
import clsx from 'clsx'
import useTranslation from 'next-translate/useTranslation'
import Link from 'next/link'
import { DeploymentActions, DeploymentState } from './use-deployment-state'
import { dateSort, sortHeaderBuilder, stringSort, useSorting } from '@app/hooks/use-sorting'

export interface DeploymentViewListProps {
state: DeploymentState
Expand Down Expand Up @@ -43,7 +43,7 @@ const DeploymentViewList = (props: DeploymentViewListProps) => {
})

const columnWidths = ['w-12', 'w-4/12', 'w-2/12', 'w-2/12', 'w-4/12', 'w-28']
const headers = ['', 'containerName', 'common:registry', 'imageTag', 'common:createdAt', 'common:actions', '']
const headers = ['', 'containerName', 'common:registry', 'imageTag', 'common:createdAt', 'common:actions']
const defaultHeaderClass = 'uppercase text-bright text-sm font-semibold bg-medium-eased px-2 py-3 h-11'
const headerClasses = [
clsx('rounded-tl-lg pl-6', defaultHeaderClass),
Expand Down Expand Up @@ -93,7 +93,7 @@ const DeploymentViewList = (props: DeploymentViewListProps) => {
imageTag: 'imageTag',
'common:createdAt': 'createdAt',
},
text => t(text),
text => (text ? t(text) : ''),
)
const headerBuilder = (header: string, index: number) =>
index === 0 ? (
Expand Down
2 changes: 1 addition & 1 deletion web/crux-ui/src/pages/[teamSlug]/deployments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const DeploymentsPage = (props: DeploymentsPageProps) => {
</Filters>
<DyoCard className="relative mt-4">
<DyoList
headers={[...headers, '']}
headers={[...headers]}
headerClassName={headerClasses}
itemClassName={itemClasses}
data={sorting.items}
Expand Down
Loading