From a61c762818498b09e89334d8c43004ae8802dc80 Mon Sep 17 00:00:00 2001 From: Iain Collins Date: Sun, 8 Sep 2024 01:30:51 +0100 Subject: [PATCH] Improve commodity import/export listing --- components/commodity-export-orders.js | 2 +- components/commodity-import-orders.js | 2 +- components/local-commodity-exporters.js | 2 +- components/local-commodity-importers.js | 2 +- components/nearby-commodity-exporters.js | 2 +- components/nearby-commodity-importers.js | 2 +- package.json | 2 +- pages/commodity/[commodity-name]/index.js | 7 ++++--- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/commodity-export-orders.js b/components/commodity-export-orders.js index f7f4508..d4fe2bf 100644 --- a/components/commodity-export-orders.js +++ b/components/commodity-export-orders.js @@ -127,7 +127,7 @@ function ExpandedRow ({ r }) { className='data-table--mini data-table--striped scrollable' columns={[ { - title: 'Location', + title: 'Exporters in system', dataIndex: 'stationName', key: 'stationName', align: 'left', diff --git a/components/commodity-import-orders.js b/components/commodity-import-orders.js index 0c7d237..e713b82 100644 --- a/components/commodity-import-orders.js +++ b/components/commodity-import-orders.js @@ -127,7 +127,7 @@ function ExpandedRow ({ r }) { className='data-table--mini data-table--striped scrollable' columns={[ { - title: 'Location', + title: 'Importers in system', dataIndex: 'stationName', key: 'stationName', align: 'left', diff --git a/components/local-commodity-exporters.js b/components/local-commodity-exporters.js index 08ffa74..bb2d66e 100644 --- a/components/local-commodity-exporters.js +++ b/components/local-commodity-exporters.js @@ -12,7 +12,7 @@ export default ({ commodityOrders }) => { className='data-table--mini data-table--striped scrollable' columns={[ { - title: 'Location', + title: 'Exporters in system', dataIndex: 'stationName', key: 'stationName', align: 'left', diff --git a/components/local-commodity-importers.js b/components/local-commodity-importers.js index f96052c..1ac6129 100644 --- a/components/local-commodity-importers.js +++ b/components/local-commodity-importers.js @@ -12,7 +12,7 @@ export default ({ commodityOrders }) => { className='data-table--mini data-table--striped scrollable' columns={[ { - title: 'Location', + title: 'Importers in system', dataIndex: 'stationName', key: 'stationName', align: 'left', diff --git a/components/nearby-commodity-exporters.js b/components/nearby-commodity-exporters.js index cc35433..337d814 100644 --- a/components/nearby-commodity-exporters.js +++ b/components/nearby-commodity-exporters.js @@ -64,7 +64,7 @@ export default ({ commodity }) => { className='data-table--mini data-table--striped data-table--border-left scrollable' columns={[ { - title: 'Location', + title: 'Exporters nearby', dataIndex: 'stationName', key: 'stationName', align: 'left', diff --git a/components/nearby-commodity-importers.js b/components/nearby-commodity-importers.js index 70bab7d..e030880 100644 --- a/components/nearby-commodity-importers.js +++ b/components/nearby-commodity-importers.js @@ -64,7 +64,7 @@ export default ({ commodity }) => { className='data-table--mini data-table--striped data-table--border-left scrollable' columns={[ { - title: 'Location', + title: 'Importers nearby', dataIndex: 'stationName', key: 'stationName', align: 'left', diff --git a/package.json b/package.json index 431264f..eb23430 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ardent-www", - "version": "0.44.1", + "version": "0.44.2", "description": "Ardent Industry", "main": "index.js", "scripts": { diff --git a/pages/commodity/[commodity-name]/index.js b/pages/commodity/[commodity-name]/index.js index 624c278..aea4316 100644 --- a/pages/commodity/[commodity-name]/index.js +++ b/pages/commodity/[commodity-name]/index.js @@ -36,7 +36,9 @@ export default () => { const commodityName = router.query?.['commodity-name'] ?? window.location?.pathname?.replace(/\/(importers|exporters)$/, '').replace(/.*\//, '') if (!commodityName) return setUpdating(true) - + setImports(undefined) + setExports(undefined) + const imports = await getImports(commodityName) imports.forEach(c => { c.key = c.commodityId @@ -50,6 +52,7 @@ export default () => { delete c.commodityId delete c.commodityName }) + setImports(imports) const exports = await getExports(commodityName) @@ -73,8 +76,6 @@ export default () => { useEffect(() => { (async () => { setCommodity(undefined) - setExports(undefined) - setImports(undefined) const commodityName = router.query?.['commodity-name'] if (!commodityName) return