Skip to content

Commit

Permalink
(fix) O3-4337 Service queues - make QueueTableByStatus show tables in…
Browse files Browse the repository at this point in the history
… predicable order (#1438)
  • Loading branch information
chibongho authored Jan 13, 2025
1 parent 8d84f6c commit 9c3e90a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { openmrsFetch, restBaseUrl, type Location } from '@openmrs/esm-framework';
import { type FetchResponse, openmrsFetch, restBaseUrl, type Location } from '@openmrs/esm-framework';
import { type Concept, type QueueEntry } from '../../types';

// see QueueEntryTransition.java in openmrs-module-queue
Expand All @@ -20,7 +20,10 @@ interface TransitionQueueEntryParams {
* @param abortController
* @returns
*/
export function transitionQueueEntry(params: TransitionQueueEntryParams, abortController?: AbortController) {
export function transitionQueueEntry(
params: TransitionQueueEntryParams,
abortController?: AbortController,
): Promise<FetchResponse<QueueEntry>> {
return openmrsFetch(`${restBaseUrl}/queue-entry/transition`, {
method: 'POST',
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ function QueueTable({
return (
<React.Fragment key={row.id}>
<Row {...getRowProps({ row })}>
{row.cells.map((cell) => (
{row.cells.map((cell, i) => (
<TableCell
key={cell.id}
className={classNames({
'cds--table-column-menu': cell?.id?.split(':')?.[1] === 'actions',
'cds--table-column-menu': columns[i].key.includes('actions'),
})}>
{cell.value}
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ interface QueueTablesByStatusProps {
function QueueTablesByStatus({ selectedQueue, searchTerm }: QueueTablesByStatusProps) {
const { t } = useTranslation();
const { queueEntries, isLoading, isValidating } = useQueueEntries({ queue: selectedQueue.uuid, isEnded: false });
const allowedStatuses = selectedQueue.allowedStatuses.reverse();
const allowedStatuses = [...selectedQueue.allowedStatuses].reverse();
const noStatuses = !allowedStatuses?.length;
if (isLoading) {
return <QueueTableByStatusSkeleton />;
Expand Down

0 comments on commit 9c3e90a

Please sign in to comment.