Conversation
Deploying nmrium with
|
| Latest commit: |
bea3a26
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f7d70c0e.nmrium.pages.dev |
| Branch Preview URL: | https://4032-replace-previous-generi.nmrium.pages.dev |
|
If you find any issues that were not present in the previous implementation, now is the time to report them. It needs to be fixed, before merge this PR. If you find issues but they already here in previous implementation this should not block this PR and open a new issue. |
|
The "Reset workspace preferences" button's is not enabled based on the right condition. I guess it's based on the form being dirty, but it should be based on the workspace being dirty and reset to the last saved state of the workspace (or to the initial value for read-only workspaces) |
|
Ok, I re-checked the previous check. adapt and fixed. const isResetDisabled = useMemo(() => {
if (!isPristine) return false;
const original = getPreferencesByWorkspace(currentName, originalWorkspaces);
return isEqualLodash(current, original);
}, [current, currentName, isPristine, originalWorkspaces]);Method with There is still an edge-case. If the form is not pristine but all values match with original: reset is allowed, but it will reset to the same values. I think it's OK, if not we could remove the first check. |
That sounds OK, but then is there a way for it to become pristine when the click is done? It's confusing that the read-only workspace stays "unsaved" even after clicking on reset. |
|
To reproduce the case:
|
|
Wow it's nice that we found it. It's a real bug (filter order is important)! |
|
I fixed it, (not yet pushed) but form save apply more props than |
Final solution is: * refactor AutoProcessingTab * no codec to transform filters array to record by name because it can reorder the final filters and the order is important. * simplify the components with `withFieldGroup` * to check current form values (transformed to workspace) with the original one. isPristine is not needed anymore. * fix `getPreferencesByWorkspace` with `mergeReplaceArray` strategy * complete `workspaceDefaultProperties` to match with concrete save of the form. * add `satisfies` constraints when properties can be missing (lot of `Partial` and optional props usage in `WorkspacePreferences`)
|
When comparing form behavior, pay attention to the experimental mode. Check it add more fields in the form |
This comment was marked as resolved.
This comment was marked as resolved.
|
I'll finish the review with @lpatiny on Monday |

Closes: #4032
Closes: #3932