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(web): add missing i18n lines #909

Merged
merged 3 commits into from
Feb 14, 2024
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
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 => {
m8vago marked this conversation as resolved.
Show resolved Hide resolved
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
Loading