fix(dossier): disable buttons when selection is canceled

This commit is contained in:
Paul Chavard 2023-01-11 11:50:12 +01:00
parent cc3053e707
commit f17ae44952
2 changed files with 6 additions and 3 deletions

View file

@ -13,7 +13,7 @@ class Dossiers::BatchOperationComponent < ApplicationComponent
def operations_for_dossier(dossier) def operations_for_dossier(dossier)
case dossier.state case dossier.state
when Dossier.states.fetch(:en_construction) 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) when Dossier.states.fetch(:en_instruction)
[BatchOperation.operations.fetch(:accepter)] [BatchOperation.operations.fetch(:accepter)]
when Dossier.states.fetch(:accepte), Dossier.states.fetch(:refuse), Dossier.states.fetch(:sans_suite) when Dossier.states.fetch(:accepte), Dossier.states.fetch(:refuse), Dossier.states.fetch(:sans_suite)

View file

@ -40,9 +40,12 @@ export class BatchOperationController extends ApplicationController {
disable(this.menuTarget); disable(this.menuTarget);
} }
} }
} else if (this.hasMenuTarget) { } else {
if (this.hasMenuTarget) {
disable(this.menuTarget); disable(this.menuTarget);
} }
buttons.forEach((button) => switchButton(button, false));
}
} }
} }