aau-giraf / weekplanner

Main repository of the Weekplanner tablet application
GNU General Public License v3.0
15 stars 3 forks source link

New update for Issue#945 #990

Open Thuyhaile opened 11 months ago

Thuyhaile commented 11 months ago

Description

Now, only the guardian can delete activities in the 'Edit mode' UI, while the citizen can only mark activities as finished. The citizen wishes to remove finished activities from the day to focus solely on activities that haven't been completed.

Fixes #\<945>

Possible Suggested Solution:

  1. Add a function for removing activities for the citizen:
    • Only activities that have been marked as 'complete' or have finished running a timer can be removed.
    • After marking an activity as finished, drag and remove it from the day.

https://github.com/aau-giraf/weekplanner/assets/95319419/47fcdeeb-d5f4-435e-adc6-28c75c46e096

The activities that were removed by the citizen will not be deleted; they will only be hidden from the citizen's screen. The guardian can see them with the red 'complete' mark on his screen. A new button at the bottom of the day serves as a 'a separate box' in the school. When pressed, children have the opportunity to view hidden activities or all activities done during the day.

https://github.com/aau-giraf/weekplanner/assets/95319419/d41b643b-bc42-4b5c-a7c5-fa4017cede84

  1. Add "drag and delete" functionality for activities for the guardian:
    • Activities can be dragged from their current position in the 'ugeplan' UI, dropped, and then deleted from the day. Only one activity can be deleted at a time.
    • The guardian can drag and delete all activities without any conditions.

https://github.com/aau-giraf/weekplanner/assets/95319419/8fce797a-a3bf-4b69-ace7-29430228988d

Other related changes:

  1. When navigating from the 'Aktivitet' UI to the 'Ugeplan' UI, data isn't reloaded. To enable the 'drag and delete' functionality, users need to navigate back to the previous UI and then log into the 'Ugeplan' UI again. This inconvenience for the user can be addressed by implementing the following changes in the 'Aktivitet' UI:

    • Add a 'reload data' function for the back arrow at the top-left of the screen.
    • Add 'reload data' and 'navigation to Ugeplan UI' for the 'Gem til borger' button. image
  2. Fix old error: Activities don't show all on the first load.

Note:

To implement this issue, it is necessary to add 'Removed' to the enum ActivityState { Normal, Active, Canceled, Completed, Removed } on the API client side.

Type of change

How Has This Been Tested?

Android Platform: emulation is carried out using Android Studio on Windows computer iOS Platform: emulation is carried out using Xcode on MacBook

Development Configuration Flutter version: 3.16.0 Dart version: 3.2.0

Checklist:

Thuyhaile commented 11 months ago

Dette 'issue' kan ikke bestå tjek, da vi i vores kode har tilføjet 'Removed' til enumen ActivityState { Normal, Active, Canceled, Completed, Removed }, som findes i filen activity_state_enum i api-client. Dog kan vi ikke blande os direkte i denne enum, da den tilhører api-client-siden. For at prøve at køre 'issue': • Ctrl + klik på 'ActivityState' i for eksempel filen 'weekplan_bloc.dart'. • Tilføj 'Removed' til enum ActivityState { Normal, Active, Canceled, Completed, Removed }. Hvis 'Removed' tilføjes fra api-client-siden, behøver vi ikke at gøre dette.