Skip to content

Commit

Permalink
72 change score to risk (#73)
Browse files Browse the repository at this point in the history
* Change score to risk

* Remove auto focus from tabs

* Add autofocus to snippet text area

* Add autofocus to repository input field

* Highlight resource type in report header

* Update changelog

* Remove commented out code

---------

Co-authored-by: Nicolas Vuillamy <[email protected]>
  • Loading branch information
itayox and megalinter-bot authored Aug 12, 2023
1 parent 4dc0d8a commit ef1f72d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ _Can be run using `npm run codetotal:beta`_
- Add missing icon for Java
- Show language only if it's available
- Detect language for file analysis
- Change score to risk
- Remove auto focus from analysis tabs
- Add auto focus to snippet & repo inputs
- Highlight resource type in report header
- Back-End
- Bug fix: SBOM packages not showing up in report page. Async parsing of packages information in SBOM module

Expand Down
1 change: 0 additions & 1 deletion packages/app/src/analysis/components/AnalysisInputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const AnalysisInputForm: FC<AnalysisInputFormProps> = ({
variant="fullWidth"
>
<Tab
autoFocus
label="Code Snippet"
value={AnalysisType.Snippet}
className={classes.tab}
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/analysis/components/CodeSnippetForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const CodeSnippetForm: FC<AnalysisFormProps> = ({ onSubmit }) => {
return (
<div className={classes.codeSnippetForm}>
<TextField
autoFocus
rows={5}
multiline
fullWidth
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/analysis/components/RepositoryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const RepositoryForm: FC<AnalysisFormProps> = ({ onSubmit }) => {
<div className={classes.repositoryForm}>
<FormControl fullWidth>
<TextField
autoFocus
placeholder="Enter Repository URL"
value={repositoryURL}
onChange={handleChange}
Expand Down
19 changes: 17 additions & 2 deletions packages/app/src/report/components/header/ReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,23 @@ export const ReportHeader: FC<ReportBannerProps> = ({ ready }) => {
style={{ color }}
data-cy="report-header"
>
{linters.length === 0 && <>Scanning {resourceType}...</>}
{linters.length === 0 && (
<>
Scanning
<span className={classes.resourceTypeText}>
&nbsp;{resourceType}&nbsp;
</span>
...
</>
)}
{linters.length > 0 && (
<>
{lintersWithIssuesCount} / {linters.length} security linters
flagged this&nbsp;{resourceType} to have security issues
flagged this
<span className={classes.resourceTypeText}>
&nbsp;{resourceType}&nbsp;
</span>
to have security issues
</>
)}
</Typography>
Expand Down Expand Up @@ -155,6 +167,9 @@ const useStyles = makeStyles()((theme: Theme) => ({
maxWidth: 600,
whiteSpace: "nowrap",
},
resourceTypeText: {
fontWeight: 300,
},
}));

interface ReportBannerProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/report/components/header/Score.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const Score: FC<ScoreProps> = ({
color="text.secondary"
className={classes.label}
>
Score
Risk
</Typography>
</div>
)}
Expand Down Expand Up @@ -101,7 +101,7 @@ const useStyles = makeStyles()((theme: Theme) => ({
},
countUp: {
fontSize: 20,
[theme.breakpoints.up("sm")]: {
[theme.breakpoints.up("md")]: {
fontSize: 35,
},
fontWeight: 700,
Expand Down

0 comments on commit ef1f72d

Please sign in to comment.