Skip to content

Commit da853d8

Browse files
authored
updated node version and other packages (#1341)
* updated node version and other packages * Update Dockerfile * regenerated min css * min css * wip * removed console logs * updated uglidy-js; minify argohub-redirect separately * wip * wip * updated .nvmrc, added prettier rules, updated package.lock * updated .nvmrc, added prettier rules, updated package.lock * fixed gitops layout * formated argohub-redirect * removed commnets
1 parent 4912635 commit da853d8

24 files changed

+13621
-17803
lines changed

.babelrc.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintrc.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"root": true,
3-
"parser": "babel-eslint",
43
"env": {
54
"browser": true,
65
"es6": true
76
},
7+
"parser": "@babel/eslint-parser",
8+
"parserOptions": {
9+
"requireConfigFile": false,
10+
"ecmaVersion": 2022
11+
},
812
"extends": "eslint:recommended",
9-
"plugins": ["compat"],
1013
"rules": {
1114
// Possible Errors
1215
"no-await-in-loop": "error",
1316
"no-extra-parens": "error",
1417
"no-prototype-builtins": "error",
1518
"no-template-curly-in-string": "error",
16-
"compat/compat": "error",
1719
"valid-jsdoc": "error",
1820

1921
// Best Practices

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"endOfLine": "lf",
5+
"printWidth": 120,
6+
"quoteProps": "as-needed",
7+
"proseWrap": "preserve",
8+
"semi": false,
9+
"singleQuote": true,
10+
"tabWidth": 2,
11+
"trailingComma": "es5",
12+
"useTabs": false
13+
}

.stylelintrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"extends": ["stylelint-config-standard", "stylelint-config-recommended-scss"],
3-
"plugins": [
4-
"stylelint-order"
5-
],
2+
"extends": ["stylelint-config-standard-scss"],
3+
"plugins": ["stylelint-scss", "stylelint-order"],
64
"rules": {
75
"at-rule-empty-line-before": [null,
86
"except": ["first-nested"]
97
],
108
"at-rule-name-space-after": "always",
119
"at-rule-no-vendor-prefix": true,
10+
"at-rule-no-unknown": null,
11+
"scss/at-rule-no-unknown": true,
1212
"at-rule-semicolon-space-before": "never",
1313
"block-closing-brace-empty-line-before": null,
1414
"block-closing-brace-newline-after": null,

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ The site is automatically deployed when commits are merged/pushed in `master`, h
1616

1717
To compile scss files into css run the command `npm run css` or in the live mode `npm run watch-css`.
1818
To compile js files into a bundle run the command `npm run js` or in the live mode `npm run watch-js`.
19-
Node version `9.11.2`
2019

2120
### Preview documentation locally (Legacy method)
2221

_includes/scripts.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
const SITE_GITOPS_COLLECTION = "{{ site.gitops_collection }}";
44
const SITE_IS_GITOPS_COLLECTION = "{{ page.collection }}" === "{{ site.gitops_collection }}";
55
</script>
6-
<script src="{{ site.baseurl }}/assets/js/src/argohub-redirect.js"></script>
6+
<script src="{{ site.baseurl }}/assets/js/argohub-redirect/argohub-redirect.min.js"></script>
7+
78

89
<script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
910
<script>window.jQuery || document.write('<script src="{{ site.baseurl }}/assets/js/vendor/jquery.min.js"><\/script>')</script>

assets/css/docs.min.css

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/docs.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/src/argohub-redirect.js renamed to assets/js/argohub-redirect/argohub-redirect.js

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable no-implicit-globals, strict */
2+
/* global SITE_BASE_URL, SITE_GITOPS_COLLECTION, SITE_IS_GITOPS_COLLECTION */
3+
14
const GITOPS_DOC_COOKIE = 'cfdoctype=gitops'
25
const IS_GITOPS_DOC_COOKIE_SET = document.cookie.includes(GITOPS_DOC_COOKIE)
36

@@ -7,9 +10,10 @@ async function getArgoHubRedirectURL(currentPath) {
710
currentPath = currentPath.replace(SITE_BASE_URL, '')
811

912
const redirectMap = await fetchRedirectMap()
10-
1113
const newPath = redirectMap[currentPath]
12-
if (!newPath) return null
14+
if (!newPath) {
15+
return null
16+
}
1317

1418
const newURL =
1519
newPath === `/${SITE_GITOPS_COLLECTION}/`
@@ -20,16 +24,20 @@ async function getArgoHubRedirectURL(currentPath) {
2024
}
2125

2226
async function handleRedirect() {
23-
if (SITE_IS_GITOPS_COLLECTION || !IS_GITOPS_DOC_COOKIE_SET) return
27+
if (SITE_IS_GITOPS_COLLECTION || !IS_GITOPS_DOC_COOKIE_SET) {
28+
return
29+
}
2430

2531
const argoHubRedirectURL = await getArgoHubRedirectURL(location.pathname)
26-
if (!argoHubRedirectURL) return
32+
if (!argoHubRedirectURL) {
33+
return
34+
}
2735

2836
location.href = argoHubRedirectURL
2937
}
3038

3139
async function fetchRedirectMap() {
32-
const response = await fetch(`${SITE_BASE_URL}/assets/js/src/argohub-redirect-mapping.json`)
40+
const response = await fetch(`${SITE_BASE_URL}/assets/js/argohub-redirect/argohub-redirect-mapping.json`)
3341
if (!response.ok) {
3442
throw new Error('Failed to fetch the collections redirect map.')
3543
}
@@ -64,6 +72,7 @@ function toggleSegmentDropdown() {
6472
select.classList.toggle('open')
6573
}
6674

75+
// eslint-disable-next-line no-unused-vars
6776
function handleDropdownKeydown(event) {
6877
const select = document.querySelector('.custom-select')
6978
const options = select.querySelectorAll('.option')
@@ -77,59 +86,33 @@ function handleDropdownKeydown(event) {
7786
break
7887
case 'ArrowDown':
7988
event.preventDefault()
80-
if (!isOpen) toggleSegmentDropdown()
89+
if (!isOpen) {
90+
toggleSegmentDropdown()
91+
}
8192
options[0].focus()
8293
break
8394
case 'Escape':
84-
if (isOpen) toggleSegmentDropdown()
85-
break
86-
}
87-
}
88-
89-
function handleOptionKeydown(event, option, selectedValue) {
90-
const select = document.querySelector('.custom-select')
91-
const options = select.querySelectorAll('.option')
92-
const currentIndex = Array.from(options).indexOf(option)
93-
94-
switch (event.key) {
95-
case 'Enter':
96-
case ' ':
97-
event.preventDefault()
98-
selectSegmentOption(option, selectedValue)
99-
break
100-
case 'ArrowDown':
101-
event.preventDefault()
102-
if (currentIndex < options.length - 1) {
103-
options[currentIndex + 1].focus()
95+
if (isOpen) {
96+
toggleSegmentDropdown()
10497
}
10598
break
106-
case 'ArrowUp':
107-
event.preventDefault()
108-
if (currentIndex > 0) {
109-
options[currentIndex - 1].focus()
110-
}
111-
break
112-
case 'Escape':
113-
select.classList.remove('open')
114-
select.querySelector('.select-display').focus()
99+
default:
115100
break
116101
}
117102
}
118103

119104
async function selectSegmentOption(option, selectedValue) {
120105
const selectDisplay = document.querySelector('.select-display')
121-
122106
selectDisplay.textContent = option.textContent
123107

124108
const redirectMap = await fetchRedirectMap()
125-
126109
const pathname = window.location.pathname
127110
const currentPath = pathname.replace(SITE_BASE_URL, '')
128111

129112
if (selectedValue === 'enterprise') {
130113
removeGitOpsDocumentationCookie()
131114

132-
const enterprisePath = Object.keys(redirectMap).find((key) => redirectMap[key] === currentPath)
115+
const enterprisePath = Object.keys(redirectMap).find(key => redirectMap[key] === currentPath)
133116

134117
if (enterprisePath) {
135118
window.location.href = `${SITE_BASE_URL}${enterprisePath}`
@@ -149,7 +132,40 @@ async function selectSegmentOption(option, selectedValue) {
149132
}
150133
}
151134

152-
document.addEventListener('click', (e) => {
135+
// eslint-disable-next-line no-unused-vars
136+
function handleOptionKeydown(event, option, selectedValue) {
137+
const select = document.querySelector('.custom-select')
138+
const options = select.querySelectorAll('.option')
139+
const currentIndex = Array.from(options).indexOf(option)
140+
141+
switch (event.key) {
142+
case 'Enter':
143+
case ' ':
144+
event.preventDefault()
145+
selectSegmentOption(option, selectedValue)
146+
break
147+
case 'ArrowDown':
148+
event.preventDefault()
149+
if (currentIndex < options.length - 1) {
150+
options[currentIndex + 1].focus()
151+
}
152+
break
153+
case 'ArrowUp':
154+
event.preventDefault()
155+
if (currentIndex > 0) {
156+
options[currentIndex - 1].focus()
157+
}
158+
break
159+
case 'Escape':
160+
select.classList.remove('open')
161+
select.querySelector('.select-display').focus()
162+
break
163+
default:
164+
break
165+
}
166+
}
167+
168+
document.addEventListener('click', e => {
153169
const select = document.querySelector('.custom-select')
154170
if (!select.contains(e.target)) {
155171
select.classList.remove('open')

assets/js/argohub-redirect/argohub-redirect.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/scss/_buttons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.btn-link {
66
color: $bd-link-color;
77

8-
@include hover {
8+
&:hover {
99
color: $bd-link-color;
1010
border-color: transparent;
1111
}

assets/scss/_links.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
a {
22
color: rgba($bd-link-color, .99);
3+
text-decoration: none;
34

4-
@include hover {
5+
&:hover {
56
color: $bd-link-hover-color;
67
}
78

@@ -47,6 +48,7 @@ ul > li {
4748
a:not([data-type="image"]):not([data-anchorjs-icon="#"]) {
4849
color: $bd-link-default;
4950
border-bottom: none;
51+
text-decoration: none;
5052
transition: color .3s ease-in-out, border-bottom .3s ease-in-out;
5153

5254
&:hover {

assets/scss/_sidebar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
line-height: 1;
172172
color: $cf-light;
173173

174-
@include hover {
174+
&:hover {
175175
color: $bd-link-hover-color;
176176
}
177177
}

assets/scss/_variables.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ $grid-breakpoints: (
119119
xl: 1274px,
120120
xxl: 1600px
121121
);
122-
@include _assert-ascending($grid-breakpoints, "$grid-breakpoints");
123-
@include _assert-starts-at-zero($grid-breakpoints);
124122

125123
// Grid containers
126124
//
@@ -133,7 +131,6 @@ $container-max-widths: (
133131
xl: 1214px,
134132
xxl: 1540px
135133
);
136-
@include _assert-ascending($container-max-widths, "$container-max-widths");
137134

138135
// Grid columns
139136
//

assets/scss/custom-overrides.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@mixin make-container($padding-x: $container-padding-x) {
2+
width: 100%;
3+
padding-right: $padding-x;
4+
padding-left: $padding-x;
5+
margin-right: auto;
6+
margin-left: auto;
7+
}
8+
9+
@mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
10+
@each $breakpoint, $container-max-width in $max-widths {
11+
@include media-breakpoint-up($breakpoint, $breakpoints) {
12+
max-width: $container-max-width;
13+
}
14+
}
15+
}
16+
17+
.custom-container {
18+
@include make-container();
19+
@include make-container-max-widths();
20+
}

assets/scss/docs.scss

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@
33
* Copyright 2018 Codefresh, Inc.
44
*/
55

6-
// Load Bootstrap variables and mixins
6+
@use "bootstrap/scss/bootstrap" as *;
77

8-
//@import "../../scss/functions";
9-
@import "../../node_modules/bootstrap/scss/functions";
10-
11-
//@import "../../scss/variables";
12-
@import "../../node_modules/bootstrap/scss/variables";
13-
14-
//@import "../../scss/mixins";
15-
@import "../../node_modules/bootstrap/scss/mixins";
168

179
// Load docs components
1810
@import "variables";
1911

20-
@import "../../node_modules/bootstrap/scss/bootstrap-grid";
21-
2212
@import "root";
2313
@import "reboot";
2414
@import "code";
@@ -43,6 +33,7 @@
4333
@import "modal";
4434
@import "select";
4535
@import "divider";
36+
@import "custom-overrides";
4637

4738
// Load docs dependencies
4839
@import "syntax";

0 commit comments

Comments
 (0)