forked from hajkmap/Hajk
-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP 2 #3
Open
karljakoblarsson
wants to merge
164
commits into
develop
Choose a base branch
from
feat/layer-switcher-new-take-refactoring-1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
WIP 2 #3
karljakoblarsson
wants to merge
164
commits into
develop
from
feat/layer-switcher-new-take-refactoring-1
Conversation
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
…evel-snackbar-display
Resolved an issue where toggling a parent group's visibility did not accurately reflect the visibility of its sublayers. The `setGroupHidden` and `setGroupVisible` functions were updated to maintain the correct state of `visibleSubLayers`.
…evel-snackbar-display
The following features have been added in this commit: SnackbarProvider.js: - Create `SnackbarContext` to share snackbar state and controls among components. - Implement `SnackbarProvider` component to set up `SnackbarContext` provider using the `useSnackbar` hook from `notistack` for snackbar controls. - Initialize shared state (`messageItems`) to hold list of messages for snackbar display. - Utilize `NotistackSnackbarProvider` to render the snackbar and provide the shared state and functions through `SnackbarContext`, enabling access to snackbar controls and shared state in child components. useSnackbar.js: - Create `useSnackbar` custom hook to manage snackbar messages with methods for adding (`addToSnackbar`), removing (`removeFromSnackbar`), hiding (`hideSnackbar`), displaying snackbar messages without storing (`displaySnackbar`) and clearing all messages (`clearAllMessages`). - Implement functionality to handle group and layer specific snackbar messages for visibility notification of layers at different zoom levels. - Include handling for non-grouped messages, displaying individual messages as standalone notifications. - Add a close action button to each snackbar message and enable automatic control of snackbar visibility duration. App.js: - Update `SnackbarProvider` import statement to use the `SnackbarProvider` component.
…arch-in-layerswitcher
Implement a queue-based system to manage state updates in the `useSnackbar` function to solve race conditions. Changes include: 1. Create a new `updateQueue` ref to hold all state update operations. 2. Adjust `addToSnackbar` and `removeFromSnackbar` to push their state update functions into `updateQueue`, rather than executing them directly. 3. Add a new function `processQueue` that takes the next update function from the queue and executes it. 4. Call `processQueue` in `addToSnackbar` and `removeFromSnackbar` after their update is pushed into the queue, starting the processing of queued updates.
1. Import and implement `useSnackbar` custom hook for managing notifications. This enables addition, removal, and display of Snackbar messages. 2. Update the `listenToZoomChange` and `zoomEndHandler` functions to effectively handle zoom level changes and visibility of the layer at the current zoom level. 3. Refactor render logic to adjust CheckBoxIcon's color based on layer visibility, type, and zoom level.
Changes include: 1. Import and implement `useSnackbar` custom hook in GroupLayer for handling notifications. 2. Use a custom hook within a `useEffect` to remove layer captions from the Snackbar message when the visibility of sublayers in a group changes. 3. Update the `handleLayerItemClick` method in GroupLayer to manage visibility toggling of group layers and remove the appropriate layer captions from the Snackbar message. 4. Pass `zoomVisible` state as a prop from GroupLayer to SubLayerItem component to ensure consistent layer visibility management. 5. Modify the `getLayerToggleIcon` function in SubLayerItem to adjust the icon color based on the zoom visibility.
Import `useSnackbar` in MapCleaner to use `clearAllMessages` that clears all Snackbar messages.
…-add-theme-management
Changes include: - Add features that allow users to create new `Quick Layers` by inputting data into fields. - Ability to add and delete layers. - Import and validate JSON data. - Automatically generate unique IDs for each `Quick Layer`. - All `Quick Layers` are displayed in a list. - Filter feature to search through the list of `Quick Layers`. - A success message is displayed if the save or import was successful, and an error message is shown if the save or import failed.
Add new classes for managing Quick Layers in the backend. Changes include: `LayerMenuOptions.cs`: New property `quickLayersPresets` to store a list of `Quick Layer` presets. `QuickLayer.cs`: This class defines the structure of a `Quick Layer`. `QuickLayerMetadata.cs`: This class holds metadata about a `Quick Layer`. `QuickLayerPreset.cs`: This class represents a `Quick Layer` preset.
We want to be more explicit with our props.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.