Skip to content

Commit 06b93b5

Browse files
committed
chore: input id added
1 parent 84a9b0b commit 06b93b5

File tree

6 files changed

+5
-44
lines changed

6 files changed

+5
-44
lines changed

src/components/AppSelector/AppSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const AppSelector = ({ onChange, appId, appName, isJobView }: AppSelectorType) =
8383

8484
return (
8585
<ContextSwitcher
86-
inputId={`${isJobView ? 'job' : 'app'}-name`}
86+
inputId={`${isJobView ? `job-switcher-${appId}` : `app-switcher-${appId}`}`}
8787
options={selectOptions}
8888
inputValue={inputValue}
8989
onInputChange={onInputChange}

src/components/AppSelector/AppSelectorUtil.tsx

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import {
18-
BaseAppMetaData,
1918
BaseRecentlyVisitedEntitiesTypes,
2019
getIsRequestAborted,
2120
RecentlyVisitedGroupedOptionsType,
@@ -88,41 +87,3 @@ export const appListOptions = ({
8887
}, 300)
8988
})
9089
}
91-
92-
export const contextSwitcherOptions = ({
93-
recentlyVisitedDevtronApps,
94-
selectOptions,
95-
inputValue,
96-
resourceKind,
97-
}): Promise<RecentlyVisitedGroupedOptionsType[]> =>
98-
new Promise((resolve) => {
99-
if (timeoutId) {
100-
clearTimeout(timeoutId)
101-
}
102-
timeoutId = setTimeout(() => {
103-
if (inputValue.length < 3) {
104-
resolve(
105-
recentlyVisitedDevtronApps?.length
106-
? [
107-
{
108-
label: 'Recently Visited',
109-
options: recentlyVisitedDevtronApps.map((app: BaseAppMetaData) => ({
110-
label: app.appName,
111-
value: app.appId,
112-
isRecentlyVisited: true,
113-
})) as RecentlyVisitedOptions[],
114-
},
115-
getMinCharSearchPlaceholderGroup(resourceKind),
116-
]
117-
: [],
118-
)
119-
} else {
120-
resolve([
121-
{
122-
label: `All ${resourceKind}`,
123-
options: selectOptions as RecentlyVisitedOptions[],
124-
},
125-
] as RecentlyVisitedGroupedOptionsType[])
126-
}
127-
}, 300)
128-
})

src/components/AppSelector/ChartSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default function ChartSelector({
7373

7474
return (
7575
<ContextSwitcher
76-
inputId="chart-select"
76+
inputId={`chart-switcher-${_primaryKey}`}
7777
options={getChartsOptions()}
7878
inputValue={inputValue}
7979
onInputChange={onInputChange}

src/components/ApplicationGroup/AppGroup.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export const envListOptions = (
193193
const appList = response.result
194194
? ([
195195
{
196-
label: `All Environments`,
196+
label: 'All Environments',
197197
options: response.result.envList.map((res) => ({
198198
value: res.id,
199199
label: res.environment_name,

src/components/ApplicationGroup/EnvSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const EnvSelector = ({ onChange, envId, envName }: EnvSelectorType) => {
7373
onChange={handleChange}
7474
value={defaultOptions}
7575
options={selectOptions}
76-
inputId={`app-group-${envId}`}
76+
inputId={`app-group-switcher-${envId}`}
7777
placeholder={envName}
7878
inputValue={inputValue}
7979
onInputChange={onInputChange}

src/components/ResourceBrowser/ResourceList/ClusterSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const ClusterSelector: React.FC<ClusterSelectorType> = ({
7474
return (
7575
<div className="flexbox dc__align-items-center dc__gap-12">
7676
<ContextSwitcher
77-
inputId="cluster-select-header"
77+
inputId={`cluster-switcher-${clusterId}`}
7878
isLoading={isClusterListLoading}
7979
onChange={onChange}
8080
value={defaultOption}

0 commit comments

Comments
 (0)