Working provider check in & check out
This commit is contained in:
@@ -11,7 +11,9 @@ import {
|
||||
Pagination,
|
||||
Popup,
|
||||
Loader,
|
||||
Label
|
||||
Label,
|
||||
List,
|
||||
Message
|
||||
} from "semantic-ui-react";
|
||||
import {
|
||||
getCShiftsRequest,
|
||||
@@ -114,6 +116,10 @@ const ClientShiftsView = ({
|
||||
const provider = employee.provider || {};
|
||||
const price = getPriceFromPrice(result.price, user) || {};
|
||||
const workType = price.work_type;
|
||||
const checkedIn =
|
||||
!!result.actual_start && utc(result.actual_start, ISO_8601);
|
||||
const checkedOut =
|
||||
!!result.actual_end && utc(result.actual_end, ISO_8601);
|
||||
const min = duration(
|
||||
utc(result.set_end, ISO_8601) - utc(result.set_start, ISO_8601),
|
||||
"milliseconds"
|
||||
@@ -173,7 +179,7 @@ const ClientShiftsView = ({
|
||||
<a href={"mailto:" + provider.email}>{provider.email}</a>
|
||||
</Item.Description>
|
||||
</Item.Content>
|
||||
{result.actual_start === null && (
|
||||
{!checkedIn && (
|
||||
<Item.Extra>
|
||||
<Button
|
||||
primary
|
||||
@@ -207,6 +213,38 @@ const ClientShiftsView = ({
|
||||
/>
|
||||
</Item.Extra>
|
||||
)}
|
||||
{checkedIn && (
|
||||
<Item.Content>
|
||||
<Item.Description>
|
||||
{result.description && (
|
||||
<Message>{result.description}</Message>
|
||||
)}
|
||||
<strong>Provider</strong>
|
||||
<List bulleted>
|
||||
<List.Item>
|
||||
{"Checked in at " +
|
||||
checkedIn
|
||||
.local(false)
|
||||
.format("dddd, MMMM Do YYYY, h:mm a Z")}
|
||||
</List.Item>
|
||||
{checkedOut && (
|
||||
<List.Item>
|
||||
{"Checked out at " +
|
||||
checkedOut
|
||||
.local(false)
|
||||
.format("dddd, MMMM Do YYYY, h:mm a Z")}
|
||||
</List.Item>
|
||||
)}
|
||||
</List>
|
||||
{result.chart && (
|
||||
<Message>
|
||||
<Message.Header>Chart</Message.Header>
|
||||
{result.chart}
|
||||
</Message>
|
||||
)}
|
||||
</Item.Description>
|
||||
</Item.Content>
|
||||
)}
|
||||
</Item>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user