Skip to content

Commit 183539d

Browse files
[mlp] add eui super select function to list registry options (#118)
* Add EUI super select function to list registry options * fix pipelines - goci and ci-pipeline * modify golang ci * exclude files from golang ci * use exclude dirs as part of api/client --------- Co-authored-by: vinoth <vinosambath@gmail.com>
1 parent e057352 commit 183539d

File tree

3 files changed

+12
-37
lines changed

3 files changed

+12
-37
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ jobs:
105105
uses: golangci/golangci-lint-action@v6
106106
with:
107107
version: ${{ env.GO_LINT_VERSION }}
108-
skip-go-installation: true
109108
args: --timeout 3m --verbose api/...
110109

111110
- name: Run Integration Test

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
run:
22
build-tags:
33
- integration
4-
skip-dirs:
4+
5+
issues:
6+
exclude-dirs:
57
- api/client
68

79
linters:
Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,14 @@
1-
import React, { useState } from "react";
2-
import { EuiButtonEmpty, EuiContextMenu, EuiPopover } from "@elastic/eui";
3-
import { flattenPanelTree } from "../../../utils";
1+
import { EuiSuperSelect } from "@elastic/eui";
42

53
export const DockerRegistryPopover = ({ value, registryOptions, onChange }) => {
6-
const [isOpen, setOpen] = useState(false);
7-
8-
const panels = flattenPanelTree({
9-
id: 0,
10-
items: registryOptions.map(registry => ({
11-
name: registry.inputDisplay,
12-
value: registry.value,
13-
icon: "logoDocker",
14-
onClick: () => {
15-
togglePopover();
16-
onChange(registry.value);
17-
}
18-
}))
19-
});
20-
21-
const togglePopover = () => setOpen(!isOpen);
224

235
return (
24-
<EuiPopover
25-
button={
26-
<EuiButtonEmpty
27-
size="xs"
28-
iconType="arrowDown"
29-
iconSide="right"
30-
onClick={togglePopover}>
31-
{registryOptions.find(o => o.value === value).inputDisplay}
32-
</EuiButtonEmpty>
33-
}
34-
isOpen={isOpen}
35-
closePopover={togglePopover}
36-
panelPaddingSize="s">
37-
<EuiContextMenu initialPanelId={0} panels={panels} />
38-
</EuiPopover>
6+
<EuiSuperSelect
7+
fullWidth
8+
options={registryOptions}
9+
valueOfSelected={value}
10+
itemLayoutAlign="top"
11+
onChange={onChange}
12+
/>
3913
);
40-
};
14+
};

0 commit comments

Comments
 (0)