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
ba228072
Verified
Commit
ba228072
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Moved picker provider in app.
parent
c5894aa4
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/App.tsx
+16
-9
16 additions, 9 deletions
src/App.tsx
src/components/Dashboard/ReservationPage/Reservation/TripStage.tsx
+48
-55
48 additions, 55 deletions
...nents/Dashboard/ReservationPage/Reservation/TripStage.tsx
with
64 additions
and
64 deletions
src/App.tsx
+
16
−
9
View file @
ba228072
...
@@ -12,6 +12,8 @@ import { Unauthorized } from 'components/Unauthorized/Unauthorized';
...
@@ -12,6 +12,8 @@ import { Unauthorized } from 'components/Unauthorized/Unauthorized';
import
{
LandingPage
}
from
'
components/LandingPage/LandingPage
'
;
import
{
LandingPage
}
from
'
components/LandingPage/LandingPage
'
;
import
{
configureInterceptors
}
from
'
api/axios/configureInterceptors
'
;
import
{
configureInterceptors
}
from
'
api/axios/configureInterceptors
'
;
import
{
All
}
from
'
roles/All
'
;
import
{
All
}
from
'
roles/All
'
;
import
DateFnsUtils
from
'
@date-io/date-fns
'
;
import
MuiPickersUtilsProvider
from
'
@material-ui/pickers/MuiPickersUtilsProvider
'
;
/**
/**
* Entry point of the app.
* Entry point of the app.
...
@@ -23,15 +25,20 @@ export const App: FC = () => {
...
@@ -23,15 +25,20 @@ export const App: FC = () => {
return
(
return
(
<
div
data-testid
=
"App"
>
<
div
data-testid
=
"App"
>
<
ThemeProvider
theme
=
{
appTheme
}
>
<
ThemeProvider
theme
=
{
appTheme
}
>
<
Router
>
<
MuiPickersUtilsProvider
utils
=
{
DateFnsUtils
}
>
<
Switch
>
<
Router
>
<
Route
exact
path
=
{
NonAuthRoutes
.
home
}
component
=
{
LandingPage
}
/>
<
Switch
>
<
Route
path
=
{
NonAuthRoutes
.
auth
}
component
=
{
AuthUser
}
/>
<
Route
exact
path
=
{
NonAuthRoutes
.
home
}
component
=
{
LandingPage
}
/>
<
Route
path
=
{
AuthRoutes
.
dashboard
}
component
=
{
All
(
Dashboard
)
}
/>
<
Route
path
=
{
NonAuthRoutes
.
auth
}
component
=
{
AuthUser
}
/>
<
Route
path
=
{
NonAuthRoutes
.
unauthorized
}
component
=
{
Unauthorized
}
/>
<
Route
path
=
{
AuthRoutes
.
dashboard
}
component
=
{
All
(
Dashboard
)
}
/>
<
Route
component
=
{
NotFound
}
/>
<
Route
</
Switch
>
path
=
{
NonAuthRoutes
.
unauthorized
}
</
Router
>
component
=
{
Unauthorized
}
/>
<
Route
component
=
{
NotFound
}
/>
</
Switch
>
</
Router
>
</
MuiPickersUtilsProvider
>
</
ThemeProvider
>
</
ThemeProvider
>
</
div
>
</
div
>
);
);
...
...
This diff is collapsed.
Click to expand it.
src/components/Dashboard/ReservationPage/Reservation/TripStage.tsx
+
48
−
55
View file @
ba228072
...
@@ -9,13 +9,8 @@ import {
...
@@ -9,13 +9,8 @@ import {
Typography
,
Typography
,
}
from
'
@material-ui/core
'
;
}
from
'
@material-ui/core
'
;
import
{
Control
,
Controller
}
from
'
react-hook-form
'
;
import
{
Control
,
Controller
}
from
'
react-hook-form
'
;
import
{
InputField
}
from
'
components/Auth/InputField/InputField
'
;
import
{
ReservationType
}
from
'
types/ReservationType
'
;
import
{
ReservationType
}
from
'
types/ReservationType
'
;
import
DateFnsUtils
from
'
@date-io/date-fns
'
;
import
{
KeyboardDateTimePicker
}
from
'
@material-ui/pickers
'
;
import
{
MuiPickersUtilsProvider
,
KeyboardDateTimePicker
,
}
from
'
@material-ui/pickers
'
;
import
{
reservationPageStyle
}
from
'
../ReservationPage.style
'
;
import
{
reservationPageStyle
}
from
'
../ReservationPage.style
'
;
type
TripStageProps
=
{
type
TripStageProps
=
{
...
@@ -32,54 +27,52 @@ export const TripStage: FC<TripStageProps> = ({ control }: TripStageProps) => {
...
@@ -32,54 +27,52 @@ export const TripStage: FC<TripStageProps> = ({ control }: TripStageProps) => {
};
};
return
(
return
(
<
MuiPickersUtilsProvider
utils
=
{
DateFnsUtils
}
>
<
Card
>
<
Card
>
{
stage
.
map
((
field
,
index
)
=>
(
{
stage
.
map
((
field
,
index
)
=>
(
<
CardContent
>
<
CardContent
>
<
Typography
<
Typography
variant
=
"h6"
variant
=
"h6"
component
=
"h3"
component
=
"h3"
className
=
{
classes
.
paddingBottomKlein
}
className
=
{
classes
.
paddingBottomKlein
}
>
>
Stage
{
index
}
Stage
{
index
}
</
Typography
>
</
Typography
>
<
Controller
<
Controller
as
=
{
<
input
hidden
/>
}
as
=
{
<
input
hidden
/>
}
name
=
{
`tripStages[
${
index
}
].number`
}
name
=
{
`tripStages[
${
index
}
].number`
}
control
=
{
control
}
control
=
{
control
}
defaultValue
=
{
index
}
defaultValue
=
{
index
}
/>
/>
<
Controller
<
Controller
as
=
{
<
TextField
variant
=
"outlined"
fullWidth
label
=
"Location"
/>
}
as
=
{
<
TextField
variant
=
"outlined"
fullWidth
label
=
"Location"
/>
}
name
=
{
`tripStages[
${
index
}
].location.address`
}
name
=
{
`tripStages[
${
index
}
].location.address`
}
control
=
{
control
}
control
=
{
control
}
defaultValue
=
{
field
}
defaultValue
=
{
field
}
/>
/>
<
Controller
<
Controller
control
=
{
control
}
control
=
{
control
}
name
=
{
`tripStages[
${
index
}
].estimatedBeAt`
}
name
=
{
`tripStages[
${
index
}
].estimatedBeAt`
}
as
=
{
({
ref
,
...
rest
})
=>
(
as
=
{
({
ref
,
...
rest
})
=>
(
<
KeyboardDateTimePicker
<
KeyboardDateTimePicker
margin
=
"normal"
margin
=
"normal"
id
=
"date-picker-dialog"
id
=
"date-picker-dialog"
label
=
"Date and Hour"
label
=
"Date and Hour"
defaultValue
=
{
field
}
defaultValue
=
{
field
}
format
=
"dd/MM/yyyy"
format
=
"dd/MM/yyyy"
KeyboardButtonProps
=
{
{
KeyboardButtonProps
=
{
{
'
aria-label
'
:
'
Insert trip stage
'
,
'
aria-label
'
:
'
Insert trip stage
'
,
}
}
}
}
{
...
rest
}
{
...
rest
}
/>
/>
)
}
)
}
/>
/>
</
CardContent
>
</
CardContent
>
))
}
))
}
<
CardActions
>
<
CardActions
>
<
Button
variant
=
"outlined"
onClick
=
{
addStage
}
type
=
"button"
>
<
Button
variant
=
"outlined"
onClick
=
{
addStage
}
type
=
"button"
>
Add stage
Add stage
</
Button
>
</
Button
>
</
CardActions
>
</
CardActions
>
</
Card
>
</
Card
>
</
MuiPickersUtilsProvider
>
);
);
};
};
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