From fab18400bbefc0d77ec38c9654abd061da539b7f Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 10 Aug 2023 12:23:15 -0700 Subject: [PATCH 01/27] implement orthographic camera --- src/assets/orthographic.svg | 3 + src/assets/perspective.svg | 17 +++ src/components/CameraControls/index.tsx | 154 +++++++++++++++++------- src/containers/ViewerPanel/index.tsx | 1 + 4 files changed, 129 insertions(+), 46 deletions(-) create mode 100644 src/assets/orthographic.svg create mode 100644 src/assets/perspective.svg diff --git a/src/assets/orthographic.svg b/src/assets/orthographic.svg new file mode 100644 index 000000000..558fca8e7 --- /dev/null +++ b/src/assets/orthographic.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/perspective.svg b/src/assets/perspective.svg new file mode 100644 index 000000000..b22953160 --- /dev/null +++ b/src/assets/perspective.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/components/CameraControls/index.tsx b/src/components/CameraControls/index.tsx index aed5086f5..5b16d5d39 100644 --- a/src/components/CameraControls/index.tsx +++ b/src/components/CameraControls/index.tsx @@ -10,12 +10,21 @@ import styles from "./style.css"; const PAN = "pan"; const ROTATE = "rotate"; +const ORTHOGRAPHIC = "o"; +const PERSPECTIVE = "p"; const CAMERA_MODE_MODIFIER_KEYS = ["Meta", "Shift"]; const ZOOM_IN_HK = "ArrowUp"; const ZOOM_OUT_HK = "ArrowDown"; const RESET_HK = "h"; const FOCUS_HK = "f"; -const HOT_KEYS = [ZOOM_IN_HK, ZOOM_OUT_HK, RESET_HK, FOCUS_HK]; +const HOT_KEYS = [ + ZOOM_IN_HK, + ZOOM_OUT_HK, + RESET_HK, + FOCUS_HK, + ORTHOGRAPHIC, + PERSPECTIVE, +]; interface CameraControlsProps { resetCamera: () => void; @@ -23,6 +32,7 @@ interface CameraControlsProps { zoomOut: () => void; setPanningMode: (value: boolean) => void; setFocusMode: (value: boolean) => void; + setCameraType: (value: boolean) => void; } const CameraControls = ({ @@ -31,9 +41,11 @@ const CameraControls = ({ zoomOut, setPanningMode, setFocusMode, + setCameraType, }: CameraControlsProps): JSX.Element => { const [isFocused, saveFocusMode] = useState(true); const [mode, setMode] = useState(ROTATE); + const [camera, setCamera] = useState(PERSPECTIVE); const [keyPressed, setKeyPressed] = useState(""); const lastKeyPressed = useRef(""); @@ -91,6 +103,10 @@ const CameraControls = ({ } }, [mode]); + useEffect(() => { + setCameraType(camera === ORTHOGRAPHIC); + }, [camera]); + useEffect(() => { if ( (isModifierKey(keyPressed) && !lastKeyPressed.current) || @@ -113,6 +129,12 @@ const CameraControls = ({ case FOCUS_HK: saveFocusMode(!isFocused); break; + case ORTHOGRAPHIC: + setCamera(ORTHOGRAPHIC); + break; + case PERSPECTIVE: + setCamera(PERSPECTIVE); + break; default: break; } @@ -120,6 +142,30 @@ const CameraControls = ({ }, [keyPressed]); return (
+
+ +
- -
+
+
+ - - - + onClick={() => { + setCamera(ORTHOGRAPHIC); + }} + icon={Icons.OrthographicCamera} + > + + + + +
- -
- -
+ + + + {/* home */}
); From b23d847486f97313b163895ca4fdd28014e9ea7a Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 10 Aug 2023 12:25:26 -0700 Subject: [PATCH 02/27] initial styling of camera controls --- src/components/CameraControls/style.css | 73 ++++++++++++++----------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/src/components/CameraControls/style.css b/src/components/CameraControls/style.css index 4ba5ecdb2..41cb1faab 100644 --- a/src/components/CameraControls/style.css +++ b/src/components/CameraControls/style.css @@ -5,72 +5,73 @@ bottom: 0; right: 20px; justify-content: space-evenly; + gap: 12px; margin-bottom: 20px; } +.container :global(.ant-btn) { + height: 26px; + width: 26px; + background-color: var(--viewer-btn-bg-default); +} + .radio-group { display: flex; flex-flow: column; + justify-content: space-evenly; } + .zoom-buttons { display: flex; flex-direction: column; justify-content: space-evenly; height: 60px; - margin-bottom: 4px; - -} - -.move-buttons { - display: flex; - height: 84px; - flex-flow: column; - justify-content: space-evenly; } .btn { - background-color: var(--dark-theme-btn-bg); - color: var(--dark-theme-btn-color); + background-color: var(--viewer-btn-bg-default); + color: var(--viewer-btn-color-default); border-radius: 3px!important; + height: 26px !important; + width: 26px !important; } .radio-btn { - border-color: var(--dark-theme-btn-bg)!important; - background-color: black!important; padding: 0 2px!important; - width: 24px; - height: 24px; + width: 26px; + height: 26px; font-size: 18px; line-height: 18px; border-left-width: 1px; + border: none; } -.radio-group .radio-btn:first-child { - border-radius: 3px 3px 0px 0px; +.radio-btn.active { + color: var(--viewer-btn-color-default) !important; + background-color: var(--viewer-btn-bg-default) !important; + border: 1px solid var(--viewer-btn-border-active) !important; } -.radio-group .radio-btn:last-child { - border-radius: 0px 0px 3px 3px; -} - -.radio-btn.active { - color: var(--dark-theme-btn-color) !important; - background-color: var(--dark-theme-btn-bg) !important; +.radio-btn:hover { + color: var(--viewer-btn-color-default); + background-color: var(--viewer-btn-bg-hover)!important; } .radio-group .radio-btn:not(:first-child) { border-top: 0px; } -.radio-btn:hover { - color: var(--dark-theme-btn-color); - background-color: var(--dark-theme-btn-hover-bg)!important; +.radio-group .radio-btn:first-child { + border-radius: 3px 3px 0px 0px; } -.btn:hover, -.btn:active { - color: var(--dark-theme-btn-color); - background-color: var(--dark-theme-btn-hover-bg); +.radio-group .radio-btn:last-child { + border-radius: 0px 0px 3px 3px; +} +.btn:hover { + color: var(--viewer-btn-color-default); + background-color: var(--viewer-btn-bg-hover); + border: 1px solid var(--viewer-btn-border-active) !important; } .btn:focus { @@ -79,11 +80,17 @@ } .btn[disabled] { - background-color: var(--dark-theme-btn-disabled-bg); - color: var(--dark-theme-btn-disabled-color); + background-color: var(--viewer-btn-bg-disabled); + color: var(--viewer-btn-color-disabled); } +.container .anticon svg { + height: 24px; + width: 24px; + color: var(--viewer-btn-color-default); +} + .rotate::after { content: "\e909"; } From f3cc830f8f9aa341b57a7da9459ab2cbab7d63ed Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 10 Aug 2023 12:25:50 -0700 Subject: [PATCH 03/27] ortho/perspective icons --- src/components/Icons/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Icons/index.tsx b/src/components/Icons/index.tsx index 03f8f94d0..7b3b7a367 100644 --- a/src/components/Icons/index.tsx +++ b/src/components/Icons/index.tsx @@ -18,6 +18,8 @@ import AicsLogoWhite from "../../assets/AICS-logo-full.png"; import ClockwiseArrow from "../../assets/step-forward.svg"; import CounterClockwiseArrow from "../../assets/step-back.svg"; import Beta from "../../assets/beta.svg"; +import Orthographic from "../../assets/orthographic.svg"; +import Perspective from "../../assets/perspective.svg"; export const Loading = ; export const Play = ; @@ -37,6 +39,8 @@ export const AicsLogo = ; export const StepForward = ; export const StepBack = ; export const BetaTag = ; +export const OrthographicCamera = ; +export const PerspectiveCamera = ; export default { StepBack, @@ -57,4 +61,6 @@ export default { BetaTag, Download, LoopOutlined, + OrthographicCamera, + PerspectiveCamera, }; From 4506ce9a66fd55978cbdc27d4bf08dbacce98fcb Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 10 Aug 2023 12:26:56 -0700 Subject: [PATCH 04/27] define viewer button color variables --- src/styles/colors.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/styles/colors.css b/src/styles/colors.css index 6b2d4ccb2..1b6b76ec0 100644 --- a/src/styles/colors.css +++ b/src/styles/colors.css @@ -13,10 +13,12 @@ --white-six: #e7e7e7; --transparent-white: rgba(255, 255, 255, 0.65); --dim-gray: #383838; + --dim-gray-two: #6E6E6E; + --purplish-gray: #4A4658; --pale-grey: #ddd9ec; --heather: #bab5c9; --text-gray: #a0a0a0; - --greyish-brown: #4a4a4a; + --grayish-brown: #4a4a4a; --warm-gray: #979797; --charcoal-grey: #3b3649; --dark-blue-grey: #2d224d; @@ -70,5 +72,12 @@ --light-theme-modal-supplemental-text: var(--charcoal-grey); --light-theme-modal-btn-default-color: var(--dark-four); --light-theme-btn-default-disabled-bg: var(--heather); + --viewer-btn-bg-default: var(--dark-three); + --viewer-btn-bg-hover: var(--purplish-gray); + --viewer-btn-bg-disabled: var(--dark-three); + --viewer-btn-border-active: var( --white-three); + --viewer-btn-border-on: var(--dim-gray-two); + --viewer-btn-color-default: var(--white-three); + --viewer-btn-color-disabled: var(--grayish-brown); } From 8756d054f27ed2c5e14af0d2f0f9410e81a9dd53 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Mon, 14 Aug 2023 13:00:59 -0700 Subject: [PATCH 05/27] focus:hover state on home button --- src/components/CameraControls/index.tsx | 5 ----- src/components/CameraControls/style.css | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/CameraControls/index.tsx b/src/components/CameraControls/index.tsx index 5b16d5d39..4228dc7a6 100644 --- a/src/components/CameraControls/index.tsx +++ b/src/components/CameraControls/index.tsx @@ -258,7 +258,6 @@ const CameraControls = ({ - {/* focus */} - - {/* home */} Date: Mon, 14 Aug 2023 13:01:55 -0700 Subject: [PATCH 06/27] playback control styling --- src/components/PlaybackControls/index.tsx | 22 +++--- src/components/PlaybackControls/style.css | 86 +++++++++++++++-------- 2 files changed, 64 insertions(+), 44 deletions(-) diff --git a/src/components/PlaybackControls/index.tsx b/src/components/PlaybackControls/index.tsx index 7643a7e59..5100eafc4 100644 --- a/src/components/PlaybackControls/index.tsx +++ b/src/components/PlaybackControls/index.tsx @@ -129,7 +129,6 @@ const PlayBackControls = ({ btnClassNames, { [styles.customStepButton]: !loading }, ])} - size="small" onClick={prevHandler} disabled={isStepBackDisabled || loading || isEmpty} loading={loading} @@ -152,8 +151,10 @@ const PlayBackControls = ({ color={TOOLTIP_COLOR} > @@ -243,11 +247,14 @@ const CameraControls = ({ > From 67f2f582cffb3537bd1d47ad37caf0866f1137bf Mon Sep 17 00:00:00 2001 From: Megan Riel-Mehan Date: Thu, 5 Oct 2023 13:28:50 -0700 Subject: [PATCH 12/27] audit fix (#437) --- package-lock.json | 242 ++++++++++++++++++++++++---------------------- 1 file changed, 126 insertions(+), 116 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88b208ac9..5cf084145 100644 --- a/package-lock.json +++ b/package-lock.json @@ -105,9 +105,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.2.0.tgz", - "integrity": "sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", + "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", "dev": true }, "node_modules/@aics/simularium-viewer": { @@ -4182,9 +4182,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4308,9 +4308,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4349,9 +4349,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -5183,9 +5183,9 @@ } }, "node_modules/auto-changelog/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6769,9 +6769,9 @@ } }, "node_modules/css-loader/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -8835,9 +8835,9 @@ } }, "node_modules/eslint/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -9022,9 +9022,9 @@ } }, "node_modules/execa/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -9847,9 +9847,9 @@ } }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -14026,9 +14026,9 @@ "dev": true }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -15159,9 +15159,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -16074,10 +16074,16 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -16320,9 +16326,9 @@ } }, "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -17277,9 +17283,9 @@ } }, "node_modules/postcss": { - "version": "8.4.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", - "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -17289,10 +17295,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -17666,9 +17676,9 @@ } }, "node_modules/postcss-loader/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -20491,9 +20501,9 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -22324,9 +22334,9 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "dependencies": { "psl": "^1.1.33", @@ -22424,9 +22434,9 @@ } }, "node_modules/ts-jest/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -24143,9 +24153,9 @@ "dev": true }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "engines": { "node": ">=0.10.0" } @@ -24348,9 +24358,9 @@ }, "dependencies": { "@adobe/css-tools": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.2.0.tgz", - "integrity": "sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", + "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", "dev": true }, "@aics/simularium-viewer": { @@ -27398,9 +27408,9 @@ }, "dependencies": { "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -27464,9 +27474,9 @@ }, "dependencies": { "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -27491,9 +27501,9 @@ }, "dependencies": { "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -28160,9 +28170,9 @@ "dev": true }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -29407,9 +29417,9 @@ }, "dependencies": { "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -30860,9 +30870,9 @@ "dev": true }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -31098,9 +31108,9 @@ "dev": true }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true }, "shebang-command": { @@ -31755,9 +31765,9 @@ "dev": true }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -34898,9 +34908,9 @@ "dev": true }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -35758,9 +35768,9 @@ }, "dependencies": { "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -36359,9 +36369,9 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" }, "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true }, "nanomatch": { @@ -36571,9 +36581,9 @@ }, "dependencies": { "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -37310,12 +37320,12 @@ "dev": true }, "postcss": { - "version": "8.4.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", - "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "requires": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } @@ -37507,9 +37517,9 @@ }, "dependencies": { "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -39643,9 +39653,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, "semver-compare": { @@ -41146,9 +41156,9 @@ "dev": true }, "tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "requires": { "psl": "^1.1.33", @@ -41205,9 +41215,9 @@ }, "dependencies": { "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -42474,9 +42484,9 @@ "dev": true }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" }, "wordwrap": { "version": "1.0.0", From 72f1a233d73b64eabc86b30426cace6c727bee2c Mon Sep 17 00:00:00 2001 From: Megan Riel-Mehan Date: Mon, 9 Oct 2023 12:57:08 -0700 Subject: [PATCH 13/27] change check for if a file is shareable (#439) * change check for if a file is shareable * use constant for trajFileName * use selector instead of type guard * add unit test * remove accidental auto import --- .../DownloadTrajectoryMenu/index.tsx | 13 +++++---- .../ShareTrajectoryButton/index.tsx | 11 +++----- src/components/ShareTrajectoryModal/index.tsx | 22 +++++++-------- src/components/ViewerTitle/index.tsx | 6 ++++- src/containers/AppHeader/index.tsx | 5 ++++ src/state/trajectory/types.ts | 1 + src/util/test/index.test.ts | 24 ++++++++++++++++- src/util/userUrlHandling.ts | 27 ++++++++++++------- 8 files changed, 73 insertions(+), 36 deletions(-) diff --git a/src/components/DownloadTrajectoryMenu/index.tsx b/src/components/DownloadTrajectoryMenu/index.tsx index 9908711a2..1ff696a02 100644 --- a/src/components/DownloadTrajectoryMenu/index.tsx +++ b/src/components/DownloadTrajectoryMenu/index.tsx @@ -3,23 +3,21 @@ import { Button, Tooltip } from "antd"; import { ISimulariumFile } from "@aics/simularium-viewer/type-declarations"; import { DATA_BUCKET_URL, TOOLTIP_COLOR } from "../../constants"; -import { - NetworkedSimFile, - LocalSimFile, - isNetworkSimFileInterface, -} from "../../state/trajectory/types"; +import { NetworkedSimFile, LocalSimFile } from "../../state/trajectory/types"; import { Download } from "../Icons"; import styles from "./style.css"; interface DownloadTrajectoryMenuProps { isBuffering: boolean; + isNetworkedFile: boolean; simulariumFile: LocalSimFile | NetworkedSimFile; } const DownloadTrajectoryMenu = ({ isBuffering, simulariumFile, + isNetworkedFile, }: DownloadTrajectoryMenuProps): JSX.Element => { const fileIsLoaded = () => !!simulariumFile.name; @@ -27,10 +25,11 @@ const DownloadTrajectoryMenu = ({ if (!fileIsLoaded()) { return ""; } - if (isNetworkSimFileInterface(simulariumFile)) { + if (isNetworkedFile) { return `${DATA_BUCKET_URL}/trajectory/${simulariumFile.name}`; } else { - const data: ISimulariumFile = simulariumFile.data; + const localFile = simulariumFile as LocalSimFile; // isNetworkedFile checks for this + const data: ISimulariumFile = localFile.data; const blob = data.getAsBlob(); return URL.createObjectURL(blob); } diff --git a/src/components/ShareTrajectoryButton/index.tsx b/src/components/ShareTrajectoryButton/index.tsx index e26038f18..021675efa 100644 --- a/src/components/ShareTrajectoryButton/index.tsx +++ b/src/components/ShareTrajectoryButton/index.tsx @@ -2,15 +2,12 @@ import React from "react"; import { Button, Tooltip } from "antd"; import { TOOLTIP_COLOR } from "../../constants"; -import { - NetworkedSimFile, - LocalSimFile, - isLocalFileInterface, -} from "../../state/trajectory/types"; +import { NetworkedSimFile, LocalSimFile } from "../../state/trajectory/types"; import { Share } from "../Icons"; import ShareTrajectoryModal from "../ShareTrajectoryModal"; import styles from "./style.css"; +import { isOnlineTrajectory } from "../../util/userUrlHandling"; interface ShareTrajectoryButtonProps { simulariumFile: LocalSimFile | NetworkedSimFile; @@ -21,7 +18,7 @@ const ShareTrajectoryButton = ({ }: ShareTrajectoryButtonProps): JSX.Element => { const [isSharing, setIsSharing] = React.useState(false); - const isLocalFile = isLocalFileInterface(simulariumFile); + const trajectoryIsSharable = isOnlineTrajectory(location.href); const handleShare = () => { setIsSharing(!isSharing); @@ -42,7 +39,7 @@ const ShareTrajectoryButton = ({ {isSharing ? (
diff --git a/src/components/ShareTrajectoryModal/index.tsx b/src/components/ShareTrajectoryModal/index.tsx index da38ad2ea..e10c64d12 100644 --- a/src/components/ShareTrajectoryModal/index.tsx +++ b/src/components/ShareTrajectoryModal/index.tsx @@ -17,14 +17,14 @@ import styles from "./style.css"; import theme from "../theme/light-theme.css"; interface ShareTrajectoryModalProps { - isLocalFile: boolean; + trajectoryIsSharable: boolean; closeModal: () => void; timeUnits: TimeUnits; displayTimes: DisplayTimes; } const ShareTrajectoryModal = ({ - isLocalFile, + trajectoryIsSharable, closeModal, timeUnits, displayTimes, @@ -102,7 +102,7 @@ const ShareTrajectoryModal = ({ }; const modalOptions = { - localFile: { + errorMessage: { content: ( <>

{Warn} The current file is stored on your device.

@@ -134,7 +134,7 @@ const ShareTrajectoryModal = ({ ), }, - networkedFile: { + isSharable: { content: ( <>
@@ -177,20 +177,20 @@ const ShareTrajectoryModal = ({ - {isLocalFile - ? modalOptions.localFile.content - : modalOptions.networkedFile.content} + {trajectoryIsSharable + ? modalOptions.isSharable.content + : modalOptions.errorMessage.content} ); diff --git a/src/components/ViewerTitle/index.tsx b/src/components/ViewerTitle/index.tsx index 9df3e7dfa..e2f370f62 100644 --- a/src/components/ViewerTitle/index.tsx +++ b/src/components/ViewerTitle/index.tsx @@ -7,6 +7,7 @@ import { VIEWER_PATHNAME } from "../../routes"; import TRAJECTORIES from "../../constants/networked-trajectories"; import styles from "./style.css"; +import { URL_PARAM_KEY_FILE_NAME } from "../../constants"; interface ViewerTitleProps { simulariumFileName: string; @@ -27,7 +28,10 @@ const ViewerTitle: React.FunctionComponent = ( // networked-trajectories.ts to get its version info // TODO: Eventually we should put all the contents of networked-trajectories.ts in the // Simularium files themselves - const trajectoryId = location.search.replace("?trajFileName=", ""); + const trajectoryId = location.search.replace( + `?${URL_PARAM_KEY_FILE_NAME}=`, + "" + ); const currentTrajectory = TRAJECTORIES.find( (trajectory) => trajectory.id === trajectoryId ); diff --git a/src/containers/AppHeader/index.tsx b/src/containers/AppHeader/index.tsx index 85f7a220f..57aef1852 100644 --- a/src/containers/AppHeader/index.tsx +++ b/src/containers/AppHeader/index.tsx @@ -31,6 +31,7 @@ import DownloadTrajectoryMenu from "../../components/DownloadTrajectoryMenu"; interface AppHeaderProps { simulariumFile: LocalSimFile | NetworkedSimFile; isBuffering: boolean; + isNetworkedFile: boolean; clearSimulariumFile: ActionCreator; changeToLocalSimulariumFile: ActionCreator; changeToNetworkedFile: ActionCreator; @@ -48,6 +49,7 @@ class AppHeader extends React.Component { setViewerStatus, clearSimulariumFile, setError, + isNetworkedFile, } = this.props; let lastModified = 0; let displayName = ""; @@ -89,6 +91,7 @@ class AppHeader extends React.Component {
@@ -101,6 +104,8 @@ function mapStateToProps(state: State) { simulariumFile: trajectoryStateBranch.selectors.getSimulariumFile(state), isBuffering: viewerStateBranch.selectors.getIsBuffering(state), + isNetworkedFile: + trajectoryStateBranch.selectors.getIsNetworkedFile(state), }; } diff --git a/src/state/trajectory/types.ts b/src/state/trajectory/types.ts index d05b58504..f0238d050 100644 --- a/src/state/trajectory/types.ts +++ b/src/state/trajectory/types.ts @@ -60,6 +60,7 @@ export interface NetworkedSimFile { } export const isLocalFileInterface = (file: any): file is LocalSimFile => !!file.lastModified; + export const isNetworkSimFileInterface = ( file: any ): file is NetworkedSimFile => !!file.title; diff --git a/src/util/test/index.test.ts b/src/util/test/index.test.ts index 0352c4910..cdb7040b2 100644 --- a/src/util/test/index.test.ts +++ b/src/util/test/index.test.ts @@ -1,6 +1,10 @@ import * as React from "react"; -import { USER_TRAJ_REDIRECTS } from "../../constants"; +import { + URL_PARAM_KEY_FILE_NAME, + URL_PARAM_KEY_USER_URL, + USER_TRAJ_REDIRECTS, +} from "../../constants"; import { bindAll, convertToSentenceCase, @@ -16,6 +20,7 @@ import { getRedirectUrl, getUserTrajectoryUrl, isGoogleDriveUrl, + isOnlineTrajectory, urlCheck, } from "../userUrlHandling"; @@ -373,4 +378,21 @@ describe("User Url handling", () => { expect(result).toEqual("dl.dropboxusercontent.com/path"); }); }); + describe("isOnlineTrajectory", () => { + it("it returns true if the trajectory is hosted online", () => { + const cloudTrajectoryUrl = `simularium?${URL_PARAM_KEY_USER_URL}=url`; + const result = isOnlineTrajectory(cloudTrajectoryUrl); + expect(result).toBeTruthy; + }); + it("true if the trajectory is one of our networked models", () => { + const networkedUrl = `simularium?${URL_PARAM_KEY_FILE_NAME}=url`; + const result = isOnlineTrajectory(networkedUrl); + expect(result).toBeTruthy; + }); + it("it returns false if no relevant url params are present", () => { + const url = `simularium?other_url_param=value`; + const result = isOnlineTrajectory(url); + expect(result).toBeFalsy; + }); + }); }); diff --git a/src/util/userUrlHandling.ts b/src/util/userUrlHandling.ts index ea827b83f..26a85e8f6 100644 --- a/src/util/userUrlHandling.ts +++ b/src/util/userUrlHandling.ts @@ -1,8 +1,13 @@ import { isString } from "lodash"; -import { USER_TRAJ_REDIRECTS } from "../constants"; +import { + URL_PARAM_KEY_FILE_NAME, + URL_PARAM_KEY_USER_URL, + USER_TRAJ_REDIRECTS, +} from "../constants"; -const googleDriveUrlRegEx = /(?:drive.google\.com\/file\/d\/)(.*)(?=\/)|(?:drive.google\.com\/file\/d\/)(.*)/g; +const googleDriveUrlRegEx = + /(?:drive.google\.com\/file\/d\/)(.*)(?=\/)|(?:drive.google\.com\/file\/d\/)(.*)/g; const googleDriveUrlExcludingIdRegEx = /(drive.google\.com\/file\/d\/)(?=.*)/g; export const urlCheck = (urlToCheck: any): string => { @@ -14,7 +19,8 @@ export const urlCheck = (urlToCheck: any): string => { * I had to modify the original to allow s3 buckets which have multiple `.letters-letters.` in them * and I made the http(s) required */ - const regEx = /(https?:\/\/)([\w\-]){0,200}(\.[a-zA-Z][^\-])([\/\w]*)*\/?\??([^\n\r]*)?([^\n\r]*)/g; + const regEx = + /(https?:\/\/)([\w\-]){0,200}(\.[a-zA-Z][^\-])([\/\w]*)*\/?\??([^\n\r]*)?([^\n\r]*)/g; if (regEx.test(urlToCheck)) { return urlToCheck; } @@ -68,18 +74,14 @@ export const getFileIdFromUrl = ( export const getRedirectUrl = (url: string, fileName: string | undefined) => { if (url && fileName && USER_TRAJ_REDIRECTS.includes(url)) { // ex) simularium.allencell.org/viewer?trajFileName=endocytosis.simularium - return `${location.origin}${ - location.pathname - }?trajFileName=${fileName}`; + return `${location.origin}${location.pathname}?${URL_PARAM_KEY_FILE_NAME}=${fileName}`; } else { return ""; } }; export const getGoogleApiUrl = (id: string) => { - return `https://www.googleapis.com/drive/v2/files/${id}?alt=media&key=${ - process.env.GOOGLE_API_KEY - }`; + return `https://www.googleapis.com/drive/v2/files/${id}?alt=media&key=${process.env.GOOGLE_API_KEY}`; }; export const getUserTrajectoryUrl = (url: string, fileId?: string) => { @@ -89,3 +91,10 @@ export const getUserTrajectoryUrl = (url: string, fileId?: string) => { return url.replace("dropbox.com", "dl.dropboxusercontent.com"); } }; + +export const isOnlineTrajectory = (url: string) => { + return ( + url.includes(URL_PARAM_KEY_USER_URL) || + url.includes(URL_PARAM_KEY_FILE_NAME) + ); +}; From 60326cfa9649737d21bae5388626c5fd1bfa0d65 Mon Sep 17 00:00:00 2001 From: Lyndsay <93954795+lynwilhelm@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:57:20 -0700 Subject: [PATCH 14/27] Update ux_issue.md (#433) --- .github/ISSUE_TEMPLATE/ux_issue.md | 41 ++++++++++-------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/ux_issue.md b/.github/ISSUE_TEMPLATE/ux_issue.md index 1b085a6d6..7364f6e19 100644 --- a/.github/ISSUE_TEMPLATE/ux_issue.md +++ b/.github/ISSUE_TEMPLATE/ux_issue.md @@ -1,40 +1,27 @@ --- -name: Usability Issue/Improvement -about: '"UX work to be done"' +name: UX Issue +about: 'UX work to be done' title: '' labels: ux assignees: '' --- -### Background -_Context, goals, known challenges, technical risks, unknowns, etc_ +### Description +- _Type of UX work needed (research, discovery and/or design_ +- _Problem(s) to solve_ -### User needs statement(s) -As a _[type of user]_, I need/want to _[action(s)]_, so that I can _[goal]_. +*** +_Below to be filled out by UX during kickoff Q&A to the best of current understanding_ ### Size -_Expected level of user research, discovery and design effort (xs, sm, m, lg, xl)_ - -### Requirements -_Examples:_ -- _UI for ability to add, edit, and save_ -- _Error messaging for error states_ -- _Solution for responsive design on small screen sizes_ -- _Align new feature to exising style_ - -### Deliverables -_Examples:_ -- _High-fi designs + dev specifications_ -- _Interactive prototype (for testing)_ -- _User testing and analysis of findings before implementation_ +_Effort level (xs, sm, m, lg, xl)_ -### Stakeholder(s) -_Who is directly involved? (developers, main points of contact, final approver)_ +### Scope +_What will we do? What will we NOT do?_ -### Timeline -_Add completion date to ticket and any time specific notes here_ - -### Notes -_Additional notes here_ +### User needs statement(s) +As a _[type of user]_, I need/want to _[action(s)]_, so that I can _[goal]_. +### Additional notes +_Knowns/unknowns, stakeholders, time/dependency considerations, deliverables_ From 3e9d57898ff065c37ea5bc2dcacf9deda19442af Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Tue, 23 May 2023 10:56:42 -0700 Subject: [PATCH 15/27] menu item and modal --- src/components/HelpMenu/index.tsx | 18 +++++++++ src/components/VersionModal/index.tsx | 57 +++++++++++++++++++++++++++ src/components/VersionModal/style.css | 12 ++++++ 3 files changed, 87 insertions(+) create mode 100644 src/components/VersionModal/index.tsx create mode 100644 src/components/VersionModal/style.css diff --git a/src/components/HelpMenu/index.tsx b/src/components/HelpMenu/index.tsx index 32b559c1b..e90027590 100644 --- a/src/components/HelpMenu/index.tsx +++ b/src/components/HelpMenu/index.tsx @@ -13,6 +13,8 @@ import { import styles from "./style.css"; +import VersionModal from "../VersionModal"; + const HelpMenu = (): JSX.Element => { const location = useLocation(); const tutorialLink = @@ -27,8 +29,15 @@ const HelpMenu = (): JSX.Element => { ) : ( Quick start ); + + const [modalVisible, setModalVisible] = React.useState(false); + const menu = ( + {/* */} + {modalVisible ? ( + + ) : null} {tutorialLink} @@ -65,6 +74,15 @@ const HelpMenu = (): JSX.Element => { + { + console.log("firing"); + setModalVisible(!modalVisible); + }} + > + <>Version Info + ); diff --git a/src/components/VersionModal/index.tsx b/src/components/VersionModal/index.tsx new file mode 100644 index 000000000..57514aeb9 --- /dev/null +++ b/src/components/VersionModal/index.tsx @@ -0,0 +1,57 @@ +import { Button } from "antd"; +import React from "react"; + +import CustomModal from "../CustomModal"; + +import styles from "./style.css"; + +interface VersionModalProps { + setModalVisible: (isModalVisible: boolean) => void; +} + +const VersionModal: React.FC = ({ setModalVisible }) => { + const closeModal = () => { + setModalVisible(false); + }; + + const footerButton = ( + <> + + + ); + console.log("VersionModal"); + return ( + +
+ {" "} + Application:{" "} + + {" "} + simularium-website v{SIMULARIUM_WEBSITE_VERSION}{" "} + +
+
+ {" "} + Viewer:{" "} + + {" "} + simulairum-viewer v{SIMULARIUM_VIEWER_VERSION}{" "} + +
+ {/* TODO what should this content be */} + Engine: not connected to server +
+ ); +}; + +export default VersionModal; diff --git a/src/components/VersionModal/style.css b/src/components/VersionModal/style.css new file mode 100644 index 000000000..00499ca7a --- /dev/null +++ b/src/components/VersionModal/style.css @@ -0,0 +1,12 @@ + +.blue-text { + color: var(--blue); +} + +.container :global(.ant-modal-footer) { + background-color: var(--modal-content-bg); +} + +.container :global(.ant-modal-body) { + padding: 12px 12px 0px 12px; +} \ No newline at end of file From dcff5c8b8fd4842b72e53e100c76e1b79d23c178 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 1 Jun 2023 11:27:55 -0700 Subject: [PATCH 16/27] removing logs --- src/components/HelpMenu/index.tsx | 1 - src/components/VersionModal/index.tsx | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/HelpMenu/index.tsx b/src/components/HelpMenu/index.tsx index e90027590..7951e87dc 100644 --- a/src/components/HelpMenu/index.tsx +++ b/src/components/HelpMenu/index.tsx @@ -77,7 +77,6 @@ const HelpMenu = (): JSX.Element => { { - console.log("firing"); setModalVisible(!modalVisible); }} > diff --git a/src/components/VersionModal/index.tsx b/src/components/VersionModal/index.tsx index 57514aeb9..05a7a614b 100644 --- a/src/components/VersionModal/index.tsx +++ b/src/components/VersionModal/index.tsx @@ -21,7 +21,6 @@ const VersionModal: React.FC = ({ setModalVisible }) => { ); - console.log("VersionModal"); return ( = ({ setModalVisible }) => { simulairum-viewer v{SIMULARIUM_VIEWER_VERSION}{" "} - {/* TODO what should this content be */} - Engine: not connected to server + {/* TODO add enginge when we switch to Octopus?/} + {/* Engine: not connected to server */} ); }; From 72c2e8d2ab548ee36829775a608e0dda5d3116f4 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Mon, 9 Oct 2023 14:10:35 -0700 Subject: [PATCH 17/27] remove unneeded jsx fragment wrappers --- src/components/VersionModal/index.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/VersionModal/index.tsx b/src/components/VersionModal/index.tsx index 05a7a614b..062ad115d 100644 --- a/src/components/VersionModal/index.tsx +++ b/src/components/VersionModal/index.tsx @@ -15,12 +15,11 @@ const VersionModal: React.FC = ({ setModalVisible }) => { }; const footerButton = ( - <> - - + ); + return ( Date: Mon, 9 Oct 2023 14:14:01 -0700 Subject: [PATCH 18/27] remove commented code --- src/components/HelpMenu/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/HelpMenu/index.tsx b/src/components/HelpMenu/index.tsx index 7951e87dc..524c734c9 100644 --- a/src/components/HelpMenu/index.tsx +++ b/src/components/HelpMenu/index.tsx @@ -34,7 +34,6 @@ const HelpMenu = (): JSX.Element => { const menu = ( - {/* */} {modalVisible ? ( ) : null} From 8dcccc1a3688e7528923670aa8f0611ae7283376 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Mon, 9 Oct 2023 14:34:28 -0700 Subject: [PATCH 19/27] styling update --- src/components/HelpMenu/index.tsx | 2 +- src/components/VersionModal/index.tsx | 2 +- src/components/VersionModal/style.css | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/HelpMenu/index.tsx b/src/components/HelpMenu/index.tsx index 524c734c9..a576d3531 100644 --- a/src/components/HelpMenu/index.tsx +++ b/src/components/HelpMenu/index.tsx @@ -79,7 +79,7 @@ const HelpMenu = (): JSX.Element => { setModalVisible(!modalVisible); }} > - <>Version Info + <>Version info ); diff --git a/src/components/VersionModal/index.tsx b/src/components/VersionModal/index.tsx index 062ad115d..1fb55901a 100644 --- a/src/components/VersionModal/index.tsx +++ b/src/components/VersionModal/index.tsx @@ -27,7 +27,7 @@ const VersionModal: React.FC = ({ setModalVisible }) => { open footer={footerButton} centered - title="Version Info" + title="Version Information" width={425} >
diff --git a/src/components/VersionModal/style.css b/src/components/VersionModal/style.css index 00499ca7a..90d9306a1 100644 --- a/src/components/VersionModal/style.css +++ b/src/components/VersionModal/style.css @@ -1,12 +1,18 @@ - -.blue-text { +.container .blue-text { color: var(--blue); } -.container :global(.ant-modal-footer) { - background-color: var(--modal-content-bg); +.container :global(.ant-modal-header) { + padding: 12px 24px; +} +.container :global(.ant-modal-title) { + font-weight: 400; } .container :global(.ant-modal-body) { padding: 12px 12px 0px 12px; +} + +.container :global(.ant-modal-footer) { + background-color: var(--modal-content-bg); } \ No newline at end of file From 141b0370f42b3ee2b4345d56fe2e4db9e6fff2ab Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Mon, 9 Oct 2023 14:34:44 -0700 Subject: [PATCH 20/27] remove comments --- src/components/VersionModal/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/VersionModal/index.tsx b/src/components/VersionModal/index.tsx index 1fb55901a..04da902a2 100644 --- a/src/components/VersionModal/index.tsx +++ b/src/components/VersionModal/index.tsx @@ -46,8 +46,6 @@ const VersionModal: React.FC = ({ setModalVisible }) => { simulairum-viewer v{SIMULARIUM_VIEWER_VERSION}{" "}
- {/* TODO add enginge when we switch to Octopus?/} - {/* Engine: not connected to server */}
); }; From 23be0d4f7ed526a3853889940727a9dd21cbbc19 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Mon, 9 Oct 2023 15:27:12 -0700 Subject: [PATCH 21/27] typo --- src/components/VersionModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VersionModal/index.tsx b/src/components/VersionModal/index.tsx index 04da902a2..61f847822 100644 --- a/src/components/VersionModal/index.tsx +++ b/src/components/VersionModal/index.tsx @@ -43,7 +43,7 @@ const VersionModal: React.FC = ({ setModalVisible }) => { Viewer:{" "} {" "} - simulairum-viewer v{SIMULARIUM_VIEWER_VERSION}{" "} + simularium-viewer v{SIMULARIUM_VIEWER_VERSION}{" "} From caac57be991dc3dfaf79ff426e13ba6854c6ab03 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Tue, 10 Oct 2023 12:51:42 -0700 Subject: [PATCH 22/27] prevent bg color change after click --- src/components/HelpMenu/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/HelpMenu/style.css b/src/components/HelpMenu/style.css index 3b9cd371d..260de5fa0 100644 --- a/src/components/HelpMenu/style.css +++ b/src/components/HelpMenu/style.css @@ -13,4 +13,8 @@ width: fit-content; right: 160px !important; left: auto !important; +} + +.menu :global(.ant-dropdown-menu-item-active){ + background-color: transparent !important; } \ No newline at end of file From 836510a92366a61ef1dbc455f17838f92a638322 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Wed, 11 Oct 2023 11:47:54 -0700 Subject: [PATCH 23/27] Update src/components/HelpMenu/index.tsx Co-authored-by: Megan Riel-Mehan --- src/components/HelpMenu/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/HelpMenu/index.tsx b/src/components/HelpMenu/index.tsx index a576d3531..1eee77cb7 100644 --- a/src/components/HelpMenu/index.tsx +++ b/src/components/HelpMenu/index.tsx @@ -34,9 +34,9 @@ const HelpMenu = (): JSX.Element => { const menu = ( - {modalVisible ? ( + {modalVisible && ( - ) : null} + )} {tutorialLink} From ca5ac248433cc26a66fa09a546332cae8d80c2b5 Mon Sep 17 00:00:00 2001 From: Megan Riel-Mehan Date: Mon, 16 Oct 2023 10:41:45 -0700 Subject: [PATCH 24/27] fix menus offsets (#440) * fix menus offsets * move version info --- src/components/HelpMenu/index.tsx | 124 +++++++++++++++----------- src/components/HelpMenu/style.css | 2 - src/components/LoadFileMenu/style.css | 2 - 3 files changed, 71 insertions(+), 57 deletions(-) diff --git a/src/components/HelpMenu/index.tsx b/src/components/HelpMenu/index.tsx index 1eee77cb7..10ca28dac 100644 --- a/src/components/HelpMenu/index.tsx +++ b/src/components/HelpMenu/index.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { useLocation, Link } from "react-router-dom"; -import { Menu, Dropdown, Button } from "antd"; +import { Dropdown, Button, MenuProps } from "antd"; import { TUTORIAL_PATHNAME } from "../../routes"; import { DownArrow } from "../Icons"; @@ -16,6 +16,8 @@ import styles from "./style.css"; import VersionModal from "../VersionModal"; const HelpMenu = (): JSX.Element => { + const [modalVisible, setModalVisible] = React.useState(false); + const location = useLocation(); const tutorialLink = location.pathname === "/viewer" ? ( @@ -30,66 +32,82 @@ const HelpMenu = (): JSX.Element => { Quick start ); - const [modalVisible, setModalVisible] = React.useState(false); - - const menu = ( - - {modalVisible && ( - - )} - {tutorialLink} - + const items: MenuProps["items"] = [ + { + key: "tutorial", + label: tutorialLink, + }, + { + key: "forum", + label: ( Forum - - + ), + }, + { + key: "github", + label: ( GitHub - - - - - via GitHub (preferred) - - - - - via Forum (for non-GitHub users) - - - - { - setModalVisible(!modalVisible); - }} - > - <>Version info - - - ); + ), + }, + { + key: "submit-issue", + label: "Submit issue", + popupClassName: styles.submenu, + popupOffset: [-0.45, -4], + children: [ + { + key: "via-github", + label: ( + + via GitHub (preferred) + + ), + }, + { + key: "via-forum", + label: ( + + via Forum (for non-GitHub users) + + ), + }, + ], + }, + { + key: "version", + label: ( + { + setModalVisible(!modalVisible); + }} + > + Version info + + ), + }, + ]; return ( - - - + <> + + + + {modalVisible && } + ); }; diff --git a/src/components/HelpMenu/style.css b/src/components/HelpMenu/style.css index 260de5fa0..3e4bb0605 100644 --- a/src/components/HelpMenu/style.css +++ b/src/components/HelpMenu/style.css @@ -11,8 +11,6 @@ box-shadow: 0 1px 3px black; padding: 0; width: fit-content; - right: 160px !important; - left: auto !important; } .menu :global(.ant-dropdown-menu-item-active){ diff --git a/src/components/LoadFileMenu/style.css b/src/components/LoadFileMenu/style.css index 7ba5c1b34..25a7889df 100644 --- a/src/components/LoadFileMenu/style.css +++ b/src/components/LoadFileMenu/style.css @@ -28,6 +28,4 @@ box-shadow: 0 1px 3px black; padding: 0; width: fit-content; - right: 300px !important; - left: auto !important; } \ No newline at end of file From 4baff29420c6a06647a08b5c57e64ad88ad09a86 Mon Sep 17 00:00:00 2001 From: Blair Lyons Date: Thu, 19 Oct 2023 14:49:46 -0700 Subject: [PATCH 25/27] update viewer to 3.6.3 --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5cf084145..37b727768 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.9.0", "license": "ISC", "dependencies": { - "@aics/simularium-viewer": "^3.6.2", + "@aics/simularium-viewer": "^3.6.3", "@ant-design/css-animation": "^1.7.3", "@ant-design/icons": "^4.0.6", "antd": "^4.23.6", @@ -111,9 +111,9 @@ "dev": true }, "node_modules/@aics/simularium-viewer": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@aics/simularium-viewer/-/simularium-viewer-3.6.2.tgz", - "integrity": "sha512-QTuxtExeqFYhAmfr4VFqpu9QKVqd0Vg1znaDFUyV4qGEr9W1hDlA2evxK3c3PXnNn/wNCWEE1SnrWRjSzjesIA==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@aics/simularium-viewer/-/simularium-viewer-3.6.3.tgz", + "integrity": "sha512-8g/DQqEip5MatFJE65jx+hQuKuesrKkpGu112ioEwPDn5TaqxbkGu2w1mhLNIquXUP7B72+UoEozAzcUmSFncA==", "dependencies": { "@fortawesome/fontawesome-free": "^5.15.2", "@fortawesome/fontawesome-svg-core": "~1.2.34", @@ -24364,9 +24364,9 @@ "dev": true }, "@aics/simularium-viewer": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@aics/simularium-viewer/-/simularium-viewer-3.6.2.tgz", - "integrity": "sha512-QTuxtExeqFYhAmfr4VFqpu9QKVqd0Vg1znaDFUyV4qGEr9W1hDlA2evxK3c3PXnNn/wNCWEE1SnrWRjSzjesIA==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@aics/simularium-viewer/-/simularium-viewer-3.6.3.tgz", + "integrity": "sha512-8g/DQqEip5MatFJE65jx+hQuKuesrKkpGu112ioEwPDn5TaqxbkGu2w1mhLNIquXUP7B72+UoEozAzcUmSFncA==", "requires": { "@fortawesome/fontawesome-free": "^5.15.2", "@fortawesome/fontawesome-svg-core": "~1.2.34", From f13dcb01b32c16f2d0f5853c7f890ab566a06244 Mon Sep 17 00:00:00 2001 From: Megan Riel-Mehan Date: Fri, 20 Oct 2023 12:46:48 -0700 Subject: [PATCH 26/27] update viewer and fix types (#445) --- package.json | 2 +- src/containers/ViewerPanel/selectors.test.ts | 1 + src/containers/ViewerPanel/selectors.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f71e7e5a1..e835dcc80 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "webpack-dev-server": "^4.10.1" }, "dependencies": { - "@aics/simularium-viewer": "^3.6.2", + "@aics/simularium-viewer": "^3.6.3", "@ant-design/css-animation": "^1.7.3", "@ant-design/icons": "^4.0.6", "antd": "^4.23.6", diff --git a/src/containers/ViewerPanel/selectors.test.ts b/src/containers/ViewerPanel/selectors.test.ts index 6cf1ebd3e..22bf2e731 100644 --- a/src/containers/ViewerPanel/selectors.test.ts +++ b/src/containers/ViewerPanel/selectors.test.ts @@ -26,6 +26,7 @@ describe("ViewerPanel selectors", () => { expect(result).toEqual({ hiddenAgents: [], highlightedAgents: [], + colorChanges: [], }); }); }); diff --git a/src/containers/ViewerPanel/selectors.ts b/src/containers/ViewerPanel/selectors.ts index 4e03a040c..325c611ae 100644 --- a/src/containers/ViewerPanel/selectors.ts +++ b/src/containers/ViewerPanel/selectors.ts @@ -20,6 +20,7 @@ export const getSelectionStateInfoForViewer = createSelector( (highlightedAgents, hiddenAgents) => ({ highlightedAgents, hiddenAgents, + colorChanges: [], }) ); From c6eaea3d3c81c88c240ee1e8c1e4825d8fe5545e Mon Sep 17 00:00:00 2001 From: Blair Lyons Date: Mon, 23 Oct 2023 11:06:47 -0700 Subject: [PATCH 27/27] 0.10.0 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2231630b..3675d5cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,35 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.10.0](https://github.com/simularium/simularium-website/compare/v0.9.0...v0.10.0) + +- update viewer and fix types [`#445`](https://github.com/simularium/simularium-website/pull/445) +- fix menus offsets [`#440`](https://github.com/simularium/simularium-website/pull/440) +- Feature/version info [`#423`](https://github.com/simularium/simularium-website/pull/423) +- Update ux_issue.md [`#433`](https://github.com/simularium/simularium-website/pull/433) +- change check for if a file is shareable [`#439`](https://github.com/simularium/simularium-website/pull/439) +- audit fix [`#437`](https://github.com/simularium/simularium-website/pull/437) +- Feature/orthographic UI [`#430`](https://github.com/simularium/simularium-website/pull/430) +- Feature/share time url [`#424`](https://github.com/simularium/simularium-website/pull/424) +- change gh-deploy to be a dev build [`#426`](https://github.com/simularium/simularium-website/pull/426) +- Update CONTRIBUTING.md [`#425`](https://github.com/simularium/simularium-website/pull/425) +- Feature/download trajectory [`#422`](https://github.com/simularium/simularium-website/pull/422) +- looping playback and tooltip styling [`#417`](https://github.com/simularium/simularium-website/pull/417) +- Bump json5 from 1.0.1 to 1.0.2 [`#404`](https://github.com/simularium/simularium-website/pull/404) +- Bump webpack from 5.75.0 to 5.76.0 [`#401`](https://github.com/simularium/simularium-website/pull/401) +- Bump d3-color and plotly.js [`#399`](https://github.com/simularium/simularium-website/pull/399) +- Bump loader-utils and typescript-plugin-css-modules [`#398`](https://github.com/simularium/simularium-website/pull/398) +- Bump decode-uri-component from 0.2.0 to 0.2.2 [`#382`](https://github.com/simularium/simularium-website/pull/382) +- Update ux_issue.md [`#393`](https://github.com/simularium/simularium-website/pull/393) +- File upload modal rework and styling [`#392`](https://github.com/simularium/simularium-website/pull/392) +- ui components for share time in url [`9e50b00`](https://github.com/simularium/simularium-website/commit/9e50b00371b6d0edd98f266ac83c233154551932) +- remove now-unused `LocalFileUpload` component [`2a1c111`](https://github.com/simularium/simularium-website/commit/2a1c11130033c4a9f48d3f2ae17ce14544529dd6) +- shift style rules, add light theme, remove buffer [`225ebfd`](https://github.com/simularium/simularium-website/commit/225ebfd1395622c5b5a27e7b721c787c3f08ecc3) + #### [v0.9.0](https://github.com/simularium/simularium-website/compare/v0.8.2...v0.9.0) +> 19 February 2023 + - add a default collapsed [`#397`](https://github.com/simularium/simularium-website/pull/397) - Url Upload Auto Focus [`#373`](https://github.com/simularium/simularium-website/pull/373) - Clean up [`3c66ae3`](https://github.com/simularium/simularium-website/commit/3c66ae3aade3a50abba7a524b24978e6154bf268) diff --git a/package-lock.json b/package-lock.json index 37b727768..6d2eeff7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simularium-webapp", - "version": "0.9.0", + "version": "0.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "simularium-webapp", - "version": "0.9.0", + "version": "0.10.0", "license": "ISC", "dependencies": { "@aics/simularium-viewer": "^3.6.3", diff --git a/package.json b/package.json index e835dcc80..42aa438e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simularium-webapp", - "version": "0.9.0", + "version": "0.10.0", "description": "", "main": "src/index.tsx", "repository": {