Skip to content

Commit

Permalink
fix(HMS-4217): sorting of domains
Browse files Browse the repository at this point in the history
Sorrting of domains in domains list did not work as the function
which was returning rows for sorting did not return one column thus
the index for "domain autojoin" returned undefined value for all rows.

Returning the same amount of values as columns fixes the issue.

https://issues.redhat.com/browse/HMS-4217

Signed-off-by: Petr Vobornik <[email protected]>
  • Loading branch information
pvoborni committed Jun 11, 2024
1 parent a81e8fe commit fc044af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Components/DomainList/DomainList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export interface DomainListProps {
* @returns an array with the indexable fields for comparing.
*/
const getSortableRowValues = (domain: Domain): string[] => {
const { domain_type } = domain;
const { domain_type, domain_id } = domain;
let { title, auto_enrollment_enabled } = domain;
title = title || '';
auto_enrollment_enabled = auto_enrollment_enabled || false;
const text_auto_enrollment_enabled = auto_enrollment_enabled === true ? 'Enabled' : 'Disabled';
return [title, domain_type, text_auto_enrollment_enabled];
return [title, domain_id || '', domain_type, text_auto_enrollment_enabled];
};

type fnCompareRows = (a: Domain, b: Domain) => number;
Expand Down

0 comments on commit fc044af

Please sign in to comment.