From 48affc5809c47fa98e88a346d7c22a65e20c657c Mon Sep 17 00:00:00 2001 From: Mason Ballengee Date: Mon, 13 Nov 2023 15:39:23 -0500 Subject: [PATCH] Do not display transcript and file tabs when none are present --- app/javascript/components/Ramp.jsx | 28 ++++++++------ app/models/media_object.rb | 4 ++ .../speedy_af/proxy/media_object.rb | 10 +++-- app/views/media_objects/_item_view.html.erb | 37 ++++++++++++++++++- 4 files changed, 63 insertions(+), 16 deletions(-) diff --git a/app/javascript/components/Ramp.jsx b/app/javascript/components/Ramp.jsx index 263d8fc4b7..c95249f5e6 100644 --- a/app/javascript/components/Ramp.jsx +++ b/app/javascript/components/Ramp.jsx @@ -31,8 +31,8 @@ import './Ramp.scss'; const ExpandCollapseArrow = () => { return ( - ); @@ -48,7 +48,9 @@ const Ramp = ({ timeline, playlist, in_progress, - cdl + cdl, + has_files, + has_transcripts }) => { const [manifestUrl, setManifestUrl] = React.useState(''); const [isClosed, setIsClosed] = React.useState(false); @@ -64,7 +66,7 @@ const Ramp = ({ if(has_structure) { interval = setInterval(addPlayerEventListeners, 500); } - + // Clear interval upon component unmounting return () => clearInterval(interval); }, []); @@ -180,12 +182,12 @@ const Ramp = ({ } - { has_structure && + { has_structure && -