Working provider check in & check out

This commit is contained in:
Alexander Wong
2018-04-23 12:19:14 -06:00
parent 805f20e040
commit 4c639db50f
7 changed files with 201 additions and 36 deletions
+40 -2
View File
@@ -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>
);
})}