Views
These are the core app views.
index
This view is the entrance to the system for registered users. This view checks to which group the user belongs. If it is from the management group, it is redirected to the manager’s index. Otherwise, the index of the app for clients is rendered. This view requires the user to be logged in.
URL: /
GET: Provide the data to the frontend; these data are:
component: “Index”
props: No data
index_settings
View to redirect the user to the app’s settings according to the group they belong to. If it belongs to the management group, it is redirected to the manager settings; otherwise it is redirected to the settings for clients. This view requires the user to be logged in.
URL: /index/settings
GET: Redirection to the corresponding settings.
settings
View that renders the General template of the Settings, which shows the basic information of the User Profile. This view requires the user to be logged in.
URL: /settings
GET: Provide the data to the frontend; these data are:
component: SettingsIndex
props:
{ props = { "unconfirmedEmail": # Indicates if there is an unconfirmed email "userProfile": # The user profile of the UserProfile model, "maxSizeFile": # Maximum size allowed for file upload, "availableLanguages": # List of allowed languages, "availableCountries": # List of authorized countries, "availableDateFormats": # List of allowed date formats, "timeResendEmail": # Waiting time to resend confirmation email, } }
change_user_email
View that allows the user to change their primary email address. Then it redirects to the index_settings view. The new email is on hold until it is confirmed, through the email verification process. This view requires the user to be logged in.
URL: /settings/change/email
POST: Validates the input data: Email (the new email address) and password (Required as a secondary validation method). If the new email address is registered with another user, the error is added to the general inertia props. Otherwise, the email address confirmation email is sent.
cancel_change_email
View that allows you to cancel the email address change process. To do this, the new address must be in the confirmation process started in the change_user_email view. The user is then redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/cancel-change-email
POST: The email address is received as a parameter. It is verified that the address is not the main one, if it is valid it will be eliminated from the EmailAddress model.
change_names
View to change the user’s first and last name in the CustomUser model; the user is redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/change/names
POST: FirstName and lastName are received as parameters and the values of the first_name and last_name fields are changed, respectively, in the CustomUser model.
change_job_title
View to change the profession of the user in the UserProfile model. The user is redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/change/job
POST: It is received as jobTitle parameters and changes the value of the job_title field of the UserProfile model.
change_photo
View to change the user’s profile photo in the UserProfile model. The user is redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/change/photo
POST: A File type request with the file is received as parameters. It is validated that it meets the requirements (file type and size). It is stored in the media path and the location is recorded in the photo field of the UserProfile model.
remnove_photo
View to remove the user profile photo in the UserProfile model. The user is redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/remove/photo
POST: Removes the location that references the location of the photo in the photo field of the UserProfile model.
change_language
View to change the user’s preferred language in the UserProfile model. The user is redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/change/language
POST: It is received as a language parameter and changes the value of the language field of the UserProfile model.
change_country
View to change the user’s country preference in the UserProfile model. The user is redirected to the index_settings view. This view requires the user to be logged in.
URL: /settings/change/country
POST: It is received as a country parameter and changes the value of the country field of the UserProfile model.
device_list
View to list the devices and IP authorized by the user. This view requires the user to be logged in.
URL: /settings/devices
GET: Provide the data to the frontend; these data are:
component: Devices
props:
{ props = { "devices": # device list, "count": # Total number of devices, "paginateBy": # Number of devices displayed per page, "pages": # Number of pages needed to display the total, "currentPage": # Actual page. } }
delete_device
View to remove a device from those authorized by the user. The user is redirected to the device_list view. This view requires the user to be logged in.
URL: /device/delete/<device_id>
GET: It receives the id of the device as a parameter to eliminate it from the WhiteListIpAuthorization model.
login_connections
Lists the authentication providers that the user uses to log into the application. This view requires the user to be logged in.
URL: /settings/login/connections
GET: Provide the data to the frontend; these data are:
component: LoginConnections
props:
{ props = { "socialApps": # List of user authentication providers. } }
error_404
View to render the 404 error page.
URL: /404
GET: It provides the frontend with the following:
component: 404Error
props: No data
error_400
View to render the 400 error page.
URL: /400
GET: It provides the frontend with the following:
component: 400Error
props: No data
error_403
View to render the 403 error page.
URL: /403
GET: It provides the frontend with the following:
component: 403Error
props: No data
error_500
View to render the 500 error page.
URL: /500
GET: It provides the frontend with the following:
component: 500Error
props: No data