Skip to content

Commit

Permalink
Merge branch 'main' into dray/a11y-external-link
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjray committed May 15, 2023
2 parents 8a9357f + 92a937b commit 5a83ebb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/js/components/epics/table/statusCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const StatusTableCell = ({ item, className, ...props }: TableCellProps) => {
return null;
}

const { status, icon } = getEpicStatus({
const { status } = getEpicStatus({
epicStatus: item.status,
});

Expand All @@ -21,7 +21,6 @@ const StatusTableCell = ({ item, className, ...props }: TableCellProps) => {
title={status}
className={classNames(className, 'status-cell', 'complex-cell')}
>
{icon}
<span className="slds-m-left_x-small status-cell-text">{status}</span>
</DataTableCell>
);
Expand Down
11 changes: 4 additions & 7 deletions src/js/components/githubIssues/selectIssueModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,11 @@ const TaskStatus = ({ task }: { task: IssueTask }) => {
};

const EpicStatus = ({ epic }: { epic: IssueEpic }) => {
const { status, icon } = getEpicStatus({ epicStatus: epic.status });

const { t } = useTranslation();
const { status } = getEpicStatus({ epicStatus: epic.status });
return (
<span
className="slds-m-left_x-small v-align-center icon-text-block"
title={status}
>
{icon}
<span className="slds-m-left_x-small v-align-center icon-text-block">
{`${t('Status')}: ${status}`}
</span>
);
};
Expand Down
9 changes: 1 addition & 8 deletions src/js/components/utils/getEpicStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
import ProgressRing from '@salesforce/design-system-react/components/progress-ring';
import { t } from 'i18next';
import React from 'react';

import { EPIC_STATUSES, EpicStatuses } from '@/js/utils/constants';

const getEpicStatus = ({ epicStatus }: { epicStatus: EpicStatuses }) => {
let displayStatus, icon;
let displayStatus;
switch (epicStatus) {
case EPIC_STATUSES.PLANNED:
displayStatus = t('Planned');
icon = <ProgressRing value={0} />;
break;
case EPIC_STATUSES.IN_PROGRESS:
displayStatus = t('In Progress');
icon = <ProgressRing value={40} flowDirection="fill" theme="active" />;
break;
case EPIC_STATUSES.REVIEW:
displayStatus = t('Review');
icon = <ProgressRing value={100} />;
break;
case EPIC_STATUSES.MERGED:
displayStatus = t('Merged');
icon = <ProgressRing value={100} theme="complete" hasIcon />;
break;
}

return {
status: displayStatus || epicStatus,
icon,
};
};

Expand Down

0 comments on commit 5a83ebb

Please sign in to comment.