Merge pull request #8408 from tchak/fix-batch-operations-buttons

fix(dossier): disable buttons when selection is canceled
This commit is contained in:
Paul Chavard 2023-01-11 12:11:18 +01:00 committed by GitHub
commit 061a3e59ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,8 +40,11 @@ export class BatchOperationController extends ApplicationController {
disable(this.menuTarget); disable(this.menuTarget);
} }
} }
} else if (this.hasMenuTarget) { } else {
disable(this.menuTarget); if (this.hasMenuTarget) {
disable(this.menuTarget);
}
buttons.forEach((button) => switchButton(button, false));
} }
} }
} }