Skip to content

Commit

Permalink
Add Prettier formatting check to the Dashboard lint check (#3358)
Browse files Browse the repository at this point in the history
Also, add more files to Prettier's ignore list, and reformat the offending files.

PBENCH-1114
  • Loading branch information
webbnh authored Mar 23, 2023
1 parent afb9bef commit 91980b0
Show file tree
Hide file tree
Showing 24 changed files with 376 additions and 378 deletions.
8 changes: 6 additions & 2 deletions dashboard/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
**/*.ejs
**/*.html
**/*.ico
**/*.jpg
**/*.md
**/*.png
**/*.snap
**/*.svg
**/*.html
**/*.ejs
package.json
1 change: 1 addition & 0 deletions dashboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ build: package-lock.json node_modules ${FILES}

run_lint: package-lock.json node_modules
npx eslint --max-warnings 0 "src/**"
npx prettier --check "src/**"

run_unittests: package-lock.json node_modules
CI=true npm test
Expand Down
62 changes: 31 additions & 31 deletions dashboard/src/App.css
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
body,
html {
padding: 0;
margin: 0;
height: 100%;
padding: 0;
margin: 0;
height: 100%;
}

ul>li {
list-style-type: none;
ul > li {
list-style-type: none;
}

#root {
height: 100%;
height: 100%;
}

.App {
height: 100%;
height: 100%;
}

/* Works on Firefox */
* {
scrollbar-width: thin;
scrollbar-color: #F5F5F5 #a39f9f;
scrollbar-width: thin;
scrollbar-color: #f5f5f5 #a39f9f;
}

/* Works on Chrome, Edge, and Safari */
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #f5f5f5;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar {
width: 5px;
background-color: #F5F5F5;
width: 5px;
background-color: #f5f5f5;
}

::-webkit-scrollbar-thumb {
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, .3);
background-color: #a39f9f;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
background-color: #a39f9f;
}

/* Works on Firefox */
* {
scrollbar-width: thin;
scrollbar-color: #F5F5F5 #a39f9f;
scrollbar-width: thin;
scrollbar-color: #f5f5f5 #a39f9f;
}

/* Works on Chrome, Edge, and Safari */
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #f5f5f5;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar {
width: 5px;
background-color: #F5F5F5;
width: 5px;
background-color: #f5f5f5;
}

::-webkit-scrollbar-thumb {
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, .3);
background-color: #a39f9f;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
border-radius: 10px;
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
background-color: #a39f9f;
}
17 changes: 8 additions & 9 deletions dashboard/src/actions/overviewActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@ export const updateDataset =
const method = metaDataActions[actionType];

