Skip to content

Commit

Permalink
Refactoring: give JavaSCript files with JSX the extension .jsx to pre…
Browse files Browse the repository at this point in the history
…pate for ejection of Create React App.
  • Loading branch information
fniessink committed Jan 31, 2025
1 parent 0b7de0e commit 27bdce4
Show file tree
Hide file tree
Showing 204 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"resetMocks": false,
"coveragePathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/src/index.js"
"<rootDir>/src/index.jsx"
]
},
"browserslist": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions components/frontend/src/api/metric.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { showMessage } from "../widgets/toast"
import { fetch_server_api } from "./fetch_server_api"

export function add_metric(subject_uuid, metricType, reload) {
Expand Down Expand Up @@ -27,14 +26,14 @@ export function set_metric_debt(metric_uuid, value, reload) {
return fetch_server_api("post", `metric/${metric_uuid}/debt`, { accept_debt: value }).then(reload)
}

export function add_metric_issue(metric_uuid, reload) {
export function add_metric_issue(metric_uuid, reload, showMessage) {
const payload = { metric_url: `${window.location}#${metric_uuid}` }
return fetch_server_api("post", `metric/${metric_uuid}/issue/new`, payload)
.then((json) => {
if (json.ok) {
window.open(json.issue_url)
} else {
showMessage("error", "Could not create issue", json.error)
showMessage(json.error)
}
return null
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as toast from "../widgets/toast"
import { ChangeLog } from "./ChangeLog"

jest.mock("../api/changelog.js")
jest.mock("../widgets/toast.js")
jest.mock("../widgets/toast.jsx")

beforeEach(() => {
jest.resetAllMocks()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as toast from "../../widgets/toast"
import { DownloadAsPDFButton } from "./DownloadAsPDFButton"

jest.mock("../../api/report")
jest.mock("../../widgets/toast.js")
jest.mock("../../widgets/toast.jsx")

beforeEach(() => {
jest.resetAllMocks()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function CreateIssueButton({ issueTrackerConfigured, issueTrackerInstruction, me
disabled={disabled || !issueTrackerConfigured}
icon={<AddItemIcon />}
itemType="issue"
onClick={() => add_metric_issue(metric_uuid, reload)}
onClick={() =>
add_metric_issue(metric_uuid, reload, (error) => showMessage("error", "Could not create issue", error))
}
popup={
<>
Create a new issue for this {target} in the configured issue tracker and add its identifier to the
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as toast from "../widgets/toast"
import { Sources } from "./Sources"

jest.mock("../api/fetch_server_api.js")
jest.mock("../widgets/toast.js")
jest.mock("../widgets/toast.jsx")

const dataModel = {
metrics: { metric_type: { sources: ["source_type1", "source_type2"] } },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sonar.python.version=3.13

# Exclude third party software and generated code from analysis
sonar.exclusions=**/coverage/**/*,**/build/**/*,**/node_modules/**/*
sonar.coverage.exclusions=components/frontend/coverage/**/*,**/*.test.js,**/src/index.js,**/setupTests.js,**/ci/**/*,**/build/**/*,docs/**/*,**/setup.py,**/tests/*.py
sonar.coverage.exclusions=components/frontend/coverage/**/*,**/*.test.js?,**/src/index.jsx,**/setupTests.js,**/ci/**/*,**/build/**/*,docs/**/*,**/setup.py,**/tests/*.py

# Unit tests
sonar.python.xunit.reportPath=components/**/build/unittests.xml
Expand Down

0 comments on commit 27bdce4

Please sign in to comment.