Migrate off the OCA.Viewer global before Nextcloud 36
Maintainer thường phản hồi trong vòng 1 ngày
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
- 74/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu trong src/components/card/AttachmentList.vue tại dòng 251 và 262, sau đó theo dõi cách dữ liệu tệp đính kèm được biểu diễn trước khi viewer được mở. Sử dụng hướng dẫn migration của @nextcloud/viewer để chuyển các bước kiểm tra khả năng hiển thị và việc mở, đồng thời giữ lại onClose; hoàn tất khi các tệp đính kèm của card có thể được mở và các loại MIME không được hỗ trợ vẫn không khả dụng trên Viewer 7 và Nextcloud 36.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Deck opens card attachments in the viewer:
src/components/card/AttachmentList.vue:251:window.OCA.Viewer.availableHandlers.map(h => h.mimes).flat().includes(mimetype)src/components/card/AttachmentList.vue:262:window.OCA.Viewer.open({ path, onClose })
Flattening availableHandlers[].mimes becomes canView(node). onClose is still there, as
part of the options object: getViewer().open(nodes, file, { onClose }).
OCA.Viewer is gone in Viewer 7.0.0. The viewer ships as the
@nextcloud/viewer library rather than a
bundled app, and nextcloud/server#63954 removes the viewer app from Nextcloud 36 altogether.
Roughly what it looks like:
import { canView, getViewer } from '@nextcloud/viewer'
// OCA.Viewer.open({ path }) / ({ fileInfo, list })
getViewer().open(nodes, file) // @nextcloud/files nodes
getViewer().openFolder(folder, file) // when a path is all you have, let it fetch
// OCA.Viewer.mimetypes.includes(mime) / availableHandlers
canView(node)
The part that is not a rename is that the viewer takes @nextcloud/files nodes now, not
fileinfo objects or path strings. Importing the package is also all it takes to get the viewer
onto the page: no LoadViewer event to dispatch, and nothing to check about whether the app is
enabled.
[!IMPORTANT]
There is no compatibility shim, which was a deliberate call, so this is a real port rather
than a rename. Nothing breaks until the server PR lands; after that these calls throw on
Nextcloud 36.
[!TIP]
The developer manual covers the migration under
Critical changes
(being added in nextcloud/documentation#15597), and the
README
has the full before/after table. Happy to help with the port, just ping me.
👾 This issue was written with the help of Claude Code.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.4k
- Fork
- 358
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 101
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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 nextcloud/deck
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CSV export leaves trailing commas in tags and assigned-user fieldsCó thể đã có người làm @Kumar-s75 đã nhận 42 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Board clone API failure is treated as a successful board responseCó thể đã có người làm @Kumar-s75 đã nhận 42 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nextcloud/deck#8334 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1. to develop bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nextcloud/deck#8146 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextcloud/deck
Issue tương tự
-
Correction: IMOU Cruiser 4MPĐang mởcorrection via-web
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ch-bas/cctv-camera-database#416 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug effort:medium model:light tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
piskyRpapalo/preceptoros-web#231 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type/bug type/docs type/enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Redo-San/RedoSan-Authenticity#574 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Place search spins forever when nominatim failsCó thể đã có người làm @jgt87 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
anvaka/city-roads#213 ·