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

Remove the Status column from list view #9

Merged
merged 1 commit into from
Oct 13, 2023
Merged
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
21 changes: 1 addition & 20 deletions src/Components/DomainList/DomainList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ export interface DomainProps {
* @returns an array with the indexable fields for comparing.
*/
const getSortableRowValues = (domain: Domain): string[] => {
// FIXME What is status column? where do we retrieve that value form the backend?
const status = 'Available';
const { domain_type } = 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, status, text_auto_enrollment_enabled];
return [title, domain_type, text_auto_enrollment_enabled];
};

type fnCompareRows = (a: Domain, b: Domain) => number;
Expand Down Expand Up @@ -92,19 +90,6 @@ const DomainListFieldType = (props: DomainListFieldTypeProps) => {
}
};

interface DomainListFieldStatusProps {
domain: Domain;
}

const DomainListFieldStatus = (props: DomainListFieldStatusProps) => {
// TODO TBD Which values to return and logic for them
if (props.domain.domain_id === undefined || props.domain.domain_id === null) {
return <>Unavailable</>;
} else {
return <>Available</>;
}
};

export const DomainList = () => {
const context = useContext<IAppContext>(AppContext);

Expand Down Expand Up @@ -159,7 +144,6 @@ export const DomainList = () => {
<Tr>
<Th sort={getSortParams(0)}>Name</Th>
<Th>Type</Th>
<Th>Status</Th>
<Th sort={getSortParams(3)}>Domain auto-join on launch</Th>
<Th></Th>
</Tr>
Expand All @@ -181,9 +165,6 @@ export const DomainList = () => {
<Td>
<DomainListFieldType domain_type={domain.domain_type} />
</Td>
<Td>
<DomainListFieldStatus domain={domain} />
</Td>
<Td>{domain.auto_enrollment_enabled ? enabledText : disabledText}</Td>
<Td isActionCell>
<ActionsColumn items={rowActions} />
Expand Down
Loading