diff --git a/jsapp/js/components/bigModal/bigModal.es6 b/jsapp/js/components/bigModal/bigModal.es6 index d0f3530d8b..b235f9f0f7 100644 --- a/jsapp/js/components/bigModal/bigModal.es6 +++ b/jsapp/js/components/bigModal/bigModal.es6 @@ -72,6 +72,8 @@ function getSubmissionTitle(props) { * * There are also two other important methods: `hideModal` and `switchModal`. * + * The modal rendering is being handled by `app.jsx`. + * * @prop {object} params - to be passed to the custom modal component */ class BigModal extends React.Component { diff --git a/jsapp/js/components/common/koboSelect.scss b/jsapp/js/components/common/koboSelect.scss index 1625f126db..6a42ec0352 100644 --- a/jsapp/js/components/common/koboSelect.scss +++ b/jsapp/js/components/common/koboSelect.scss @@ -90,10 +90,11 @@ $k-select-menu-padding: 6px; @include mixins.buttonReset; font-weight: 400; position: relative; + color: colors.$kobo-dark-blue; &:hover, &.k-select__option--selected { - color: colors.$kobo-gray-800; + color: colors.$kobo-dark-blue; background-color: colors.$kobo-gray-200; } @@ -114,7 +115,6 @@ $k-select-menu-padding: 6px; justify-content: space-between; width: 100%; height: $k-select-option-height; - color: colors.$kobo-gray-700; padding: 0 #{16px - 2px}; text-align: initial; } @@ -122,6 +122,7 @@ $k-select-menu-padding: 6px; .k-select__menu-message { font-style: italic; margin: 0; + color: colors.$kobo-gray-24; } .k-select__error { diff --git a/jsapp/js/components/formGallery/formGallery.component.scss b/jsapp/js/components/formGallery/formGallery.component.scss index 6b7920f80b..bc7dad9e95 100644 --- a/jsapp/js/components/formGallery/formGallery.component.scss +++ b/jsapp/js/components/formGallery/formGallery.component.scss @@ -1,5 +1,6 @@ @use 'scss/colors'; @use 'scss/breakpoints'; +@use 'scss/mixins'; .gallery { background-color: colors.$kobo-white; @@ -47,12 +48,21 @@ margin-right: 5px; } -.gallery-grid { +.gallery__grid { display: flex; flex-wrap: wrap; gap: 3px; } +.gallery-grid-deleted-attachment { + @include mixins.centerRowFlex; + justify-content: center; + min-width: 100px; + min-height: 100px; + border-radius: 6px; + background-color: colors.$kobo-gray-92; +} + @include breakpoints.breakpoint(mediumAndUp) { .gallery__wrapper { margin: 20px 50px; diff --git a/jsapp/js/components/formGallery/formGallery.component.tsx b/jsapp/js/components/formGallery/formGallery.component.tsx index 637f25542e..539dda3aea 100644 --- a/jsapp/js/components/formGallery/formGallery.component.tsx +++ b/jsapp/js/components/formGallery/formGallery.component.tsx @@ -16,6 +16,7 @@ import { selectImageAttachments, selectShowLoadMore, } from './formGallery.selectors'; +import DeletedAttachment from 'js/components/submissions/deletedAttachment.component'; bem.Gallery = makeBem(null, 'gallery'); bem.Gallery__wrapper = makeBem(bem.Gallery, 'wrapper'); @@ -159,20 +160,30 @@ export default function FormGallery(props: FormGalleryProps) { - {attachments.map((attachment) => ( - - {attachment.filename} - - ))} + {attachments.map((attachment) => { + if (attachment.is_deleted) { + return ( + + + + ); + } else { + return ( + + {attachment.filename} + + ) + } + })} {showLoadMore && ( diff --git a/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.module.scss b/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.module.scss index 868cc625ff..25b42ea86f 100644 --- a/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.module.scss +++ b/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.module.scss @@ -1,15 +1,19 @@ @use 'scss/colors'; .mediaWrapper { + border-radius: sizes.$x6; + background-color: colors.$kobo-white; + + &.mediaWrapperDeleted { + padding: 14px; + } + &.mediaWrapperAudio { - background-color: colors.$kobo-white; - border-radius: 6px; // right padding is for the audio player to appear centered padding: 20px #{20px + 12px} 14px 20px; } &.mediaWrapperVideo { - border-radius: 6px; overflow: hidden; } } diff --git a/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx b/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx index 781cc3fa9b..bb3232ee00 100644 --- a/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx +++ b/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx @@ -1,10 +1,12 @@ import React, {useState} from 'react'; +import cx from 'classnames'; import AudioPlayer from 'js/components/common/audioPlayer'; import singleProcessingStore from 'js/components/processing/singleProcessingStore'; import type {AssetContent} from 'js/dataInterface'; import {QUESTION_TYPES} from 'js/constants'; import {getAttachmentForProcessing} from 'js/components/processing/transcript/transcript.utils'; import styles from './sidebarSubmissionMedia.module.scss'; +import DeletedAttachment from 'js/components/submissions/deletedAttachment.component'; interface SidebarSubmissionMediaProps { assetContent: AssetContent | undefined; @@ -26,15 +28,23 @@ export default function SidebarSubmissionMedia( return null; } + if (attachment.is_deleted) { + return ( +
+ +
+ ); + } + switch (store.currentQuestionType) { case QUESTION_TYPES.audio.id: case QUESTION_TYPES['background-audio'].id: return (