Skip to content

MB51/MB52 UX and user management improvements (persist MB51, refresh MB52, contagem apply, perfil handling) - #12

Open
hhhthiti wants to merge 2 commits into
codex/fix-import-function-and-update-layout-t5n2gffrom
codex/implementar-alteracoes-na-mb51-e-mb52
Open

MB51/MB52 UX and user management improvements (persist MB51, refresh MB52, contagem apply, perfil handling)#12
hhhthiti wants to merge 2 commits into
codex/fix-import-function-and-update-layout-t5n2gffrom
codex/implementar-alteracoes-na-mb51-e-mb52

Conversation

@hhhthiti

Copy link
Copy Markdown
Owner

Motivation

  • Provide a clearer MB51/MB52 workflow so MB51 is the sheet upload/ground-truth that is persisted per centre and MB52 is the query view with a fast refresh button.
  • Make contagem flow more direct by using the form submit to apply confirmed counts to the consulta and keep an explicit auxiliary "Aplicar agora" action.
  • Remove friction when the master edits user profiles by making password optional on edit and handling DB constraints that may accept MESTRE instead of MASTER.
  • Restrict planning UI to master users to avoid accidental access by common profiles.

Description

  • Persist MB51 snapshot to localStorage under key wmss_turno_snapshot_v2, load it at startup and present a per-centre summary (Principal/Tissue/TTD/Lonil/Estrutura). (changes in app.js).
  • Rename/annotate UI to reflect MB52 (Consulta) and MB51 (Conferência) semantics, add a Refresh informações button on MB52 that calls loadAll() without reloading the page, and update labels/messages accordingly. (changes in index.html + app.js).
  • Change contagem submit behaviour so the form submit now triggers applyContagemToConsulta() (applies confirmed rows to estoque_area), and keep a separate Aplicar agora button; update related UI labels. (changes in index.html + app.js).
  • Make password optional when editing an existing user in the master UI, normalize perfil values via normalizePerfil() and attempt DB upserts with a fallback to MESTRE when the wmss_users_perfil_check constraint differs, avoiding save errors. (changes in app.js).
  • Hide the Planejamento tab and section from non-master users by marking the section with data-role="master" in the markup. (change in index.html).

Testing

  • Performed a static syntax check with node --check app.js which completed successfully.
  • Verified the application starts without JavaScript syntax errors and the new consulta refresh handler and contagem submit wiring are present by inspection (no browser automation available here).
  • No automated integration tests were run in this environment; manual UI verification is recommended for upload/apply flows and Supabase interactions.

Codex Task

@vercel

vercel Bot commented Apr 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wmss Ready Ready Preview, Comment Apr 17, 2026 7:18pm

@netlify

netlify Bot commented Apr 17, 2026

Copy link
Copy Markdown

Deploy Preview for estoquecontagem ready!

Name Link
🔨 Latest commit 5c75b90
🔍 Latest deploy log https://app.netlify.com/projects/estoquecontagem/deploys/69e287731801030008521509
😎 Deploy Preview https://deploy-preview-12--estoquecontagem.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant