-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/property tree topic #195
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
Merged
+1,486
−1,079
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
b306ae4
First draft of property tree topic
ylvaselling 00c8ce7
Make the new property tree kind of work
ylvaselling 340d6cb
Fix the updating of properties
ylvaselling 12a3494
Remove previous redux for properties & property owners, and switch to…
ylvaselling e2b330f
Fix some bugs
ylvaselling a4af65a
A fancy progress icon
ylvaselling 3e507c9
Some polishing of the checkbox
ylvaselling 3f99532
Throttle time updates
ylvaselling 9cd5f99
First draft of more efficient property setting; minimize dispatches
ylvaselling 4d1f18d
Remove duplicate comment
ylvaselling f0412d6
Make the middleware get the root explicitly
ylvaselling d827caf
Throttle camera updates
ylvaselling cf60a1a
Remove unneccessary subscriptions
ylvaselling 8be7b4a
Rename propertyTreeTest to propertyTree and add remove uri action
ylvaselling d0a9910
Split the usePropertyOwnerVisibility into two hooks and add one for s…
ylvaselling d57c1cc
Fix progress bar icon
ylvaselling a2739ee
Add comments on entity adapters
ylvaselling 7bab1cb
Fix the glitch of the icon
ylvaselling e562cd8
Rename propertyActive to propertyVisible
ylvaselling e4b30f9
Use redux visibility instead of properties to calculate visibility
ylvaselling 5ca4d9c
Some cleanup
ylvaselling 75397ba
Update from useProperty to usePropertyValue where possible, as we don…
ylvaselling f8296d9
Move helper functions from selector file to helpers
ylvaselling 30d5851
Fix some small bugs
ylvaselling 74a9b76
Batch time updates
ylvaselling 2d1d154
Address PR comments from copilot
ylvaselling 82aa4f2
Fix issues with opening a layer
ylvaselling 10ee070
Address PR comment
ylvaselling 9bcf088
Remove suspense as it is not helping
ylvaselling 7b08ada
Replace selectors with usePropertyOwner hooks where possible
ylvaselling 5410134
PR comments and lint fix
ylvaselling 782f11b
Address PR comments
ylvaselling 5f72eb1
Remove refreshing of group as a dispatch listener
ylvaselling 6ad812c
Add visibility for new property owner sgns
ylvaselling 5d655f9
Add explaining comment
ylvaselling c38633d
Fix issue with updating fading correctly
ylvaselling fff3435
Set visibility when adding new property owners
ylvaselling da2678c
Remove unnecessary false
ylvaselling adb9912
Change the fade icon as it was a bit choppy
ylvaselling 62d1c42
Set throttling time to a better value
ylvaselling 862d28c
Lint fix
ylvaselling 20f85cd
Stop showing map markers when delta time is too fast
ylvaselling 71c53ea
Fix render error with visible filter
ylvaselling 4c56a22
Address PR comments
ylvaselling e1dd87c
Fix the bug with making new property updates
ylvaselling 658e9cc
Do some proper type checks for enabled and fade
ylvaselling b216c33
Add visibility calculations if someone upserts many properties
ylvaselling 9878c46
Add some behaviour to the fading action icon
ylvaselling e547f47
Update src/util/batcher.ts
ylvaselling 759e1af
Update src/util/batcher.ts
ylvaselling eafbaa9
Address PR comments
ylvaselling f0f6cc7
Merge branch 'feature/property-tree-topic' of https://github.com/Open…
ylvaselling a2ccecf
Add metadata to property tree topic
ylvaselling 05ca0e9
Address PR comments
ylvaselling 8126a42
Rename propertyTree to propertytree
ylvaselling 9d4f305
Address PR comments
ylvaselling eb766d3
Address PR comments
ylvaselling c86d3f5
Merge remote-tracking branch 'origin/master' into feature/property-tr…
ylvaselling fb0b317
Add comments to batcher
ylvaselling File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import { PropsWithChildren } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { | ||
| Alert, | ||
| AspectRatio, | ||
| BackgroundImage, | ||
| LoadingOverlay, | ||
| MantineStyleProps, | ||
| Text | ||
| } from '@mantine/core'; | ||
|
|
||
| import { useSubscribeToTime } from '@/hooks/topicSubscriptions'; | ||
| import { useAppSelector } from '@/redux/hooks'; | ||
| import { useAnchorNode } from '@/util/propertyTreeHooks'; | ||
|
|
||
| import { useMapPath } from './hooks'; | ||
|
|
||
| // Settings for the OpenSpace marker and view cone | ||
| interface Props extends MantineStyleProps, PropsWithChildren { | ||
| ref?: React.RefObject<HTMLDivElement>; | ||
| refSize?: React.RefObject<HTMLDivElement | null>; | ||
| style?: React.CSSProperties; | ||
| } | ||
|
|
||
| export function Map({ ref, refSize, children, style, ...styleProps }: Props) { | ||
| const { t } = useTranslation('components', { keyPrefix: 'map' }); | ||
| const oneDayPerSecond = 86400; | ||
|
|
||
| const isTimeTooFast = useAppSelector( | ||
| (state) => Math.abs(state.time.targetDeltaTime ?? 0) > oneDayPerSecond | ||
| ); | ||
| const anchor = useAnchorNode(); | ||
| const [mapPath, mapExists] = useMapPath(anchor); | ||
| useSubscribeToTime(); | ||
|
|
||
| if (!anchor) { | ||
| return ( | ||
| <AspectRatio ratio={2} {...styleProps} style={style}> | ||
| <BackgroundImage src={''} /> | ||
| <LoadingOverlay visible={true} /> | ||
| </AspectRatio> | ||
| ); | ||
| } | ||
|
|
||
| if (!mapExists || !anchor) { | ||
| return ( | ||
| <Alert variant={'light'} color={'orange'} title={t('no-map.title')}> | ||
| <Text>{t('no-map.description', { name: anchor?.name })}</Text> | ||
| </Alert> | ||
| ); | ||
| } | ||
| return ( | ||
| <AspectRatio | ||
| ratio={2} | ||
| mx={'auto'} | ||
| miw={300} | ||
| {...styleProps} | ||
| ref={(el) => { | ||
| if (ref && el) { | ||
| ref.current = el; | ||
| } | ||
| if (refSize && el) { | ||
| refSize.current = el; | ||
| } | ||
| }} | ||
ylvaselling marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| style={style} | ||
| > | ||
| <BackgroundImage | ||
| src={mapPath} | ||
| style={{ position: 'relative' }} | ||
| aria-label={t('aria-labels.map', { name: anchor.name })} | ||
| > | ||
| {!isTimeTooFast && children} | ||
| {isTimeTooFast && ( | ||
| <Alert | ||
| variant={'filled'} | ||
| color={'orange'} | ||
| title={t('time-too-fast.title')} | ||
| style={{ position: 'absolute', top: 10, left: 10, right: 10 }} | ||
| > | ||
| {t('time-too-fast.description')} | ||
| </Alert> | ||
| )} | ||
| </BackgroundImage> | ||
| </AspectRatio> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.