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,8 +3,6 @@ import "./add-secret-dialog.scss";
|
||||
import React from "react";
|
||||
import { observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { Dialog, DialogProps } from "../dialog";
|
||||
import { Wizard, WizardStep } from "../wizard";
|
||||
import { Input } from "../input";
|
||||
@@ -135,7 +133,7 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
<SubTitle compact className="fields-title" title={upperFirst(field.toString())}>
|
||||
<Icon
|
||||
small
|
||||
tooltip={_i18n._(t`Add field`)}
|
||||
tooltip={`Add field`}
|
||||
material="add_circle_outline"
|
||||
onClick={() => this.addField(field)}
|
||||
/>
|
||||
@@ -148,7 +146,7 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
<div key={index} className="secret-field flex gaps auto align-center">
|
||||
<Input
|
||||
className="key"
|
||||
placeholder={_i18n._(t`Name`)}
|
||||
placeholder={`Name`}
|
||||
title={key}
|
||||
tabIndex={required ? -1 : 0}
|
||||
readOnly={required}
|
||||
@@ -158,13 +156,13 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
multiLine maxRows={5}
|
||||
required={required}
|
||||
className="value"
|
||||
placeholder={_i18n._(t`Value`)}
|
||||
placeholder={`Value`}
|
||||
value={value} onChange={v => item.value = v}
|
||||
/>
|
||||
<Icon
|
||||
small
|
||||
disabled={required}
|
||||
tooltip={required ? <Trans>Required field</Trans> : <Trans>Remove field</Trans>}
|
||||
tooltip={required ? "Required field" : "Remove field"}
|
||||
className="remove-icon"
|
||||
material="remove_circle_outline"
|
||||
onClick={() => this.removeField(field, index)}
|
||||
@@ -180,7 +178,7 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
render() {
|
||||
const { ...dialogProps } = this.props;
|
||||
const { namespace, name, type } = this;
|
||||
const header = <h5><Trans>Create Secret</Trans></h5>;
|
||||
const header = <h5>Create Secret</h5>;
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
@@ -191,19 +189,19 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
close={this.close}
|
||||
>
|
||||
<Wizard header={header} done={this.close}>
|
||||
<WizardStep contentClass="flow column" nextLabel={<Trans>Create</Trans>} next={this.createSecret}>
|
||||
<WizardStep contentClass="flow column" nextLabel="Create" next={this.createSecret}>
|
||||
<div className="secret-name">
|
||||
<SubTitle title={<Trans>Secret name</Trans>} />
|
||||
<SubTitle title="Secret name" />
|
||||
<Input
|
||||
autoFocus required
|
||||
placeholder={_i18n._(t`Name`)}
|
||||
placeholder={`Name`}
|
||||
validators={systemName}
|
||||
value={name} onChange={v => this.name = v}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex auto gaps">
|
||||
<div className="secret-namespace">
|
||||
<SubTitle title={<Trans>Namespace</Trans>} />
|
||||
<SubTitle title="Namespace" />
|
||||
<NamespaceSelect
|
||||
themeName="light"
|
||||
value={namespace}
|
||||
@@ -211,7 +209,7 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
/>
|
||||
</div>
|
||||
<div className="secret-type">
|
||||
<SubTitle title={<Trans>Secret type</Trans>} />
|
||||
<SubTitle title="Secret type" />
|
||||
<Select
|
||||
themeName="light"
|
||||
options={this.types}
|
||||
|
||||
@@ -4,7 +4,6 @@ import React from "react";
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
import { autorun, observable } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Input } from "../input";
|
||||
import { Button } from "../button";
|
||||
@@ -14,7 +13,6 @@ import { Icon } from "../icon";
|
||||
import { secretsStore } from "./secrets.store";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { Secret } from "../../api/endpoints";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
|
||||
@@ -47,7 +45,7 @@ export class SecretDetails extends React.Component<Props> {
|
||||
|
||||
try {
|
||||
await secretsStore.update(secret, { ...secret, data: this.data });
|
||||
Notifications.ok(<Trans>Secret successfully updated.</Trans>);
|
||||
Notifications.ok("Secret successfully updated.");
|
||||
} catch (err) {
|
||||
Notifications.error(err);
|
||||
}
|
||||
@@ -66,12 +64,12 @@ export class SecretDetails extends React.Component<Props> {
|
||||
return (
|
||||
<div className="SecretDetails">
|
||||
<KubeObjectMeta object={secret}/>
|
||||
<DrawerItem name={<Trans>Type</Trans>}>
|
||||
<DrawerItem name="Type">
|
||||
{secret.type}
|
||||
</DrawerItem>
|
||||
{!isEmpty(this.data) && (
|
||||
<>
|
||||
<DrawerTitle title={_i18n._(t`Data`)}/>
|
||||
<DrawerTitle title={`Data`}/>
|
||||
{
|
||||
Object.entries(this.data).map(([name, value]) => {
|
||||
const revealSecret = this.revealSecret[name];
|
||||
@@ -98,7 +96,7 @@ export class SecretDetails extends React.Component<Props> {
|
||||
{decodedVal && (
|
||||
<Icon
|
||||
material={`visibility${revealSecret ? "" : "_off"}`}
|
||||
tooltip={revealSecret ? <Trans>Hide</Trans> : <Trans>Show</Trans>}
|
||||
tooltip={revealSecret ? "Hide" : "Show"}
|
||||
onClick={() => this.revealSecret[name] = !revealSecret}
|
||||
/>)
|
||||
}
|
||||
@@ -109,7 +107,7 @@ export class SecretDetails extends React.Component<Props> {
|
||||
}
|
||||
<Button
|
||||
primary
|
||||
label={_i18n._(t`Save`)} waiting={this.isSaving}
|
||||
label={`Save`} waiting={this.isSaving}
|
||||
className="save-btn"
|
||||
onClick={this.saveSecret}
|
||||
/>
|
||||
|
||||
@@ -2,7 +2,6 @@ import "./secrets.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { Secret } from "../../api/endpoints";
|
||||
import { AddSecretDialog } from "./add-secret-dialog";
|
||||
@@ -43,15 +42,15 @@ export class Secrets extends React.Component<Props> {
|
||||
(item: Secret) => item.getSearchFields(),
|
||||
(item: Secret) => item.getKeys(),
|
||||
]}
|
||||
renderHeaderTitle={<Trans>Secrets</Trans>}
|
||||
renderHeaderTitle="Secrets"
|
||||
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>Labels</Trans>, className: "labels", sortBy: sortBy.labels },
|
||||
{ title: <Trans>Keys</Trans>, className: "keys", sortBy: sortBy.keys },
|
||||
{ title: <Trans>Type</Trans>, className: "type", sortBy: sortBy.type },
|
||||
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
||||
{ title: "Namespace", className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: "Labels", className: "labels", sortBy: sortBy.labels },
|
||||
{ title: "Keys", className: "keys", sortBy: sortBy.keys },
|
||||
{ title: "Type", className: "type", sortBy: sortBy.type },
|
||||
{ title: "Age", className: "age", sortBy: sortBy.age },
|
||||
]}
|
||||
renderTableContents={(secret: Secret) => [
|
||||
secret.getName(),
|
||||
@@ -64,7 +63,7 @@ export class Secrets extends React.Component<Props> {
|
||||
]}
|
||||
addRemoveButtons={{
|
||||
onAdd: () => AddSecretDialog.open(),
|
||||
addTooltip: <Trans>Create new Secret</Trans>
|
||||
addTooltip: "Create new Secret"
|
||||
}}
|
||||
/>
|
||||
<AddSecretDialog/>
|
||||
|
||||
Reference in new issue
Block a user