From 9e19bedb90eb5c6e31f1b0d841fc9beb3416d199 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 25 Jul 2023 13:45:05 +1000 Subject: [PATCH] RN-903 Prefix QR code (#4783) --- packages/admin-panel/src/pages/resources/EntitiesPage.js | 1 + packages/admin-panel/src/table/columnTypes/QrCodeButton.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/admin-panel/src/pages/resources/EntitiesPage.js b/packages/admin-panel/src/pages/resources/EntitiesPage.js index 6dc5a271ba..56b41a226b 100644 --- a/packages/admin-panel/src/pages/resources/EntitiesPage.js +++ b/packages/admin-panel/src/pages/resources/EntitiesPage.js @@ -63,6 +63,7 @@ export const COLUMNS = [ actionConfig: { qrCodeContentsKey: 'id', humanReadableIdKey: 'code', + qrCodePrefix: 'entity-', }, }, ]; diff --git a/packages/admin-panel/src/table/columnTypes/QrCodeButton.js b/packages/admin-panel/src/table/columnTypes/QrCodeButton.js index 1ea7db6214..ff140bb682 100644 --- a/packages/admin-panel/src/table/columnTypes/QrCodeButton.js +++ b/packages/admin-panel/src/table/columnTypes/QrCodeButton.js @@ -34,7 +34,7 @@ QrCodeButtonComponent.propTypes = { const mapDispatchToProps = (dispatch, ownProps) => ({ openModal: () => { const { row, actionConfig } = ownProps; - const { qrCodeContentsKey, humanReadableIdKey } = actionConfig; + const { qrCodeContentsKey, humanReadableIdKey, qrCodePrefix } = actionConfig; if (!qrCodeContentsKey || !humanReadableIdKey) { throw new Error( 'QR code button misconfigured. Must specify qrCodeContentsKey and humanReadableIdKey', @@ -42,7 +42,7 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ } const qrCodeContents = row[qrCodeContentsKey]; const humanReadableId = row[humanReadableIdKey]; - dispatch(openQrCodeModal(qrCodeContents, humanReadableId)); + dispatch(openQrCodeModal(`${qrCodePrefix}${qrCodeContents}`, humanReadableId)); }, });