Skip to content

Commit

Permalink
comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Achintha Isuru committed Oct 24, 2023
1 parent 4f05254 commit 3b91496
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions apps/console/src/features/roles/api/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export const useRolesList = <Data = RoleListInterface, Error = RequestErrorInter
* @param domain - User store domain.
* @param filter - Search filter.
* @returns The object containing the roles list.
* @deprecated This is a temporary hook until the API resources is moved to features.
* @deprecated This is a temporary hook until the API resource feature moved to the features folder.
*/
export const useAPIResourcesList = <Data = APIResourceListInterface, Error = RequestErrorInterface>(
filter?: string
Expand Down Expand Up @@ -468,7 +468,7 @@ export const useAPIResourcesList = <Data = APIResourceListInterface, Error = Req
* @param apiResourceId - id of the API resource
* @returns `Promise<APIResourceInterface>`
* @throws `IdentityAppsApiException`
* @deprecated This is a temporary hook until the API resources is moved to features.
* @deprecated This is a temporary hook until the API resource feature moved to the features folder.
*/
export const useAPIResourceDetails = <Data = APIResourceInterface, Error = RequestErrorInterface>(
apiResourceId: string
Expand Down Expand Up @@ -503,7 +503,7 @@ export const useAPIResourceDetails = <Data = APIResourceInterface, Error = Reque
* @param appId - Application ID.
*
* @returns A promise containing the response.
* @deprecated This is a temporary hook until the API resources is moved to features.
* @deprecated This is a temporary hook until the API resource feature moved to the features folder.
*/
export const useGetAuthorizedAPIList = <Data = AuthorizedAPIListItemInterface[], Error = RequestErrorInterface>(
applicationId: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,19 @@ export const RolePermissionsList: FunctionComponent<RolePermissionsListProp> =
const options: DropdownProps[] = [];

if(roleAudience === RoleAudienceTypes.ORGANIZATION) {
// // API resources list options when role audience is "organization".
apiResourcesList?.apiResources?.map((apiResource: APIResourceInterface) => {
if (!selectedAPIResources.find((selectedAPIResource: APIResourceInterface) =>
selectedAPIResource?.id === apiResource?.id)) {
options.push({
key: apiResource.id,
text: apiResource.name,
value: apiResource.id
});
}
});
// API resources list options when role audience is "organization".
apiResourcesList?.apiResources?.map(
(apiResource: APIResourceInterface) => {
if (!selectedAPIResources.find(
(selectedAPIResource: APIResourceInterface) =>
selectedAPIResource?.id === apiResource?.id)) {
options.push({
key: apiResource.id,
text: apiResource.name,
value: apiResource.id
});
}
});
} else {
// API resources list options when role audience is "application".
authorizedAPIListForApplication?.map((api: AuthorizedAPIListItemInterface) => {
Expand Down

0 comments on commit 3b91496

Please sign in to comment.