Latest version not replacing url on resolve of image uploader
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 346
- Fork
- 94
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tinymce/tinymce-angular
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
tinymce/tinymce-angular#425 · 4 bình luận ·
-
Excessive nested span tags generated when repeatedly copy-pasting text with white background color Đang mởneeds: more info
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
tinymce/tinymce-angular#420 · 1 bình luận ·
-
needs: more info
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
tinymce/tinymce-angular#412 · 3 bình luận ·
-
disabling formgroup with tinymce in material tab gives 'node cannot be null or undefined' bug. Đang mởGitHub status: escalated
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tinymce/tinymce-angular#167 · 11 bình luận · 1 reaction ·
Tất cả issue của tinymce/tinymce-angular
Issue tương tự
-
Browser Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
getsentry/sentry-javascript#24577 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agilepathway/label-checker#640 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Đang mởagentic-workflows
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anomalyco/models.dev#7701 ·