diff --git a/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx b/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx index eadb403ab..244ba4f5d 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx +++ b/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx @@ -98,6 +98,15 @@ const useStyles = makeStyles( }, warehousesLabel: { marginBottom: theme.spacing(2) + }, + scrollArea: { + maxHeight: "calc(100vh - 350px)", + minHeight: "auto", + "@media (min-height: 800px)": { + minHeight: 440 + }, + overflowY: "auto", + overflowX: "hidden" } }), { @@ -304,303 +313,305 @@ const ProductExportDialogInfo: React.FC = ({ description="select product informations to be exported" /> - 0 && ( -
- {selectedChannels.slice(0, maxChips).map(channel => ( - onChannelSelect(channel)} - key={channel.id} - /> - ))} - {selectedChannels.length > maxChips && ( - - - - )} -
- ) - } - data-test="channels" - > - - - !!selectedChannels.find(channel => channel.id === option.id) - } - onChange={onChannelSelect} - /> - -
- - 0 && ( -
- {selectedAttributes.slice(0, maxChips).map(attribute => ( - - onAttrtibuteSelect({ - target: { - name: attributeNamePrefix + attribute.value, - value: undefined - } - }) - } - key={attribute.value} - /> - ))} - {selectedAttributes.length > maxChips && ( - - - - )} -
- ) - } - data-test="attributes" - > - - }} - /> -
- {attributes.map(attribute => ( - - ))} - {(hasMore || loading) && ( -
- {hasMore && !loading && ( - - )} - {loading && } -
- )} -
- - 0 || - selectedInventoryFields.length > 0) && ( -
- {selectedInventoryFields.slice(0, maxChips).map(field => ( - - onChange({ - target: { - name: field, - value: false - } - }) - } - /> - ))} - {data.exportInfo.warehouses - .slice(0, maxChips - selectedInventoryFields.length) - .map(warehouseId => ( +
+ 0 && ( +
+ {selectedChannels.slice(0, maxChips).map(channel => ( warehouse.value === warehouseId - ).label - } + label={channel.name} + onClose={() => onChannelSelect(channel)} + key={channel.id} + /> + ))} + {selectedChannels.length > maxChips && ( + + + + )} +
+ ) + } + data-test="channels" + > + + + !!selectedChannels.find(channel => channel.id === option.id) + } + onChange={onChannelSelect} + /> + +
+ + 0 && ( +
+ {selectedAttributes.slice(0, maxChips).map(attribute => ( + - onWarehouseSelect({ + onAttrtibuteSelect({ target: { - name: warehouseNamePrefix + warehouseId, + name: attributeNamePrefix + attribute.value, value: undefined } }) } + key={attribute.value} + /> + ))} + {selectedAttributes.length > maxChips && ( + + + + )} +
+ ) + } + data-test="attributes" + > + + }} + /> +
+ {attributes.map(attribute => ( + + ))} + {(hasMore || loading) && ( +
+ {hasMore && !loading && ( + + )} + {loading && } +
+ )} +
+ + 0 || + selectedInventoryFields.length > 0) && ( +
+ {selectedInventoryFields.slice(0, maxChips).map(field => ( + + onChange({ + target: { + name: field, + value: false + } + }) + } /> ))} - {data.exportInfo.warehouses.length + - selectedInventoryFields.length > - maxChips && ( - - - - )} -
- ) - } - data-test="inventory" - > -
- - {inventoryFields.map(field => ( + {data.exportInfo.warehouses + .slice(0, maxChips - selectedInventoryFields.length) + .map(warehouseId => ( + warehouse.value === warehouseId + ).label + } + onClose={() => + onWarehouseSelect({ + target: { + name: warehouseNamePrefix + warehouseId, + value: undefined + } + }) + } + /> + ))} + {data.exportInfo.warehouses.length + + selectedInventoryFields.length > + maxChips && ( + + + + )} +
+ ) + } + data-test="inventory" + > +
+ {inventoryFields.map(field => ( + + ))} +
+
+ + + +
+ +
+
+ + + + {warehouses.map(warehouse => ( + ))} -
-
- - - -
- -
-
- - - - {warehouses.map(warehouse => ( - - ))} - - + + +
); };