Skip to content

feat: #INTEG-1924 Intégration de Nextcloud dans la bibliothèque multimédia - #577

Open
theovgl wants to merge 13 commits into
develop-integrationfrom
feat-INTEG-1924-port-react-nextcloud-filetree
Open

feat: #INTEG-1924 Intégration de Nextcloud dans la bibliothèque multimédia#577
theovgl wants to merge 13 commits into
develop-integrationfrom
feat-INTEG-1924-port-react-nextcloud-filetree

Conversation

@theovgl

@theovgl theovgl commented Aug 26, 2026

Copy link
Copy Markdown
Member

Description

Ajoute un onglet Nextcloud à la Media Library : arborescence de dossiers, recherche, tri, sélection multiple, aperçus/miniatures et copie vers le workspace, via une connexion OAuth2 par utilisateur.

INTEG-1924 - Nextcloud - Intégration - Bibliothèque Multimédia Édifce

Contexte

Dans le cadre de certains projets, les utilisateurs peuvent avoir des fichiers stockés sur un Nextcloud externe. Ces changements garantissent une intégration complète avec l'ENT en permettant aux utilisateurs de réutiliser leurs documents dans les modules react (éditeur, blog, etc.) sans passer par un import manuel.

Changements

  • @edifice.io/client : nouveau NextcloudService (list, copy vers workspace, statut OAuth2, URL de fichier/miniature) + interfaces NextcloudDocument/NextcloudDocumentResponse.
  • @edifice.io/react : hook useNextcloudSearch pour charger et mettre en cache l'arborescence Nextcloud par dossier.
    • Nouveau composant Nextcloud (arborescence via Tree, recherche, tri nom/date, sélection multiple, filtrage par rôle) et NextcloudFileCard (miniatures images).
    • Intégration dans MediaLibrary comme nouvel onglet interne (innertabs/Nextcloud.tsx), activé selon la config folder-service et le droit de workflow.
    • Flow OAuth2 : détection de connexion active, popup d'authentification.

Comment tester

  1. pnpm --filter @edifice.io/react test et pnpm --filter @edifice.io/client test
  2. pnpm docs puis ouvrir la story Nextcloud / MediaLibrary dans Storybook (appels Nextcloud mockés).
  3. Manuellement : ouvrir la Media Library, aller sur l'onglet Nextcloud, s'authentifier via la popup OAuth2, naviguer dans l'arborescence, rechercher et trier des fichiers, les miniatures d'images doivent s'afficher et valider la copie vers le workspace.

Which Package changed?

Please check the name of the package you changed

  • Components
  • Core
  • Icons
  • Hooks

Has the documentation changed?

  • Storybook

Type of change

Please check options that are relevant.

  • Chore (PATCH)
  • Doc (PATCH)
  • Bug fix (PATCH)
  • New feature (MINOR)
  • Breaking change (MAJOR)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Axios serializes the paths array as repeated `path[]=` query keys, but
the nextcloud backend only reads bare `path=` keys via
request.params().getAll("path"), so it rejected every call with a 400.
Build the query string manually instead.
…iles

The nextcloud backend has no dedicated thumbnail/preview endpoint, only
a generic file download route. Reuse the existing useThumbnail hook
(same pattern as the workspace FileCard) with that download URL as the
image source, for image files only, mirroring the legacy behaviour.
…a type

Nextcloud tab ignored the MediaLibrary type (image/video/audio),
always listing every file. Mirror the same role-based filtering
already used by the workspace tab.
@theovgl
theovgl requested a balanced review from Copilot August 26, 2026 13:14

This comment was marked as off-topic.

@theovgl
theovgl force-pushed the feat-INTEG-1924-port-react-nextcloud-filetree branch from 74a361b to 8aeccbf Compare August 26, 2026 14:55
@theovgl
theovgl force-pushed the feat-INTEG-1924-port-react-nextcloud-filetree branch from 8aeccbf to dd4db65 Compare August 26, 2026 15:44
@theovgl
theovgl marked this pull request as ready for review August 27, 2026 12:48
if (!a) return -1;
if (!b) return 1;
return a.localeCompare(b);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si c'est une proxy de comparaison pour gérer les undefined, il manque un cas :

function compare(a?: string, b?: string) {
  if (a === b) return 0;
  if (a === undefined) return -1;
  if (b === undefined) return 1;

  return a.localeCompare(b);
}

Y'a des triples égalités sur undefined, sinon tu matche aussi les "" et ''. Si c'est voulu tu peux remettre.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants