Merge pull request #8408 from tchak/fix-batch-operations-buttons
fix(dossier): disable buttons when selection is canceled
This commit is contained in:
commit
061a3e59ff
2 changed files with 6 additions and 3 deletions
|
@ -13,7 +13,7 @@ class Dossiers::BatchOperationComponent < ApplicationComponent
|
|||
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)
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue