-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from helsingborg-stad/feature/group-by-session
Feature/group-by-session
- Loading branch information
Showing
38 changed files
with
808 additions
and
194 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { getEvents, exportEvents } from 'api/event'; | ||
import { getEvents, exportEvents, getGroupedEvents } from 'api/event'; | ||
|
||
export const useEventApi = () => { | ||
const getAllEvents = (filter?: string) => getEvents(filter); | ||
const exportAllEvents = (filter?: string) => exportEvents(filter); | ||
const getAllGroupedEvents = (filter?: string) => getGroupedEvents(filter); | ||
|
||
return { | ||
getAllEvents, | ||
exportAllEvents, | ||
getAllGroupedEvents, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
src/modules/Delivery/components/DeliveryList/ListContent/ListContent.tsx
This file was deleted.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
src/modules/Delivery/components/DeliveryList/components/EventRow/EventRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { FC } from 'react'; | ||
import DistributionSvg from 'assets/distributor_icon.svg'; | ||
import { ZoneType } from 'types'; | ||
import CollecionSvg from 'assets/delivery_icon.svg'; | ||
import { Event } from 'types/event'; | ||
import { useDateConverter } from 'utils'; | ||
import * as Styled from './styled'; | ||
|
||
type Props = { | ||
event: Event; | ||
}; | ||
|
||
export const EventRow: FC<Props> = ({ event }) => { | ||
const { getWeekday, getHourAndMin, getYYYYMMDD } = useDateConverter(); | ||
return ( | ||
<Styled.Container key={event.id}> | ||
<Styled.Column>{getYYYYMMDD(event.enteredAt)}</Styled.Column> | ||
<Styled.Column> | ||
{getWeekday(event.enteredAt)} | ||
</Styled.Column> | ||
<Styled.Column>{getHourAndMin(event.exitedAt)}</Styled.Column> | ||
<Styled.TypeColumn> | ||
{event.zoneType === ZoneType.DISTRIBUTION | ||
? <Styled.SVGContainer src={DistributionSvg} alt="Distribution icon" /> | ||
: <Styled.SVGContainer src={CollecionSvg} alt="Collection icon" />} | ||
<Styled.IconInfo> | ||
<Styled.InfoText> | ||
{ | ||
event.zoneType === ZoneType.DISTRIBUTION | ||
? 'Lager' : 'Leveransplats' | ||
} | ||
</Styled.InfoText> | ||
</Styled.IconInfo> | ||
</Styled.TypeColumn> | ||
<Styled.PlaceColumn> | ||
{event.name} | ||
<Styled.SmallLabel>{event.address}</Styled.SmallLabel> | ||
</Styled.PlaceColumn> | ||
<Styled.Column>{event.area}</Styled.Column> | ||
<Styled.CarrierColumn> | ||
{event.organisation.name} | ||
<Styled.InfoBox> | ||
<Styled.InfoHeader>{event.organisation.name}</Styled.InfoHeader> | ||
<Styled.InfoText> | ||
Kontaktperson: | ||
{' '} | ||
{event.organisation.contactPerson} | ||
</Styled.InfoText> | ||
<Styled.InfoText>{event.organisation.email}</Styled.InfoText> | ||
<Styled.InfoText>{event.organisation.mobileNumber}</Styled.InfoText> | ||
</Styled.InfoBox> | ||
</Styled.CarrierColumn> | ||
<Styled.CarrierColumn> | ||
{event.distributionOrganisation ? event.distributionOrganisation.name : ''} | ||
{event.distributionOrganisation?.name && ( | ||
<Styled.InfoBox> | ||
<Styled.InfoHeader>{event.distributionOrganisation.name}</Styled.InfoHeader> | ||
<Styled.InfoText> | ||
Kontaktperson: | ||
{' '} | ||
{event.distributionOrganisation.contactPerson} | ||
</Styled.InfoText> | ||
<Styled.InfoText>{event.distributionOrganisation.email}</Styled.InfoText> | ||
<Styled.InfoText>{event.distributionOrganisation.mobileNumber}</Styled.InfoText> | ||
</Styled.InfoBox> | ||
)} | ||
</Styled.CarrierColumn> | ||
|
||
<Styled.Column>{event.sessionId}</Styled.Column> | ||
<Styled.Column>{getHourAndMin(event.enteredAt)}</Styled.Column> | ||
<Styled.Column>{event.os}</Styled.Column> | ||
</Styled.Container> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
src/modules/Delivery/components/DeliveryList/components/EventRow/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './EventRow'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.