mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove lingui (#1874)
* remove lingui Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * babelless Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * tweak ts-loader options Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * tweak renderer webpack config Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
050603a7b3
commit
a03da3c572
163 files changed
+1140
-12003
No files matched your search
@@ -3,7 +3,6 @@ import "./deployment-details.scss";
|
||||
import React from "react";
|
||||
import kebabCase from "lodash/kebabCase";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { DrawerItem } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
import { Deployment } from "../../api/endpoints";
|
||||
@@ -13,7 +12,6 @@ import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities"
|
||||
import { KubeEventDetails } from "../+events/kube-event-details";
|
||||
import { podsStore } from "../+workloads-pods/pods.store";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { ResourceMetrics, ResourceMetricsText } from "../resource-metrics";
|
||||
import { deploymentStore } from "./deployments.store";
|
||||
import { PodCharts, podMetricTabs } from "../+workloads-pods/pod-charts";
|
||||
@@ -63,20 +61,20 @@ export class DeploymentDetails extends React.Component<Props> {
|
||||
</ResourceMetrics>
|
||||
)}
|
||||
<KubeObjectMeta object={deployment}/>
|
||||
<DrawerItem name={<Trans>Replicas</Trans>}>
|
||||
{_i18n._(t`${spec.replicas} desired, ${status.updatedReplicas || 0} updated`)},{" "}
|
||||
{_i18n._(t`${status.replicas || 0} total, ${status.availableReplicas || 0} available`)},{" "}
|
||||
{_i18n._(t`${status.unavailableReplicas || 0} unavailable`)}
|
||||
<DrawerItem name="Replicas">
|
||||
{`${spec.replicas} desired, ${status.updatedReplicas || 0} updated`},{" "}
|
||||
{`${status.replicas || 0} total, ${status.availableReplicas || 0} available`},{" "}
|
||||
{`${status.unavailableReplicas || 0} unavailable`}
|
||||
</DrawerItem>
|
||||
{selectors.length > 0 &&
|
||||
<DrawerItem name={<Trans>Selector</Trans>} labelsOnly>
|
||||
<DrawerItem name="Selector" labelsOnly>
|
||||
{
|
||||
selectors.map(label => <Badge key={label} label={label}/>)
|
||||
}
|
||||
</DrawerItem>
|
||||
}
|
||||
{nodeSelector.length > 0 &&
|
||||
<DrawerItem name={<Trans>Node Selector</Trans>}>
|
||||
<DrawerItem name="Node Selector">
|
||||
{
|
||||
nodeSelector.map(label => (
|
||||
<Badge key={label} label={label}/>
|
||||
@@ -84,10 +82,10 @@ export class DeploymentDetails extends React.Component<Props> {
|
||||
}
|
||||
</DrawerItem>
|
||||
}
|
||||
<DrawerItem name={<Trans>Strategy Type</Trans>}>
|
||||
<DrawerItem name="Strategy Type">
|
||||
{spec.strategy.type}
|
||||
</DrawerItem>
|
||||
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
||||
<DrawerItem name="Conditions" className="conditions" labelsOnly>
|
||||
{
|
||||
deployment.getConditions().map(condition => {
|
||||
const { type, message, lastTransitionTime, status } = condition;
|
||||
@@ -100,7 +98,7 @@ export class DeploymentDetails extends React.Component<Props> {
|
||||
tooltip={(
|
||||
<>
|
||||
<p>{message}</p>
|
||||
<p><Trans>Last transition time: {lastTransitionTime}</Trans></p>
|
||||
<p>Last transition time: {lastTransitionTime}</p>
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -3,7 +3,6 @@ import "./deployment-scale-dialog.scss";
|
||||
import React, { Component } from "react";
|
||||
import { computed, observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { Dialog, DialogProps } from "../dialog";
|
||||
import { Wizard, WizardStep } from "../wizard";
|
||||
import { Deployment, deploymentApi } from "../../api/endpoints";
|
||||
@@ -89,7 +88,7 @@ export class DeploymentScaleDialog extends Component<Props> {
|
||||
desiredReplicasUp = () => {
|
||||
this.desiredReplicas < this.scaleMax && this.desiredReplicas++;
|
||||
};
|
||||
|
||||
|
||||
desiredReplicasDown = () => {
|
||||
this.desiredReplicas > 0 && this.desiredReplicas--;
|
||||
};
|
||||
@@ -101,11 +100,11 @@ export class DeploymentScaleDialog extends Component<Props> {
|
||||
return (
|
||||
<>
|
||||
<div className="current-scale" data-testid="current-scale">
|
||||
<Trans>Current replica scale: {currentReplicas}</Trans>
|
||||
Current replica scale: {currentReplicas}
|
||||
</div>
|
||||
<div className="flex gaps align-center">
|
||||
<div className="desired-scale" data-testid="desired-scale">
|
||||
<Trans>Desired number of replicas</Trans>: {desiredReplicas}
|
||||
Desired number of replicas: {desiredReplicas}
|
||||
</div>
|
||||
<div className="slider-container flex align-center">
|
||||
<Slider value={desiredReplicas} max={scaleMax} onChange={onChange as any /** see: https://github.com/mui-org/material-ui/issues/20191 */}/>
|
||||
@@ -126,7 +125,7 @@ export class DeploymentScaleDialog extends Component<Props> {
|
||||
{warning &&
|
||||
<div className="warning" data-testid="warning">
|
||||
<Icon material="warning"/>
|
||||
<Trans>High number of replicas may cause cluster performance issues</Trans>
|
||||
High number of replicas may cause cluster performance issues
|
||||
</div>
|
||||
}
|
||||
</>
|
||||
@@ -138,7 +137,7 @@ export class DeploymentScaleDialog extends Component<Props> {
|
||||
const deploymentName = this.deployment ? this.deployment.getName() : "";
|
||||
const header = (
|
||||
<h5>
|
||||
<Trans>Scale Deployment <span>{deploymentName}</span></Trans>
|
||||
Scale Deployment <span>{deploymentName}</span>
|
||||
</h5>
|
||||
);
|
||||
|
||||
@@ -155,7 +154,7 @@ export class DeploymentScaleDialog extends Component<Props> {
|
||||
<WizardStep
|
||||
contentClass="flex gaps column"
|
||||
next={this.scale}
|
||||
nextLabel={<Trans>Scale</Trans>}
|
||||
nextLabel="Scale"
|
||||
disabledNext={!this.ready}
|
||||
>
|
||||
{this.renderContents()}
|
||||
|
||||
@@ -3,7 +3,6 @@ import "./deployments.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { Deployment, deploymentApi } from "../../api/endpoints";
|
||||
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { MenuItem } from "../menu";
|
||||
@@ -17,7 +16,6 @@ import { nodesStore } from "../+nodes/nodes.store";
|
||||
import { eventStore } from "../+events/event.store";
|
||||
import { KubeObjectListLayout } from "../kube-object";
|
||||
import { IDeploymentsRouteParams } from "../+workloads";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { cssNames } from "../../utils";
|
||||
import kebabCase from "lodash/kebabCase";
|
||||
import orderBy from "lodash/orderBy";
|
||||
@@ -70,15 +68,15 @@ export class Deployments extends React.Component<Props> {
|
||||
(deployment: Deployment) => deployment.getSearchFields(),
|
||||
(deployment: Deployment) => deployment.getConditionsText(),
|
||||
]}
|
||||
renderHeaderTitle={<Trans>Deployments</Trans>}
|
||||
renderHeaderTitle="Deployments"
|
||||
renderTableHeader={[
|
||||
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
||||
{ title: "Name", className: "name", sortBy: sortBy.name },
|
||||
{ className: "warning" },
|
||||
{ title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: <Trans>Pods</Trans>, className: "pods" },
|
||||
{ title: <Trans>Replicas</Trans>, className: "replicas", sortBy: sortBy.replicas },
|
||||
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
||||
{ title: <Trans>Conditions</Trans>, className: "conditions", sortBy: sortBy.condition },
|
||||
{ title: "Namespace", className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: "Pods", className: "pods" },
|
||||
{ title: "Replicas", className: "replicas", sortBy: sortBy.replicas },
|
||||
{ title: "Age", className: "age", sortBy: sortBy.age },
|
||||
{ title: "Conditions", className: "conditions", sortBy: sortBy.condition },
|
||||
]}
|
||||
renderTableContents={(deployment: Deployment) => [
|
||||
deployment.getName(),
|
||||
@@ -103,8 +101,8 @@ export function DeploymentMenu(props: KubeObjectMenuProps<Deployment>) {
|
||||
return (
|
||||
<>
|
||||
<MenuItem onClick={() => DeploymentScaleDialog.open(object)}>
|
||||
<Icon material="open_with" title={_i18n._(t`Scale`)} interactive={toolbar}/>
|
||||
<span className="title"><Trans>Scale</Trans></span>
|
||||
<Icon material="open_with" title={`Scale`} interactive={toolbar}/>
|
||||
<span className="title">Scale</span>
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => ConfirmDialog.open({
|
||||
ok: async () =>
|
||||
@@ -118,15 +116,15 @@ export function DeploymentMenu(props: KubeObjectMenuProps<Deployment>) {
|
||||
Notifications.error(err);
|
||||
}
|
||||
},
|
||||
labelOk: _i18n._(t`Restart`),
|
||||
labelOk: `Restart`,
|
||||
message: (
|
||||
<p>
|
||||
<Trans>Are you sure you want to restart deployment <b>{object.getName()}</b>?</Trans>
|
||||
Are you sure you want to restart deployment <b>{object.getName()}</b>?
|
||||
</p>
|
||||
),
|
||||
})}>
|
||||
<Icon material="autorenew" title={_i18n._(t`Restart`)} interactive={toolbar}/>
|
||||
<span className="title"><Trans>Restart</Trans></span>
|
||||
<Icon material="autorenew" title={`Restart`} interactive={toolbar}/>
|
||||
<span className="title">Restart</span>
|
||||
</MenuItem>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user