Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint fixes #4

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ plugins:
rules:
prettier/prettier:
- error
react/prop-types:
- warn
settings:
react:
version: detect
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ name: Node.js CI
on:
push:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '.devcontainer/**'
- '.github/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '.devcontainer/**'
- '.github/**'

jobs:
ci:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Container Build
on:
push:
branches: [ main ]
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '.devcontainer/**'
- '.github/**'
pull_request:
branches: [ main ]
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '.devcontainer/**'
- '.github/**'

jobs:
build:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ name: Yarn Lint
on:
push:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '.devcontainer/**'
- '.github/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '.devcontainer/**'
- '.github/**'

jobs:
lint:
Expand Down
6 changes: 4 additions & 2 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ rules:
# Disallow CSS classnames prefixed with .pf- or .co- as these prefixes are
# reserved by PatternFly and OpenShift console.
selector-disallowed-list:
- "*"
- /\.(pf|co)-/
# Due to a issue with PF: https://github.com/openshift/console/pull/14246
- null
# - "*"
# - /\.(pf|co)-/
# Plugins should avoid naked element selectors like `table` and `li` since
# this can impact layout of existing pages in console.
selector-max-type:
Expand Down
111 changes: 84 additions & 27 deletions src/components/missing-pf-styles.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/pod/PodTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export default function PodDetails({ obj }) {
},
];

const detectionsBody = detections.map((d) => {
const detectionsBody = detections.map((d, index) => {
return (
<Tr>
<Tr key={index}>
<Td>{d.severity}</Td>
<Td>{d.description}</Td>
<Td>{d.action}</Td>
Expand Down
16 changes: 11 additions & 5 deletions src/components/virt/DetectionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function DetectionsTable({ client, deviceId, alerts, setAlerts })
<DataList aria-label="Endpoint alerts">
{alerts.map((a) => {
return (
<DataListItem isExpanded={expanded.includes(a.compositeId)}>
<DataListItem key={a.compositeId} isExpanded={expanded.includes(a.compositeId)}>
<DataListItemRow>
<DataListToggle
onClick={() => toggle(a.compositeId)}
Expand All @@ -94,12 +94,18 @@ export default function DetectionsTable({ client, deviceId, alerts, setAlerts })
/>
<DataListItemCells
dataListCells={[
<DataListCell width={4}>{a.description}</DataListCell>,
<DataListCell width={1}>{a.tactic}</DataListCell>,
<DataListCell width={1}>
<DataListCell key="description" width={4}>
{a.description}
</DataListCell>,
<DataListCell key="tactic" width={1}>
{a.tactic}
</DataListCell>,
<DataListCell key="severity" width={1}>
<SeverityLabel name={a.severityName} />
</DataListCell>,
<DataListCell width={2}>{a.timestamp.toUTCString()}</DataListCell>,
<DataListCell key="timestamp" width={2}>
{a.timestamp.toUTCString()}
</DataListCell>,
]}
/>
<DataListAction
Expand Down
4 changes: 2 additions & 2 deletions src/components/virt/NoAgent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default function NoAgent() {
/>
<EmptyStateBody>
<p>
We couldn't find a running Falcon agent that matches this system's MAC address. If the
agent is installed, make sure the <code>falcon-sensor</code> service is running.
We couldn&apos;t find a running Falcon agent that matches this system&apos;s MAC address.
If the agent is installed, make sure the <code>falcon-sensor</code> service is running.
</p>
</EmptyStateBody>
<EmptyStateFooter>
Expand Down
14 changes: 9 additions & 5 deletions src/components/virt/VulnsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function VulnsTable({ client, deviceId, vulns, setVulns }) {
<DataList aria-label="Remediations">
{sortedRemediations.map((r) => {
return (
<DataListItem isExpanded={expanded.includes(r.id)}>
<DataListItem key={r.id} isExpanded={expanded.includes(r.id)}>
<DataListItemRow>
<DataListToggle
onClick={() => toggle(r.id)}
Expand All @@ -129,9 +129,13 @@ export default function VulnsTable({ client, deviceId, vulns, setVulns }) {
/>
<DataListItemCells
dataListCells={[
<DataListCell width={4}>{r.action}</DataListCell>,
<DataListCell width={2}>{r.maxBaseScore}</DataListCell>,
<DataListCell width={2}>
<DataListCell key="action" width={4}>
{r.action}
</DataListCell>,
<DataListCell key="maxscore" width={2}>
{r.maxBaseScore}
</DataListCell>,
<DataListCell key="severity" width={2}>
<SeverityLabel
name="critical"
text={r.counts.critical}
Expand Down Expand Up @@ -172,7 +176,7 @@ export default function VulnsTable({ client, deviceId, vulns, setVulns }) {
<Tbody>
{r.cves.map((c) => {
return (
<Tr>
<Tr key={c.id}>
<Td>{c.id}</Td>
<Td>{c.baseScore}</Td>
<Td>
Expand Down
4 changes: 2 additions & 2 deletions src/components/virt/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ ul.crwd-process-tree-child {
}

ul.crwd-process-tree-child li::marker {
color: #8A8D90;
color: var(--pf-global--Color--400);
}

ul.crwd-process-tree-root pre, ul.crwd-process-tree-child pre {
text-wrap: wrap;
}

ul.crwd-process-tree-root li, ul.crwd-process-tree-child li {
padding: 5px 0px 0px 5px;
padding: 5px 0 0 5px;
}

div.crwd-card-title {
Expand Down