forked from ComPlat/chemotion_ELN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Minor fixes & improvements (ComPlat#2232)
* Do not modify Sample object when rendering ElementalCompositionCustom Assigning to `el_composition.data` would cause the sample to be considered as `isEdited`. * Add missing key prop when rendering UserLabels * Do not update state during render in InboxModal Before this change, we would `this.state.sortColumn = ...` during render in order to get the latest value from UserStore. Now we properly listen (and unlisten) for store changes and update the state using `this.setState`. With this change we also set the initial UIStore state when the component mounts and not only when the store state changes. * Remove unused genericEls prop from ManagingActions The ManagingActions component handles syncing genericEls with UserStore itself. No need to pass that information in as prop. * Do not copy UIStore state into local component state We used to copy the state to determine whether the selection had changed or not. However, we can simply calculate that information from the UIStore state without the local state. * Fix showing/hiding preview images in list of Samples * Remove unnecessary UIAction.selectSyncCollection This used to trigger `UIState.handleSelectSyncCollection` which forwarded to `UIStore.handleSelectCollection`. Removing in favour of less indirection. * Use currentTab data stored in UserStore Before this change, we would always reset the currentTab to 0 and not use the data stored in the UserStore. This was fine when we never unmounted/mounted the ElementList component but leads to the undesired effect of not respecting the user's selected tab when we unmount/mount the component. * Remove obsolete `update` prop in ResearchPlanDetails This was used to force a re-render when changing to full screen. It does not seem to be necessary anymore. * Prefer setState over modifying state directly Also fix collection type. JS Array has no `size` property. * Apply store state when ElementsTable mounts * Use setState instead of mutating state directly in ElementsTable
- Loading branch information
Showing
17 changed files
with
117 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.