Skip to content

Commit

Permalink
UIREC-418 Disable piece actions menu only when all actions are disabl…
Browse files Browse the repository at this point in the history
…ed (#610)
  • Loading branch information
NikitaSedyx authored and usavkov-epam committed Nov 22, 2024
1 parent 6a3a6ee commit a8f2520
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Do not overlap components on Edit piece page when location is long. Refs UIREC-419.
* Do not disable title submit button when form has errors. Refs UIREC-420.
* Disable piece actions menu only when all actions are disabled. Refs UIREC-418.

## [6.0.1](https://github.com/folio-org/ui-receiving/tree/v6.0.1) (2024-11-08)
[Full Changelog](https://github.com/folio-org/ui-receiving/compare/v6.0.0...v6.0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import css from './PieceFormActionButtons.css';

export const PieceFormActionButtons = ({
actionsDisabled,
canDeletePiece = false,
isEditMode,
onClaimDelay,
onClaimSend,
Expand All @@ -33,7 +32,6 @@ export const PieceFormActionButtons = ({

const actionMenu = getPieceActionMenu({
actionsDisabled,
canDeletePiece,
isEditMode,
onClaimDelay,
onClaimSend,
Expand All @@ -50,6 +48,7 @@ export const PieceFormActionButtons = ({
});
const saveButtonLabelId = 'stripes-components.saveAndClose';
const isSaveDisabled = actionsDisabled?.[PIECE_ACTION_NAMES.saveAndClose];
const isActionsMenuDisabled = isSaveDisabled && actionsDisabled?.[PIECE_ACTION_NAMES.delete];

if (actionMenu.length === 0) {
return (
Expand Down Expand Up @@ -79,7 +78,7 @@ export const PieceFormActionButtons = ({
</Button>
<Dropdown
key={actionsKey}
disabled={isSaveDisabled}
disabled={isActionsMenuDisabled}
buttonProps={{
buttonStyle: 'primary',
buttonClass: css.dropdownButton,
Expand All @@ -97,7 +96,6 @@ export const PieceFormActionButtons = ({

PieceFormActionButtons.propTypes = {
actionsDisabled: PropTypes.objectOf(PropTypes.bool),
canDeletePiece: PropTypes.bool,
isEditMode: PropTypes.bool.isRequired,
onClaimDelay: PropTypes.func.isRequired,
onClaimSend: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const onDelete = jest.fn();
const defaultProps = {
disabled: false,
isCreateAnother: false,
canDeletePiece: false,
onDelete,
onSave,
status: PIECE_STATUS.expected,
Expand Down

0 comments on commit a8f2520

Please sign in to comment.