[PUI] Build actions (#7945)

* add table buttons to build line table

* Add deallocate row action

* Restrict row actions

* Add functionality to 'deallocate' stock from build order

* Implement 'auto-allocate'

* Table column cleanup

* Refactor code into new hook:

- Helper function to update a set of selected rows
- Callback function to remove row

* Refactor existing forms to use new hook

* Fix for RelatedModelField

- Handle callback for null value

* Memoize each field instance

* Cleanup dead code

* Define interfac for TableField row properties

* Handle processing of nested errors

* Pass form controller through to table field rows

* Pass row errors through to individual table rows

* Allow Standalone field to render errors

* Allow allocation against build lines

* Adjust quantity value when stock item is changed

* Fix issue related to field name

* Add "available" filter

* Add "remove row" button

* Add field for selecting source location

* Filter out consumable items

* Adjust form success message
This commit is contained in:
Oliver
2024-08-24 15:17:05 +10:00
committed by GitHub
parent ebb01c5e5b
commit eec53ffd82
15 changed files with 595 additions and 112 deletions
@@ -28,6 +28,7 @@ import { useEffect, useMemo, useState } from 'react';
import { api } from '../App';
import { ActionButton } from '../components/buttons/ActionButton';
import RemoveRowButton from '../components/buttons/RemoveRowButton';
import { StandaloneField } from '../components/forms/StandaloneField';
import {
ApiFormAdjustFilterType,
@@ -438,13 +439,7 @@ function LineItemFormRow({
onClick={() => open()}
/>
)}
<ActionButton
onClick={() => input.removeFn(input.idx)}
icon={<InvenTreeIcon icon="square_x" />}
tooltip={t`Remove item from list`}
tooltipAlignment="top"
color="red"
/>
<RemoveRowButton onClick={() => input.removeFn(input.idx)} />
</Flex>
</Table.Td>
</Table.Tr>