From 4e2121e9160b627415a31f628fa3f00711138375 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 2 Nov 2020 16:38:13 +0100 Subject: images can include images from galleries. command to duplicate annotations --- .../annotationForms/annotationForm.gallery.js | 38 +++------------------- .../annotationForms/annotationForm.image.js | 27 ++++++++++----- .../annotationForms/annotationForm.utility.js | 10 ++---- .../annotationForms/annotationForm.video.js | 10 ++---- 4 files changed, 27 insertions(+), 58 deletions(-) (limited to 'animism-align/frontend/app/views/align/components/annotations/annotationForms') diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js index c43d8d5..55bdd86 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js @@ -3,17 +3,11 @@ import React, { Component } from 'react' import { CURTAIN_COLOR_SELECT_OPTIONS } from 'app/constants' import { TextInput, Select, Checkbox, LabelDescription } from 'app/common' import { AnnotationFormFullscreen } from './annotationForm.utility' +import { makeMediaItems, makeGalleryItems } from 'app/utils/annotation.utils' export const AnnotationFormGallery = ({ annotation, media, handleSettingsSelect, handleSettingsChange }) => { if (!media.lookup) return
- const { lookup, order } = media - const image_list_items = order.filter(id => lookup[id].type === 'gallery').map(id => { - const image = lookup[id] - return { - name: image.id, - label: image.author + ' - ' + image.title - } - }) + const image_list_items = makeMediaItems(media, ['gallery']) return (
- {item && ( + {gallery_items && ( - + + {gallery_items && ( + { if (!media.lookup) return
- const { lookup, order } = media - const video_list_items = order.filter(id => lookup[id].type === 'video').map(id => { - const video = lookup[id] - return { - name: video.id, - label: video.author + ' - ' + video.title - } - }) + const video_list_items = makeMediaItems(media, ['video']) return (