right panel is closed when the last task is completed

This change was tested in the following scenarios.
Simple task or task of process:
 * when the task is completed and this is the last task

Scenarios:
 - grid
 - day
 - week
 - month