Suppression photo(s) « mes fichiers » : proposer de conserver dans « mes albums »#356
Merged
Merged
Conversation
…albums à la suppression (#246)
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Closes #246
Mediaavait une relationOneToOneversFileaveconDelete: CASCADE: supprimer un fichier depuis « mes fichiers » supprimait silencieusement leMediaassocié et toutes ses appartenances aux albums (AlbumMedia), sans aucun avertissement.Media::$filedevient nullable (onDelete: SET NULL), avec une nouvelle colonneMedia::$ownerpour ne plus dépendre deFile::$ownercomme source d'autorité (ownership indépendant du File).MediaDetachService: supprime uniquement le fichier source (disque + entité), en conservant leMediaet sesAlbumMediaintacts.MediaDeletionServicemis à jour : le CASCADE DB historique n'existe plus, il supprime donc explicitementFileetMedia.FileWebController::delete(route web/files/{id}/delete, utilisée par « mes fichiers ») propose désormais un choix via une nouvelle modale (DeleteFileModal, jamais deconfirm()natif) : suppression totale, ou conserver dans les albums si le fichier a unMediarattaché à au moins un album.GET /api/v1/medias, thumbnail, vue plein écran, partage public, renommage) pour tolérer unMediadétaché sans régression.Périmètre limité à la route web pour ce ticket — l'API publique (
DELETE /api/v1/files/{id}) garde son comportement actuel de suppression totale (voir #354 pour l'alignement futur). Le renommage est masqué pour un média détaché (voir #355 pour les évolutions possibles).Test plan
./vendor/bin/phpunit— 922 tests, 0 échec (hors 1 échec Tailwind préexistant sans rapport)npm test— 129 tests Jest, 0 échec