From d1f3fcc8e07f8bd1d148b0539e8e22c0ea86e9ff Mon Sep 17 00:00:00 2001
From: esikkala <esko.ikkala@aalto.fi>
Date: Tue, 8 Jun 2021 12:22:43 +0300
Subject: [PATCH] Result table font size to layout config

---
 src/client/components/App.js                  |  4 ++--
 .../components/facet_results/ResultTable.js   |  3 +++
 src/client/configs/sampo/GeneralConfig.js     |  1 +
 src/client/reducers/sampo/perspective1.js     | 22 +++++++++----------
 4 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/client/components/App.js b/src/client/components/App.js
index f9755774..62ba0261 100644
--- a/src/client/components/App.js
+++ b/src/client/components/App.js
@@ -45,8 +45,8 @@ const theme = createMuiTheme({
     },
     MuiTableCell: {
       sizeSmall: {
-        paddingTop: 2,
-        paddingBottom: 2
+        paddingTop: 0,
+        paddingBottom: 0
       }
     }
   }
diff --git a/src/client/components/facet_results/ResultTable.js b/src/client/components/facet_results/ResultTable.js
index eccdc67c..2c54c05c 100644
--- a/src/client/components/facet_results/ResultTable.js
+++ b/src/client/components/facet_results/ResultTable.js
@@ -21,6 +21,9 @@ import history from '../../History'
 const styles = theme => ({
   tableContainer: props => ({
     overflow: 'auto',
+    '& td, & th': {
+      fontSize: props.layoutConfig.tableFontSize
+    },
     [theme.breakpoints.up(props.layoutConfig.hundredPercentHeightBreakPoint)]: {
       height: `calc(100% - ${props.layoutConfig.tabHeight + props.layoutConfig.paginationToolbarHeight + 2}px)`
     },
diff --git a/src/client/configs/sampo/GeneralConfig.js b/src/client/configs/sampo/GeneralConfig.js
index 7c251412..d042db09 100644
--- a/src/client/configs/sampo/GeneralConfig.js
+++ b/src/client/configs/sampo/GeneralConfig.js
@@ -33,6 +33,7 @@ export const layoutConfig = {
   reducedHeightBreakpoint: 'lg',
   tabHeight: 58,
   paginationToolbarHeight: 37,
+  tableFontSize: '0.8rem',
   topBar: {
     showLanguageButton: true,
     feedbackLink: 'https://link.webropolsurveys.com/',
diff --git a/src/client/reducers/sampo/perspective1.js b/src/client/reducers/sampo/perspective1.js
index bbc3cb18..c60b02f5 100644
--- a/src/client/reducers/sampo/perspective1.js
+++ b/src/client/reducers/sampo/perspective1.js
@@ -56,7 +56,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 250
+      minWidth: 200
     },
     {
       id: 'author',
@@ -65,7 +65,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 200
+      minWidth: 150
     },
     {
       id: 'work',
@@ -74,7 +74,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 250,
+      minWidth: 200,
       priority: 5
     },
     {
@@ -84,7 +84,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 250,
+      minWidth: 180,
       priority: 5
     },
     {
@@ -96,7 +96,7 @@ export const INITIAL_STATE = {
       numberedList: false,
       showSource: true,
       sourceExternalLink: true,
-      minWidth: 200
+      minWidth: 150
     },
     {
       id: 'productionTimespan',
@@ -107,7 +107,7 @@ export const INITIAL_STATE = {
       numberedList: false,
       showSource: true,
       sourceExternalLink: true,
-      minWidth: 250
+      minWidth: 150
     },
     {
       id: 'lastKnownLocation',
@@ -116,7 +116,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 220
+      minWidth: 160
     },
     {
       id: 'note',
@@ -126,7 +126,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 250,
+      minWidth: 220,
       collapsedMaxWords: 12
     },
     {
@@ -145,7 +145,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 450
+      minWidth: 200
     },
     {
       id: 'owner',
@@ -172,7 +172,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 220
+      minWidth: 200
     },
     {
       id: 'transferOfCustodyTimespan',
@@ -181,7 +181,7 @@ export const INITIAL_STATE = {
       externalLink: false,
       sortValues: true,
       numberedList: false,
-      minWidth: 210
+      minWidth: 200
     },
     {
       id: 'material',
-- 
GitLab