Skip to content

Commit 91980b0

Browse files
authored
Add Prettier formatting check to the Dashboard lint check (#3358)
Also, add more files to Prettier's ignore list, and reformat the offending files. PBENCH-1114
1 parent afb9bef commit 91980b0

File tree

24 files changed

+376
-378
lines changed

24 files changed

+376
-378
lines changed

dashboard/.prettierignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
**/*.ejs
2+
**/*.html
3+
**/*.ico
4+
**/*.jpg
15
**/*.md
6+
**/*.png
7+
**/*.snap
28
**/*.svg
3-
**/*.html
4-
**/*.ejs
59
package.json

dashboard/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ build: package-lock.json node_modules ${FILES}
2727

2828
run_lint: package-lock.json node_modules
2929
npx eslint --max-warnings 0 "src/**"
30+
npx prettier --check "src/**"
3031

3132
run_unittests: package-lock.json node_modules
3233
CI=true npm test

dashboard/src/App.css

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
11
body,
22
html {
3-
padding: 0;
4-
margin: 0;
5-
height: 100%;
3+
padding: 0;
4+
margin: 0;
5+
height: 100%;
66
}
77

8-
ul>li {
9-
list-style-type: none;
8+
ul > li {
9+
list-style-type: none;
1010
}
1111

1212
#root {
13-
height: 100%;
13+
height: 100%;
1414
}
1515

1616
.App {
17-
height: 100%;
17+
height: 100%;
1818
}
1919

2020
/* Works on Firefox */
2121
* {
22-
scrollbar-width: thin;
23-
scrollbar-color: #F5F5F5 #a39f9f;
22+
scrollbar-width: thin;
23+
scrollbar-color: #f5f5f5 #a39f9f;
2424
}
2525

2626
/* Works on Chrome, Edge, and Safari */
2727
::-webkit-scrollbar-track {
28-
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
29-
border-radius: 10px;
30-
background-color: #F5F5F5;
31-
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
28+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
29+
border-radius: 10px;
30+
background-color: #f5f5f5;
31+
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
3232
}
3333

3434
::-webkit-scrollbar {
35-
width: 5px;
36-
background-color: #F5F5F5;
35+
width: 5px;
36+
background-color: #f5f5f5;
3737
}
3838

3939
::-webkit-scrollbar-thumb {
40-
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
41-
border-radius: 10px;
42-
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, .3);
43-
background-color: #a39f9f;
40+
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
41+
border-radius: 10px;
42+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
43+
background-color: #a39f9f;
4444
}
4545

4646
/* Works on Firefox */
4747
* {
48-
scrollbar-width: thin;
49-
scrollbar-color: #F5F5F5 #a39f9f;
48+
scrollbar-width: thin;
49+
scrollbar-color: #f5f5f5 #a39f9f;
5050
}
5151

5252
/* Works on Chrome, Edge, and Safari */
5353
::-webkit-scrollbar-track {
54-
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
55-
border-radius: 10px;
56-
background-color: #F5F5F5;
57-
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
54+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
55+
border-radius: 10px;
56+
background-color: #f5f5f5;
57+
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
5858
}
5959

6060
::-webkit-scrollbar {
61-
width: 5px;
62-
background-color: #F5F5F5;
61+
width: 5px;
62+
background-color: #f5f5f5;
6363
}
6464

6565
::-webkit-scrollbar-thumb {
66-
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
67-
border-radius: 10px;
68-
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, .3);
69-
background-color: #a39f9f;
66+
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
67+
border-radius: 10px;
68+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
69+
background-color: #a39f9f;
7070
}

dashboard/src/actions/overviewActions.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,12 @@ export const updateDataset =
118118
const method = metaDataActions[actionType];
119119

