Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
I
iTasks-SDK
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 84
    • Issues 84
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • clean-and-itasks
  • iTasks-SDK
  • Issues
  • #417

Closed
Open
Opened Oct 26, 2020 by Camil Staps@cstaps🚀Owner

onRefresh of updateSharedInformation is ignored when the editor is in an invalid state

It seems that the value in an updateSharedInformation is not updated by an onRefresh when the editor is in an 'invalid' state. In the below example, first fill in a value, then remove it (the icon becomes red), and then click the Continue button. I would expect the editor to get the new value, but it doesn't.

This seems to be because of this part of updateSharedInformation:

		(mapEditorWithState ?None
			(\(r,valid) _ -> (if valid (?Just (tof r)) ?None, ?Just r))
			(\mbv (?Just r) -> ((fmap (fromf r) mbv, isJust mbv), ?Just r))
			editor
		)

The if valid only accepts changes when the value is valid. This is to make sure that the user can actually enter an invalid value (otherwise the last valid value is restored), but also blocks 'external' refreshes.

Or do I misunderstand the concept again, @baslijns?

import iTasks

:: R = {x :: String}

derive class iTask R

Start w = doTasks (withShared {x=""} task) w

task share =
	updateSharedInformation [] share -&&-
	(viewInformation [] "Set the value?" >!| set {x="new value"} share)
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: clean-and-itasks/iTasks-SDK#417