Skip to content

Commit 370317e

Browse files
committed
fix: sorting for parent plugin list
1 parent a91c002 commit 370317e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/Shared/Components/Plugin/PluginListContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const PluginListContainer = ({
103103
const {
104104
pluginStore: { parentPluginStore, pluginVersionStore },
105105
totalCount: responseTotalCount,
106+
parentPluginIdList,
106107
} = pluginResponse
107108

108109
handlePluginDataStoreUpdate(getUpdatedPluginStore(pluginDataStore, parentPluginStore, pluginVersionStore))
@@ -117,10 +118,10 @@ const PluginListContainer = ({
117118
{} as Record<number, true>,
118119
)
119120

120-
Object.keys(parentPluginStore).forEach((key) => {
121+
parentPluginIdList.forEach((key) => {
121122
if (!newPluginListMap[key]) {
122123
newPluginList.push({
123-
parentPluginId: +key,
124+
parentPluginId: key,
124125
})
125126
newPluginListMap[key] = true
126127
}

src/Shared/Components/Plugin/service.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const getPluginStoreData = async ({
6565
return {
6666
totalCount: result?.totalCount || 0,
6767
pluginStore,
68+
parentPluginIdList: result?.parentPlugins?.map((parentPluginDetails) => parentPluginDetails.id) || [],
6869
}
6970
} catch (error) {
7071
if (!getIsRequestAborted(error)) {

src/Shared/Components/Plugin/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ export interface GetPluginListPayloadType
165165
export interface GetPluginStoreDataReturnType {
166166
totalCount: number
167167
pluginStore: PluginDataStoreType
168+
/**
169+
* Sorted on the basis of name of latest version of parent plugin
170+
*/
171+
parentPluginIdList: number[]
168172
}
169173

170174
export interface PluginListParamsType {

0 commit comments

Comments
 (0)