From 49bf95f864130e3d6083b709d0f60d6fc8e11a1b Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 20 Oct 2021 16:52:00 -0700 Subject: [PATCH 01/18] preview orange overlay --- frontend/src/components/PluginDetails/MetadataList.tsx | 9 ++++++++- frontend/src/fixtures/napari.json | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index ee5a706c1..2ba973749 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -55,7 +55,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { {isEmpty && (
  • @@ -68,13 +68,17 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { let node: ReactNode; let key: string; + let isValueEmpty = false; + if (typeof value === 'string') { key = value; node = value; + isValueEmpty = !value; } else { // If metadata value is link, render icon and anchor tag. key = `${value.text}-${value.href}`; const hasLink = !!value.href; + isValueEmpty = !hasLink; const linkNode = hasLink && ( <> @@ -137,6 +141,9 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { // Render as comma list if inline // https://markheath.net/post/css-comma-separated-list inline && ['inline', styles.commaList], + + // Preview orange overlay if isValueEmpty is true + isValueEmpty && 'bg-napari-preview-orange-overlay', )} key={key} > diff --git a/frontend/src/fixtures/napari.json b/frontend/src/fixtures/napari.json index 67f35dfa9..165fb19f0 100644 --- a/frontend/src/fixtures/napari.json +++ b/frontend/src/fixtures/napari.json @@ -6,11 +6,11 @@ "description_content_type": "text/markdown", "authors": [ { - "name": "Draga Doncila", + "name": "", "email": "ddoncila@gmail.com" } ], - "license": "MIT", + "license": "", "python_version": ">=3.6", "operating_system": ["Operating System :: OS Independent"], "release_date": "2021-03-03T20:41:59.257726Z", @@ -24,7 +24,7 @@ "dask[complete]" ], "project_site": "https://pypi.org/project/napari-compressed-labels-io", - "documentation": "https://github.com/DragaDoncila/napari-compressed-labels-io", + "documentation": "", "support": "https://github.com/DragaDoncila/napari-compressed-labels-io/issues", "report_issues": "https://github.com/DragaDoncila/napari-compressed-labels-io/issues", "twitter": "https://twitter.com/DragaDoncila", From 58a1a03395da72c94c90efdcdcccfcbaa97aa598 Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 20 Oct 2021 17:15:17 -0700 Subject: [PATCH 02/18] updated snapshot test --- .../__snapshots__/PluginDetails.test.tsx.snap | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap index be8d84f52..d744cb8b6 100644 --- a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap +++ b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap @@ -104,9 +104,9 @@ exports[` should match snapshot 1`] = ` class="list-none block" >
  • - MIT + information not submitted
  • @@ -403,9 +403,9 @@ exports[` should match snapshot 1`] = ` class="list-none block" >
  • - Draga Doncila + information not submitted
  • @@ -463,12 +463,13 @@ exports[` should match snapshot 1`] = `
  • should match snapshot 1`] = ` stroke="black" /> - Documentation - +
  • should match snapshot 1`] = ` class="list-none inline" >
  • - Draga Doncila + information not submitted
  • @@ -751,12 +750,13 @@ exports[` should match snapshot 1`] = `
  • should match snapshot 1`] = ` stroke="black" /> - Documentation - +
  • - MIT + information not submitted
  • From bfdadff11dfa32d1a59bb6dd07da68690d157ef7 Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 20 Oct 2021 17:54:13 -0700 Subject: [PATCH 03/18] added warning icon for missing components --- frontend/src/components/PluginDetails/MetadataList.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index 2ba973749..e0a4fd30b 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -8,6 +8,7 @@ import { usePlausible } from '@/hooks'; import styles from './MetadataList.module.scss'; import { MetadataItem, MetadataValueTypes } from './PluginDetails.types'; +import { MetadataStatus } from '../AppBar/MetadataStatus'; interface CommonProps { /** @@ -60,6 +61,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { )} > information not submitted + )} @@ -148,6 +150,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { key={key} > {node} + {isValueEmpty && } ); })} From c137f3944a5ffc0c133b70da5e5dcebf2c3e98ac Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 20 Oct 2021 17:59:02 -0700 Subject: [PATCH 04/18] Fixed import statements and snapshot tests --- .../components/PluginDetails/MetadataList.tsx | 2 +- .../__snapshots__/PluginDetails.test.tsx.snap | 132 ++++++++++++++++++ 2 files changed, 133 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index e0a4fd30b..d7cc288c2 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -6,9 +6,9 @@ import { Link } from '@/components/common'; import { usePluginState } from '@/context/plugin'; import { usePlausible } from '@/hooks'; +import { MetadataStatus } from '../AppBar/MetadataStatus'; import styles from './MetadataList.module.scss'; import { MetadataItem, MetadataValueTypes } from './PluginDetails.types'; -import { MetadataStatus } from '../AppBar/MetadataStatus'; interface CommonProps { /** diff --git a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap index d744cb8b6..c6e44509e 100644 --- a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap +++ b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap @@ -107,6 +107,28 @@ exports[` should match snapshot 1`] = ` class="text-napari-gray font-normal bg-napari-preview-orange-overlay block leading-8" > information not submitted +
    + + + + +
    @@ -406,6 +428,28 @@ exports[` should match snapshot 1`] = ` class="text-napari-gray font-normal bg-napari-preview-orange-overlay block leading-8" > information not submitted +
    + + + + +
    @@ -497,6 +541,28 @@ exports[` should match snapshot 1`] = ` Documentation +
    + + + + +
  • should match snapshot 1`] = ` class="text-napari-gray font-normal bg-napari-preview-orange-overlay inline" > information not submitted +
    + + + + +
  • @@ -784,6 +872,28 @@ exports[` should match snapshot 1`] = ` Documentation +
    + + + + +
  • information not submitted +
    + + + + +
  • From 4f7f12232602321665906367776f10e78da5ee2a Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 20 Oct 2021 18:35:26 -0700 Subject: [PATCH 05/18] Fixed e2e test --- frontend/src/fixtures/napari.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/fixtures/napari.json b/frontend/src/fixtures/napari.json index 165fb19f0..803800d39 100644 --- a/frontend/src/fixtures/napari.json +++ b/frontend/src/fixtures/napari.json @@ -10,7 +10,7 @@ "email": "ddoncila@gmail.com" } ], - "license": "", + "license": "MIT", "python_version": ">=3.6", "operating_system": ["Operating System :: OS Independent"], "release_date": "2021-03-03T20:41:59.257726Z", From 296d105a770e4efa14751790ef41c21b24c86788 Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 20 Oct 2021 18:46:59 -0700 Subject: [PATCH 06/18] updated snapshot test --- .../__snapshots__/PluginDetails.test.tsx.snap | 52 ++----------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap index c6e44509e..9922e9389 100644 --- a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap +++ b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap @@ -104,31 +104,9 @@ exports[` should match snapshot 1`] = ` class="list-none block" >
  • - information not submitted -
    - - - - -
    + MIT
  • @@ -1579,31 +1557,9 @@ the coverage at least stays the same before you submit a pull request. class="list-none inline" >
  • - information not submitted -
    - - - - -
    + MIT
  • From 291f83938d567fdbd939ec73f2582d1086a3883d Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Thu, 21 Oct 2021 10:55:27 -0700 Subject: [PATCH 07/18] revert code changes for napari.json --- frontend/src/fixtures/napari.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/fixtures/napari.json b/frontend/src/fixtures/napari.json index 803800d39..67f35dfa9 100644 --- a/frontend/src/fixtures/napari.json +++ b/frontend/src/fixtures/napari.json @@ -6,7 +6,7 @@ "description_content_type": "text/markdown", "authors": [ { - "name": "", + "name": "Draga Doncila", "email": "ddoncila@gmail.com" } ], @@ -24,7 +24,7 @@ "dask[complete]" ], "project_site": "https://pypi.org/project/napari-compressed-labels-io", - "documentation": "", + "documentation": "https://github.com/DragaDoncila/napari-compressed-labels-io", "support": "https://github.com/DragaDoncila/napari-compressed-labels-io/issues", "report_issues": "https://github.com/DragaDoncila/napari-compressed-labels-io/issues", "twitter": "https://twitter.com/DragaDoncila", From d442f6939284106f0dbdce78db21d33f2fd5d0ee Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Thu, 21 Oct 2021 11:00:13 -0700 Subject: [PATCH 08/18] updated test snapshot --- .../__snapshots__/PluginDetails.test.tsx.snap | 126 +++--------------- 1 file changed, 20 insertions(+), 106 deletions(-) diff --git a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap index 9922e9389..be8d84f52 100644 --- a/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap +++ b/frontend/src/components/PluginDetails/__snapshots__/PluginDetails.test.tsx.snap @@ -403,31 +403,9 @@ exports[` should match snapshot 1`] = ` class="list-none block" >
  • - information not submitted -
    - - - - -
    + Draga Doncila
  • @@ -485,13 +463,12 @@ exports[` should match snapshot 1`] = `
  • should match snapshot 1`] = ` stroke="black" /> - Documentation - + -
    - - - - -
  • should match snapshot 1`] = ` class="list-none inline" >
  • - information not submitted -
    - - - - -
    + Draga Doncila
  • @@ -816,13 +751,12 @@ exports[` should match snapshot 1`] = `
  • should match snapshot 1`] = ` stroke="black" /> - Documentation - + -
    - - - - -
  • Date: Fri, 22 Oct 2021 14:29:43 -0700 Subject: [PATCH 09/18] Preview page metadata highlighting positioning and alignment --- frontend/src/components/AppBar/MetadataStatus.tsx | 2 +- frontend/src/components/PluginDetails/MetadataList.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/AppBar/MetadataStatus.tsx b/frontend/src/components/AppBar/MetadataStatus.tsx index 2bf299eca..b891e244c 100644 --- a/frontend/src/components/AppBar/MetadataStatus.tsx +++ b/frontend/src/components/AppBar/MetadataStatus.tsx @@ -16,7 +16,7 @@ export function MetadataStatus({ className={clsx( 'flex items-center justify-center', hasValue ? 'bg-napari-primary' : 'bg-napari-preview-orange', - variant === 'small' && 'w-2 h-2', + variant === 'small' ? 'w-2 h-2' : 'w-[0.9375rem] h-[0.9375rem]', )} > {hasValue ? : } diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index d7cc288c2..273cebde2 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -47,6 +47,9 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { // Font 'font-bold whitespace-nowrap', + + // Preview orange overlay + isEmpty && 'bg-napari-preview-orange-overlay', )} > {title}: @@ -56,7 +59,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { {isEmpty && (
  • From 6f884e407313e9f5f6be6e82dc0ad5b0fc9e58fd Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Fri, 22 Oct 2021 15:36:00 -0700 Subject: [PATCH 10/18] Refactored MetatdataStatus Component --- frontend/src/components/{AppBar => }/MetadataStatus.tsx | 0 frontend/src/components/PluginDetails/MetadataList.tsx | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename frontend/src/components/{AppBar => }/MetadataStatus.tsx (100%) diff --git a/frontend/src/components/AppBar/MetadataStatus.tsx b/frontend/src/components/MetadataStatus.tsx similarity index 100% rename from frontend/src/components/AppBar/MetadataStatus.tsx rename to frontend/src/components/MetadataStatus.tsx diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index 273cebde2..cd1972039 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -3,10 +3,10 @@ import clsx from 'clsx'; import { ReactNode } from 'react-markdown'; import { Link } from '@/components/common'; +import { MetadataStatus } from '@/components/MetadataStatus'; import { usePluginState } from '@/context/plugin'; import { usePlausible } from '@/hooks'; -import { MetadataStatus } from '../AppBar/MetadataStatus'; import styles from './MetadataList.module.scss'; import { MetadataItem, MetadataValueTypes } from './PluginDetails.types'; From 8816ca4b52deff51eafc8214f2773b267fd9e2b4 Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Fri, 22 Oct 2021 15:43:12 -0700 Subject: [PATCH 11/18] Refactored MetatdataStatus Component --- frontend/src/components/AppBar/AppBarPreview.tsx | 2 +- frontend/src/components/AppBar/PreviewMetadataPanel.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/AppBar/AppBarPreview.tsx b/frontend/src/components/AppBar/AppBarPreview.tsx index 3515bbc62..895363e1f 100644 --- a/frontend/src/components/AppBar/AppBarPreview.tsx +++ b/frontend/src/components/AppBar/AppBarPreview.tsx @@ -12,7 +12,7 @@ import { Media } from '@/components/common/media'; import styles from './AppBarPreview.module.scss'; import { useMetadataSections } from './metadataPreview.hooks'; -import { MetadataStatus } from './MetadataStatus'; +import { MetadataStatus } from '@/components/MetadataStatus'; import { PreviewMetadataPanel } from './PreviewMetadataPanel'; const HUB_WIKI_LINK = diff --git a/frontend/src/components/AppBar/PreviewMetadataPanel.tsx b/frontend/src/components/AppBar/PreviewMetadataPanel.tsx index 2752d6d17..6eed46749 100644 --- a/frontend/src/components/AppBar/PreviewMetadataPanel.tsx +++ b/frontend/src/components/AppBar/PreviewMetadataPanel.tsx @@ -1,12 +1,12 @@ import clsx from 'clsx'; import { Media } from '@/components/common/media'; +import { MetadataStatus } from '@/components/MetadataStatus'; import { MetadataSectionField, useMetadataSections, } from './metadataPreview.hooks'; -import { MetadataStatus } from './MetadataStatus'; /** * Creates a new array of metadata fields that have the missing metadata ordered From e1ad2ab79b109e4691719d4cd3270a12e66c2688 Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Fri, 22 Oct 2021 15:49:43 -0700 Subject: [PATCH 12/18] Revert "Preview page metadata highlighting positioning and alignment" This reverts commit 21ae70c44d21014287472bf2eab74c2e900b9946. --- frontend/src/components/MetadataStatus.tsx | 2 +- frontend/src/components/PluginDetails/MetadataList.tsx | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/MetadataStatus.tsx b/frontend/src/components/MetadataStatus.tsx index b891e244c..2bf299eca 100644 --- a/frontend/src/components/MetadataStatus.tsx +++ b/frontend/src/components/MetadataStatus.tsx @@ -16,7 +16,7 @@ export function MetadataStatus({ className={clsx( 'flex items-center justify-center', hasValue ? 'bg-napari-primary' : 'bg-napari-preview-orange', - variant === 'small' ? 'w-2 h-2' : 'w-[0.9375rem] h-[0.9375rem]', + variant === 'small' && 'w-2 h-2', )} > {hasValue ? : } diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index cd1972039..88fc137ff 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -47,9 +47,6 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { // Font 'font-bold whitespace-nowrap', - - // Preview orange overlay - isEmpty && 'bg-napari-preview-orange-overlay', )} > {title}: @@ -59,7 +56,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { {isEmpty && (
  • From 1f09c0e1235fb265a2a010291dc3a36bcf21c6bd Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Fri, 22 Oct 2021 15:52:37 -0700 Subject: [PATCH 13/18] Revert "Refactored MetatdataStatus Component" This reverts commit 6f884e407313e9f5f6be6e82dc0ad5b0fc9e58fd. --- frontend/src/components/AppBar/AppBarPreview.tsx | 2 +- frontend/src/components/{ => AppBar}/MetadataStatus.tsx | 2 +- frontend/src/components/AppBar/PreviewMetadataPanel.tsx | 2 +- frontend/src/components/PluginDetails/MetadataList.tsx | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) rename frontend/src/components/{ => AppBar}/MetadataStatus.tsx (87%) diff --git a/frontend/src/components/AppBar/AppBarPreview.tsx b/frontend/src/components/AppBar/AppBarPreview.tsx index 895363e1f..3515bbc62 100644 --- a/frontend/src/components/AppBar/AppBarPreview.tsx +++ b/frontend/src/components/AppBar/AppBarPreview.tsx @@ -12,7 +12,7 @@ import { Media } from '@/components/common/media'; import styles from './AppBarPreview.module.scss'; import { useMetadataSections } from './metadataPreview.hooks'; -import { MetadataStatus } from '@/components/MetadataStatus'; +import { MetadataStatus } from './MetadataStatus'; import { PreviewMetadataPanel } from './PreviewMetadataPanel'; const HUB_WIKI_LINK = diff --git a/frontend/src/components/MetadataStatus.tsx b/frontend/src/components/AppBar/MetadataStatus.tsx similarity index 87% rename from frontend/src/components/MetadataStatus.tsx rename to frontend/src/components/AppBar/MetadataStatus.tsx index 2bf299eca..b891e244c 100644 --- a/frontend/src/components/MetadataStatus.tsx +++ b/frontend/src/components/AppBar/MetadataStatus.tsx @@ -16,7 +16,7 @@ export function MetadataStatus({ className={clsx( 'flex items-center justify-center', hasValue ? 'bg-napari-primary' : 'bg-napari-preview-orange', - variant === 'small' && 'w-2 h-2', + variant === 'small' ? 'w-2 h-2' : 'w-[0.9375rem] h-[0.9375rem]', )} > {hasValue ? : } diff --git a/frontend/src/components/AppBar/PreviewMetadataPanel.tsx b/frontend/src/components/AppBar/PreviewMetadataPanel.tsx index 6eed46749..2752d6d17 100644 --- a/frontend/src/components/AppBar/PreviewMetadataPanel.tsx +++ b/frontend/src/components/AppBar/PreviewMetadataPanel.tsx @@ -1,12 +1,12 @@ import clsx from 'clsx'; import { Media } from '@/components/common/media'; -import { MetadataStatus } from '@/components/MetadataStatus'; import { MetadataSectionField, useMetadataSections, } from './metadataPreview.hooks'; +import { MetadataStatus } from './MetadataStatus'; /** * Creates a new array of metadata fields that have the missing metadata ordered diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index 88fc137ff..273cebde2 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -3,10 +3,10 @@ import clsx from 'clsx'; import { ReactNode } from 'react-markdown'; import { Link } from '@/components/common'; -import { MetadataStatus } from '@/components/MetadataStatus'; import { usePluginState } from '@/context/plugin'; import { usePlausible } from '@/hooks'; +import { MetadataStatus } from '../AppBar/MetadataStatus'; import styles from './MetadataList.module.scss'; import { MetadataItem, MetadataValueTypes } from './PluginDetails.types'; @@ -47,6 +47,9 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { // Font 'font-bold whitespace-nowrap', + + // Preview orange overlay + isEmpty && 'bg-napari-preview-orange-overlay', )} > {title}: @@ -56,7 +59,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { {isEmpty && (
  • From bb852052201cb4a1f8085405610d19de33b1050c Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Fri, 22 Oct 2021 17:03:17 -0700 Subject: [PATCH 14/18] Added tooltip component and tooltip text for missing field components --- .../components/PluginDetails/MetadataList.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index 273cebde2..af0c5ebed 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -64,7 +64,11 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { )} > information not submitted - + +
    + +
    +
  • )} @@ -148,12 +152,22 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) { inline && ['inline', styles.commaList], // Preview orange overlay if isValueEmpty is true - isValueEmpty && 'bg-napari-preview-orange-overlay', + isValueEmpty && + 'bg-napari-preview-orange-overlay flex justify-between items-center', )} key={key} > {node} - {isValueEmpty && } + {isValueEmpty && ( + +
    + +
    +
    + )} ); })} From 4e4c62651a37f5d7f116be2fbc9a9037a38b2c9a Mon Sep 17 00:00:00 2001 From: klai95 Date: Sun, 24 Oct 2021 15:10:41 -0700 Subject: [PATCH 15/18] Added comment in MetadataList.tsx --- frontend/src/components/PluginDetails/MetadataList.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index af0c5ebed..11e765bd6 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -58,6 +58,7 @@ function MetadataListItem({ inline, title, values }: MetadataListItemProps) {
      {isEmpty && (
    • Date: Mon, 25 Oct 2021 12:53:24 -0700 Subject: [PATCH 16/18] Refactor code --- .../src/components/AppBar/AppBarPreview.tsx | 2 +- .../src/components/AppBar/MetadataStatus.tsx | 25 ------------------- .../AppBar/PreviewMetadataPanel.tsx | 2 +- .../components/PluginDetails/MetadataList.tsx | 2 +- 4 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 frontend/src/components/AppBar/MetadataStatus.tsx diff --git a/frontend/src/components/AppBar/AppBarPreview.tsx b/frontend/src/components/AppBar/AppBarPreview.tsx index 3515bbc62..02620df04 100644 --- a/frontend/src/components/AppBar/AppBarPreview.tsx +++ b/frontend/src/components/AppBar/AppBarPreview.tsx @@ -9,10 +9,10 @@ import { ViewPullRequest, } from '@/components/common/icons'; import { Media } from '@/components/common/media'; +import { MetadataStatus } from '@/components/MetadataStatus'; import styles from './AppBarPreview.module.scss'; import { useMetadataSections } from './metadataPreview.hooks'; -import { MetadataStatus } from './MetadataStatus'; import { PreviewMetadataPanel } from './PreviewMetadataPanel'; const HUB_WIKI_LINK = diff --git a/frontend/src/components/AppBar/MetadataStatus.tsx b/frontend/src/components/AppBar/MetadataStatus.tsx deleted file mode 100644 index b891e244c..000000000 --- a/frontend/src/components/AppBar/MetadataStatus.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import clsx from 'clsx'; - -import { Check, PriorityHigh } from '@/components/common/icons'; - -interface MetadataStatusProps { - hasValue: boolean; - variant?: 'regular' | 'small'; -} - -export function MetadataStatus({ - hasValue, - variant = 'regular', -}: MetadataStatusProps) { - return ( -
      - {hasValue ? : } -
      - ); -} diff --git a/frontend/src/components/AppBar/PreviewMetadataPanel.tsx b/frontend/src/components/AppBar/PreviewMetadataPanel.tsx index 2752d6d17..6eed46749 100644 --- a/frontend/src/components/AppBar/PreviewMetadataPanel.tsx +++ b/frontend/src/components/AppBar/PreviewMetadataPanel.tsx @@ -1,12 +1,12 @@ import clsx from 'clsx'; import { Media } from '@/components/common/media'; +import { MetadataStatus } from '@/components/MetadataStatus'; import { MetadataSectionField, useMetadataSections, } from './metadataPreview.hooks'; -import { MetadataStatus } from './MetadataStatus'; /** * Creates a new array of metadata fields that have the missing metadata ordered diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index 11e765bd6..25ee65c6f 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -3,10 +3,10 @@ import clsx from 'clsx'; import { ReactNode } from 'react-markdown'; import { Link } from '@/components/common'; +import { MetadataStatus } from '@/components/MetadataStatus'; import { usePluginState } from '@/context/plugin'; import { usePlausible } from '@/hooks'; -import { MetadataStatus } from '../AppBar/MetadataStatus'; import styles from './MetadataList.module.scss'; import { MetadataItem, MetadataValueTypes } from './PluginDetails.types'; From 7fa8c133b588cc53a72d5cfb07269a231feb7553 Mon Sep 17 00:00:00 2001 From: klai95 Date: Mon, 25 Oct 2021 12:55:00 -0700 Subject: [PATCH 17/18] Refactor code --- frontend/src/components/MetadataStatus.tsx | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 frontend/src/components/MetadataStatus.tsx diff --git a/frontend/src/components/MetadataStatus.tsx b/frontend/src/components/MetadataStatus.tsx new file mode 100644 index 000000000..b891e244c --- /dev/null +++ b/frontend/src/components/MetadataStatus.tsx @@ -0,0 +1,25 @@ +import clsx from 'clsx'; + +import { Check, PriorityHigh } from '@/components/common/icons'; + +interface MetadataStatusProps { + hasValue: boolean; + variant?: 'regular' | 'small'; +} + +export function MetadataStatus({ + hasValue, + variant = 'regular', +}: MetadataStatusProps) { + return ( +
      + {hasValue ? : } +
      + ); +} From 9bfe1acc990e68fb99807bcc810bba95859ab233 Mon Sep 17 00:00:00 2001 From: klai95 Date: Mon, 25 Oct 2021 14:56:03 -0700 Subject: [PATCH 18/18] Refactored import statement --- frontend/src/components/PluginDetails/MetadataList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/PluginDetails/MetadataList.tsx b/frontend/src/components/PluginDetails/MetadataList.tsx index 043a6fdd8..ec8d6fbfb 100644 --- a/frontend/src/components/PluginDetails/MetadataList.tsx +++ b/frontend/src/components/PluginDetails/MetadataList.tsx @@ -2,7 +2,7 @@ import { Tooltip } from '@material-ui/core'; import clsx from 'clsx'; import { ReactNode } from 'react'; -import { Link } from '@/components/common'; +import { Link } from '@/components/common/Link'; import { MetadataStatus } from '@/components/MetadataStatus'; import { usePluginState } from '@/context/plugin'; import { usePlausible } from '@/hooks';