2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-02 05:26:45 +00:00

[PUI] Barcode title (#8591)

* Increase query limit

* PUI: Barcode UI tweaks

- Small visual tweaks to barcode dialogs
This commit is contained in:
Oliver 2024-11-29 17:32:15 +11:00 committed by GitHub
parent 20d862e350
commit 327884ca26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 14 deletions

View File

@ -163,7 +163,7 @@ export function BarcodeActionDropdown({
actions={[ actions={[
GeneralBarcodeAction({ GeneralBarcodeAction({
mdl_prop: prop, mdl_prop: prop,
title: t`View`, title: t`View Barcode`,
icon: <IconQrcode />, icon: <IconQrcode />,
tooltip: t`View barcode`, tooltip: t`View barcode`,
ChildItem: InvenTreeQRCode ChildItem: InvenTreeQRCode

View File

@ -4,6 +4,7 @@ import {
Box, Box,
Button, Button,
Code, Code,
Divider,
Group, Group,
Image, Image,
Select, Select,
@ -96,6 +97,8 @@ export const InvenTreeQRCode = ({
return ( return (
<Stack> <Stack>
<Divider />
{mdl_prop.hash ? ( {mdl_prop.hash ? (
<Alert variant='outline' color='red' title={t`Custom barcode`}> <Alert variant='outline' color='red' title={t`Custom barcode`}>
<Trans> <Trans>
@ -107,6 +110,8 @@ export const InvenTreeQRCode = ({
<QRCode data={data} ecl={ecl} {...props} /> <QRCode data={data} ecl={ecl} {...props} />
<Divider />
{data && settings.getSetting('BARCODE_SHOW_TEXT', 'false') && ( {data && settings.getSetting('BARCODE_SHOW_TEXT', 'false') && (
<Group <Group
justify={showEclSelector ? 'space-between' : 'center'} justify={showEclSelector ? 'space-between' : 'center'}
@ -163,13 +168,16 @@ export const QRCodeLink = ({ mdl_prop }: { mdl_prop: QrCodeType }) => {
}; };
return ( return (
<BarcodeInput <Stack gap='xs'>
value={barcode} <Divider />
onChange={(event) => setBarcode(event.currentTarget.value)} <BarcodeInput
onScan={actionSubmit} value={barcode}
onAction={handleLinkBarcode} onChange={(event) => setBarcode(event.currentTarget.value)}
actionText={t`Link`} onScan={actionSubmit}
/> onAction={handleLinkBarcode}
actionText={t`Link`}
/>
</Stack>
); );
}; };
@ -186,12 +194,17 @@ export const QRCodeUnlink = ({ mdl_prop }: { mdl_prop: QrCodeType }) => {
} }
return ( return (
<Box> <Box>
<Text> <Stack gap='xs'>
<Trans>This will remove the link to the associated barcode</Trans> <Divider />
</Text> <Text>
<Button color='red' onClick={unlinkBarcode}> <Trans>This will remove the link to the associated barcode</Trans>
<Trans>Unlink Barcode</Trans> </Text>
</Button> <Group grow>
<Button color='red' onClick={unlinkBarcode}>
<Trans>Unlink Barcode</Trans>
</Button>
</Group>
</Stack>
</Box> </Box>
); );
}; };