Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide m2m applications in application selection modal in IDP quickstart #7234

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading