Skip to content

Commit c6333b2

Browse files
committed
Merge branch 'fix/plugin-policy-qa' into feat/plugin-policy
2 parents c117dbc + 0ebde91 commit c6333b2

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.6.1-beta-9",
3+
"version": "0.6.1-beta-10",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/Plugin/service.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,11 @@ export const getAvailablePluginTags = async (appId: number): Promise<string[]> =
119119

120120
export const getParentPluginList = async (
121121
params?: Partial<GetParentPluginListPayloadType>,
122-
): Promise<ResponseType<MinParentPluginDTO[]>> =>
123-
get<MinParentPluginDTO[]>(getUrlWithSearchParams(ROUTES.PLUGIN_LIST_MIN, params))
122+
): Promise<ResponseType<MinParentPluginDTO[]>> => {
123+
const response = await get<MinParentPluginDTO[]>(getUrlWithSearchParams(ROUTES.PLUGIN_LIST_MIN, params))
124+
125+
return {
126+
...response,
127+
result: (response?.result ?? []).sort((a, b) => stringComparatorBySortOrder(a.name, b.name)),
128+
}
129+
}

src/Shared/Hooks/useGetResourceKindsOptions/service.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,25 @@ export const getEnvironmentOptionsGroupedByClusters = async (): Promise<Environm
7777
return []
7878
}
7979

80-
const sortedEnvList = result.map(
81-
({
82-
id,
83-
environment_name: name,
84-
isVirtualEnvironment,
85-
cluster_name: cluster,
86-
default: isDefault,
87-
namespace,
88-
}) => ({
89-
id,
90-
name,
91-
isVirtual: isVirtualEnvironment ?? false,
92-
cluster,
93-
environmentType: isDefault ? EnvironmentTypeEnum.production : EnvironmentTypeEnum.nonProduction,
94-
namespace,
95-
}),
96-
)
80+
const sortedEnvList = result
81+
.map(
82+
({
83+
id,
84+
environment_name: name,
85+
isVirtualEnvironment,
86+
cluster_name: cluster,
87+
default: isDefault,
88+
namespace,
89+
}) => ({
90+
id,
91+
name,
92+
isVirtual: isVirtualEnvironment ?? false,
93+
cluster,
94+
environmentType: isDefault ? EnvironmentTypeEnum.production : EnvironmentTypeEnum.nonProduction,
95+
namespace,
96+
}),
97+
)
98+
.sort((a, b) => stringComparatorBySortOrder(a.name, b.name))
9799

98100
const envGroupedByCluster = Object.values(
99101
sortedEnvList.reduce<

0 commit comments

Comments
 (0)