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

Adjust web side for new tooling changes (Key -> Keys and OrderOnPage) #674

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Joshua-Lester3
Copy link
Collaborator

@Joshua-Lester3 Joshua-Lester3 commented Dec 4, 2024

Description

Adding support for new Tooling side update: adjusting from SiteMapping.Key to Keys as well as sorting by OrderOnPage since the new Tooling update changes how sitemap.json is ordered.

Ensure that your pull request has followed all the steps below:

  • Code compilation
  • Created tests which fail without the change (if possible)
  • All tests passing

@Joshua-Lester3 Joshua-Lester3 force-pushed the BMichaelis/UpdateSitemaps branch from eefdf2d to 3a9a1ca Compare December 4, 2024 00:58
v-on:toggle="!$event.target.open ? expandedTocs.delete(item.key) : expandedTocs.add(item.key)">
<summary :class="{
'toc-content' : item.level==0,
'nested' : item.level>
0,
'current-section': currentPage.some(p => p.key == item.key),
'current-section': currentPage.some(p => JSON.stringify(p.keys) == JSON.stringify(item.keys)),
Copy link
Contributor

@ascott18 ascott18 Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that in other places we're using the first key of a page as something of a canonical key for a page. Can we not just use the first key here as well rather than repeatedly stringifying arrays? (and likewise for other occurrences below)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That definitely makes sense. My reasoning behind trying to find another implementation is I didn't want to assume Keys was non-empty. My only other idea is to add a helper function to check the arrays length then return first element otherwise null, but I wasn't sure if that was the best implementation. Is that what you're thinking for a better alternative?

Also, it's super cool to get feedback from the main maintainer of Coalesce. It's one of my favorite technologies/ideas, maybe aside from LINQ. So yeah, it's cool to virtually meet you :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be invalid for a page to not have any keys? Should add a check for that when building up the TOC data and throw if there is such a page. Then we know its always safe to grab the first key.

This reverts commit 1fb2ffb.

Revert "Change stringify implementation"

This reverts commit 98f4423.

Redo buried changes for key => keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants