From f760eb847f89cdff3415569c8f191779a15a0dd1 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Sat, 28 Mar 2020 18:52:25 +0200 Subject: [PATCH] href of board row moved to view --- src/routes/Board/Board.js | 7 ++++--- src/routes/Board/useBoard.js | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/Board/Board.js b/src/routes/Board/Board.js index c016b2bdd..003485640 100644 --- a/src/routes/Board/Board.js +++ b/src/routes/Board/Board.js @@ -23,6 +23,7 @@ const Board = () => { null } {board.catalog_resources.map((catalog_resource, index) => { + const href = `#/discover/${encodeURIComponent(catalog_resource.request.base)}/${encodeURIComponent(catalog_resource.request.path.type_name)}/${encodeURIComponent(catalog_resource.request.path.id)}`; const title = `${catalog_resource.origin} - ${catalog_resource.request.path.id} ${catalog_resource.request.path.type_name}`; switch (catalog_resource.content.type) { case 'Ready': { @@ -33,7 +34,7 @@ const Board = () => { title={title} items={catalog_resource.content.content} itemComponent={MetaItem} - href={catalog_resource.href} + href={href} /> ); } @@ -45,7 +46,7 @@ const Board = () => { className={styles['board-row']} title={title} message={message} - href={catalog_resource.href} + href={href} /> ); } @@ -55,7 +56,7 @@ const Board = () => { key={index} className={styles['board-row']} title={title} - href={catalog_resource.href} + href={href} /> ); } diff --git a/src/routes/Board/useBoard.js b/src/routes/Board/useBoard.js index 898f4c6dd..2ec97881a 100644 --- a/src/routes/Board/useBoard.js +++ b/src/routes/Board/useBoard.js @@ -33,8 +33,7 @@ const mapBoardStateWithCtx = (board, ctx) => { return origin; }, catalog_resource.request.base); - const href = `#/discover/${encodeURIComponent(catalog_resource.request.base)}/${encodeURIComponent(catalog_resource.request.path.type_name)}/${encodeURIComponent(catalog_resource.request.path.id)}`; - return { request, content, origin, href }; + return { request, content, origin }; }); return { selected, catalog_resources }; };