Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Migrate off the OCA.Viewer global before Nextcloud 36

Abierto
#8,358 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
74/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
frontend

Línea de trabajo

Comienza en src/components/card/AttachmentList.vue en las líneas 251 y 262; después, sigue cómo se representan los datos adjuntos antes de abrir el visor. Usa la guía de migración de @nextcloud/viewer para trasladar las comprobaciones de visualización y la apertura, conservando onClose; estará terminado cuando los archivos adjuntos de las tarjetas se abran y los tipos MIME no compatibles sigan sin estar disponibles en Viewer 7 y Nextcloud 36.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
1.4k
Forks
358
Merge medio
1 d 22 h
PR fusionados (30 d)
101

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/deck

Todos los issues de nextcloud/deck

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.