Skip to content

Refatoração dos painéis do JournalProxyEditor com mapeamento de seções#1314

Merged
robertatakenaka merged 4 commits intoscieloorg:mainfrom
robertatakenaka:reorganiza_formulario_de_journal_para_editores
Feb 8, 2026
Merged

Refatoração dos painéis do JournalProxyEditor com mapeamento de seções#1314
robertatakenaka merged 4 commits intoscieloorg:mainfrom
robertatakenaka:reorganiza_formulario_de_journal_para_editores

Conversation

@robertatakenaka
Copy link
Member

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

  • Melhorar a manutenibilidade do código através de documentação clara dos campos
  • Facilitar o entendimento da relação entre os campos do modelo e as seções do formulário
  • Remover campos temporariamente não utilizados (comentados) para simplificar a interface do editor
  • Organizar logicamente os painéis seguindo a estrutura do formulário de cadastro

Alterações Principais

1. Migration: JournalProxyAdminOnly

  • Criado modelo proxy JournalProxyAdminOnly para separação de responsabilidades
  • Modelo destinado exclusivamente para administradores

2. Reorganização de Painéis com Mapeamento de Seções

panels_titles

  • Mantidos apenas campos essenciais: official, title, short_title
  • Comentado: other_titles (InlinePanel)
  • Seção: SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica

panels_scope_and_about

  • Mantidos: history, focus, indexed_at, additional_indexed_at
  • Comentados: mission, subject, thematic_area, subject_descriptor, wos_area, wos_db, vocabulary, title_in_database
  • Seções:
    • SOBRE O PERIÓDICO - 01 (Brief History)
    • SOBRE O PERIÓDICO - 05 (Focus and Scope)
    • SOBRE O PERIÓDICO - 07a/07b (Indexação)

panels_institutions

  • Mantidos: owner_history, publisher_history, sponsor_history
  • Comentado: copyright_holder_history
  • Seções:
    • SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica (C1/C2)
    • POLÍTICA EDITORIAL - 14 (Patrocinadores)

panels_website

  • Reorganizados campos de contato e websites
  • Reativado: journal_url
  • Comentados: related_journal_urls, main_collection, standard
  • Seções:
    • SOBRE O PERIÓDICO - 09 (Websites e Mídias Sociais)
    • SOBRE O PERIÓDICO - 10 (Contato)

panels_open_science

  • Mantidos painéis relacionados à Ciência Aberta
  • Movido: ethics para este painel
  • Comentados: open_access, url_oa, journal_use_license
  • Seções:
    • SOBRE O PERIÓDICO - 02/03/04 (Open Access, Ciência Aberta, Ética)
    • POLÍTICA EDITORIAL - 01/02/03/11b (Preprints, Peer Review, Dados Abertos)

panels_policy

  • Reorganizados todos os painéis de política editorial
  • Comentados: digital_pa, editorial_policy
  • Seções: POLÍTICA EDITORIAL - 04 a 13 (diversas políticas)

panels_instructions_for_authors

  • Mantidos campos essenciais de instruções
  • Comentados: preparing_manuscript, supp_docs_submission, acknowledgements, author_name, manuscript_length, text_language, abstract_language
  • Seção: INSTRUÇÕES AOS AUTORES - 01 a 07

panels_editorial_board

  • Mantido sem alterações
  • Seção: CORPO EDITORIAL

3. Remoção de Painel

  • Removido: panels_notes (comentado)

Mapeamento Completo de Seções

SOBRE O PERIÓDICO

  • 01: Brief History
  • 02: Open Access declaration
  • 03a/03b: Conformidade com Ciência Aberta
  • 04: Ética na Publicação
  • 05: Focus and Scope
  • 06: Preservação Digital
  • 07a/07b: Fontes de Indexação
  • 08: Ficha Bibliográfica (A-F)
  • 09: Websites e Mídias Sociais (a-d)
  • 10: Contato (a-d)

POLÍTICA EDITORIAL

  • 01: Preprints
  • 02: Peer Review
  • 03: Dados Abertos
  • 04: Cobrança de Taxas
  • 05: Política de Ética e Más Condutas
  • 06: Conflito de Interesses
  • 07: Verificação de Similaridade
  • 08: Inteligência Artificial
  • 09: Questões de Sexo e Gênero
  • 10: Comitê de Ética
  • 11a/11b: Direitos Autorais
  • 12: Responsabilidade do Site
  • 13: Responsabilidade do Autor
  • 14: Patrocinadores e Agências de Fomento

INSTRUÇÕES AOS AUTORES

  • 01: Tipos de Documentos Aceitos
  • 02: Contribuição dos Autores
  • 03: Formato de Envio
  • 04: Ativos Digitais
  • 05: Citações e Referências
  • 06: Declaração de Financiamento
  • 07: Informações Adicionais

Impacto

  • Interface do Editor: Simplificada, exibindo apenas campos essenciais
  • Manutenibilidade: Significativamente melhorada com documentação inline
  • Compatibilidade: Mantida - campos apenas comentados, não removidos
  • Performance: Sem impacto - alterações apenas estruturais

Testes Recomendados

  1. Verificar carregamento correto dos painéis no admin do Wagtail
  2. Confirmar que todos os InlinePanels ativos funcionam corretamente
  3. Validar que campos read_only mantêm seu comportamento
  4. Testar criação/edição de Journal através do proxy Editor

Próximos Passos

  • Avaliar quais campos comentados devem ser permanentemente removidos
  • Considerar criação de views customizadas para seções específicas
  • Implementar validações adicionais baseadas nas seções mapeadas
  • Avaliar necessidade de model proxy adicional para visualização pública

Checklist

  • Migration criada e testada
  • Documentação inline adicionada
  • Código segue padrões do projeto
  • Compatibilidade mantida com código existente

…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.
Copilot AI review requested due to automatic review settings February 8, 2026 01:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JournalProxyEditor tab 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 JournalProxyAdminOnly proxy 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.

Comment on lines +69 to +71
FieldPanel("journal_url"),

# InlinePanel("related_journal_urls", label=_("Journal Urls")),
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
FieldPanel("journal_url"),
# InlinePanel("related_journal_urls", label=_("Journal Urls")),
# FieldPanel("journal_url"),
InlinePanel("related_journal_urls", label=_("Journal Urls")),

Copilot uses AI. Check for mistakes.
Comment on lines +47 to 49

# POLÍTICA EDITORIAL - 14 - Patrocinadores e Agências de Fomento
InlinePanel("sponsor_history", label=_("Sponsor")),
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
# 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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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

Copilot uses AI. Check for mistakes.
Comment on lines +212 to +217

# INSTRUÇÕES AOS AUTORES - 0? -
# InlinePanel(
# "preparing_manuscript",
# label=_("Preparing Manuscript"),
# ),
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines 19 to +31
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"),
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@robertatakenaka robertatakenaka merged commit f3e5763 into scieloorg:main Feb 8, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant