From e9e2b06b4c7ca4c2ecfdb8e2f075c7516c92f748 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 21 Sep 2022 02:30:54 -0400 Subject: [PATCH] Moves column settings dropdown to header --- src/webviews/apps/plus/graph/GraphWrapper.tsx | 89 ++++++++++------- src/webviews/apps/plus/graph/graph.scss | 138 ++++++++++++++++++++++++++ 2 files changed, 189 insertions(+), 38 deletions(-) diff --git a/src/webviews/apps/plus/graph/GraphWrapper.tsx b/src/webviews/apps/plus/graph/GraphWrapper.tsx index 75f3877..81dad54 100644 --- a/src/webviews/apps/plus/graph/GraphWrapper.tsx +++ b/src/webviews/apps/plus/graph/GraphWrapper.tsx @@ -142,7 +142,7 @@ const getClientPlatform = (): GraphPlatform => { const clientPlatform = getClientPlatform(); -const graphColumns: {[Key in GraphZoneType]: {name: string; hideable: boolean}} = { +const graphColumns: { [Key in GraphZoneType]: { name: string; hideable: boolean } } = { refZone: { name: 'Branch / Tag', hideable: false, @@ -517,6 +517,56 @@ export function GraphWrapper({ ) : (

No repository is selected

)} +
+
+
+ +
+ {Object.entries(graphColumns).map( + ([graphZoneType, column]) => + column.hideable && ( + handleSelectColumn(graphZoneType as GraphZoneType)} + > + + {column.name}{' '} + + ), + )} +
+
+
+