Skip to content
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

Identify Panel Does not Show Features' Attributes In Same Order #604

Open
simonprovost opened this issue Apr 5, 2025 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@simonprovost
Copy link

Hi folks!

I realised that when I want to compare to element on the map, identifying them both to analyse on the right hand side identify panel. The order or attributes showing seems pretty random hence hard to "visually" compare.

Would it be possible maybe to order by alphabetical order or any other?

Cheers!

Image
@mfisher87
Copy link
Member

💯

Alphabetical sounds like the way to go! Is it possible these attributes are in inconsistent order in the data file? I would have expected our existing code to leave the order alone, not shuffle it around at all.

@mfisher87 mfisher87 added the enhancement New feature or request label Apr 5, 2025
@simonprovost
Copy link
Author

I first thought this too indeed ^^ ! But looking at this JGIS file it seems fairly ordered, am I missing something?

I mean letting the order alone would be indeed the way to go I'd say so here maybe a tiny bug? Wanna ma to look that around? Any thoughts where to start that out?

(JGIS file sent on Zuliper @mfisher87 )

@mfisher87
Copy link
Member

Wanna ma to look that around? Any thoughts where to start that out?

👋 Always good to see you in GitHub :)

Here's where the identified feature are being displayed:

{Object.entries(feature)
.filter(
([key, value]) =>
typeof value !== 'object' || value === null
)
.map(([key, value]) => (
<div key={key} className="jgis-identify-grid-body">
<strong>{key}:</strong>
{typeof value === 'string' &&
/<\/?[a-z][\s\S]*>/i.test(value) ? (
<span
dangerouslySetInnerHTML={{ __html: `${value}` }}
/>
) : (
<span>{String(value)}</span>
)}
</div>
))}

I think all we need is to sort on key between the filter and map. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants