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)); }, });