const endpoints = getState().apiEndpoint.endpoints;
const uri = expandUriTemplate(endpoints, 'datasets_metadata', { dataset: dataset.resource_id });
const response = await API.put(
uri,
{
metadata: { [method]: actionValue },
}
);
const uri = expandUriTemplate(endpoints, "datasets_metadata", {
dataset: dataset.resource_id,
});
const response = await API.put(uri, {
metadata: { [method]: actionValue },
});
if (response.status === 200) {
const dataIndex = runs.findIndex(
(item) => item.resource_id === dataset.resource_id
Expand Down Expand Up @@ -208,8 +207,8 @@ export const updateMultipleDataset =
method === "delete"
? "Deleted!"
: method === "save"
? "Saved!"
: "Updated!";
? "Saved!"
: "Updated!";
dispatch(showToast(CONSTANTS.SUCCESS, toastMsg));
dispatch(setSelectedRuns([]));
} else {
Expand Down
5 changes: 4 additions & 1 deletion dashboard/src/actions/tableOfContentActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export const fetchTOC =
(param, parent, callForSubData) => async (dispatch, getState) => {
try {
const endpoints = getState().apiEndpoint.endpoints;
const uri = expandUriTemplate(endpoints, 'datasets_contents', { dataset: param, target: parent });
const uri = expandUriTemplate(endpoints, "datasets_contents", {
dataset: param,
target: parent,
});
const response = await API.get(uri);
if (response.status === 200 && response.data) {
dispatch({
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/assets/constants/paginationConstants.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const DEFAULT_PER_PAGE=10;
export const DEFAULT_PER_PAGE = 10;
6 changes: 3 additions & 3 deletions dashboard/src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
5 changes: 2 additions & 3 deletions dashboard/src/modules/components/AlertComponent/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Alert } from "@patternfly/react-core";
import React from "react";


const AlertMessage = ( message ) => {
const AlertMessage = (message) => {
return (
<Alert
className="alertNotification"
variant="info"
isInline
title={ message }
title={message}
/>
);
};
Expand Down
176 changes: 87 additions & 89 deletions dashboard/src/modules/components/AuthComponent/index.less
Original file line number Diff line number Diff line change
@@ -1,97 +1,95 @@
.main-container {
position: relative;
.login-page {
.login-footer-btn-wrapper {
width: 100%;
margin: 2vh 0;

button {
width: 100%;
}
}
.password-holder {
display: flex;
}
.logo {
width: 75px;
}
.sideGridItem {
margin-top: 5vh;
color: #FFFFFF;
}
.login-right-component {
position: relative;
}
.pf-c-card {
padding: 2vh 0;
}
.continueBtn {
padding: inherit;
}
.signup-card {
height: 80%;
overflow-y: scroll;
padding: 0 2vh;

.contraints-container {
padding: 1vh;
.pf-c-helper-text__item-icon {
margin-right: 1vw;
}
.pf-c-helper-text__item-text {
color: #151515;
}
}
.button-wrapper {
margin: 1vh 0;
}
.error {
color: red;
font-size: var(--pf-global--FontSize--sm);
}
}
.orText {
padding: 1vh;
}
.text-center {
text-align: center;
}
position: relative;
.login-page {
.login-footer-btn-wrapper {
width: 100%;
margin: 2vh 0;

button {
width: 100%;
}
}
.auth-card {
.pf-c-card__body {
padding: 0;
}
.button-wrapper {
width: 100%;
margin: 2vh 0 4vh;
padding: 0 24px;
.password-holder {
display: flex;
}
.logo {
width: 75px;
}
.sideGridItem {
margin-top: 5vh;
color: #ffffff;
}
.login-right-component {
position: relative;
}
.pf-c-card {
padding: 2vh 0;
}
.continueBtn {
padding: inherit;
}
.signup-card {
height: 80%;
overflow-y: scroll;
padding: 0 2vh;

button {
width: 100%;
}
}
.account-wrapper {
text-align: center;
padding: 2vh 0;
background: #F0F0F0;
max-height: 20vh;
height: 15vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.contraints-container {
padding: 1vh;
.pf-c-helper-text__item-icon {
margin-right: 1vw;
}
.log-in-alternate {
text-align: center;
margin-top: 3vh;
}
.alternate-btn-wrapper {
button {
width: 100%;
margin: 2vh 0;
}
.pf-c-helper-text__item-text {
color: #151515;
}
}
.button-wrapper {
margin: 1vh 0;
}
.error {
color: red;
font-size: var(--pf-global--FontSize--sm);
}
}
}
.orText {
padding: 1vh;
}
.text-center {
text-align: center;
}
}
.auth-card {
.pf-c-card__body {
padding: 0;
}
.button-wrapper {
width: 100%;
margin: 2vh 0 4vh;
padding: 0 24px;

button {
width: 100%;
}
}
.account-wrapper {
text-align: center;
padding: 2vh 0;
background: #f0f0f0;
max-height: 20vh;
height: 15vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.log-in-alternate {
text-align: center;
margin-top: 3vh;
}
.alternate-btn-wrapper {
button {
width: 100%;
margin: 2vh 0;
}
}
}
}
Loading

0 comments on commit 91980b0

Please sign in to comment.