-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #25 🎫: Finish final touches left overs #27
Merged
ITurres
merged 33 commits into
development
from
feature/finish-final-touches-left-overs
Apr 15, 2024
Merged
Issue #25 🎫: Finish final touches left overs #27
ITurres
merged 33 commits into
development
from
feature/finish-final-touches-left-overs
Apr 15, 2024
Conversation
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
- The now old 'vehicle_loader' and 'vehicle_error' classes have been renamed to 'loader-indicator' and 'error-indicator' and are now in the 'index.scss' file. This will allow its use in other components.
- Move some of the cookie retrieval logic to a separate helper function named 'getCookie' in 'src/helpers/getCookie.js'. - Update 'apiRequest.js' to use the new helper function.
- Update from 'vehicles' to 'vehiclesList'. - Update component prop to match the new state variable. This changes in naming will bring more clarity to the codebase.
- Updated prop from 'vehicles' to 'vehiclesList'.
…dability - and Updated all references to it.
- Moved the nested mobile button selector outside of the desktop button class. - Rename both desktop and mobile svg classes to match the name given in the 'SidePanel' component. - Give both svg classes a fill, width and height. This should resolve the bug where the icons were being displayed smaller than expected on mobile.
- Give 'theme_color' the same value as '$secondary-main-color'. - Give 'background_color' the same value as '$main-color'. - Add project 'icons' for different sizes. - Give icons the 'purpose' of 'any maskable'.
ITurres
added
enhancement
New feature or request
bug fix
Fixed a bug
UI/UX
User interface / User experience
deploy
gh-pages deployment
labels
Mar 30, 2024
- Rename all it's import references. - Rename array state variable 'vehicles' to 'vehiclesList'. These changes will give the component a more readable name.
…ITurres/tesla-booking-front-end into feature/finish-final-touches-left-overs
- Added static vehicle list to manage delays in database fetching. - Included timeout to handle database initialization delay for a better user experience. - Updated useEffect dependencies for better component re-rendering. - Enhanced error handling with 'DataStatusDialog' component.
9 tasks
ITurres
requested review from
mahammad-mostafa
and removed request for
mahammad-mostafa
April 14, 2024 23:11
- Migrate to ES5 function for better debugging with React Devtools. - Add size attr to icons to fix mobile bug, where icons are tiny.
mahammad-mostafa
approved these changes
Apr 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏆 Approved 🏆
Well done @ITurres 👏🏻 Your branch have been approved and you can merge 📦
🥇 🥇 🥇 🥇 🥇 🥇 🥇 🥇 🥇 🥇
Thank you @mahammad-mostafa! I appreciate it 🤠. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug fix
Fixed a bug
deploy
gh-pages deployment
documentation
Improvements or additions to documentation
enhancement
New feature or request
UI/UX
User interface / User experience
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Summary for Issue #25 Completion
Overview:
Changes Made:
Added:
/src/helpers/getCookie.js
apiRequest.js
file to get the cookie by its name./src/components/DataStatusDialog.jsx
/src/styles/components/DataStatusDialog.scss
DataStatusDialog
component.Modified:
/public/index.html
meta => theme-color
tag to set the theme color of the website to the primary color of the theme, which value is the same used under the sass variable$secondary-main-color
(red).manifest.json
file, which is used to provide metadata used when the website is added to the home screen of a mobile device and enables the website to have a native app-like experience./public/manifest.json
theme_color
property to match the value of the$secondary-main-color
sass variable (red).background_color
property to match the value of the$main-color
sass variable (off-white).icons
property to include the project's icontesla-red-logo-favicon.png
with a size of 512x512 pixels, which is used when the website is added to the home screen of a mobile device.tesla-apple-touch-icon.png
with a size of 192x192 pixels, which is used when the website is added to the home screen of an iOS device./src/app/App.jsx
App
component to handle the deletion of the cookie when the user hard loads the page. One is thegetAndDeleteCookie()
, this function will have the cookie bearer name and it will use the helpersgetCookie()
anddeleteCookie()
to successfully delete the cookie. The other functions is theisNavigationTimingSupported()
, this function will check if theperformance
object is in thewindow
object and if thegetEntriesByType
object is in theperformance
object. If both conditions are met, the function will returntrue
, otherwise it will returnfalse
./src/components/SidePanel.jsx
bars_icon_svg
to be able to style it with thebars_icon_svg
class in theSidePanel.scss
file.mobile_close_button
to the close button to be able to style it with themobile_close_button
class in theSidePanel.scss
file./src/features/reservations/ReservationForm.jsx
vehicles
destructured from thevehicles
slice has been renamed fromvehicles
tovehicleList
to better reflect the data it holds./src/features/reservations/ReservationItem.jsx
ReservationItem => rentalPrice
has been updated to be a string instead of a number. Solving the issue of therentalPrice
prop being passed as a number./src/features/reservations/ReservationsList.jsx
reservations
destructured from thereservations
slice has been renamed fromreservations
toreservationsList
to better reflect the data it holds./src/features/reservations/reservationsSlice.js
reservationsSlice
has been updated by renaming the arrayreservations
toreservationsList
to better reflect the data it holds. As well as updating all its references in the slice./src/features/vehicles/SplideCarousel.jsx
vehicles
tovehiclesList
to match the prop name passed to the component./src/features/vehicles/VehiclesList.jsx
Updated the class
vehicle_loader
for a more descriptive and reusable class nameloader-indicator
to be used on other components.The state array constant
vehicles
destructured from thevehicles
slice has been renamed fromvehicles
tovehicleList
to better reflect the data it holds.References to the
vehicles
array have been updated tovehicleList
to match the new name.Now the
VehiclesList
component will also render an static vehicle list that it is imported fromsrc/json/vehicles.json
file when the dynamic vehicle list is taking more than 3 seconds to load. Why? this happens in the first render of the page and when the database currently hosted in Render.com is in dormant state. This will prevent the user from seeing a blank page when the dynamic vehicle list is taking too long to load.Additionally, it will render a
DataStatusDialog
component with the message "Loading..." when the dynamic vehicle list is taking more than 3 seconds to load and a button to retry the fetch of the vehicle list.Incase of an
error
when fetching the vehicle list, theVehiclesList
component will render aDataStatusDialog
component with the message "Error loading vehicles" and a button to retry the fetch of the vehicle list.If the
loading
state of the current fetch is false and also the dynamic vehicle list (array) length is greater than 0, it is there that it will render the the dynamic vehicle list.The default return of the component will render a loader indicator (spinner) with the message "Loading..." when the dynamic/static vehicle list is being processed.
All in all, this will provide a better user experience when the vehicle list is taking too long to load or when an error occurs.
/src/features/vehicles/vehiclesSlice.js
vehiclesSlice
has been updated by renaming the arrayvehicles
tovehiclesList
to better reflect the data it holds. As well as updating all its references in the slice./src/helpers/apiRequest.js
getCookie()
, theapiRequest
helper function has been updated to use thegetCookie()
function to get the cookie./src/styles/components/SidePanel.scss
bars_icon_svg
class to style the menu button's React icon to be larger in mobile view./src/styles/features/vehicles/SplideCarousel.scss
SplideCarousel.scss
file to style the carousel component and fix the issue of the carousel social icons not being centered at the bottom of each vehicle item./src/styles/features/vehicles/VehicleDetail.scss
=>/src/styles/index.scss
.vehicle_loader
and.vehicle_error
have been renamed to.loader-indicator
anderror-indicator
and moved to theindex.scss
file to be global and reusable./src/styles/index.scss
.loader-indicator
and.error-indicator
to theindex.scss
file to be global and reusable..btn
class a focus style..loader-indicator
has an utility class ofvisible
to modify the visibility of the loader./src/styles/pages/AddVehiclePage.scss
.vehicles__list--wrapper
will have different styles if has the classloader-indicator
withing it. This is to modify the layout of the wrapper when the loader is visible.Renamed:
/src/features/vehicles/DeleteVehicleList.jsx
->/src/features/vehicles/ListVehiclesToDelete.jsx
DeleteVehicleList
component has been renamed toListVehiclesToDelete
to better reflect the purpose of the component.Deleted:
/src/styles/features/vehicles/VehiclesList.scss
DataStatusDialog.scss
file to be reused by theDataStatusDialog
component.VehiclesList
component.Moved:
/public/vehicles.json
->/src/json/vehicles.json
vehicles.json
file has been moved from thepublic
directory to thesrc/json
directory to be used as a static data source for the vehicles list at theVehiclesList
component.Impact:
These changes will impact the following components:
App.jsx
SidePanel.jsx
ReservationForm.jsx
ReservationItem.jsx
ReservationsList.jsx
SplideCarousel.jsx
VehiclesList.jsx
vehiclesSlice.js
DeleteVehicleList.jsx
-> newListVehiclesToDelete
apiRequest.js
SidePanel.scss
SplideCarousel.scss
VehicleDetail.scss
index.scss
These changes will impact the following files:
public/index.html
public/manifest.json
src/helpers/getCookie.js
Testing:
Related Issues:
Dependencies:
Additional Notes:
Some functional components like
DataStatusDialog
andVehiclesList
have been changed from ES6 fat arrow functions to ES5 functions for React Developer Tools to display the correct component names (instead ofUnknown
oranonymous
).The rest of the components have been left as ES6 fat arrow functions but will need to be changed to ES5 functions as well for consistency.
These changes have been deployed with the Semantic Versioning (SemVer) version v0.1.0.
You can see the commit here.
Thank you for reviewing this PR. Feel free to reach out on Slack as Arturo (Arthur) Emanuel Guerra Iturres for any queries or further assistance. 🌟