The Settings page (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Edwin950821/BodegaX/llms.txt
Use this file to discover all available pages before exploring further.
/settings) is the administrative control centre for BodegaX. It surfaces user management tools, the workday-termination flow, and sidebar navigation toggles — all in a single, auth-guarded view. Only users whose session carries role: 'admin' should access this page; regular warehouse users are directed away by the application’s route and UI logic. This page covers session management, sidebar configuration, browser compatibility, screen-resolution requirements, and the API base URL — the operational details that keep BodegaX running smoothly day to day.
User creation, editing, and deletion are covered in depth on the User Management page. This page focuses on the broader system-level settings and configuration concerns.
Accessing the Settings Page
The Settings route (/settings) is protected by CheckLoginGuard, which redirects unauthenticated visitors to /login. Once authenticated, the component reads the active session from sessionStorage['bodegax'] on initialisation:
nombre field is displayed in the top-right corner of the page header. The Terminar Jornada button is always present on this page — because the Settings page itself is the admin-only area, no additional *ngIf role check is applied to the button within the template.
Session Management
BodegaX sessions live entirely in the browser’ssessionStorage under the key "bodegax". The session object is a serialised JSON document that includes the user’s nombre, role, uuid, and other account fields written by AppService.logIn() at authentication time.
Logging Out
CallingAppService.logOut() performs four actions in sequence:
logOut() completes, any component still subscribed to isLogged$ or role$ receives the updated values immediately thanks to the BehaviorSubject pattern.
Sidebar Visibility Controls
Every page in BodegaX features a collapsible left sidebar. Its open/closed state is managed centrally byAppService using a BehaviorSubject<boolean> so that all pages stay in sync regardless of which component triggers the toggle.
AppService Sidebar API
Mobile Sidebar Behaviour
SettingsComponent tracks the viewport width to adapt the layout for smaller screens:
isMobile is true (viewport ≤ 768 px), the username label in the header is hidden to save horizontal space.
Browser and Device Requirements
Supported Browsers
BodegaX is tested and supported on the latest stable releases of Chrome, Firefox, Edge, and Safari. Older browser versions or non-standard engines may encounter rendering issues with Angular Material components.
Screen Resolution
The minimum recommended resolution is 1366 × 768 px. The responsive layout adapts for mobile viewports at the 768 px breakpoint, but the full admin interface (tables, dialogs, sidebar) is optimised for desktop screens.
API Base URL Configuration
All HTTP calls in BodegaX target a hard-coded base URL ofhttp://localhost:8080. This value is embedded directly in every component file that makes API requests — there is no environment-variable system or Angular environment.ts configuration in the current version.
Example calls from settings.component.ts and user-form-message.ts:
Frequently Asked Settings Questions
What is the 'Nombre de Bodega' field on the Settings page?
What is the 'Nombre de Bodega' field on the Settings page?
The Settings page displays a Nombre de Bodega heading and a text input labelled Bodega in the HTML template. However, the corresponding
guardar() method in SettingsComponent is currently an empty stub with no implementation — clicking save has no effect. The input exists as a UI placeholder for a future configuration feature. The warehouse name shown in the page header comes from the authenticated user’s nombre field stored in sessionStorage['bodegax'].Why do I see 'Terminar Jornada' on the Settings page?
Why do I see 'Terminar Jornada' on the Settings page?
Terminar Jornada (End Workday) is an admin action available on the Settings page. Clicking it opens the
TerminarJornada dialog, which processes end-of-day operations for active warehouse clients. The Settings page is itself restricted to admin sessions, so the button is always rendered on this page without an additional role check in the template.Can two admins be logged in at the same time?
Can two admins be logged in at the same time?
Yes. Because BodegaX sessions are stored in
sessionStorage (which is tab-isolated in modern browsers), two different browser tabs — or two different browsers — can maintain independent admin sessions simultaneously. Each tab’s session is independent and does not interfere with the other.What happens to the session when I close the browser tab?
What happens to the session when I close the browser tab?
sessionStorage is cleared automatically by the browser when the tab or window is closed. The next time BodegaX is opened, AppService finds no entry under "bodegax" and sets isLogged to false, sending the user to /login. No manual logout is needed between sessions.How do I deploy BodegaX to a server instead of localhost?
How do I deploy BodegaX to a server instead of localhost?
You need to update the hard-coded
http://localhost:8080 base URL in every component TypeScript file to point to your production Spring Boot server address. After updating, rebuild the Angular application with ng build --configuration production and serve the output from /dist using a web server such as Nginx or Apache. Ensure your Spring Boot application’s CORS configuration allows requests from the Angular app’s origin.What is the minimum PostgreSQL version required?
What is the minimum PostgreSQL version required?
BodegaX’s Spring Boot backend manages all database schema creation and migrations. Verify the specific PostgreSQL version requirement in the backend’s
application.properties or pom.xml. Generally, PostgreSQL 12 or later is recommended for compatibility with Spring Boot’s JPA/Hibernate layer.Settings Page Component Reference
| Property / Method | Type | Description |
|---|---|---|
sidebarOpen | boolean | Local flag tracking whether the sidebar is expanded; initialised to true. |
isMobile | boolean | true when window.innerWidth <= 768; recalculated on every window resize event. |
usuarios | any[] | Array of user objects populated by GET /admin/all on component init. |
user5 | object | Parsed session object from sessionStorage['bodegax']; provides nombre for the header. |
ngOnInit() | void | Lifecycle hook — calls getUsers() to pre-populate the user table. |
getUsers() | void | Issues GET /admin/all and assigns the response to usuarios. |
crear() | void | Opens UserFormDialog with no data (new-user mode). Does not subscribe to afterClosed(). |
editar(user) | void | Opens UserFormDialog pre-filled with the selected user’s data; subscribes to afterClosed() to refresh the table. |
eliminar(user) | void | Opens ConfirmDialog; on confirmation issues DELETE /admin/delete with the user in the body, then refreshes the table. |
terminar() | void | Opens TerminarJornada dialog for end-of-day workday closure. |
guardar() | void | Stub method — currently empty, not yet implemented. |
openSidebar() | void | Calls AppService.toggleSidebar() and flips the local sidebarOpen flag. |
shouldShowUserName | boolean (getter) | Returns true when the username label should be visible based on sidebar and viewport state. |