[arvados] updated: 2.7.0-5831-g7aa5e4fe60

git repository hosting git at public.arvados.org
Tue Jan 16 16:59:29 UTC 2024


Summary of changes:
 .../multiselect-toolbar/MultiselectToolbar.tsx     |  2 +-
 .../ms-toolbar-overflow-wrapper.tsx                | 35 ++++++++++++++--------
 2 files changed, 23 insertions(+), 14 deletions(-)

       via  7aa5e4fe60d4c1f8aeffa48bde44c07104710579 (commit)
      from  5461466dc71b7206716cb4eededd86ed7d2fec69 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7aa5e4fe60d4c1f8aeffa48bde44c07104710579
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Tue Jan 16 11:59:09 2024 -0500

    21315: functionality to skip first hidden button in place Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
index cf8f34a16f..7277e98715 100644
--- a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
+++ b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
@@ -126,7 +126,7 @@ export const MultiselectToolbar = connect(
                     data-cy='multiselect-toolbar'
                     >
                     {actions.length ? (
-                        <IntersectionObserverWrapper length={ actions.length }>
+                        <IntersectionObserverWrapper menuLength={actions.length}>
                             {actions.map((action, i) =>{
                                 const { hasAlts, useAlts, name, altName, icon, altIcon } = action;
                             return hasAlts ? (
diff --git a/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx b/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx
index 3d8cf2f453..ee88a1efae 100644
--- a/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx
+++ b/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx
@@ -37,12 +37,12 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 type WrapperProps = {
     children: OverflowChild[];
-    length: number;
+    menuLength: number;
 };
 
 export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperProps & WithStyles<CssRules>) => {
-    const { classes, children, length } = props;
-
+    const { classes, children, menuLength } = props;
+    const lastEntryId = (children[menuLength - 1] as any).props['data-targetid'];
     const navRef = useRef<any>(null);
     const [visibilityMap, setVisibilityMap] = useState({});
 
@@ -58,9 +58,11 @@ export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperPro
         });
 
         setVisibilityMap((prev) => ({
-            ...prev,
-            ...updatedEntries,
-        }));
+                ...prev,
+                ...updatedEntries,
+                [lastEntryId]: Object.keys(updatedEntries)[0] === lastEntryId,
+            })
+        );
     };
 
     useEffect((): any => {
@@ -82,7 +84,12 @@ export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperPro
         return () => {
             observer.disconnect();
         };
-    }, [length]);
+        // eslint-disable-next-line 
+    }, [menuLength]);
+
+    const numHidden = (visMap: {}) => {
+        return Object.values(visMap).filter((x) => x === false).length;
+    };
 
     return (
         <div
@@ -97,12 +104,14 @@ export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperPro
                     }),
                 });
             })}
-            <OverflowMenu
-                visibilityMap={visibilityMap}
-                className={classes.overflowStyle}
-            >
-                {children}
-            </OverflowMenu>
+            {numHidden(visibilityMap) >= 2 && (
+                <OverflowMenu
+                    visibilityMap={visibilityMap}
+                    className={classes.overflowStyle}
+                >
+                    {children}
+                </OverflowMenu>
+            )}
         </div>
     );
 });

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list