Skip to content

Commit

Permalink
Bug 1952625: Remove model and use Trans
Browse files Browse the repository at this point in the history
Removed a deprecated model and updated a phrase to use the Trans component.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1952625
  • Loading branch information
rebeccaalpert committed Apr 22, 2021
1 parent 09bfd78 commit 8fc1eaf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
9 changes: 5 additions & 4 deletions frontend/public/components/hpa.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import * as _ from 'lodash-es';
import * as classNames from 'classnames';
import { sortable } from '@patternfly/react-table';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import {
K8sResourceKind,
K8sResourceKindReference,
Expand Down Expand Up @@ -95,16 +95,17 @@ const MetricsTable: React.FC<MetricsTableProps> = ({ obj: hpa }) => {

const objectRow = (metric, current, ns, key, scaleTarget) => {
const { object } = metric;
const name = object.metric.name;
const type = (
<>
{object.metric.name} {t('public~on')}
<Trans t={t} ns="public">
{{ name }} on
<ResourceLink
kind={scaleTarget.kind}
name={scaleTarget.name}
namespace={ns}
title={object.metric.name}
/>
</>
</Trans>
);
const currentValue = current?.object?.current.value;
const targetValue = object.target.value;
Expand Down
4 changes: 1 addition & 3 deletions frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"resource {{name}}": "resource {{name}}",
"(as a percentage of request)": "(as a percentage of request)",
"{{name}} on pods": "{{name}} on pods",
"on": "on",
"{{name}} on<2></2>": "{{name}} on<2></2>",
"Metrics": "Metrics",
"Current": "Current",
"Target": "Target",
Expand Down Expand Up @@ -676,8 +676,6 @@
"LocalResourceAccessReview": "LocalResourceAccessReview",
"LocalResourceAccessReviews": "LocalResourceAccessReviews",
"PersistentVolume": "PersistentVolume",
"Petset": "Petset",
"Petsets": "Petsets",
"StatefulSet": "StatefulSet",
"ResourceQuota": "ResourceQuota",
"ClusterResourceQuota": "ClusterResourceQuota",
Expand Down
15 changes: 0 additions & 15 deletions frontend/public/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,21 +675,6 @@ export const PersistentVolumeClaimModel: K8sKind = {
labelPluralKey: 'public~PersistentVolumeClaims',
};

export const PetsetModel: K8sKind = {
apiVersion: 'v1',
label: 'Petset',
// t('public~Petset')
labelKey: 'public~Petset',
plural: 'petsets',
abbr: 'PS',
propagationPolicy: 'Foreground',
kind: 'Petset',
id: 'petset',
labelPlural: 'Petsets',
// t('public~Petsets')
labelPluralKey: 'public~Petsets',
};

export const StatefulSetModel: K8sKind = {
label: 'StatefulSet',
// t('public~StatefulSet')
Expand Down

0 comments on commit 8fc1eaf

Please sign in to comment.