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

WIP: Nested nav with reporting on usage #9097

Draft
wants to merge 189 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
97e22c1
mdx and import ordering
stevector Apr 26, 2024
9f34a0d
Update index.js
stevector Apr 26, 2024
b9008bd
whitespace fixes
stevector Apr 26, 2024
5eae4c8
merging
stevector Apr 30, 2024
8b93d7f
Merge branch 'main' into mdx-and-css-fixes
rachelwhitton May 9, 2024
5b9f380
BackstopJS init for local VRT (#8989)
rachelwhitton May 9, 2024
d95bca8
removing potentially unneeded component
stevector May 13, 2024
cf75a79
Revert "removing potentially unneeded component"
stevector May 13, 2024
1a872ea
removing releaseHeadlines from MdxWrapper
stevector May 13, 2024
8e731b3
adding more pages to backstop
stevector May 13, 2024
4771556
adding npx to instructions
stevector May 13, 2024
cdc5483
mdx customshortcodes
stevector May 14, 2024
7d58394
Merge remote-tracking branch 'origin/main' into mdx-and-css-fixes
stevector May 20, 2024
6457cd6
Revert "BackstopJS init for local VRT (#8989)"
rachelwhitton Jun 11, 2024
00ebff4
Merge branch 'main' into mdx-and-css-fixes
rachelwhitton Jun 11, 2024
c2f1234
Merge remote-tracking branch 'origin/main' into sidebar-omni-nav
stevector Jun 12, 2024
75cf363
starting on a new sidebar
stevector Jun 12, 2024
885cc88
getting sidebar somewhat functional
stevector Jun 12, 2024
7ed44c1
more sidebar nav playing
stevector Jun 12, 2024
9d7278e
Certification multilevel nav
stevector Jun 12, 2024
3e34cce
Getting certification working with multilevel menu
stevector Jun 12, 2024
03a177a
more sidebar experimenting
stevector Jun 13, 2024
1b194e2
sidebar nav graphql-ing
stevector Jun 13, 2024
31ff665
adding guides to omni nav
stevector Jun 13, 2024
8709fae
adding subtitles
stevector Jun 13, 2024
b3d4279
adding stuff
stevector Jun 13, 2024
fc7a7bf
more nav
stevector Jun 13, 2024
ee637de
link nesting
stevector Jun 13, 2024
179b9c2
more link mucking
stevector Jun 13, 2024
924d411
still working
stevector Jun 13, 2024
6dc44b6
still working
stevector Jun 13, 2024
d52d70e
removing commented out code
stevector Jun 13, 2024
2140f8b
cleanup
stevector Jun 13, 2024
c17c6fb
starting on omni component
stevector Jun 20, 2024
3f74e8f
trying function in separate file
stevector Jun 21, 2024
22d23b4
functioning again
stevector Jun 21, 2024
3c2581c
submenus
stevector Jun 21, 2024
8e33575
wrangling the guides
stevector Jun 24, 2024
79308c9
getting decoupled guides
stevector Jun 24, 2024
4dadd6a
more decouple guiding
stevector Jun 24, 2024
594a25b
more simplification
stevector Jun 24, 2024
7580ee3
splitting up
stevector Jun 25, 2024
8f45d6f
segmenting out guide function
stevector Jun 25, 2024
f094fdf
delete unused files
stevector Jun 25, 2024
eedb013
guide!
stevector Jun 25, 2024
dad90c3
whitespace
stevector Jun 25, 2024
759b79b
more re-arranging
stevector Jun 25, 2024
3cd145a
no errors
stevector Jun 25, 2024
c906c6a
remove unused stuff
stevector Jun 25, 2024
a1e9bfd
no errors with query coming from outside index.js
stevector Jun 25, 2024
9d1300f
more tweaks
stevector Jun 25, 2024
8372bbc
adding OmniSidebarNavWithFallback.js
stevector Jun 25, 2024
90698c8
fallback is working in guide
stevector Jun 25, 2024
0f4046a
whitespace
stevector Jun 25, 2024
3b67d44
using fallback
stevector Jun 25, 2024
957c2d8
more cleanup
stevector Jun 25, 2024
122b92c
getting rid of separate OmniSidebarNavWithFallback
stevector Jun 25, 2024
fa64a51
more cleanup
stevector Jun 26, 2024
49b1c19
link fix
stevector Jul 1, 2024
550ef9b
screenshot testing nav
stevector Jul 1, 2024
2c8572d
update prettier
stevector Jul 1, 2024
e4f05fb
running prettier
stevector Jul 1, 2024
a914402
switching prettier standard based on internal discussion
stevector Jul 1, 2024
7705f80
adding eslint
stevector Jul 1, 2024
f84fc28
adding eslint
stevector Jul 1, 2024
c3d5fc8
Revert "adding eslint"
stevector Jul 1, 2024
3e839b5
Revert "adding eslint"
stevector Jul 1, 2024
54aabfb
Revert "running prettier"
stevector Jul 1, 2024
72e6097
small prettier formatting
stevector Jul 1, 2024
31c1954
formatting
stevector Jul 1, 2024
7715255
manual spacing
stevector Jul 1, 2024
14c826b
more manual
stevector Jul 1, 2024
3f1cc9c
manual formatting
stevector Jul 1, 2024
708a88b
prettier with manual fix
stevector Jul 1, 2024
1875b16
prettier fixes
stevector Jul 1, 2024
9e185ef
simplify regex
stevector Jul 2, 2024
7f95a83
prettier comment
stevector Jul 2, 2024
3737121
Revert "prettier comment"
stevector Jul 2, 2024
05b2c70
going back to work regex
stevector Jul 2, 2024
ab1beb2
I do not even need the regex
stevector Jul 2, 2024
5af02ea
adding vitest
stevector Jul 3, 2024
cc5dda8
adding unit tests samples
stevector Jul 3, 2024
087f29a
moving helper functions to their own file
stevector Jul 3, 2024
4f710c5
more testing
stevector Jul 3, 2024
e20af5d
query in its own file
stevector Jul 3, 2024
6c641d5
more unit testing
stevector Jul 3, 2024
e7a6270
one more unit test
stevector Jul 4, 2024
676ec4a
fix
stevector Jul 4, 2024
eb4053c
removing helper functions that were too small
stevector Jul 4, 2024
84fb491
more moving helper functions
stevector Jul 4, 2024
7d99ac9
moving deck chairs
stevector Jul 4, 2024
3cb3fb7
removing a too small function. And removing sample unit test
stevector Jul 4, 2024
53f28e5
deleting separate sidebarNav component
stevector Jul 4, 2024
5e94008
moving test fixture
stevector Jul 4, 2024
fc9f98c
simplyfing a function
stevector Jul 4, 2024
938f290
simplify data structures
stevector Jul 4, 2024
5c58736
running prettier
stevector Jul 4, 2024
64d0353
checking for search js before adding it
stevector Jul 10, 2024
1a05428
Merge branch 'fixing-search-hmr' into nested-cert-nav
stevector Jul 10, 2024
8eb4198
Merge remote-tracking branch 'origin/main' into nested-cert-nav
stevector Jul 10, 2024
81a27f5
cleanup
stevector Jul 10, 2024
ff83e64
adding some doc blocks and minor refactor
stevector Jul 10, 2024
15270c0
docs and cleanup
stevector Jul 10, 2024
31bdf60
more comments
stevector Jul 10, 2024
326b254
more cleanup
stevector Jul 10, 2024
bbcae6c
more comments more tests
stevector Jul 10, 2024
472c5de
adding all the front-end sites guides
stevector Jul 10, 2024
07e534e
removing extra nav alert in the middle of decouple overview pages
stevector Jul 10, 2024
f4a2fb8
running prettier
stevector Jul 10, 2024
4ba6420
going back to old prettier config files. Redo this change under https…
stevector Jul 10, 2024
d427598
reporting files
stevector Jul 10, 2024
6a36bb7
reporting tests
stevector Jul 10, 2024
c8dcac5
more reporting tools
stevector Jul 11, 2024
f77f27a
tests for reporting
stevector Jul 11, 2024
c30beb8
more tests and console logging
stevector Jul 11, 2024
b7b25ab
moving reporting function
stevector Jul 11, 2024
778e8c3
more testing of reporting
stevector Jul 11, 2024
0d6df2b
reporting
stevector Jul 11, 2024
74b953c
getting percentages calculated
stevector Jul 11, 2024
0451c76
adding contributors for exceptions examples
stevector Jul 11, 2024
023e536
starting to unwind logic error that had percentages reversed
stevector Jul 11, 2024
f357ccf
fixing logic
stevector Jul 11, 2024
936e947
more logic fixing
stevector Jul 11, 2024
452aa7c
getting close
stevector Jul 11, 2024
c98e38a
8%!
stevector Jul 11, 2024
98da549
removing unused stuff
stevector Jul 12, 2024
0e33875
adding to menu
stevector Jul 12, 2024
da3aa99
more menus
stevector Jul 12, 2024
8509cd5
55%
stevector Jul 12, 2024
4651122
migrating and upgrading guides
stevector Jul 12, 2024
a5e41f8
more guides in menus
stevector Jul 12, 2024
e28a8d6
199!
stevector Jul 12, 2024
28d12cc
updating exceptions
stevector Jul 13, 2024
4eb0e08
Adding menu to video template
stevector Jul 13, 2024
2f19712
putting omni items in doc template
stevector Jul 13, 2024
25c4965
starting on DNS
stevector Jul 13, 2024
bba2b24
putting everything in a menu
stevector Jul 13, 2024
7ff67e2
more sidebars
stevector Jul 14, 2024
d18ff1a
moving simpleLink to helper
stevector Jul 14, 2024
866cc48
breaking out file for submenu
stevector Jul 14, 2024
e7a46aa
breaking out menus
stevector Jul 14, 2024
fded07e
two more
stevector Jul 14, 2024
17d7567
breaking out menus
stevector Jul 14, 2024
3392681
assigning menus
stevector Jul 14, 2024
2fa7813
a few more assignments
stevector Jul 14, 2024
89f2b3b
getting doc template with sidebar
stevector Jul 14, 2024
762155e
dns menus
stevector Jul 14, 2024
ca95d9b
lots of menu moving
stevector Jul 15, 2024
c591782
Drupal and WordPress separate menus
stevector Jul 15, 2024
3a682de
moving menus
stevector Jul 15, 2024
da46542
adding about section
stevector Jul 15, 2024
067ec7c
everything in a top level menu
stevector Jul 15, 2024
a720fb7
build tools menu link
stevector Jul 15, 2024
f69b2b0
comment about nested docroot
stevector Jul 17, 2024
c969c73
Merge remote-tracking branch 'origin/main' into nested-cert-nav
stevector Jul 24, 2024
4311b81
starting to add a styling file for omnisidebarnav
stevector Jul 24, 2024
1a8a51f
starting on styling
stevector Jul 24, 2024
e237ecd
getting external link indicator working
stevector Jul 24, 2024
88b62ec
merging main
stevector Jul 24, 2024
a7aee27
remove extra arrow in link
stevector Jul 24, 2024
a86a02b
removing console.log
stevector Jul 24, 2024
7e1e0c3
merging
stevector Jul 24, 2024
b9345f1
workflows()
stevector Jul 24, 2024
5dd01da
getting rendering of default docs pages working
stevector Jul 24, 2024
1121257
code organizing
stevector Jul 24, 2024
1179834
adding comment
stevector Jul 25, 2024
cc1d08e
adding comments
stevector Jul 25, 2024
096ed92
reporting on status codes
stevector Jul 25, 2024
8649e70
Moving submenus around
stevector Jul 25, 2024
9a27b0e
more
stevector Jul 25, 2024
0999f9e
Adding label
stevector Jul 26, 2024
4d23c39
Merge remote-tracking branch 'origin/main' into nested-nav---reporting
stevector Aug 5, 2024
8468bfa
Add vitest to GitHub actions (#9162)
jazzsequence Aug 8, 2024
991ee46
moving icon to back and setting to small
stevector Aug 16, 2024
1deca10
merge
stevector Aug 16, 2024
ca1475e
Merge remote-tracking branch 'origin/main' into nested-cert-nav
stevector Oct 7, 2024
34ca4e2
testing readme
stevector Oct 7, 2024
3ebd2d6
fixing link
stevector Oct 7, 2024
3ea6421
copy fix
stevector Oct 7, 2024
df5f62d
changing addsearch back
stevector Oct 7, 2024
e2d3f13
addsearch back
stevector Oct 7, 2024
d0959e4
adding vite.config.ts
stevector Oct 7, 2024
efedf9c
Merge remote-tracking branch 'origin/nested-cert-nav' into nested-nav…
stevector Oct 7, 2024
783c613
some menu restructuring
stevector Oct 16, 2024
4a5e8d4
menu reorgs
stevector Oct 16, 2024
9e15bc5
fixing page title
stevector Oct 16, 2024
cbc7ecf
drupal notes and DNS titles
stevector Oct 16, 2024
17b2370
Refining menus with Rachel and Chris. And adding some JS todos
stevector Oct 16, 2024
d8548aa
more menu tweaks with Rachel and Chris
stevector Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/vitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: JavaScript Unit Tests
on:
pull_request:
paths:
- 'src/**'
- '.github/workflows/vitest.yml'
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'latest'
- run: npm ci
- run: npx vitest src/components
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,19 @@ You can view the local environment at `localhost:8000/`. Updates to docs are aut

## Testing

We include several tools to test that new content doesn't break the documentation. Most of these tests are performed automatically by our continuous integration service, but pull requests created from external contributors aren't included in CI tests. If you want to manually test your branch, you can execute the following tests within the Docker container.
To reduced the likelihood of regressions and bugs this site uses a few different testing tools:

### Merge Conflicts
### Visual Regression Tests

To check for merge conflict messages accidentally committed into the docs, run `merge_conflicts.sh` from `scripts`.
Within the [`tests`](/tests/) directory there are a number of visual regression tests that can be run to compare the current state of the site to a PR preview or the live site.
These tests are meant to be run locally instead of CI as they have a high rate of false positives.

### Unit Tests

Unit tests for custom logic are written in in Vitest and can be executed with

```bash
npx vitest src/components
```

These tests are executed in CI via a [GitHub Action](.github/workflows/vitest.yml).
41 changes: 41 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,46 @@ exports.onPreBootstrap = () => {
fs.copySync(scriptsCopyFrom, scriptsCopyTo)
}



exports.onPostBuild = async ({ graphql, getNodes }) => {
// Fetch all pages created by Gatsby
const pages = getNodes().filter(node => node.internal.type === 'SitePage');


//console.log('pages', pages);
//loop over pages and log the path
const pagePaths = pages.map(page => page.path);
console.log('pagePaths', pagePaths);
pages.forEach(page => {
console.log('path', page.path);
});

// const exceptions = ['https://certification.pantheon.io/', '/404.html'];
// const OmniItems = getOmniItems();
// const menuReport = calculateNumberOfPathsInMenu(pagePaths, OmniItems, exceptions);
// console.log('menuReport', menuReport);

fs.writeFile('all-written-paths.txt', JSON.stringify(pagePaths, null, 2), (err) => {
if (err) throw err;
console.log('The file has been saved!');
});


// // Read the menu links from your menu file (assuming it's a JSON file)
// const menuFilePath = path.resolve(__dirname, 'src/data/menu.json');
// const menuData = JSON.parse(fs.readFileSync(menuFilePath, 'utf-8'));

// // Extract the paths from the menu links
// const menuLinks = menuData.map(item => item.path);

// // Check how many pages are in the menu
// const pagesInMenu = pages.filter(page => menuLinks.includes(page.path));

// console.log(`Total Pages Created by Gatsby: ${pages.length}`);
// console.log(`Total Pages in Menu: ${pagesInMenu.length}`);
};


/* todo should there be an error thrown if a release note category is set that is not allowed */
/* todo, infer published date from file name. And throw an error if there are files that don't follow the pattern. */
1 change: 1 addition & 0 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const onRenderBody = ({ setPostBodyComponents }) => {
<script key="jquery" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js" />,
<script key="bootstrap" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" />,
<script key="twitter" src="https://platform.twitter.com/widgets.js" />,

// OneTrust Banner
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="fba5027b-04c0-4165-8778-4e10fb9f5fa3" />,
function OptanonWrapper() {
Expand Down
Loading
Loading