mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix crd-list.tsx
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
b2d36493ae
commit
f72880fa44
@ -48,9 +48,11 @@ export class CustomResourceDefinitions extends React.Component {
|
|||||||
return crdStore.items; // show all by default
|
return crdStore.items; // show all by default
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSelection = (groups: readonly string[]) => {
|
toggleSelection = (options: readonly ({ group: string })[]) => {
|
||||||
|
const groups = options.map(({ group }) => group);
|
||||||
|
|
||||||
this.selectedGroups.replace(groups);
|
this.selectedGroups.replace(groups);
|
||||||
crdGroupsUrlParam.set([...groups]);
|
crdGroupsUrlParam.set(groups);
|
||||||
};
|
};
|
||||||
|
|
||||||
private getPlaceholder() {
|
private getPlaceholder() {
|
||||||
@ -101,13 +103,13 @@ export class CustomResourceDefinitions extends React.Component {
|
|||||||
<Select
|
<Select
|
||||||
className="group-select"
|
className="group-select"
|
||||||
placeholder={this.getPlaceholder()}
|
placeholder={this.getPlaceholder()}
|
||||||
options={Object.keys(crdStore.groups)}
|
options={Object.keys(crdStore.groups).map(group => ({ group }))}
|
||||||
onChange={this.toggleSelection}
|
onChange={this.toggleSelection}
|
||||||
closeMenuOnSelect={false}
|
closeMenuOnSelect={false}
|
||||||
controlShouldRenderValue={false}
|
controlShouldRenderValue={false}
|
||||||
isOptionSelected={opt => this.selectedGroups.has(opt)}
|
isOptionSelected={opt => this.selectedGroups.has(opt.group)}
|
||||||
isMulti={true}
|
isMulti={true}
|
||||||
formatOptionLabel={(group) => (
|
formatOptionLabel={({ group }) => (
|
||||||
<div className="flex gaps align-center">
|
<div className="flex gaps align-center">
|
||||||
<Icon small material="folder" />
|
<Icon small material="folder" />
|
||||||
<span>{group}</span>
|
<span>{group}</span>
|
||||||
@ -115,11 +117,11 @@ export class CustomResourceDefinitions extends React.Component {
|
|||||||
<Icon
|
<Icon
|
||||||
small
|
small
|
||||||
material="check"
|
material="check"
|
||||||
className="box right"
|
className="box right"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user