hale-commenting-system 2.2.94 → 2.2.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hale-commenting-system",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.97",
|
|
4
4
|
"description": "A commenting system for PatternFly React applications that allows designers and developers to add comments directly on design pages, sync with GitHub Issues, and link Jira tickets.",
|
|
5
5
|
"repository": "https://github.com/patternfly/patternfly-react-seed.git",
|
|
6
6
|
"homepage": "https://www.npmjs.com/package/hale-commenting-system",
|
package/scripts/integrate.js
CHANGED
|
@@ -1288,14 +1288,40 @@ function modifyAppLayoutTsx(filePath) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
1290
|
// Step 3: Add the special renderNavGroup logic
|
|
1291
|
-
//
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1291
|
+
// Replace the simple arrow function with a block function that has special Comments handling
|
|
1292
|
+
if (!content.includes("group.label === 'Comments'")) {
|
|
1293
|
+
// Find the renderNavGroup function - handle both arrow expression () => (...) and block () => {...}
|
|
1294
|
+
const arrowFuncMatch = content.match(/const\s+renderNavGroup\s*=\s*\(([^)]+)\)\s*=>\s*\(/);
|
|
1295
|
+
|
|
1296
|
+
if (arrowFuncMatch) {
|
|
1297
|
+
const params = arrowFuncMatch[1];
|
|
1298
|
+
|
|
1299
|
+
// Find the entire function including the closing parenthesis and semicolon
|
|
1300
|
+
const funcStart = content.indexOf(arrowFuncMatch[0]);
|
|
1301
|
+
const afterArrow = funcStart + arrowFuncMatch[0].length;
|
|
1302
|
+
|
|
1303
|
+
// Find matching closing paren and semicolon
|
|
1304
|
+
let depth = 1;
|
|
1305
|
+
let endPos = afterArrow;
|
|
1306
|
+
for (let i = afterArrow; i < content.length; i++) {
|
|
1307
|
+
if (content.charAt(i) === '(') depth++;
|
|
1308
|
+
if (content.charAt(i) === ')') {
|
|
1309
|
+
depth--;
|
|
1310
|
+
if (depth === 0) {
|
|
1311
|
+
// Found the closing paren, now find the semicolon
|
|
1312
|
+
endPos = i + 1;
|
|
1313
|
+
while (endPos < content.length && content.charAt(endPos).trim() === '') endPos++;
|
|
1314
|
+
if (content.charAt(endPos) === ';') endPos++;
|
|
1315
|
+
break;
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
// Extract the original NavExpandable JSX (we'll use it as the default case)
|
|
1321
|
+
const originalBody = content.slice(funcStart + arrowFuncMatch[0].length - 1, endPos - 1); // Remove opening ( and closing );
|
|
1322
|
+
|
|
1323
|
+
// Create the new block function
|
|
1324
|
+
const newFunction = `const renderNavGroup = (${params}) => {
|
|
1299
1325
|
// Special handling for Comments group
|
|
1300
1326
|
if (group.label === 'Comments') {
|
|
1301
1327
|
return (
|
|
@@ -1381,9 +1407,12 @@ function modifyAppLayoutTsx(filePath) {
|
|
|
1381
1407
|
}
|
|
1382
1408
|
|
|
1383
1409
|
// Default handling for other groups
|
|
1384
|
-
|
|
1410
|
+
return ${originalBody};
|
|
1411
|
+
};`;
|
|
1385
1412
|
|
|
1386
|
-
|
|
1413
|
+
// Replace the old function with the new one
|
|
1414
|
+
content = content.slice(0, funcStart) + newFunction + content.slice(endPos);
|
|
1415
|
+
}
|
|
1387
1416
|
}
|
|
1388
1417
|
|
|
1389
1418
|
// Step 4: Wrap Page children if not already done
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve the react seed
|
|
4
|
-
title: ''
|
|
5
|
-
labels: needs triage
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
**Describe the bug**
|
|
11
|
-
A clear and concise description of what the bug is.
|
|
12
|
-
|
|
13
|
-
**To Reproduce**
|
|
14
|
-
Steps to reproduce the behavior
|
|
15
|
-
|
|
16
|
-
**Expected behavior**
|
|
17
|
-
A clear and concise description of what you expected to happen.
|
|
18
|
-
|
|
19
|
-
**Screenshots**
|
|
20
|
-
If applicable, add screenshots to help explain your problem.
|
|
21
|
-
|
|
22
|
-
**Additional context**
|
|
23
|
-
Add any other context about the problem here.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
- release*
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
lint:
|
|
11
|
-
name: Lint
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout
|
|
15
|
-
uses: actions/checkout@v3
|
|
16
|
-
- name: Setup Node.js
|
|
17
|
-
uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version: lts/*
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: npm install
|
|
22
|
-
- name: Run eslint
|
|
23
|
-
run: npm run lint
|
|
24
|
-
test:
|
|
25
|
-
name: Test
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
steps:
|
|
28
|
-
- name: Checkout
|
|
29
|
-
uses: actions/checkout@v3
|
|
30
|
-
- name: Setup Node.js
|
|
31
|
-
uses: actions/setup-node@v3
|
|
32
|
-
with:
|
|
33
|
-
node-version: lts/*
|
|
34
|
-
- name: Install dependencies
|
|
35
|
-
run: npm install
|
|
36
|
-
- name: Run tests
|
|
37
|
-
run: npm run test
|
|
38
|
-
build:
|
|
39
|
-
name: Build
|
|
40
|
-
runs-on: ubuntu-latest
|
|
41
|
-
steps:
|
|
42
|
-
- name: Checkout
|
|
43
|
-
uses: actions/checkout@v3
|
|
44
|
-
- name: Setup Node.js
|
|
45
|
-
uses: actions/setup-node@v3
|
|
46
|
-
with:
|
|
47
|
-
node-version: lts/*
|
|
48
|
-
- name: Install dependencies
|
|
49
|
-
run: npm install
|
|
50
|
-
- name: Attempt a build
|
|
51
|
-
run: npm run build
|
|
@@ -1,524 +0,0 @@
|
|
|
1
|
-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
-
|
|
3
|
-
exports[`App tests > should render default App component 1`] = `
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<div
|
|
6
|
-
class="pf-v6-c-page"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
class="pf-v6-c-skip-to-content"
|
|
10
|
-
>
|
|
11
|
-
<a
|
|
12
|
-
class="pf-v6-c-button pf-m-primary"
|
|
13
|
-
data-ouia-component-id="OUIA-Generated-Button-primary-1"
|
|
14
|
-
data-ouia-component-type="PF6/Button"
|
|
15
|
-
data-ouia-safe="true"
|
|
16
|
-
href="#primary-app-container"
|
|
17
|
-
>
|
|
18
|
-
<span
|
|
19
|
-
class="pf-v6-c-button__text"
|
|
20
|
-
>
|
|
21
|
-
Skip to Content
|
|
22
|
-
</span>
|
|
23
|
-
</a>
|
|
24
|
-
</div>
|
|
25
|
-
<header
|
|
26
|
-
class="pf-v6-c-masthead pf-m-display-inline-on-md"
|
|
27
|
-
>
|
|
28
|
-
<div
|
|
29
|
-
class="pf-v6-c-masthead__main"
|
|
30
|
-
>
|
|
31
|
-
<span
|
|
32
|
-
class="pf-v6-c-masthead__toggle"
|
|
33
|
-
>
|
|
34
|
-
<button
|
|
35
|
-
aria-label="Global navigation"
|
|
36
|
-
class="pf-v6-c-button pf-m-plain"
|
|
37
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
38
|
-
data-ouia-component-type="PF6/Button"
|
|
39
|
-
data-ouia-safe="true"
|
|
40
|
-
type="button"
|
|
41
|
-
>
|
|
42
|
-
<span
|
|
43
|
-
class="pf-v6-c-button__icon"
|
|
44
|
-
>
|
|
45
|
-
<svg
|
|
46
|
-
aria-hidden="true"
|
|
47
|
-
class="pf-v6-svg"
|
|
48
|
-
fill="currentColor"
|
|
49
|
-
height="1em"
|
|
50
|
-
role="img"
|
|
51
|
-
viewBox="0 0 448 512"
|
|
52
|
-
width="1em"
|
|
53
|
-
>
|
|
54
|
-
<path
|
|
55
|
-
d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"
|
|
56
|
-
/>
|
|
57
|
-
</svg>
|
|
58
|
-
</span>
|
|
59
|
-
</button>
|
|
60
|
-
</span>
|
|
61
|
-
<div
|
|
62
|
-
class="pf-v6-c-masthead__brand"
|
|
63
|
-
data-codemods="true"
|
|
64
|
-
>
|
|
65
|
-
<span
|
|
66
|
-
class="pf-v6-c-masthead__logo"
|
|
67
|
-
data-codemods="true"
|
|
68
|
-
>
|
|
69
|
-
<svg
|
|
70
|
-
height="40px"
|
|
71
|
-
viewBox="0 0 679 158"
|
|
72
|
-
>
|
|
73
|
-
<title>
|
|
74
|
-
PatternFly logo
|
|
75
|
-
</title>
|
|
76
|
-
<defs>
|
|
77
|
-
<lineargradient
|
|
78
|
-
id="linearGradient-basic-masthead"
|
|
79
|
-
x1="68%"
|
|
80
|
-
x2="32%"
|
|
81
|
-
y1="2.25860997e-13%"
|
|
82
|
-
y2="100%"
|
|
83
|
-
>
|
|
84
|
-
<stop
|
|
85
|
-
offset="0%"
|
|
86
|
-
stop-color="#2B9AF3"
|
|
87
|
-
/>
|
|
88
|
-
<stop
|
|
89
|
-
offset="100%"
|
|
90
|
-
stop-color="#73BCF7"
|
|
91
|
-
stop-opacity="0.502212631"
|
|
92
|
-
/>
|
|
93
|
-
</lineargradient>
|
|
94
|
-
</defs>
|
|
95
|
-
<g
|
|
96
|
-
fill="none"
|
|
97
|
-
fill-rule="evenodd"
|
|
98
|
-
stroke="none"
|
|
99
|
-
stroke-width="1"
|
|
100
|
-
>
|
|
101
|
-
<g
|
|
102
|
-
fill="var(--pf-t--global--text--color--regular)"
|
|
103
|
-
fill-rule="nonzero"
|
|
104
|
-
transform="translate(206.000000, 45.750000)"
|
|
105
|
-
>
|
|
106
|
-
<path
|
|
107
|
-
d="M0,65.25 L0,2.25 L33.21,2.25 C37.35,2.25 41.025,3.135 44.235,4.905 C47.445,6.675 49.98,9.09 51.84,12.15 C53.7,15.21 54.63,18.72 54.63,22.68 C54.63,26.46 53.7,29.865 51.84,32.895 C49.98,35.925 47.43,38.31 44.19,40.05 C40.95,41.79 37.29,42.66 33.21,42.66 L15.48,42.66 L15.48,65.25 L0,65.25 Z M15.48,29.88 L31.41,29.88 C33.69,29.88 35.52,29.22 36.9,27.9 C38.28,26.58 38.97,24.87 38.97,22.77 C38.97,20.61 38.28,18.855 36.9,17.505 C35.52,16.155 33.69,15.48 31.41,15.48 L15.48,15.48 L15.48,29.88 Z"
|
|
108
|
-
/>
|
|
109
|
-
<path
|
|
110
|
-
d="M77.04,66.06 C73.68,66.06 70.695,65.43 68.085,64.17 C65.475,62.91 63.435,61.17 61.965,58.95 C60.495,56.73 59.76,54.18 59.76,51.3 C59.76,46.74 61.485,43.215 64.935,40.725 C68.385,38.235 73.2,36.99 79.38,36.99 C83.1,36.99 86.7,37.44 90.18,38.34 L90.18,36 C90.18,31.26 87.15,28.89 81.09,28.89 C77.49,28.89 72.69,30.15 66.69,32.67 L61.47,21.96 C69.15,18.48 76.56,16.74 83.7,16.74 C90.3,16.74 95.43,18.315 99.09,21.465 C102.75,24.615 104.58,29.04 104.58,34.74 L104.58,65.25 L90.18,65.25 L90.18,62.37 C88.26,63.69 86.235,64.635 84.105,65.205 C81.975,65.775 79.62,66.06 77.04,66.06 Z M73.62,51.03 C73.62,52.53 74.28,53.7 75.6,54.54 C76.92,55.38 78.75,55.8 81.09,55.8 C84.69,55.8 87.72,55.05 90.18,53.55 L90.18,47.43 C87.42,46.71 84.54,46.35 81.54,46.35 C79.02,46.35 77.07,46.755 75.69,47.565 C74.31,48.375 73.62,49.53 73.62,51.03 Z"
|
|
111
|
-
/>
|
|
112
|
-
<path
|
|
113
|
-
d="M137.25,65.88 C125.73,65.88 119.97,60.84 119.97,50.76 L119.97,29.79 L110.34,29.79 L110.34,17.64 L119.97,17.64 L119.97,5.4 L134.55,2.25 L134.55,17.64 L147.87,17.64 L147.87,29.79 L134.55,29.79 L134.55,47.88 C134.55,49.98 135.015,51.465 135.945,52.335 C136.875,53.205 138.51,53.64 140.85,53.64 C143.01,53.64 145.2,53.31 147.42,52.65 L147.42,64.44 C146.1,64.86 144.42,65.205 142.38,65.475 C140.34,65.745 138.63,65.88 137.25,65.88 Z"
|
|
114
|
-
/>
|
|
115
|
-
<path
|
|
116
|
-
d="M177.57,65.88 C166.05,65.88 160.29,60.84 160.29,50.76 L160.29,29.79 L150.66,29.79 L150.66,17.64 L160.29,17.64 L160.29,5.4 L174.87,2.25 L174.87,17.64 L188.19,17.64 L188.19,29.79 L174.87,29.79 L174.87,47.88 C174.87,49.98 175.335,51.465 176.265,52.335 C177.195,53.205 178.83,53.64 181.17,53.64 C183.33,53.64 185.52,53.31 187.74,52.65 L187.74,64.44 C186.42,64.86 184.74,65.205 182.7,65.475 C180.66,65.745 178.95,65.88 177.57,65.88 Z"
|
|
117
|
-
/>
|
|
118
|
-
<path
|
|
119
|
-
d="M217.62,66.15 C212.76,66.15 208.365,65.055 204.435,62.865 C200.505,60.675 197.4,57.72 195.12,54 C192.84,50.28 191.7,46.11 191.7,41.49 C191.7,36.87 192.795,32.7 194.985,28.98 C197.175,25.26 200.16,22.305 203.94,20.115 C207.72,17.925 211.92,16.83 216.54,16.83 C221.22,16.83 225.36,17.955 228.96,20.205 C232.56,22.455 235.395,25.53 237.465,29.43 C239.535,33.33 240.57,37.8 240.57,42.84 L240.57,46.44 L206.64,46.44 C207.6,48.66 209.1,50.475 211.14,51.885 C213.18,53.295 215.58,54 218.34,54 C222.42,54 225.6,52.8 227.88,50.4 L237.51,58.95 C234.51,61.47 231.435,63.3 228.285,64.44 C225.135,65.58 221.58,66.15 217.62,66.15 Z M206.37,36.27 L226.26,36.27 C225.48,33.99 224.205,32.16 222.435,30.78 C220.665,29.4 218.61,28.71 216.27,28.71 C213.87,28.71 211.8,29.37 210.06,30.69 C208.32,32.01 207.09,33.87 206.37,36.27 Z"
|
|
120
|
-
/>
|
|
121
|
-
<path
|
|
122
|
-
d="M247.41,65.25 L247.41,17.64 L261.99,17.64 L261.99,22.41 C265.23,18.51 269.4,16.56 274.5,16.56 C277.08,16.62 278.91,17.01 279.99,17.73 L279.99,30.42 C277.95,29.46 275.64,28.98 273.06,28.98 C270.78,28.98 268.665,29.505 266.715,30.555 C264.765,31.605 263.19,33.09 261.99,35.01 L261.99,65.25 L247.41,65.25 Z"
|
|
123
|
-
/>
|
|
124
|
-
<path
|
|
125
|
-
d="M286.29,65.25 L286.29,17.64 L300.87,17.64 L300.87,20.88 C304.47,18.12 308.73,16.74 313.65,16.74 C317.37,16.74 320.655,17.55 323.505,19.17 C326.355,20.79 328.59,23.04 330.21,25.92 C331.83,28.8 332.64,32.13 332.64,35.91 L332.64,65.25 L318.06,65.25 L318.06,37.89 C318.06,35.25 317.28,33.15 315.72,31.59 C314.16,30.03 312.06,29.25 309.42,29.25 C305.76,29.25 302.91,30.51 300.87,33.03 L300.87,65.25 L286.29,65.25 Z"
|
|
126
|
-
/>
|
|
127
|
-
<polygon
|
|
128
|
-
points="342 65.25 342 2.25 392.04 2.25 392.04 15.66 357.48 15.66 357.48 27.45 380.52 27.45 380.52 40.41 357.48 40.41 357.48 65.25"
|
|
129
|
-
/>
|
|
130
|
-
<polygon
|
|
131
|
-
points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"
|
|
132
|
-
/>
|
|
133
|
-
<path
|
|
134
|
-
d="M429.21,84.69 C428.07,84.69 426.96,84.645 425.88,84.555 C424.8,84.465 423.9,84.33 423.18,84.15 L423.18,71.73 C424.38,71.97 425.88,72.09 427.68,72.09 C432.36,72.09 435.51,70.05 437.13,65.97 L437.13,65.88 L418.86,17.64 L434.97,17.64 L445.5,47.61 L457.74,17.64 L473.49,17.64 L452.16,67.68 C450.42,71.82 448.5,75.135 446.4,77.625 C444.3,80.115 441.87,81.915 439.11,83.025 C436.35,84.135 433.05,84.69 429.21,84.69 Z"
|
|
135
|
-
/>
|
|
136
|
-
</g>
|
|
137
|
-
<g
|
|
138
|
-
transform="translate(0.000000, 0.000000)"
|
|
139
|
-
>
|
|
140
|
-
<path
|
|
141
|
-
d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z"
|
|
142
|
-
fill="#0066CC"
|
|
143
|
-
/>
|
|
144
|
-
<path
|
|
145
|
-
d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
|
|
146
|
-
fill="url(#linearGradient-basic-masthead)"
|
|
147
|
-
/>
|
|
148
|
-
<path
|
|
149
|
-
d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z"
|
|
150
|
-
fill="url(#linearGradient-basic-masthead)"
|
|
151
|
-
transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
|
|
152
|
-
/>
|
|
153
|
-
</g>
|
|
154
|
-
</g>
|
|
155
|
-
</svg>
|
|
156
|
-
</span>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
</header>
|
|
160
|
-
<div
|
|
161
|
-
aria-hidden="false"
|
|
162
|
-
class="pf-v6-c-page__sidebar pf-m-expanded"
|
|
163
|
-
id="page-sidebar"
|
|
164
|
-
>
|
|
165
|
-
<div
|
|
166
|
-
class="pf-v6-c-page__sidebar-body"
|
|
167
|
-
>
|
|
168
|
-
<nav
|
|
169
|
-
aria-label="Global"
|
|
170
|
-
class="pf-v6-c-nav"
|
|
171
|
-
data-ouia-component-id="OUIA-Generated-Nav-1"
|
|
172
|
-
data-ouia-component-type="PF6/Nav"
|
|
173
|
-
data-ouia-safe="true"
|
|
174
|
-
id="nav-primary-simple"
|
|
175
|
-
>
|
|
176
|
-
<ul
|
|
177
|
-
class="pf-v6-c-nav__list"
|
|
178
|
-
id="nav-list-simple"
|
|
179
|
-
role="list"
|
|
180
|
-
>
|
|
181
|
-
<li
|
|
182
|
-
class="pf-v6-c-nav__item"
|
|
183
|
-
data-ouia-component-id="OUIA-Generated-NavItem-1"
|
|
184
|
-
data-ouia-component-type="PF6/NavItem"
|
|
185
|
-
data-ouia-safe="true"
|
|
186
|
-
>
|
|
187
|
-
<a
|
|
188
|
-
aria-current="page"
|
|
189
|
-
class="pf-v6-c-nav__link pf-m-current active"
|
|
190
|
-
data-discover="true"
|
|
191
|
-
href="/"
|
|
192
|
-
>
|
|
193
|
-
Dashboard
|
|
194
|
-
</a>
|
|
195
|
-
</li>
|
|
196
|
-
<li
|
|
197
|
-
class="pf-v6-c-nav__item"
|
|
198
|
-
data-ouia-component-id="OUIA-Generated-NavItem-2"
|
|
199
|
-
data-ouia-component-type="PF6/NavItem"
|
|
200
|
-
data-ouia-safe="true"
|
|
201
|
-
>
|
|
202
|
-
<a
|
|
203
|
-
class="pf-v6-c-nav__link"
|
|
204
|
-
data-discover="true"
|
|
205
|
-
href="/support"
|
|
206
|
-
>
|
|
207
|
-
Support
|
|
208
|
-
</a>
|
|
209
|
-
</li>
|
|
210
|
-
<li
|
|
211
|
-
class="pf-v6-c-nav__item"
|
|
212
|
-
data-ouia-component-id="OUIA-Generated-NavExpandable-1"
|
|
213
|
-
data-ouia-component-type="PF6/NavExpandable"
|
|
214
|
-
data-ouia-safe="true"
|
|
215
|
-
>
|
|
216
|
-
<button
|
|
217
|
-
aria-expanded="false"
|
|
218
|
-
class="pf-v6-c-nav__link"
|
|
219
|
-
id="Settings-2"
|
|
220
|
-
>
|
|
221
|
-
Settings
|
|
222
|
-
<span
|
|
223
|
-
class="pf-v6-c-nav__toggle"
|
|
224
|
-
>
|
|
225
|
-
<span
|
|
226
|
-
class="pf-v6-c-nav__toggle-icon"
|
|
227
|
-
>
|
|
228
|
-
<svg
|
|
229
|
-
aria-hidden="true"
|
|
230
|
-
class="pf-v6-svg"
|
|
231
|
-
fill="currentColor"
|
|
232
|
-
height="1em"
|
|
233
|
-
role="img"
|
|
234
|
-
viewBox="0 0 256 512"
|
|
235
|
-
width="1em"
|
|
236
|
-
>
|
|
237
|
-
<path
|
|
238
|
-
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
|
|
239
|
-
/>
|
|
240
|
-
</svg>
|
|
241
|
-
</span>
|
|
242
|
-
</span>
|
|
243
|
-
</button>
|
|
244
|
-
<section
|
|
245
|
-
aria-labelledby="Settings-2"
|
|
246
|
-
class="pf-v6-c-nav__subnav"
|
|
247
|
-
hidden=""
|
|
248
|
-
inert=""
|
|
249
|
-
>
|
|
250
|
-
<ul
|
|
251
|
-
class="pf-v6-c-nav__list"
|
|
252
|
-
role="list"
|
|
253
|
-
>
|
|
254
|
-
<li
|
|
255
|
-
class="pf-v6-c-nav__item"
|
|
256
|
-
data-ouia-component-id="OUIA-Generated-NavItem-3"
|
|
257
|
-
data-ouia-component-type="PF6/NavItem"
|
|
258
|
-
data-ouia-safe="true"
|
|
259
|
-
>
|
|
260
|
-
<a
|
|
261
|
-
class="pf-v6-c-nav__link"
|
|
262
|
-
data-discover="true"
|
|
263
|
-
href="/settings/general"
|
|
264
|
-
>
|
|
265
|
-
General
|
|
266
|
-
</a>
|
|
267
|
-
</li>
|
|
268
|
-
<li
|
|
269
|
-
class="pf-v6-c-nav__item"
|
|
270
|
-
data-ouia-component-id="OUIA-Generated-NavItem-4"
|
|
271
|
-
data-ouia-component-type="PF6/NavItem"
|
|
272
|
-
data-ouia-safe="true"
|
|
273
|
-
>
|
|
274
|
-
<a
|
|
275
|
-
class="pf-v6-c-nav__link"
|
|
276
|
-
data-discover="true"
|
|
277
|
-
href="/settings/profile"
|
|
278
|
-
>
|
|
279
|
-
Profile
|
|
280
|
-
</a>
|
|
281
|
-
</li>
|
|
282
|
-
</ul>
|
|
283
|
-
</section>
|
|
284
|
-
</li>
|
|
285
|
-
<li
|
|
286
|
-
class="pf-v6-c-nav__item"
|
|
287
|
-
data-ouia-component-id="OUIA-Generated-NavExpandable-2"
|
|
288
|
-
data-ouia-component-type="PF6/NavExpandable"
|
|
289
|
-
data-ouia-safe="true"
|
|
290
|
-
>
|
|
291
|
-
<button
|
|
292
|
-
aria-expanded="false"
|
|
293
|
-
class="pf-v6-c-nav__link"
|
|
294
|
-
id="Comments-3"
|
|
295
|
-
>
|
|
296
|
-
Comments
|
|
297
|
-
<span
|
|
298
|
-
class="pf-v6-c-nav__toggle"
|
|
299
|
-
>
|
|
300
|
-
<span
|
|
301
|
-
class="pf-v6-c-nav__toggle-icon"
|
|
302
|
-
>
|
|
303
|
-
<svg
|
|
304
|
-
aria-hidden="true"
|
|
305
|
-
class="pf-v6-svg"
|
|
306
|
-
fill="currentColor"
|
|
307
|
-
height="1em"
|
|
308
|
-
role="img"
|
|
309
|
-
viewBox="0 0 256 512"
|
|
310
|
-
width="1em"
|
|
311
|
-
>
|
|
312
|
-
<path
|
|
313
|
-
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
|
|
314
|
-
/>
|
|
315
|
-
</svg>
|
|
316
|
-
</span>
|
|
317
|
-
</span>
|
|
318
|
-
</button>
|
|
319
|
-
<section
|
|
320
|
-
aria-labelledby="Comments-3"
|
|
321
|
-
class="pf-v6-c-nav__subnav"
|
|
322
|
-
hidden=""
|
|
323
|
-
inert=""
|
|
324
|
-
>
|
|
325
|
-
<ul
|
|
326
|
-
class="pf-v6-c-nav__list"
|
|
327
|
-
role="list"
|
|
328
|
-
>
|
|
329
|
-
<li
|
|
330
|
-
class="pf-v6-c-nav__item"
|
|
331
|
-
data-ouia-component-id="OUIA-Generated-NavItem-5"
|
|
332
|
-
data-ouia-component-type="PF6/NavItem"
|
|
333
|
-
data-ouia-safe="true"
|
|
334
|
-
>
|
|
335
|
-
<div
|
|
336
|
-
class="pf-v6-c-nav__link"
|
|
337
|
-
data-comment-controls="true"
|
|
338
|
-
style="display: flex; align-items: center; justify-content: space-between; padding-right: 1rem;"
|
|
339
|
-
>
|
|
340
|
-
<span>
|
|
341
|
-
Enable Comments
|
|
342
|
-
</span>
|
|
343
|
-
<label
|
|
344
|
-
class="pf-v6-c-switch"
|
|
345
|
-
data-ouia-component-id="OUIA-Generated-Switch-1"
|
|
346
|
-
data-ouia-component-type="PF6/Switch"
|
|
347
|
-
data-ouia-safe="true"
|
|
348
|
-
for="comments-enabled-switch"
|
|
349
|
-
>
|
|
350
|
-
<input
|
|
351
|
-
aria-label="Enable or disable comments"
|
|
352
|
-
class="pf-v6-c-switch__input"
|
|
353
|
-
id="comments-enabled-switch"
|
|
354
|
-
role="switch"
|
|
355
|
-
type="checkbox"
|
|
356
|
-
/>
|
|
357
|
-
<span
|
|
358
|
-
class="pf-v6-c-switch__toggle"
|
|
359
|
-
>
|
|
360
|
-
<div
|
|
361
|
-
class="pf-v6-c-switch__toggle-icon"
|
|
362
|
-
>
|
|
363
|
-
<svg
|
|
364
|
-
aria-hidden="true"
|
|
365
|
-
class="pf-v6-svg"
|
|
366
|
-
fill="currentColor"
|
|
367
|
-
height="1em"
|
|
368
|
-
role="img"
|
|
369
|
-
viewBox="0 0 512 512"
|
|
370
|
-
width="1em"
|
|
371
|
-
>
|
|
372
|
-
<path
|
|
373
|
-
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
|
|
374
|
-
/>
|
|
375
|
-
</svg>
|
|
376
|
-
</div>
|
|
377
|
-
</span>
|
|
378
|
-
</label>
|
|
379
|
-
</div>
|
|
380
|
-
</li>
|
|
381
|
-
<li
|
|
382
|
-
class="pf-v6-c-nav__item"
|
|
383
|
-
data-ouia-component-id="OUIA-Generated-NavItem-6"
|
|
384
|
-
data-ouia-component-type="PF6/NavItem"
|
|
385
|
-
data-ouia-safe="true"
|
|
386
|
-
>
|
|
387
|
-
<div
|
|
388
|
-
class="pf-v6-c-nav__link"
|
|
389
|
-
data-comment-controls="true"
|
|
390
|
-
style="display: flex; align-items: center; justify-content: space-between; padding-right: 1rem;"
|
|
391
|
-
>
|
|
392
|
-
<span>
|
|
393
|
-
Page info drawer
|
|
394
|
-
</span>
|
|
395
|
-
<label
|
|
396
|
-
class="pf-v6-c-switch"
|
|
397
|
-
data-ouia-component-id="OUIA-Generated-Switch-2"
|
|
398
|
-
data-ouia-component-type="PF6/Switch"
|
|
399
|
-
data-ouia-safe="true"
|
|
400
|
-
for="page-info-drawer-switch"
|
|
401
|
-
>
|
|
402
|
-
<input
|
|
403
|
-
aria-label="Pin page info drawer open"
|
|
404
|
-
class="pf-v6-c-switch__input"
|
|
405
|
-
id="page-info-drawer-switch"
|
|
406
|
-
role="switch"
|
|
407
|
-
type="checkbox"
|
|
408
|
-
/>
|
|
409
|
-
<span
|
|
410
|
-
class="pf-v6-c-switch__toggle"
|
|
411
|
-
>
|
|
412
|
-
<div
|
|
413
|
-
class="pf-v6-c-switch__toggle-icon"
|
|
414
|
-
>
|
|
415
|
-
<svg
|
|
416
|
-
aria-hidden="true"
|
|
417
|
-
class="pf-v6-svg"
|
|
418
|
-
fill="currentColor"
|
|
419
|
-
height="1em"
|
|
420
|
-
role="img"
|
|
421
|
-
viewBox="0 0 512 512"
|
|
422
|
-
width="1em"
|
|
423
|
-
>
|
|
424
|
-
<path
|
|
425
|
-
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
|
|
426
|
-
/>
|
|
427
|
-
</svg>
|
|
428
|
-
</div>
|
|
429
|
-
</span>
|
|
430
|
-
</label>
|
|
431
|
-
</div>
|
|
432
|
-
</li>
|
|
433
|
-
<li
|
|
434
|
-
class="pf-v6-c-nav__item"
|
|
435
|
-
data-ouia-component-id="OUIA-Generated-NavItem-7"
|
|
436
|
-
data-ouia-component-type="PF6/NavItem"
|
|
437
|
-
data-ouia-safe="true"
|
|
438
|
-
>
|
|
439
|
-
<div
|
|
440
|
-
class="pf-v6-c-nav__link"
|
|
441
|
-
data-comment-controls="true"
|
|
442
|
-
style="display: flex; align-items: center; justify-content: space-between; padding-right: 1rem;"
|
|
443
|
-
>
|
|
444
|
-
<button
|
|
445
|
-
class="pf-v6-c-button pf-m-link pf-m-inline"
|
|
446
|
-
data-ouia-component-id="OUIA-Generated-Button-link-1"
|
|
447
|
-
data-ouia-component-type="PF6/Button"
|
|
448
|
-
data-ouia-safe="true"
|
|
449
|
-
type="button"
|
|
450
|
-
>
|
|
451
|
-
<span
|
|
452
|
-
class="pf-v6-c-button__icon pf-m-start"
|
|
453
|
-
>
|
|
454
|
-
<svg
|
|
455
|
-
aria-hidden="true"
|
|
456
|
-
class="pf-v6-svg"
|
|
457
|
-
fill="currentColor"
|
|
458
|
-
height="1em"
|
|
459
|
-
role="img"
|
|
460
|
-
viewBox="0 0 496 512"
|
|
461
|
-
width="1em"
|
|
462
|
-
>
|
|
463
|
-
<path
|
|
464
|
-
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
|
|
465
|
-
/>
|
|
466
|
-
</svg>
|
|
467
|
-
</span>
|
|
468
|
-
<span
|
|
469
|
-
class="pf-v6-c-button__text"
|
|
470
|
-
>
|
|
471
|
-
Sign in with GitHub
|
|
472
|
-
</span>
|
|
473
|
-
</button>
|
|
474
|
-
</div>
|
|
475
|
-
</li>
|
|
476
|
-
</ul>
|
|
477
|
-
</section>
|
|
478
|
-
</li>
|
|
479
|
-
</ul>
|
|
480
|
-
</nav>
|
|
481
|
-
</div>
|
|
482
|
-
</div>
|
|
483
|
-
<div
|
|
484
|
-
class="pf-v6-c-page__main-container"
|
|
485
|
-
>
|
|
486
|
-
<main
|
|
487
|
-
class="pf-v6-c-page__main"
|
|
488
|
-
id="primary-app-container"
|
|
489
|
-
tabindex="-1"
|
|
490
|
-
>
|
|
491
|
-
<div
|
|
492
|
-
class="pf-v6-c-drawer pf-m-inline"
|
|
493
|
-
>
|
|
494
|
-
<div
|
|
495
|
-
class="pf-v6-c-drawer__main"
|
|
496
|
-
>
|
|
497
|
-
<div
|
|
498
|
-
class="pf-v6-c-drawer__content"
|
|
499
|
-
>
|
|
500
|
-
<div
|
|
501
|
-
class="pf-v6-c-drawer__body"
|
|
502
|
-
style="position: relative;"
|
|
503
|
-
>
|
|
504
|
-
<section
|
|
505
|
-
class="pf-v6-c-page__main-section"
|
|
506
|
-
>
|
|
507
|
-
<h1
|
|
508
|
-
class="pf-v6-c-title pf-m-lg"
|
|
509
|
-
data-ouia-component-id="OUIA-Generated-Title-1"
|
|
510
|
-
data-ouia-component-type="PF6/Title"
|
|
511
|
-
data-ouia-safe="true"
|
|
512
|
-
>
|
|
513
|
-
Dashboard Page Title!
|
|
514
|
-
</h1>
|
|
515
|
-
</section>
|
|
516
|
-
</div>
|
|
517
|
-
</div>
|
|
518
|
-
</div>
|
|
519
|
-
</div>
|
|
520
|
-
</main>
|
|
521
|
-
</div>
|
|
522
|
-
</div>
|
|
523
|
-
</DocumentFragment>
|
|
524
|
-
`;
|
package/src/app/app.test.tsx
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import App from '@app/index';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import userEvent from '@testing-library/user-event';
|
|
5
|
-
import { describe, expect, it, test } from 'vitest';
|
|
6
|
-
|
|
7
|
-
describe('App tests', () => {
|
|
8
|
-
test('should render default App component', () => {
|
|
9
|
-
const { asFragment } = render(<App />);
|
|
10
|
-
|
|
11
|
-
expect(asFragment()).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should render a nav-toggle button', () => {
|
|
15
|
-
render(<App />);
|
|
16
|
-
|
|
17
|
-
expect(screen.getByRole('button', { name: 'Global navigation' })).toBeVisible();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// I'm fairly sure that this test not going to work properly no matter what we do since JSDOM doesn't actually
|
|
21
|
-
// draw anything. We could potentially make something work, likely using a different test environment, but
|
|
22
|
-
// using Cypress for this kind of test would be more efficient.
|
|
23
|
-
it.skip('should hide the sidebar on smaller viewports', () => {
|
|
24
|
-
Object.defineProperty(window, 'innerWidth', { writable: true, configurable: true, value: 600 });
|
|
25
|
-
|
|
26
|
-
render(<App />);
|
|
27
|
-
|
|
28
|
-
window.dispatchEvent(new Event('resize'));
|
|
29
|
-
|
|
30
|
-
expect(screen.queryByRole('link', { name: 'Dashboard' })).not.toBeInTheDocument();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should expand the sidebar on larger viewports', () => {
|
|
34
|
-
render(<App />);
|
|
35
|
-
|
|
36
|
-
window.dispatchEvent(new Event('resize'));
|
|
37
|
-
|
|
38
|
-
expect(screen.getByRole('link', { name: 'Dashboard' })).toBeVisible();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should hide the sidebar when clicking the nav-toggle button', async () => {
|
|
42
|
-
const user = userEvent.setup();
|
|
43
|
-
|
|
44
|
-
render(<App />);
|
|
45
|
-
|
|
46
|
-
window.dispatchEvent(new Event('resize'));
|
|
47
|
-
const button = screen.getByRole('button', { name: 'Global navigation' });
|
|
48
|
-
|
|
49
|
-
expect(screen.getByRole('link', { name: 'Dashboard' })).toBeVisible();
|
|
50
|
-
|
|
51
|
-
await user.click(button);
|
|
52
|
-
|
|
53
|
-
expect(screen.queryByRole('link', { name: 'Dashboard' })).not.toBeInTheDocument();
|
|
54
|
-
});
|
|
55
|
-
});
|