feat(report): adiciona totais de elementos visuais por artigo - #1484
Merged
samuelveigarangel merged 15 commits intoSep 30, 2026
Merged
samuelveigarangel merged 15 commits into
samuelveigarangel merged 15 commits into
Conversation
Move visual type codes to ArticleCountType, attach counts to Article and drop CommonControlField from the count models. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Count fig, table-wrap, formula and graphic totals when the article XML is loaded or saved. Co-authored-by: Cursor <cursoragent@cursor.com>
Add tests for XML counting, count replacement and the backfill task. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
samuelveigarangel
force-pushed
the
feat/visual-element-totals
branch
from
September 30, 2026 02:50
c1f0c17 to
175314a
Compare
Add a filterable yearly totals view, semicolon CSV export and a menu item under Articles. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
samuelveigarangel
force-pushed
the
feat/visual-element-totals
branch
from
September 30, 2026 02:52
175314a to
b463f9d
Compare
samuelveigarangel
requested review from
pitangainnovare and
robertatakenaka
September 30, 2026 02:52
pitangainnovare
requested changes
Sep 30, 2026
pitangainnovare
left a comment
Contributor
There was a problem hiding this comment.
Foram solicitadas duas alterações:
- Corrigir testes em report
- Fazer code ser unique
Add a PID v2 or v3 field so the totals view and spreadsheet can be limited to one article. Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent duplicate visual count type codes when creating counts from XML. Co-authored-by: Cursor <cursoragent@cursor.com>
…unt migration Keep the constraint in the branch migration instead of adding a follow-up. Co-authored-by: Cursor <cursoragent@cursor.com>
Emit a column only for languages present in the data, keep nd last, and count both missing languages and code2 nd. Co-authored-by: Cursor <cursoragent@cursor.com>
Assert column order, the nd suffix for missing languages, and counts stored with code2 nd. Co-authored-by: Cursor <cursoragent@cursor.com>
Show the result phrase only when both the page count and the total are present. Co-authored-by: Cursor <cursoragent@cursor.com>
pitangainnovare
approved these changes
Sep 30, 2026
Use the same label on the admin menu and on the report page. Co-authored-by: Cursor <cursoragent@cursor.com>
Limit the journal list to the selected collection, drop the dashed empty label, and keep the select visible on a white background. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

O que esse PR faz?
Persiste, por artigo e idioma, a quantidade de
fig,table-wrap, fórmulas egraphicextraída do XML, e expõe esses totais numa tela administrativa com filtro e download em CSV.ArticleCountpassa a apontar paraArticle, com unicidade por artigo, tipo e idioma.ArticleCountType.task_create_article_visual_countspreenche artigos já carregados.;.Onde a revisão poderia começar?
article/models.py(ArticleCount,ArticleCountTypeeArticle.create_or_update_article_visual_counts)article/migrations/0051_articlecount_article.pyarticle/sources/xmlsps.py(count_visual_and_formula_itemsecreate_or_update_article_counts)report/visual_element_totals.pyereport/views.pyComo este poderia ser testado manualmente?
python manage.py migrate article.python manage.py test article.tests.test_visual_element_counts article.tests.test_task_update_article_visual_counts report.tests.VisualElementTotalsQueryTest;e conferir que coleções múltiplas (scl; sss) permanecem na colunacollection.Algum cenário de contexto que queira dar?
graphicdentro defigoutable-wrapnão entra na contagem degraphic. Contagens que o XML não traz mais são removidas; as que permanecem são atualizadas comupdate_or_create.Screenshots
Quais são os tickets relevantes?
#1468
Referências
Nenhuma referência externa.
Segurança da informação (NSI.04)
Este PR manipula dados sensíveis ou pessoais (LGPD)?
Este PR altera autenticação, autorização, controle de acesso ou gerenciamento de sessão?
Este PR introduz, atualiza ou remove dependências de terceiros?
Este PR foi validado pelo pipeline de segurança (SonarQube / Trivy)?
Este PR concatena, monta ou executa comandos SQL, HTML ou JavaScript a partir de entrada externa?
Este PR expõe novos endpoints, telas ou serviços?
As rotas ficam em
/admin/report/visual-element-totals/e/admin/report/visual-element-totals/csv/, no admin do Wagtail, atrás do login administrativo.Algum segredo, senha, chave ou token está sendo adicionado ao código-fonte?
Made with Cursor