Latest version not replacing url on resolve of image uploader
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
Direzione di ricerca
Start with the image uploader callback shown in the issue and compare the earlier success/failure handler with the newer Promise-based handler. Verify how the resolved URL is consumed by the TinyMCE Angular integration, using the logged response URL and the hard-coded resolved URL as test cases. Done means the uploaded image URL is placed in the editor after the Promise resolves.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
the below function was working fine
function (blobInfo, success, failure) {
const xhr = new XMLHttpRequest();
xhr.open('POST', ${environment.SITE_BASE_URL}filemanager/filemanager/upload.php);
xhr.onload = function () {
if (xhr.status !== 200) {
failure('HTTP Error: ' + xhr.status);
return;
}
const json = JSON.parse(xhr.responseText);
if (!json?.files[0]?.url) {
failure('Invalid JSON: ' + xhr.responseText);
return;
}
success(json?.files[0]?.url);
};
xhr.onerror = function () {
failure('Image upload failed due to a XHR error');
};
const formData = new FormData();
formData.append('files[]', blobInfo.blob(), blobInfo.filename());
formData.append('fldr', '');
xhr.withCredentials = true;
xhr.send(formData);
}
In latest version I replace the above with below
(blobInfo, progress) => new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open('POST', ${environment.SITE_BASE_URL}filemanager/filemanager/upload.php);
xhr.onload = () => {
if (xhr.status !== 200) {
reject('HTTP Error: ' + xhr.status);
return;
}
const json = JSON.parse(xhr.responseText);
console.log(json);
if (!json?.files[0]?.url) {
reject('Invalid JSON: ' + xhr.responseText);
return;
}
console.log(json?.files[0]?.url);
resolve('https://apiss.kualiteestaging.com/files/mceclip1.png');
};
xhr.onerror = (error) => {
console.log(error);
reject('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
};
const formData = new FormData();
formData.append('fldr', '');
formData.append('files[]', blobInfo.blob(), blobInfo.filename());
xhr.send(formData);
})
but on resolving the url is not getting placed but it was happening with first version. Is I am doing something wrong or missing or its abug
- Lingua principale
- TypeScript
- Stelle
- 346
- Fork
- 94
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tinymce/tinymce-angular
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
tinymce/tinymce-angular#425 · 4 commenti ·
-
Excessive nested span tags generated when repeatedly copy-pasting text with white background color Apertaneeds: more info
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
tinymce/tinymce-angular#420 · 1 commento ·
-
needs: more info
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
tinymce/tinymce-angular#412 · 3 commenti ·
-
disabling formgroup with tinymce in material tab gives 'node cannot be null or undefined' bug. ApertaGitHub status: escalated
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
tinymce/tinymce-angular#167 · 11 commenti · 1 reazione ·
Tutte le issue di tinymce/tinymce-angular
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mksglu/context-mode#1200 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
AOSSIE-Org/DebateAI#582 · 2 commenti ·