mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -46,16 +46,20 @@ export class NamespaceSelect extends React.Component<Props> {
|
||||
@computed get options(): SelectOption[] {
|
||||
const { customizeOptions, showClusterOption, clusterOptionLabel } = this.props;
|
||||
let options: SelectOption[] = namespaceStore.items.map(ns => ({ value: ns.getName() }));
|
||||
|
||||
options = customizeOptions ? customizeOptions(options) : options;
|
||||
|
||||
if (showClusterOption) {
|
||||
options.unshift({ value: null, label: clusterOptionLabel });
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
formatOptionLabel = (option: SelectOption) => {
|
||||
const { showIcons } = this.props;
|
||||
const { value, label } = option;
|
||||
|
||||
return label || (
|
||||
<>
|
||||
{showIcons && <Icon small material="layers" />}
|
||||
@@ -66,6 +70,7 @@ export class NamespaceSelect extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { className, showIcons, showClusterOption, clusterOptionLabel, customizeOptions, ...selectProps } = this.props;
|
||||
|
||||
return (
|
||||
<Select
|
||||
className={cssNames("NamespaceSelect", className)}
|
||||
@@ -83,8 +88,10 @@ export class NamespaceSelectFilter extends React.Component {
|
||||
render() {
|
||||
const { contextNs, hasContext, toggleContext } = namespaceStore;
|
||||
let placeholder = <Trans>All namespaces</Trans>;
|
||||
|
||||
if (contextNs.length == 1) placeholder = <Trans>Namespace: {contextNs[0]}</Trans>;
|
||||
if (contextNs.length >= 2) placeholder = <Trans>Namespaces: {contextNs.join(", ")}</Trans>;
|
||||
|
||||
return (
|
||||
<NamespaceSelect
|
||||
placeholder={placeholder}
|
||||
@@ -95,6 +102,7 @@ export class NamespaceSelectFilter extends React.Component {
|
||||
onChange={([{ value }]: SelectOption[]) => toggleContext(value)}
|
||||
formatOptionLabel={({ value: namespace }: SelectOption) => {
|
||||
const isSelected = hasContext(namespace);
|
||||
|
||||
return (
|
||||
<div className="flex gaps align-center">
|
||||
<FilterIcon type={FilterType.NAMESPACE} />
|
||||
|
||||
Reference in new issue
Block a user