Latest version not replacing url on resolve of image uploader
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
- 領域
- frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 346
- フォーク
- 94
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tinymce/tinymce-angular のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
tinymce/tinymce-angular#425 · コメント 4 件 ·
-
Excessive nested span tags generated when repeatedly copy-pasting text with white background color オープンneeds: more info
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
tinymce/tinymce-angular#420 · コメント 1 件 ·
-
needs: more info
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
tinymce/tinymce-angular#412 · コメント 3 件 ·
-
GitHub status: escalated
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tinymce/tinymce-angular#167 · コメント 11 件 · リアクション 1 件 ·
tinymce/tinymce-angular の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·