History tool default URL points to a 404 path

Aperta Adatta ai principianti
#501 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
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
javascript
Ambito
backend, tooling

Direzione di ricerca

Inizia da classes/Tools/Tools.js:221 e ispeziona la registrazione predefinita dello strumento History, quindi esamina components/simple-transcription/index.js per capire come viene caricata l’URL. Il lavoro è completato quando la registrazione utilizza l’entry point pubblicato tpen-line-history.js, il pannello History viene caricato senza un 404 e la nota di migrazione per i documenti di progetto esistenti è stata gestita.

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

Descrizione

enhancement needs-triage

Summary

The default history tool registration in classes/Tools/Tools.js:221 points to https://app.t-pen.org/components/line-history/index.js, which returns 404 Not Found. There is no components/line-history/ directory in tpen3-interfaces. The component is actually published on GitHub Pages from the tpen-line-history repo.

As a result, every project created with the default tool set inherits a broken history tool URL. In the splitscreen interface (components/simple-transcription/index.js) the script branch tries to load the URL and fails with net::ERR_ABORTED 404, so the <tpen-line-history> element never gets defined and the pane stays blank.

Reproduction

  1. Open any project with the default tool set in the simple-transcription splitscreen.
  2. Activate the History tool.
  3. DevTools console shows: GET https://app.t-pen.org/components/line-history/index.js net::ERR_ABORTED 404 (Not Found).

Suggested fix

In classes/Tools/Tools.js, change line 221:

-            "url": "https://app.t-pen.org/components/line-history/index.js",
+            "url": "https://centerfordigitalhumanities.github.io/tpen-line-history/tpen-line-history.js",

(The filename is tpen-line-history.js, matching the repo's package.json#main — not index.js.)

Migration note for existing projects

Existing project documents in MongoDB carry the bad URL embedded in their tools array. After the source fix lands, a one-time update is needed:

db.projects.updateMany(
  { "tools.toolName": "history" },
  { $set: { "tools.$[t].url": "https://centerfordigitalhumanities.github.io/tpen-line-history/tpen-line-history.js" } },
  { arrayFilters: [ { "t.toolName": "history", "t.url": "https://app.t-pen.org/components/line-history/index.js" } ] }
)
Lingua principale
JavaScript
Stelle
2
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 CenterForDigitalHumanities/TPEN-services

Tutte le issue di CenterForDigitalHumanities/TPEN-services

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.