120120
const endpoints = getState().apiEndpoint.endpoints;
121-
const uri = expandUriTemplate(endpoints, 'datasets_metadata', { dataset: dataset.resource_id });
122-
const response = await API.put(
123-
uri,
124-
{
125-
metadata: { [method]: actionValue },
126-
}
127-
);
121+
const uri = expandUriTemplate(endpoints, "datasets_metadata", {
122+
dataset: dataset.resource_id,
123+
});
124+
const response = await API.put(uri, {
125+
metadata: { [method]: actionValue },
126+
});
128127
if (response.status === 200) {
129128
const dataIndex = runs.findIndex(
130129
(item) => item.resource_id === dataset.resource_id
@@ -208,8 +207,8 @@ export const updateMultipleDataset =
208207
method === "delete"
209208
? "Deleted!"
210209
: method === "save"
211-
? "Saved!"
212-
: "Updated!";
210+
? "Saved!"
211+
: "Updated!";
213212
dispatch(showToast(CONSTANTS.SUCCESS, toastMsg));
214213
dispatch(setSelectedRuns([]));
215214
} else {

dashboard/src/actions/tableOfContentActions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ export const fetchTOC =
66
(param, parent, callForSubData) => async (dispatch, getState) => {
77
try {
88
const endpoints = getState().apiEndpoint.endpoints;
9-
const uri = expandUriTemplate(endpoints, 'datasets_contents', { dataset: param, target: parent });
9+
const uri = expandUriTemplate(endpoints, "datasets_contents", {
10+
dataset: param,
11+
target: parent,
12+
});
1013
const response = await API.get(uri);
1114
if (response.status === 200 && response.data) {
1215
dispatch({
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const DEFAULT_PER_PAGE=10;
1+
export const DEFAULT_PER_PAGE = 10;

dashboard/src/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
3+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
55
sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
1212
monospace;
1313
}

dashboard/src/modules/components/AlertComponent/index.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { Alert } from "@patternfly/react-core";
22
import React from "react";
33

4-
5-
const AlertMessage = ( message ) => {
4+
const AlertMessage = (message) => {
65
return (
76
<Alert
87
className="alertNotification"
98
variant="info"
109
isInline
11-
title={ message }
10+
title={message}
1211
/>
1312
);
1413
};
Lines changed: 87 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,95 @@
11
.main-container {
2-
position: relative;
3-
.login-page {
4-
.login-footer-btn-wrapper {
5-
width: 100%;
6-
margin: 2vh 0;
7-
8-
button {
9-
width: 100%;
10-
}
11-
}
12-
.password-holder {
13-
display: flex;
14-
}
15-
.logo {
16-
width: 75px;
17-
}
18-
.sideGridItem {
19-
margin-top: 5vh;
20-
color: #FFFFFF;
21-
}
22-
.login-right-component {
23-
position: relative;
24-
}
25-
.pf-c-card {
26-
padding: 2vh 0;
27-
}
28-
.continueBtn {
29-
padding: inherit;
30-
}
31-
.signup-card {
32-
height: 80%;
33-
overflow-y: scroll;
34-
padding: 0 2vh;
35-
36-
.contraints-container {
37-
padding: 1vh;
38-
.pf-c-helper-text__item-icon {
39-
margin-right: 1vw;
40-
}
41-
.pf-c-helper-text__item-text {
42-
color: #151515;
43-
}
44-
}
45-
.button-wrapper {
46-
margin: 1vh 0;
47-
}
48-
.error {
49-
color: red;
50-
font-size: var(--pf-global--FontSize--sm);
51-
}
52-
}
53-
.orText {
54-
padding: 1vh;
55-
}
56-
.text-center {
57-
text-align: center;
58-
}
2+
position: relative;
3+
.login-page {
4+
.login-footer-btn-wrapper {
5+
width: 100%;
6+
margin: 2vh 0;
597

8+
button {
9+
width: 100%;
10+
}
6011
}
61-
.auth-card {
62-
.pf-c-card__body {
63-
padding: 0;
64-
}
65-
.button-wrapper {
66-
width: 100%;
67-
margin: 2vh 0 4vh;
68-
padding: 0 24px;
12+
.password-holder {
13+
display: flex;
14+
}
15+
.logo {
16+
width: 75px;
17+
}
18+
.sideGridItem {
19+
margin-top: 5vh;
20+
color: #ffffff;
21+
}
22+
.login-right-component {
23+
position: relative;
24+
}
25+
.pf-c-card {
26+
padding: 2vh 0;
27+
}
28+
.continueBtn {
29+
padding: inherit;
30+
}
31+
.signup-card {
32+
height: 80%;
33+
overflow-y: scroll;
34+
padding: 0 2vh;
6935

70-
button {
71-
width: 100%;
72-
}
73-
}
74-
.account-wrapper {
75-
text-align: center;
76-
padding: 2vh 0;
77-
background: #F0F0F0;
78-
max-height: 20vh;
79-
height: 15vh;
80-
display: flex;
81-
flex-direction: column;
82-
align-items: center;
83-
justify-content: center;
36+
.contraints-container {
37+
padding: 1vh;
38+
.pf-c-helper-text__item-icon {
39+
margin-right: 1vw;
8440
}
85-
.log-in-alternate {
86-
text-align: center;
87-
margin-top: 3vh;
88-
}
89-
.alternate-btn-wrapper {
90-
button {
91-
width: 100%;
92-
margin: 2vh 0;
93-
}
41+
.pf-c-helper-text__item-text {
42+
color: #151515;
9443
}
44+
}
45+
.button-wrapper {
46+
margin: 1vh 0;
47+
}
48+
.error {
49+
color: red;
50+
font-size: var(--pf-global--FontSize--sm);
51+
}
9552
}
96-
}
53+
.orText {
54+
padding: 1vh;
55+
}
56+
.text-center {
57+
text-align: center;
58+
}
59+
}
60+
.auth-card {
61+
.pf-c-card__body {
62+
padding: 0;
63+
}
64+
.button-wrapper {
65+
width: 100%;
66+
margin: 2vh 0 4vh;
67+
padding: 0 24px;
9768

69+
button {
70+
width: 100%;
71+
}
72+
}
73+
.account-wrapper {
74+
text-align: center;
75+
padding: 2vh 0;
76+
background: #f0f0f0;
77+
max-height: 20vh;
78+
height: 15vh;
79+
display: flex;
80+
flex-direction: column;
81+
align-items: center;
82+
justify-content: center;
83+
}
84+
.log-in-alternate {
85+
text-align: center;
86+
margin-top: 3vh;
87+
}
88+
.alternate-btn-wrapper {
89+
button {
90+
width: 100%;
91+
margin: 2vh 0;
92+
}
93+
}
94+
}
95+
}

0 commit comments

Comments
 (0)