Skip to content

Commit

Permalink
upcoming: [DI-21814] - ACLP UI - DBaaS instances order by label (#11226)
Browse files Browse the repository at this point in the history
* upcoming: [DI-21814] - DBaaS instances order by label

* upcoming: [DI-21814] - Added changeset

* DI-21814: use map for better readability and optimisations

---------

Co-authored-by: vmangalr <vmangalr@akamai.com>
  • Loading branch information
ankita-akamai and vmangalr authored Nov 8, 2024
1 parent ea8b449 commit 57eb19f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

ACLP UI - DBaaS instances order by label ([#11226](https://github.com/linode/manager/pull/11226))
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,23 @@ export const CloudPulseResourcesSelect = React.memo(
xFilter,
} = props;

const platformFilter =
resourceType === 'dbaas' ? { platform: 'rdbms-default' } : {};
const resourceFilterMap: Record<string, Filter> = {
dbaas: { '+order': 'asc', '+order_by': 'label', platform: 'rdbms-default' },
};

const { data: resources, isLoading, isError } = useResourcesQuery(
disabled !== undefined ? !disabled : Boolean(region && resourceType),
resourceType,
{},
xFilter
? {
...platformFilter,
...xFilter,
}
...(resourceFilterMap[resourceType ?? ''] ?? {}),
...xFilter, // the usual xFilters
}
: {
...platformFilter,
region,
}
...(resourceFilterMap[resourceType ?? ''] ?? {}),
region,
}
);

const [selectedResources, setSelectedResources] = React.useState<
Expand Down

0 comments on commit 57eb19f

Please sign in to comment.