Coder Social home page Coder Social logo

Comments (8)

YuanZhu-apple avatar YuanZhu-apple commented on August 25, 2024

@dukemike Just want to confirm if discontinue means end an activity? If so, that's straight forward, just set the end date on the schedule of the activity.

But deferring an event or events could be much more complex, because it involves the scheduling.
For example, an weekly repeated schedule, should it be deferred to next day or next week?
And how to track the deferring in the care plan store and so on.

from carekit.

YuanZhu-apple avatar YuanZhu-apple commented on August 25, 2024

Another idea that in my head is to support swipe action menus in the table view of care card or tracker. Basically, the menu option can be provided by developer through delegate, and the action is up to the developer as well.

from carekit.

dukemike avatar dukemike commented on August 25, 2024

Yes, I am proposing that swiping on the row in the card card would cause the activity's end date to be set to now or to tomorrow at 0:00. Deferring an event would have many more edges which I could see as rescheduling.

Do you think that allowing the developer to specify the menu would be better than adding a '...canDefer...' to supporting ending the activity only?

from carekit.

umerkhan-apple avatar umerkhan-apple commented on August 25, 2024

@dukemike It was great meeting with you at WWDC. I think this will be a great addition to the Care Card.

We probably don't want to add an extra flag to the activity model.
This will create data migration issues.

Here's how I think we should proceed for this feature:

  1. We should instead add a method to the existing Care Card Delegate, something like:
    -(BOOL)careCardViewController:(OCKCareCardViewController *)viewController userCanDiscontinueActivity:(OCKCarePlanActivity *)activity;
  2. Then inside CareCardViewController, we should check the return value for this method and based on it allow the discontinue button to be shown on each table view cell (using the table view delegate/data source)
  3. By default, the cell will not show the discontinue button.

Let me know what you think! :)

from carekit.

dukemike avatar dukemike commented on August 25, 2024

@umerkhan-apple: Do we need user in the method name? Would canDiscontinueActivity be sufficient?

Are equivalents for tableView: willBeginEditingRowAtIndexPath and tableView:didEndEditingRowAtIndexPath: necessary?

from carekit.

umerkhan-apple avatar umerkhan-apple commented on August 25, 2024

@dukemike We can proceed with canDiscontinueActivity and just confirm the name with everyone else during the PR review process. I don't think those tableView equivalents are necessary.

Since the Care Card already has a table view delegate, you would just override the following methods inside OCKCareCardViewController.h:

tableView(_:canEditRowAtIndexPath:)

  • This method will return the value from canDiscontinueActivity.

tableView(_:commitEditingStyle:forRowAtIndexPath:)

  • This method will find the activity at the indexPath and call setEndDate with the current date.

from carekit.

dukemike avatar dukemike commented on August 25, 2024

pull request #80 opened

from carekit.

erik-apple avatar erik-apple commented on August 25, 2024

Closing out this issue. The requested feature has been implemented as part of CareKit 2.0
The new OCKSchedule struct now has an end property that fulfills this requirement.

from carekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.