Skip to content

Commit

Permalink
Merge pull request #7234 from pavinduLakshan/filter_m2m
Browse files Browse the repository at this point in the history
  • Loading branch information
pavinduLakshan authored Jan 3, 2025
2 parents 01a175e + bbb1d92 commit 42d025d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-readers-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.applications.v1": patch
---

Hide m2m applications in application selection modal in IDP quickstart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import { Dispatch } from "redux";
import { DropdownProps, Grid, Modal, ModalProps, PaginationProps } from "semantic-ui-react";
import { useApplicationList } from "../api/application";
import { ApplicationList } from "../components/application-list";
import { ApplicationManagementConstants } from "../constants/application-management";
import {
ApplicationListInterface,
ApplicationListItemInterface
ApplicationListItemInterface,
ApplicationTemplateIdTypes
} from "../models/application";

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ const ApplicationSelectionModal: FunctionComponent<ApplicationSelectionModalInte
data: applicationList,
isLoading: isApplicationListFetchRequestLoading,
error: applicationListFetchRequestError
} = useApplicationList("clientId", listItemLimit, listOffset, null);
} = useApplicationList("clientId,templateId", listItemLimit, listOffset, null, true, true);

/**
* Handles the application list fetch request error.
Expand All @@ -93,9 +93,7 @@ const ApplicationSelectionModal: FunctionComponent<ApplicationSelectionModalInte
return;
}

if (applicationListFetchRequestError?.response
&& applicationListFetchRequestError?.response?.data
&& applicationListFetchRequestError?.response?.data?.description) {
if (applicationListFetchRequestError?.response?.data?.description) {
dispatch(addAlert({
description: applicationListFetchRequestError.response.data.description,
level: AlertLevels.ERROR,
Expand Down Expand Up @@ -147,9 +145,7 @@ const ApplicationSelectionModal: FunctionComponent<ApplicationSelectionModalInte
// Remove the system apps from the application list.
if (!UIConfig?.legacyMode?.applicationListSystemApps) {
appList.applications = appList.applications.filter((item: ApplicationListItemInterface) =>
!ApplicationManagementConstants.SYSTEM_APPS.includes(item.name)
&& !ApplicationManagementConstants.DEFAULT_APPS.includes(item.name)
);
item.templateId !== ApplicationTemplateIdTypes.M2M_APPLICATION);
appList.count = appList.count - (applicationList.applications.length - appList.applications.length);
appList.totalResults = appList.totalResults -
(applicationList.applications.length - appList.applications.length);
Expand Down

0 comments on commit 42d025d

Please sign in to comment.