Skip to content

Commit

Permalink
Merge pull request #8408 from tchak/fix-batch-operations-buttons
Browse files Browse the repository at this point in the history
fix(dossier): disable buttons when selection is canceled
  • Loading branch information
tchak committed Jan 11, 2023
2 parents cc3053e + f17ae44 commit 061a3e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/dossiers/batch_operation_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def render?
def operations_for_dossier(dossier)
case dossier.state
when Dossier.states.fetch(:en_construction)
[BatchOperation.operations.fetch(:passer_en_instruction)]
[BatchOperation.operations.fetch(:passer_en_instruction), BatchOperation.operations.fetch(:follow)]
when Dossier.states.fetch(:en_instruction)
[BatchOperation.operations.fetch(:accepter)]
when Dossier.states.fetch(:accepte), Dossier.states.fetch(:refuse), Dossier.states.fetch(:sans_suite)
Expand Down
7 changes: 5 additions & 2 deletions app/javascript/controllers/batch_operation_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ export class BatchOperationController extends ApplicationController {
disable(this.menuTarget);
}
}
} else if (this.hasMenuTarget) {
disable(this.menuTarget);
} else {
if (this.hasMenuTarget) {
disable(this.menuTarget);
}
buttons.forEach((button) => switchButton(button, false));
}
}
}
Expand Down

0 comments on commit 061a3e5

Please sign in to comment.