Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
red-giant
dashboard
Commits
6c33f13b
Verified
Commit
6c33f13b
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Remove date provider.
parent
dbfa710a
No related branches found
No related tags found
2 merge requests
!85
Implement the remaining api calls to make possible to link a driver shift with a reservation.
,
!75
Resolve "Driver shift page where driver inserts shift."
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Dashboard/Dashboard.tsx
+6
-1
6 additions, 1 deletion
src/components/Dashboard/Dashboard.tsx
src/components/Dashboard/ReservationPage/ReservationList/ReservationsListByWeek.tsx
+18
-25
18 additions, 25 deletions
...eservationPage/ReservationList/ReservationsListByWeek.tsx
with
24 additions
and
26 deletions
src/components/Dashboard/Dashboard.tsx
+
6
−
1
View file @
6c33f13b
...
...
@@ -2,10 +2,12 @@ import React, { FC } from 'react';
import
Container
from
'
@material-ui/core/Container
'
;
import
{
Route
,
useRouteMatch
}
from
'
react-router-dom
'
;
import
{
AuthRoutes
}
from
'
api/routes
'
;
import
{
Driver
}
from
'
roles/Driver
'
;
import
{
HomePage
}
from
'
./HomePage/HomePage
'
;
import
{
ProfilePage
}
from
'
./ProfilePage/ProfilePage
'
;
import
{
ReservationPage
}
from
'
./ReservationPage/ReservationPage
'
;
import
{
VeiclePage
}
from
'
./VehiclePage/VehiclePage
'
;
import
{
DriverShiftPage
}
from
'
./DriverShift/DriverShiftPage
'
;
export
const
Dashboard
:
FC
=
()
=>
{
const
{
path
}
=
useRouteMatch
();
...
...
@@ -17,7 +19,10 @@ export const Dashboard: FC = () => {
path
=
{
`
${
path
}${
AuthRoutes
.
reservation
}
`
}
component
=
{
ReservationPage
}
/>
<
Route
path
=
{
`
${
path
}${
AuthRoutes
.
vehicle
}
`
}
component
=
{
VeiclePage
}
/>
<
Route
path
=
{
`
${
path
}${
AuthRoutes
.
driver
}
`
}
component
=
{
Driver
(
DriverShiftPage
)
}
/>
</>
);
};
This diff is collapsed.
Click to expand it.
src/components/Dashboard/ReservationPage/ReservationList/ReservationsListByWeek.tsx
+
18
−
25
View file @
6c33f13b
import
React
,
{
FC
,
useState
}
from
'
react
'
;
import
{
Grid
}
from
'
@material-ui/core
'
;
import
{
Reservation
}
from
'
components/Dashboard/ReservationPage/Reservation/Reservation
'
;
import
DateFnsUtils
from
'
@date-io/date-fns
'
;
import
itLocale
from
'
date-fns/locale/en-US
'
;
import
{
KeyboardDatePicker
,
MuiPickersUtilsProvider
,
}
from
'
@material-ui/pickers
'
;
import
{
useReservationsListByWeek
}
from
'
hooks/useReservationsListByWeek
'
;
import
{
KeyboardDatePicker
}
from
'
@material-ui/pickers/DatePicker
'
;
/**
* Displays a list of all reservations from api.
...
...
@@ -19,24 +14,22 @@ export const ReservationsListByWeek: FC = () => {
const
reservations
=
useReservationsListByWeek
(
selectedDate
);
return
(
<
MuiPickersUtilsProvider
locale
=
{
itLocale
}
utils
=
{
DateFnsUtils
}
>
<
div
data-testid
=
"ReservationListViewer"
>
<
KeyboardDatePicker
value
=
{
selectedDate
}
variant
=
"static"
onChange
=
{
(
date
)
=>
handleDateChange
(
date
)
}
format
=
"dd/MM/yyyy"
/>
<
Grid
item
container
>
{
reservations
.
length
!==
0
?
(
reservations
.
map
((
reservation
,
key
)
=>
(
<
Reservation
reservation
=
{
reservation
}
/>
))
)
:
(
<
h1
>
You do not have reservations.
</
h1
>
)
}
</
Grid
>
</
div
>
{
'
'
}
</
MuiPickersUtilsProvider
>
<
div
data-testid
=
"ReservationListViewer"
>
<
KeyboardDatePicker
value
=
{
selectedDate
}
variant
=
"static"
onChange
=
{
(
date
)
=>
handleDateChange
(
date
)
}
format
=
"dd/MM/yyyy"
/>
<
Grid
item
container
>
{
reservations
.
length
!==
0
?
(
reservations
.
map
((
reservation
,
key
)
=>
(
<
Reservation
reservation
=
{
reservation
}
/>
))
)
:
(
<
h1
>
You do not have reservations.
</
h1
>
)
}
</
Grid
>
</
div
>
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment