Skip to content

Commit 715f99d

Browse files
Fix tests
1 parent 3081d40 commit 715f99d

19 files changed

+53
-62
lines changed

.stylelintrc.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
{ "extends": [] }
1+
{
2+
"extends": "stylelint-config-recommended",
3+
"rules": {
4+
"property-no-unknown": [
5+
true,
6+
{
7+
"ignoreProperties": [
8+
"composes"
9+
]
10+
}
11+
]
12+
}
13+
}

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" data-theme="dark">
2+
<html lang="en" data-theme="dark" class="has-navbar-fixed-top">
33

44
<head>
55
<meta charset="utf-8" />
@@ -13,7 +13,7 @@
1313
<script src="/environment.js"></script>
1414
</head>
1515

16-
<body class="has-navbar-fixed-top">
16+
<body>
1717
<noscript>You need to enable JavaScript to run this app.</noscript>
1818
<div id="root"></div>
1919
<script type="module" src="/src/index.tsx"></script>

src/components/badges/UserRoleBadge.jsx

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
const UserRoleBadge = ({ role }) => {
2-
const roles = {
3-
administrator: "red",
4-
superuser: "blue",
5-
user: "green",
6-
client: "yellow",
7-
};
1+
const roles = {
2+
administrator: "red",
3+
superuser: "blue",
4+
user: "green",
5+
client: "yellow",
6+
};
87

8+
const UserRoleBadge = ({ role }) => {
99
const color = roles.hasOwnProperty(role) ? roles[role] : "yellow";
1010

1111
const styles = {
12-
padding: `var(--paddingBox, .3rem .8rem)`,
1312
borderRadius: "var(--borderRadius, 3px)",
1413
};
1514

src/components/documents/Preview.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
.document-preview {
3+
margin: 0 auto;
34
margin-top: 40px;
45
width: 80%;
5-
margin: 0 auto;
66
background-color: white;
77
padding: 3% 4%;
88
border-radius: 5px;

src/components/form/NativeSelect.module.css

Whitespace-only changes.

src/components/layout/Header.css

Whitespace-only changes.

src/components/layout/SidemenuLayout.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Link } from "react-router-dom";
22

33
const SidemenuLayout = ({ children, links }) => {
44
return (
5-
<div className="columns" style={{ marginTop: 40 }}>
6-
<div className="column is-one-fifth">
5+
<div className="columns">
6+
<div className="column is-1">
77
<aside className="menu">
88
{links.map((item) => {
99
if (item.type === "label") {

src/components/layout/dashboard/DashboardLayout.jsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ const DashboardLayout = () => {
66
return (
77
<>
88
<Header />
9-
<main role="main">
10-
<div id="content">
11-
<Outlet />
12-
</div>
13-
</main>
9+
<div>
10+
<Outlet />
11+
</div>
1412
<KeyboardShortcuts />
1513
</>
1614
);

src/components/layout/dashboard/DashboardPanels.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const DashboardPanels = () => {
8080
if (dashboardConfig === null) return <Loading />;
8181

8282
return (
83-
<section>
83+
<div>
8484
<Title type="Home" title="Dashboard" icon={<IconChartBar />} />
8585
<div>
8686
<NativeTabs labels={["View", "Configure"]} tabIndex={tabIndex} tabIndexSetter={tabIndexSetter} />
@@ -127,7 +127,7 @@ const DashboardPanels = () => {
127127
</div>
128128
)}
129129
</div>
130-
</section>
130+
</div>
131131
);
132132
};
133133

src/components/tasks/Details.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const TaskDetails = () => {
143143

144144
<div>
145145
<NativeTabs
146-
labels={["Details", command ?? "Command instructions", "Attachments"]}
146+
labels={["Details", null !== command ? "Command instructions" : null, "Attachments"]}
147147
tabIndex={tabIndex}
148148
tabIndexSetter={tabIndexSetter}
149149
/>
@@ -231,12 +231,12 @@ const TaskDetails = () => {
231231
</div>
232232
</div>
233233
)}
234-
{null !== command && (
234+
{null !== command && 1 === tabIndex && (
235235
<div>
236236
<CommandInstructions command={command} task={task} />
237237
</div>
238238
)}
239-
{1 === tabIndex && (
239+
{(null !== command ? 2 : 1) === tabIndex && (
240240
<div>
241241
<AttachmentsDropzone
242242
parentType={parentType}

src/components/ui/NoResults.jsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { IconExclamationCircle } from './Icons';
1+
import { IconExclamationCircle } from "./Icons";
22

33
export default function NoResults() {
4-
return <figure className="NoResults message__container">
5-
<IconExclamationCircle />
6-
No results
7-
</figure>
4+
return (
5+
<figure className="" style={{ display: "flex", alignItems: "center", gap: "1rem", justifyContent: "center" }}>
6+
<IconExclamationCircle />
7+
No results
8+
</figure>
9+
);
810
}

src/components/ui/ShellCommand.css

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
code {
22
display: block;
3-
padding: var(--paddingBox);
43
border-left: var(--borderWidth) solid var(--primary-color);
54
font-family: monospace;
65
white-space: pre-line;
@@ -14,7 +13,6 @@ code {
1413
bottom: 0;
1514
height: min-content;
1615
right: 5px;
17-
padding: var(--space-xs);
1816
opacity: .3;
1917

2018
&:hover {

src/components/ui/Title.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const Title = ({ type, title, icon }) => {
1111
alignItems: "center",
1212
justifyContent: "center",
1313
marginRight: "var(--padding)",
14-
width: "var(--iconSizeLarge)",
15-
height: "var(--iconSizeLarge)",
1614
},
1715
};
1816
return (

src/components/ui/buttons/DeleteIconButton.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import styles from "./DeleteIconButton.module.css";
66
const DeleteIconButton = (props) => (
77
<NativeButton className={`button ${styles.native} is-danger`} onClick={props.onClick} {...props}>
88
<FontAwesomeIcon icon={faTrashCan} />
9+
&nbsp;
910
</NativeButton>
1011
);
1112

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import NoResults from "../NoResults";
22

33
const NoResultsTableRow = ({ numColumns }) => {
4-
return <tr>
5-
<td colSpan={numColumns} style={{ padding: '20px' }}><NoResults /></td>
6-
</tr>
7-
}
4+
return (
5+
<tr>
6+
<td colSpan={numColumns}>
7+
<NoResults />
8+
</td>
9+
</tr>
10+
);
11+
};
812

913
export default NoResultsTableRow;

src/components/ui/toast.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import toast from "react-hot-toast";
1+
import { toast } from "react-hot-toast";
22

33
export function actionCompletedToast(description: string) {
44
toast.success(
@@ -9,7 +9,6 @@ export function actionCompletedToast(description: string) {
99
{
1010
duration: 4000,
1111
position: "bottom-right",
12-
isClosable: true,
1312
},
1413
);
1514
}
@@ -20,6 +19,5 @@ export function errorToast(description: string) {
2019
{description}
2120
</div>, {
2221
position: "bottom-right",
23-
isClosable: false,
2422
});
2523
}

src/components/users/Profile.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const UserProfile = () => {
8787
<div>
8888
{0 === tabIndex && (
8989
<div>
90-
<div className="grid grid-two">
90+
<div className="grid grid-two content">
9191
<div>
9292
<h4>Properties</h4>
9393
<dl>

src/components/vulnerabilities/templates/List.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ const VulnerabilityTemplatesList = () => {
105105
/>
106106
</td>
107107
<td>
108+
<LinkButton href={`/vulnerabilities/${template.id}/edit`}>Edit</LinkButton>
108109
<PrimaryButton
109110
onClick={(ev) => cloneVulnerability(ev, template.id)}
110111
key={template.id}
111112
title="Clone"
112113
>
113114
Clone and edit
114115
</PrimaryButton>
115-
<LinkButton href={`/vulnerabilities/${template.id}/edit`}>Edit</LinkButton>
116116
<DeleteIconButton onClick={(ev) => deleteTemplate(ev, template.id)} />
117117
</td>
118118
</tr>

src/styles/main.css

+1-20
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,17 @@
33
:root {
44
/*spacing*/
55
--space: 0.9rem;
6-
--space-xs: 0.1rem;
76

87
--margin: calc(var(--space) / 2);
98
--padding: var(--space);
10-
--paddingBox: calc(var(--space) / 2) var(--space);
119
--paddingBadge: calc(var(--space) / 3) calc(var(--space) / 2);
12-
--marginBox: calc(var(--space) / 2) 0;
1310
--borderRadius: calc(var(--space) / 3);
14-
15-
/*icons*/
16-
--iconSize: 32px;
17-
--iconSizeLarge: 48px;
1811
}
1912

2013
body {
21-
font-size: 14px;
14+
padding: 1rem;
2215
}
2316

24-
2517
.heading {
2618
display: flex;
2719
justify-content: space-between;
@@ -43,14 +35,3 @@ h4 {
4335
flex-shrink: 0;
4436
}
4537
}
46-
47-
.message__container {
48-
display: flex;
49-
flex-direction: row;
50-
align-items: center;
51-
justify-content: center;
52-
width: 100%;
53-
height: 100%;
54-
opacity: .4;
55-
gap: var(--padding);
56-
}

0 commit comments

Comments
 (0)