fix(Estimate): estimate status.

This commit is contained in:
a.bouhuolia
2021-12-28 17:01:35 +02:00
parent 1688f49bc1
commit 1e472d278a
5 changed files with 21 additions and 17 deletions

View File

@@ -10,23 +10,22 @@ import { T, Choose } from 'components';
export function EstimateDetailsStatus({ estimate }) {
return (
<Choose>
<Choose.When condition={estimate.is_delivered && estimate.is_approved}>
<Choose.When condition={estimate.is_approved}>
<Tag intent={Intent.SUCCESS} round={true}>
<T id={'approved'} />
</Tag>
</Choose.When>
<Choose.When condition={estimate.is_delivered && estimate.is_rejected}>
<Choose.When condition={estimate.is_rejected}>
<Tag intent={Intent.DANGER} round={true}>
<T id={'rejected'} />
</Tag>
</Choose.When>
<Choose.When
condition={
estimate.is_delivered &&
!estimate.is_rejected &&
!estimate.is_approved
}
>
<Choose.When condition={estimate.is_expired}>
<Tag intent={Intent.WARNING} round={true}>
<T id={'estimate.status.expired'} />
</Tag>
</Choose.When>
<Choose.When condition={estimate.is_delivered}>
<Tag intent={Intent.SUCCESS} round={true}>
<T id={'delivered'} />
</Tag>

View File

@@ -43,7 +43,6 @@ function EstimatesList({
<EstimatesViewTabs />
<EstimatesDataTable />
</DashboardPageContent>
</EstimatesListProvider>
);
}

View File

@@ -24,19 +24,22 @@ import { safeCallback } from 'utils';
*/
export const statusAccessor = (row) => (
<Choose>
<Choose.When condition={row.is_delivered && row.is_approved}>
<Choose.When condition={row.is_approved}>
<Tag minimal={true} intent={Intent.SUCCESS} round={true}>
<T id={'approved'} />
</Tag>
</Choose.When>
<Choose.When condition={row.is_delivered && row.is_rejected}>
<Choose.When condition={row.is_rejected}>
<Tag minimal={true} intent={Intent.DANGER} round={true}>
<T id={'rejected'} />
</Tag>
</Choose.When>
<Choose.When
condition={row.is_delivered && !row.is_rejected && !row.is_approved}
>
<Choose.When condition={row.is_expired}>
<Tag minimal={true} intent={Intent.WARNING} round={true}>
<T id={'estimate.status.expired'} />
</Tag>
</Choose.When>
<Choose.When condition={row.is_delivered}>
<Tag minimal={true} intent={Intent.SUCCESS} round={true}>
<T id={'delivered'} />
</Tag>