old people time, filter pending

This commit is contained in:
Alexander Wong 2018-04-23 14:58:14 -06:00
parent 47e5291317
commit 9a5489425e
No known key found for this signature in database
GPG Key ID: E90E5D6448C2C663
4 changed files with 17 additions and 14 deletions

View File

@ -99,7 +99,7 @@ export const ClientShiftFormView = ({
showTimeSelect showTimeSelect
showTimeSelectOnly showTimeSelectOnly
timeIntervals={30} timeIntervals={30}
dateFormat="LT Z" dateFormat="LT"
timeFormat="h:mm a" timeFormat="h:mm a"
placeholderText="Select shift start time" placeholderText="Select shift start time"
/> />

View File

@ -119,8 +119,10 @@ const ClientShiftsView = ({
const approvedOptions = [ const approvedOptions = [
{ text: "Approved", value: true }, { text: "Approved", value: true },
{ text: "Rejected", value: false }, { text: "Rejected", value: false },
{ text: "Pending", value: "" },
{ text: "All", value: null } { text: "All", value: null }
]; ];
const OLD_PEOPLE_TIME_FORMAT = "dddd, MMMM Do YYYY, h:mm a ";
return ( return (
<Container> <Container>
<Header>Shifts</Header> <Header>Shifts</Header>
@ -140,7 +142,7 @@ const ClientShiftsView = ({
{"Filter by Approval: "} {"Filter by Approval: "}
<Dropdown <Dropdown
inline inline
placeholder="All" placeholder={approvalFilter === null ? `All` : `Pending`}
options={approvedOptions} options={approvedOptions}
onChange={handleChangeApprovalFilter} onChange={handleChangeApprovalFilter}
value={approvalFilter} value={approvalFilter}
@ -207,7 +209,7 @@ const ClientShiftsView = ({
{"At " + {"At " +
utc(result.set_start, ISO_8601) utc(result.set_start, ISO_8601)
.local(false) .local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")} .format(OLD_PEOPLE_TIME_FORMAT)}
</Item.Meta> </Item.Meta>
<Item.Meta>{displayDuration}</Item.Meta> <Item.Meta>{displayDuration}</Item.Meta>
<Item.Meta>{`Rate $${price.amount}/hour`}</Item.Meta> <Item.Meta>{`Rate $${price.amount}/hour`}</Item.Meta>
@ -265,14 +267,14 @@ const ClientShiftsView = ({
{"Checked in at " + {"Checked in at " +
checkedIn checkedIn
.local(false) .local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")} .format(OLD_PEOPLE_TIME_FORMAT)}
</List.Item> </List.Item>
{checkedOut && ( {checkedOut && (
<List.Item> <List.Item>
{"Checked out at " + {"Checked out at " +
checkedOut checkedOut
.local(false) .local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")} .format(OLD_PEOPLE_TIME_FORMAT)}
</List.Item> </List.Item>
)} )}
</List> </List>

View File

@ -112,6 +112,7 @@ const ProviderShiftFormView = ({
handleCheckInPShift, handleCheckInPShift,
handleCheckOutPShift handleCheckOutPShift
}) => { }) => {
const OLD_PEOPLE_TIME_FORMAT = "dddd, MMMM Do YYYY, h:mm a";
const employer = getEmployerFromPrice(shift.price, user) || {}; const employer = getEmployerFromPrice(shift.price, user) || {};
const client = employer.client || {}; const client = employer.client || {};
const workType = getWorkTypeFromPrice(shift.price, user) || {}; const workType = getWorkTypeFromPrice(shift.price, user) || {};
@ -157,7 +158,7 @@ const ProviderShiftFormView = ({
{"Scheduled at " + {"Scheduled at " +
utc(shift.set_start, ISO_8601) utc(shift.set_start, ISO_8601)
.local(false) .local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")} .format(OLD_PEOPLE_TIME_FORMAT)}
</List.Item> </List.Item>
<List.Item>{displayDuration}</List.Item> <List.Item>{displayDuration}</List.Item>
<List.Item>{`Rate $${price.amount}/hour`}</List.Item> <List.Item>{`Rate $${price.amount}/hour`}</List.Item>
@ -198,13 +199,13 @@ const ProviderShiftFormView = ({
{checkedIn && ( {checkedIn && (
<List.Item> <List.Item>
<strong>Checked In At:</strong>{" "} <strong>Checked In At:</strong>{" "}
{checkedIn.local(false).format("dddd, MMMM Do YYYY, h:mm a Z")} {checkedIn.local(false).format(OLD_PEOPLE_TIME_FORMAT)}
</List.Item> </List.Item>
)} )}
{checkedOut && ( {checkedOut && (
<List.Item> <List.Item>
<strong>Checked Out At:</strong>{" "} <strong>Checked Out At:</strong>{" "}
{checkedOut.local(false).format("dddd, MMMM Do YYYY, h:mm a Z")} {checkedOut.local(false).format(OLD_PEOPLE_TIME_FORMAT)}
</List.Item> </List.Item>
)} )}
</List> </List>

View File

@ -119,10 +119,12 @@ const ProviderShiftsView = ({
handlePaginationChange, handlePaginationChange,
handleChangePShiftApproval handleChangePShiftApproval
}) => { }) => {
const OLD_PEOPLE_TIME_FORMAT = "dddd, MMMM Do YYYY, h:mm a";
const { count = 0, results = [] } = pShiftRequestSuccess; const { count = 0, results = [] } = pShiftRequestSuccess;
const approvedOptions = [ const approvedOptions = [
{ text: "Approved", value: true }, { text: "Approved", value: true },
{ text: "Rejected", value: false }, { text: "Rejected", value: false },
{ text: "Pending", value: "" },
{ text: "All", value: null } { text: "All", value: null }
]; ];
return ( return (
@ -133,7 +135,7 @@ const ProviderShiftsView = ({
{"Filter by Approval: "} {"Filter by Approval: "}
<Dropdown <Dropdown
inline inline
placeholder="All" placeholder={approvalFilter === null ? `All` : `Pending`}
options={approvedOptions} options={approvedOptions}
onChange={handleChangeApprovalFilter} onChange={handleChangeApprovalFilter}
value={approvalFilter} value={approvalFilter}
@ -200,7 +202,7 @@ const ProviderShiftsView = ({
{"At " + {"At " +
utc(result.set_start, ISO_8601) utc(result.set_start, ISO_8601)
.local(false) .local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")} .format(OLD_PEOPLE_TIME_FORMAT)}
</Item.Meta> </Item.Meta>
<Item.Meta>{displayDuration}</Item.Meta> <Item.Meta>{displayDuration}</Item.Meta>
<Item.Meta>{`Rate $${price.amount}/hour`}</Item.Meta> <Item.Meta>{`Rate $${price.amount}/hour`}</Item.Meta>
@ -214,9 +216,7 @@ const ProviderShiftsView = ({
{checkedIn && ( {checkedIn && (
<Item.Meta> <Item.Meta>
{"Checked in at: " + {"Checked in at: " +
checkedIn checkedIn.local(false).format(OLD_PEOPLE_TIME_FORMAT)}
.local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")}
</Item.Meta> </Item.Meta>
)} )}
{checkedOut && ( {checkedOut && (
@ -224,7 +224,7 @@ const ProviderShiftsView = ({
{"Checked out at: " + {"Checked out at: " +
checkedOut checkedOut
.local(false) .local(false)
.format("dddd, MMMM Do YYYY, h:mm a Z")} .format(OLD_PEOPLE_TIME_FORMAT)}
</Item.Meta> </Item.Meta>
)} )}
</Item.Content> </Item.Content>