-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add button to save current view configuration as default in view mode #7205
Conversation
@normanrz could you please take a better example image that has the same style as the other images from the docs once this pr is merged? |
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 functionality 👍 Please see my suggestions and remarks.
I'll report back after testing 🐒
frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx
Show resolved
Hide resolved
Regarding my comment #7205 (comment) I tested which settings are saved and restored when using the new functionality and it seems to be all-of-them (all dataset-related settings). This is in contrast to the existing configuration UI where only the values you mentioned can be modified. We need to decide whether (a) it's fine that the new functionality is more powerful, (b) the existing UI should be extended to have the same capabilities, or (c) the new functionality should be restricted to only persist the values that can be modified in the existing UI. I made a screenshot of the settings before. Then, I modified all settings, saved using the new functionality and opened the dataset with a new user:
Apart from that inconsistency, the functionality works very well :) |
Co-authored-by: Daniel <[email protected]>
…ate-default-layer-config-in-viewmode
…ate-default-layer-config-in-viewmode
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.
Looking very good, with one small issue remaining.
The layer configuration in the dataset view settings doesn't currently allow to change: brightness, contrast, min, max
I think these should be added to the schema so they can be changed (and documentation in the table at the right should be added, too).
I am pretty sure that brightness and contrast were replaced with As discussed I reworked the UI and made the |
…ate-default-layer-config-in-viewmode
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.
Thank you for the newest improvements. I have a couple of small remarks, but afterwards this PR should be ready to be merged 👍
frontend/javascripts/dashboard/dataset/dataset_settings_viewconfig_tab.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/types/schemas/dataset_view_configuration_defaults.ts
Outdated
Show resolved
Hide resolved
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.
Thanks for the review daniel. I hope everything should be fine now.
frontend/javascripts/dashboard/dataset/dataset_settings_viewconfig_tab.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/types/schemas/dataset_view_configuration_defaults.ts
Outdated
Show resolved
Hide resolved
…scalableminds/webknossos into update-default-layer-config-in-viewmode
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, LGTM 👍
After I tested the last TODO, I'll merge 👍
|
Sadly, (but obviously) this pr did not work with #7188 out of the box. I had to add a missing form item that enables the user to manipulate and save the order of the color layers. The current version looks like this: @philippotto @daniel-wer Do you think this UI is okayish enough? / Do you have suggestions? Maybe some horizontal line between the list elements? |
I think, it's alright if it is collapsed by default 👍 Alternatively, one could use the layer order from the JSON, but this is quite indirect (would need a tooltip or something similar) and annoying to change. So, I'd say, stick to your current way :) |
@philippotto Could you take over the review? Imo you should only check the new color layer order setting I added in the last commits and test whether the feature works on a deployed test instance. |
frontend/javascripts/dashboard/dataset/color_layer_ordering_component.tsx
Outdated
Show resolved
Hide resolved
Code looks good, but I couldn't change the layer order for this DS: https://updatedefaultlayerconfiginviewmode.webknossos.xyz/datasets/sample_organization/idr0101A-4d/edit |
@@ -71,6 +98,7 @@ export const enforceValidatedDatasetViewConfiguration = ( | |||
: _.pickBy(layerConfigDefault, (value: any) => value !== null); | |||
} | |||
}); | |||
ensureDatasetSettingsHasLayerOrder(datasetViewConfiguration, dataset); |
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.
Code looks good, but I couldn't change the layer order for this DS: https://updatedefaultlayerconfiginviewmode.webknossos.xyz/datasets/sample_organization/idr0101A-4d/edit
even though it has multiple color layers?
Thanks for finding this bug 🔍.
This line should fix the bug (according to my testing).
The problem was I added the new property colorLayerOrder
(see #7188) and that it is expected to be always present in a validated DatasetConfiguration
. But the backend does not send this property if it wasn't set by the frontend previously.
Previous to my changes, the property was only enforced during model initialization (see changes in model initialization
). But the enforcing of the property with correct values must be done every time when working with a DatasetConfiguration
. Thus it made more sense to me, to move the enforcing code to the enforceValidatedDatasetViewConfiguration
function.
This covers the bug, as this function is explicitly called in dataset_settings_view.tsx
after it is fetched from the backend.
Additionally, the enforceValidatedDatasetViewConfiguration
is also enforced for the model initialization as it is part of the getDatasetViewConfiguration
API backend call in admin_rest_api.ts
which is called during the model initialization to fetch the DatasetConfig
from the backend.
Could you please retest the changes (once the CI is done)?
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.
Hm, it still doesn't work for me here? 🤔 Does it work for you?
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.
Great, now it works :)
…ate-default-layer-config-in-viewmode
…scalableminds/webknossos into update-default-layer-config-in-viewmode
URL of deployed dev instance (used for testing):
Steps to test:
TODOs:
Issues:
(Please delete unneeded items, merge only when none are left open)