Auto-navigate to new organization after creation

Aperta Adatta ai principianti
#6,548 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
83/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Inizia in app/main/organizations.py, in corrispondenza di add_organization, e leggi il flusso di creazione esistente; poi esamina la modifica correlata alla fonte di raccolta dati in #6418. Aggiorna la copertura di integrazione in tests/integration/app/test_forms.py e il flusso di creazione ed eliminazione di Playwright. Il lavoro è completato quando, dopo una creazione riuscita, si apre la pagina della nuova organizzazione con la conferma e l’eventuale avviso di conflitto, mentre gli errori di salvataggio riportano al modulo con l’errore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Harvester

User Story

In order to verify a new organization and start adding harvest sources to it, a harvest admin wants to land on the new organization's page after creating it.

Acceptance Criteria

  • GIVEN I am logged in to the harvest admin
    WHEN I submit the Add Organization form successfully
    THEN I am taken to the new organization's page (/organization/<id>)
    AND the "Added new organization" message shows on that page
  • GIVEN the new organization has both a repository URL and an exemption flag
    WHEN I submit the form
    THEN the conflict warning also shows on the new organization's page
  • GIVEN the organization fails to save
    WHEN I submit the form
    THEN I stay on the add form with the error message

Background

  • Today a successful create redirects to the organization list (app/main/organizations.py, add_organization), so the user has to find the new org in the list.
  • Same change made for harvest sources in #6418 (harvester PR GSA/datagov-harvester#1050).

Security Considerations (required)

None. Redirect target is built from the new org's ID with url_for, not from user input.

Sketch

  • Change the success redirect in add_organization to url_for("main.view_organization", org_identifier=org.id)
  • Redirect failures back to the add form instead of the list
  • Update integration tests in tests/integration/app/test_forms.py and the Playwright create/destroy flow
Lingua principale
Python
Stelle
1.2k
Fork
207
Merge medio
3g 16h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GSA/data.gov

Tutte le issue di GSA/data.gov

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.