Refatoração dos painéis do JournalProxyEditor com mapeamento de seções#1314
Conversation
…SciELO Este commit reorganiza extensivamente a estrutura de painéis da classe JournalProxyEditor em 'journal/proxys.py'. O objetivo principal foi alinhar o código-fonte com a numeração e nomenclatura das seções do Guia SciELO (ex: Ficha Bibliográfica, Política Editorial, Instruções aos Autores). Principais alterações: - Adição de comentários numerados (ex: # about_the_journal - 08) para mapear cada campo à sua seção correspondente no template/guia. - Comentários em blocos de campos redundantes ou que não serão editados diretamente via proxy, visando limpar a interface administrativa. - Reordenação de campos dentro dos painéis para seguir a sequência lógica da documentação oficial. - Inclusão de novos InlinePanels específicos (como 'ethics' no bloco de ciência aberta e 'artificial_intelligence' nas políticas). - Habilitação do campo 'journal_url' e desativação de 'related_journal_urls'. Essas mudanças facilitam a manutenção do sistema e garantem que o preenchimento dos dados do periódico siga o fluxo esperado pela rede SciELO.
There was a problem hiding this comment.
Pull request overview
Refactors the Wagtail editor panels for JournalProxyEditor to align fields with the journal registration form sections/subsections, and adds a migration introducing a proxy model intended for admin-only editing.
Changes:
- Reorganized
JournalProxyEditortab panels and added inline section/subsection mapping comments for each field. - Temporarily disabled multiple panels/fields by commenting them out to simplify the editor UI.
- Added migration to create the
JournalProxyAdminOnlyproxy model.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
journal/proxys.py |
Reorders/annotates editor panels; hides multiple fields; re-enables journal_url and moves some panels between tabs. |
journal/migrations/0059_journalproxyadminonly.py |
Adds the Django migration that creates the JournalProxyAdminOnly proxy model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| FieldPanel("journal_url"), | ||
|
|
||
| # InlinePanel("related_journal_urls", label=_("Journal Urls")), |
There was a problem hiding this comment.
journal_url is being exposed in the editor UI while related_journal_urls is commented out. The codebase previously introduced JournalURL (migration 0025_journalurl) and migrated values from journal_url into the inline panel, and there’s no model logic keeping journal_url and related_journal_urls in sync. This means edits to journal_url here will likely be ignored by the rest of the system (which prefetches/uses related_journal_urls) and can lead to inconsistent data. Consider keeping related_journal_urls as the editable field (and leaving journal_url hidden/read-only), or add explicit synchronization/validation so both representations stay consistent.
| FieldPanel("journal_url"), | |
| # InlinePanel("related_journal_urls", label=_("Journal Urls")), | |
| # FieldPanel("journal_url"), | |
| InlinePanel("related_journal_urls", label=_("Journal Urls")), |
|
|
||
| # POLÍTICA EDITORIAL - 14 - Patrocinadores e Agências de Fomento | ||
| InlinePanel("sponsor_history", label=_("Sponsor")), |
There was a problem hiding this comment.
There is trailing whitespace on the blank line and on the comment line here. This will be rejected by the repo’s pre-commit trailing-whitespace hook; please remove the extra spaces.
| # POLÍTICA EDITORIAL - 02 - Peer review | ||
| InlinePanel("peer_review", label=_("Peer review")), | ||
|
|
||
| # about_the_journal - 03b - Conformidade com a Ciência Aberta - declaração de conformidade |
There was a problem hiding this comment.
The section-mapping comments are inconsistent here (about_the_journal vs the rest of the file using SOBRE O PERIÓDICO/POLÍTICA EDITORIAL). Since the main goal of this PR is clear field-to-section mapping, please standardize the terminology/casing so the mapping is unambiguous and searchable.
| # about_the_journal - 03b - Conformidade com a Ciência Aberta - declaração de conformidade | |
| # SOBRE O PERIÓDICO - 03b - Conformidade com a Ciência Aberta - declaração de conformidade |
|
|
||
| # INSTRUÇÕES AOS AUTORES - 0? - | ||
| # InlinePanel( | ||
| # "preparing_manuscript", | ||
| # label=_("Preparing Manuscript"), | ||
| # ), |
There was a problem hiding this comment.
These section-mapping comments still contain placeholders like 0?. This undermines the refactor’s purpose (explicit mapping to the form sections) and makes it hard to trust the documentation. Please replace with the correct section number/name (or remove the mapping comment if it can’t be confirmed yet).
| panels_scope_and_about = [ | ||
| InlinePanel("mission", label=_("Mission")), | ||
| # InlinePanel("mission", label=_("Mission")), | ||
|
|
||
| # SOBRE O PERIÓDICO - 01 - brief history | ||
| InlinePanel("history", label=_("Brief History")), | ||
|
|
||
| # SOBRE O PERIÓDICO - 05 - focus and scope | ||
| InlinePanel("focus", label=_("Focus and Scope")), | ||
| AutocompletePanel("subject"), | ||
| InlinePanel("thematic_area", label=_("Thematic Areas")), | ||
| AutocompletePanel("subject_descriptor"), | ||
| AutocompletePanel("wos_area"), | ||
| AutocompletePanel("wos_db"), | ||
| # AutocompletePanel("subject"), | ||
| # InlinePanel("thematic_area", label=_("Thematic Areas")), | ||
| # AutocompletePanel("subject_descriptor"), | ||
| # AutocompletePanel("wos_area"), | ||
| # AutocompletePanel("wos_db"), |
There was a problem hiding this comment.
Large blocks of panels are being kept as commented-out code. This file is now the only place in the journal app that uses commented-out InlinePanel/AutocompletePanel definitions, which makes the panel configuration harder to read/maintain over time. Prefer removing these panels entirely (git history already preserves them) or gating them behind an explicit configuration/feature flag if they are expected to return.
Descrição
Esta PR refatora completamente os painéis do modelo proxy
JournalProxyEditor, organizando os campos de acordo com as seções específicas do formulário de cadastro de periódicos. Foram adicionados comentários detalhados mapeando cada campo para sua respectiva seção e subseção.Motivação
Alterações Principais
1. Migration: JournalProxyAdminOnly
JournalProxyAdminOnlypara separação de responsabilidades2. Reorganização de Painéis com Mapeamento de Seções
panels_titlesofficial,title,short_titleother_titles(InlinePanel)panels_scope_and_abouthistory,focus,indexed_at,additional_indexed_atmission,subject,thematic_area,subject_descriptor,wos_area,wos_db,vocabulary,title_in_databasepanels_institutionsowner_history,publisher_history,sponsor_historycopyright_holder_historypanels_websitejournal_urlrelated_journal_urls,main_collection,standardpanels_open_scienceethicspara este painelopen_access,url_oa,journal_use_licensepanels_policydigital_pa,editorial_policypanels_instructions_for_authorspreparing_manuscript,supp_docs_submission,acknowledgements,author_name,manuscript_length,text_language,abstract_languagepanels_editorial_board3. Remoção de Painel
panels_notes(comentado)Mapeamento Completo de Seções
SOBRE O PERIÓDICO
POLÍTICA EDITORIAL
INSTRUÇÕES AOS AUTORES
Impacto
Testes Recomendados
Próximos Passos
Checklist