-
Notifications
You must be signed in to change notification settings - Fork 29
Add Recommended Configuration to Task Types #3466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ommended-settings
…ommended-settings
…ommended-settings
* | ||
* @example | ||
* api.user.setConfiguration("segmentationOpacity", 20); | ||
* api.data.setConfiguration("segmentationOpacity", 20); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these were messed up, probably because of copy paste errors :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation and refactoring 👍 Code per se looks good. I'll test it in a bit.
if (unmountResult && div.parentNode) { | ||
div.parentNode.removeChild(div); | ||
// The returned promise gets resolved once the element is destroyed. | ||
export default function renderIndependently( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Ok, I just tested the feature and it worked fine except for a few bits:
Where is this modelled in the code? I couldn't find the logic for that. I'm only seeing that on each wk_ready event, you are comparing the recommended settings with the actual ones? Wouldn't it make sense to reuse the "did task type change?" logic? If you are not changing the task type, the modal should probably never appear? |
@philippotto Thanks for the thorough testing!
It would be really cool if you could do another round of testing :) |
…ommended-settings
@rschwanhold In order to make this feature even more useful we want to persist the |
…ds/webknossos into recommended-settings
@daniel-wer I have added the |
isSuperUser = false, | ||
isDeactivated = !isActive | ||
isDeactivated = !isActive, | ||
lastTaskTypeId = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fm3 why do I need to specify lastTaskTypeId
here but not in InitialDataController
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you get compiler errors if you don’t? I don’t see why it would be a problem to omit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking that back, I got the error also for InitialDataController. I suppose this has something to do with the other named parameters
@rschwanhold or @fm3 Seems to work very well, except that when getting the user, the lastTaskTypeId is an object with an id property instead of just the id as a string: |
@daniel-wer you said that |
@rschwanhold I don't think we'll ever need to set the Do you know why the schema comparison fails on CircleCI? |
…ommended-settings
…ommended-settings
@philippotto In addition to these changes, the lastTaskTypeId of a user is now persisted as well, which allows to really only show the "Task-Type Description" and "Recommended Configuration" Modals if the user traces a different task type than before :) It would be great if you could have a final look and retest the things that failed for you last time :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could have a final look and retest the things that failed for you last time :)
Works for me 👍 :)
@rschwanhold nevermind, I fixed the schema stuff, now scalafmt complains, though. Would be cool if you could fix that :) |
…ossos into recommended-settings
This reverts commit 0f19dbb.
* Revert "Revert "Add Recommended Configuration to Task Types (#3466)" (#3502)" This reverts commit 246fbae. * add route to change the lasttasktypeid * use new taskTypeId route to update user's lastTaskTypeId * add display names and comments to recommended settings * add buttons to remove some of the recommended configuration quickly * uppercase button caption
This PR allows to add a recommended configuration to task types. The recommended config is shown to users when they start to trace a task and their configuration differs from the recommended one. Users can then accept or decline this config which automatically applies it (or not).
The message will not trigger twice if the "Finish and get next task" functionality is used and the user changes settings in the mean time. It will also not trigger if a tracing is continued. However, if the user returns to the dashboard and starts the next task from there, the message will trigger again, although the task type did not change.
The requirement (from discuss) was:
but I'm not sure how to achieve that. We would need to persist the last task type for that.
With the current implementation, I'm afraid users might get annoyed with the configuration recommendations. What do you think?
URL of deployed dev instance (used for testing):
Steps to test:
Create a new task type. Select to "Add Recommended User Settings" and play around with the values, json in the textarea. You should not be able to create the task type with an invalid configuration.
Once you created a task type with a recommended config, click "Edit" in the task type list. The recommended config field should be checked and expanded.
During task type creation, if the recommended config contains errors and you uncheck that you want to add a recommended config, you should still be able to create the task type.
Create a task with a task type with/without a recommended config and get this task as a user.
Open the task to trace. You should see a message informing you about the recommended settings that can be applied or not.
Once you started tracing and reload the page, the message should no longer appear.
Issues: