karya-inc / KaryaAndroid-Features

2 stars 0 forks source link

Save partial output of incomplete components #36

Open thedroiddiv opened 6 days ago

thedroiddiv commented 6 days ago

Description

Currently if user exits the task screen, only data for the component which are completed is saved and not for the current component which might have some partially filled data

Proposed Solution

I have setup a mechanism to save the output and recover it when the component reloads. Currently it is implemented only in OpenComponent, well need to implement that in each component's controller.

Steps

  1. Override destroy method
  2. Return the data and files so far from destroy
  3. Load the initial data in when the controller is instantiated next time. Few components also have a prefill values associated with them. In these scenarios the preference would be initialValue from mtaOutput > prefill > null/empty/initial

References

https://github.com/karya-inc/karya-android-client/pull/490

thedroiddiv commented 6 days ago

@atharvaTyagi @criticalAY Guys have a look. We can take this up independently, a single PR should just address only one component controller

@anuragshukla06