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
+10
-12
@@ -3,8 +3,6 @@ import "./add-role-binding-dialog.scss";
|
||||
import React from "react";
|
||||
import { computed, 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 { Select, SelectOption } from "../select";
|
||||
@@ -194,7 +192,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SubTitle title={<Trans>Context</Trans>}/>
|
||||
<SubTitle title="Context"/>
|
||||
<NamespaceSelect
|
||||
showClusterOption
|
||||
themeName="light"
|
||||
@@ -203,11 +201,11 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
onChange={({ value }) => this.onBindContextChange(value)}
|
||||
/>
|
||||
|
||||
<SubTitle title={<Trans>Role</Trans>}/>
|
||||
<SubTitle title="Role"/>
|
||||
<Select
|
||||
key={this.selectedRoleId}
|
||||
themeName="light"
|
||||
placeholder={_i18n._(t`Select role..`)}
|
||||
placeholder={`Select role..`}
|
||||
isDisabled={this.isEditing}
|
||||
options={this.roleOptions}
|
||||
value={this.selectedRoleId}
|
||||
@@ -218,7 +216,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
<>
|
||||
<Checkbox
|
||||
theme="light"
|
||||
label={<Trans>Use same name for RoleBinding</Trans>}
|
||||
label="Use same name for RoleBinding"
|
||||
value={this.useRoleForBindingName}
|
||||
onChange={v => this.useRoleForBindingName = v}
|
||||
/>
|
||||
@@ -226,7 +224,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
!this.useRoleForBindingName && (
|
||||
<Input
|
||||
autoFocus
|
||||
placeholder={_i18n._(t`Name`)}
|
||||
placeholder={`Name`}
|
||||
disabled={this.isEditing}
|
||||
value={this.bindingName}
|
||||
onChange={v => this.bindingName = v}
|
||||
@@ -237,11 +235,11 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
)
|
||||
}
|
||||
|
||||
<SubTitle title={<Trans>Binding targets</Trans>}/>
|
||||
<SubTitle title="Binding targets"/>
|
||||
<Select
|
||||
isMulti
|
||||
themeName="light"
|
||||
placeholder={_i18n._(t`Select service accounts`)}
|
||||
placeholder={`Select service accounts`}
|
||||
autoConvertOptions={false}
|
||||
options={this.serviceAccountOptions}
|
||||
onChange={(opts: BindingSelectOption[]) => {
|
||||
@@ -261,13 +259,13 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
const header = (
|
||||
<h5>
|
||||
{roleBindingName
|
||||
? <Trans>Edit RoleBinding <span className="name">{roleBindingName}</span></Trans>
|
||||
: <Trans>Add RoleBinding</Trans>
|
||||
? <>Edit RoleBinding <span className="name">{roleBindingName}</span></>
|
||||
: "Add RoleBinding"
|
||||
}
|
||||
</h5>
|
||||
);
|
||||
const disableNext = this.isLoading || !selectedRole || !selectedBindings.length;
|
||||
const nextLabel = isEditing ? <Trans>Update</Trans> : <Trans>Create</Trans>;
|
||||
const nextLabel = isEditing ? "Update" : "Create";
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import "./role-binding-details.scss";
|
||||
|
||||
import React from "react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { AddRemoveButtons } from "../add-remove-buttons";
|
||||
import { IRoleBindingSubject, RoleBinding } from "../../api/endpoints";
|
||||
import { autobind, prevDefault } from "../../utils";
|
||||
@@ -14,7 +13,6 @@ import { observable, reaction } from "mobx";
|
||||
import { roleBindingsStore } from "./role-bindings.store";
|
||||
import { AddRoleBindingDialog } from "./add-role-binding-dialog";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
|
||||
@@ -51,9 +49,9 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
|
||||
ConfirmDialog.open({
|
||||
ok: () => roleBindingsStore.updateSubjects({ roleBinding, removeSubjects: selectedSubjects }),
|
||||
labelOk: _i18n._(t`Remove`),
|
||||
labelOk: `Remove`,
|
||||
message: (
|
||||
<p><Trans>Remove selected bindings for <b>{roleBinding.getName()}</b>?</Trans></p>
|
||||
<p>Remove selected bindings for <b>{roleBinding.getName()}</b>?</p>
|
||||
)
|
||||
});
|
||||
}
|
||||
@@ -65,7 +63,6 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
if (!roleBinding) {
|
||||
return null;
|
||||
}
|
||||
const name = roleBinding.getName();
|
||||
const { roleRef } = roleBinding;
|
||||
const subjects = roleBinding.getSubjects();
|
||||
|
||||
@@ -73,12 +70,12 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
<div className="RoleBindingDetails">
|
||||
<KubeObjectMeta object={roleBinding}/>
|
||||
|
||||
<DrawerTitle title={<Trans>Reference</Trans>}/>
|
||||
<DrawerTitle title="Reference"/>
|
||||
<Table>
|
||||
<TableHead>
|
||||
<TableCell><Trans>Kind</Trans></TableCell>
|
||||
<TableCell><Trans>Name</Trans></TableCell>
|
||||
<TableCell><Trans>API Group</Trans></TableCell>
|
||||
<TableCell>Kind</TableCell>
|
||||
<TableCell>Name</TableCell>
|
||||
<TableCell>API Group</TableCell>
|
||||
</TableHead>
|
||||
<TableRow>
|
||||
<TableCell>{roleRef.kind}</TableCell>
|
||||
@@ -87,14 +84,14 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
</TableRow>
|
||||
</Table>
|
||||
|
||||
<DrawerTitle title={<Trans>Bindings</Trans>}/>
|
||||
<DrawerTitle title="Bindings"/>
|
||||
{subjects.length > 0 && (
|
||||
<Table selectable className="bindings box grow">
|
||||
<TableHead>
|
||||
<TableCell checkbox/>
|
||||
<TableCell className="binding"><Trans>Binding</Trans></TableCell>
|
||||
<TableCell className="type"><Trans>Type</Trans></TableCell>
|
||||
<TableCell className="type"><Trans>Namespace</Trans></TableCell>
|
||||
<TableCell className="binding">Binding</TableCell>
|
||||
<TableCell className="type">Type</TableCell>
|
||||
<TableCell className="type">Namespace</TableCell>
|
||||
</TableHead>
|
||||
{
|
||||
subjects.map((subject, i) => {
|
||||
@@ -120,8 +117,8 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
<AddRemoveButtons
|
||||
onAdd={() => AddRoleBindingDialog.open(roleBinding)}
|
||||
onRemove={selectedSubjects.length ? this.removeSelectedSubjects : null}
|
||||
addTooltip={<Trans>Add bindings to {name}</Trans>}
|
||||
removeTooltip={<Trans>Remove selected bindings from ${name}</Trans>}
|
||||
addTooltip="Add bindings to {name}"
|
||||
removeTooltip="Remove selected bindings from ${name}"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,7 +2,6 @@ import "./role-bindings.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { IRoleBindingsRouteParams } from "../+user-management/user-management.route";
|
||||
import { RoleBinding } from "../../api/endpoints";
|
||||
@@ -38,13 +37,13 @@ export class RoleBindings extends React.Component<Props> {
|
||||
(binding: RoleBinding) => binding.getSearchFields(),
|
||||
(binding: RoleBinding) => binding.getSubjectNames(),
|
||||
]}
|
||||
renderHeaderTitle={<Trans>Role Bindings</Trans>}
|
||||
renderHeaderTitle="Role Bindings"
|
||||
renderTableHeader={[
|
||||
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
||||
{ title: "Name", className: "name", sortBy: sortBy.name },
|
||||
{ className: "warning" },
|
||||
{ title: <Trans>Bindings</Trans>, className: "bindings", sortBy: sortBy.bindings },
|
||||
{ title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
||||
{ title: "Bindings", className: "bindings", sortBy: sortBy.bindings },
|
||||
{ title: "Namespace", className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: "Age", className: "age", sortBy: sortBy.age },
|
||||
]}
|
||||
renderTableContents={(binding: RoleBinding) => [
|
||||
binding.getName(),
|
||||
@@ -55,7 +54,7 @@ export class RoleBindings extends React.Component<Props> {
|
||||
]}
|
||||
addRemoveButtons={{
|
||||
onAdd: () => AddRoleBindingDialog.open(),
|
||||
addTooltip: <Trans>Create new RoleBinding</Trans>,
|
||||
addTooltip: "Create new RoleBinding",
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user