Skip to content

Commit

Permalink
fix(web): add missing i18n lines (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
polaroi8d committed Feb 14, 2024
1 parent 0b8369e commit 96dccee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions web/crux-ui/src/components/nodes/node-deployment-list.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import DeploymentStatusTag from '@app/components/projects/versions/deployments/deployment-status-tag'
import DeploymentStatusTag, {
deploymentStatusTranslation,
} from '@app/components/projects/versions/deployments/deployment-status-tag'
import Filters from '@app/components/shared/filters'
import { DyoCard } from '@app/elements/dyo-card'
import { chipsQALabelFromValue } from '@app/elements/dyo-chips'
Expand Down Expand Up @@ -51,7 +53,7 @@ const NodeDeploymentList = (props: NodeDeploymentListProps) => {
className="pl-6"
name="deploymentStatusFilter"
choices={DEPLOYMENT_STATUS_VALUES}
converter={it => t(`common:deploymentStatuses.${it}`)}
converter={it => t(deploymentStatusTranslation(it))}
selection={filters.filter?.enum}
onSelectionChange={type => {
filters.setFilter({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ const statusToTextColor = (status: DeploymentStatus) => {
}
}

const deploymentStatusTranslation = (status: DeploymentStatus): string => {
export const deploymentStatusTranslation = (status: DeploymentStatus | 'all'): string => {
switch (status) {
case 'successful':
case 'failed':
case 'all':
return `common:${status}`
default:
return `common:deploymentStatuses.${status}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
QA_MODAL_LABEL_DEPLOYMENT_NOTE,
} from 'quality-assurance'
import { useEffect, useState } from 'react'
import DeploymentStatusTag from './deployments/deployment-status-tag'
import DeploymentStatusTag, { deploymentStatusTranslation } from './deployments/deployment-status-tag'
import { VersionActions } from './use-version-state'

interface VersionDeploymentsSectionProps {
Expand Down Expand Up @@ -163,7 +163,7 @@ const VersionDeploymentsSection = (props: VersionDeploymentsSectionProps) => {
name="deploymentStatusFilter"
selection={filters.filter?.enum}
choices={DEPLOYMENT_STATUS_VALUES}
converter={it => t(`common:deploymentStatuses.${it}`)}
converter={it => t(deploymentStatusTranslation(it))}
onSelectionChange={type => {
filters.setFilter({
enum: type,
Expand Down
6 changes: 4 additions & 2 deletions web/crux-ui/src/pages/[teamSlug]/deployments.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import AddDeploymentCard from '@app/components/deployments/add-deployment-card'
import { Layout } from '@app/components/layout'
import CopyDeploymentCard from '@app/components/projects/versions/deployments/copy-deployment-card'
import DeploymentStatusTag from '@app/components/projects/versions/deployments/deployment-status-tag'
import DeploymentStatusTag, {
deploymentStatusTranslation,
} from '@app/components/projects/versions/deployments/deployment-status-tag'
import useCopyDeploymentState from '@app/components/projects/versions/deployments/use-copy-deployment-state'
import { BreadcrumbLink } from '@app/components/shared/breadcrumb'
import Filters from '@app/components/shared/filters'
Expand Down Expand Up @@ -142,7 +144,7 @@ const DeploymentsPage = (props: DeploymentsPageProps) => {
className="pl-6"
name="deploymentStatusFilter"
choices={DEPLOYMENT_STATUS_VALUES}
converter={it => t(`common:deploymentStatuses.${it}`)}
converter={it => t(deploymentStatusTranslation(it))}
selection={filters.filter?.enum}
onSelectionChange={type => {
filters.setFilter({
Expand Down

0 comments on commit 96dccee

Please sign in to comment.