mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
fix(frontend): remove linter workarounds
Some checks failed
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
E2E Tests / Build test build of frontend (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (push) Has been cancelled
Run tests & build / Test and build with NodeJS 20 (push) Has been cancelled
E2E Tests / frontend-cypress (1) (push) Has been cancelled
E2E Tests / frontend-cypress (2) (push) Has been cancelled
E2E Tests / frontend-cypress (3) (push) Has been cancelled
Some checks failed
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
E2E Tests / Build test build of frontend (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (push) Has been cancelled
Run tests & build / Test and build with NodeJS 20 (push) Has been cancelled
E2E Tests / frontend-cypress (1) (push) Has been cancelled
E2E Tests / frontend-cypress (2) (push) Has been cancelled
E2E Tests / frontend-cypress (3) (push) Has been cancelled
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
932ecac326
commit
8ce40bc4cd
2 changed files with 11 additions and 5 deletions
|
@ -74,8 +74,7 @@ export class NodeToReactTransformer {
|
|||
* @return the created react element
|
||||
*/
|
||||
private translateElementToReactElement(element: Element, index: number | string): ValidReactDomElement {
|
||||
const numericIndex = typeof index === 'number' ? index : Number.parseInt(index)
|
||||
const elementKey = this.calculateUniqueKey(element).orElseGet(() => (-numericIndex).toString())
|
||||
const elementKey = this.calculateUniqueKey(element).orElseGet(() => `-${index}`)
|
||||
const replacement = this.findElementReplacement(element, elementKey)
|
||||
if (replacement === null) {
|
||||
return null
|
||||
|
|
|
@ -57,9 +57,15 @@ const initialConfig: FrontendConfig = {
|
|||
let currentConfig: FrontendConfig = initialConfig
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse) => {
|
||||
// This is shorter than storing the return boolean in a variable and then calling respondToTestRequest with if
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
respondToMatchingRequest<FrontendConfig>(HttpMethod.GET, req, res, currentConfig, 200, false) ||
|
||||
const responseSuccessful = respondToMatchingRequest<FrontendConfig>(
|
||||
HttpMethod.GET,
|
||||
req,
|
||||
res,
|
||||
currentConfig,
|
||||
200,
|
||||
false
|
||||
)
|
||||
if (!responseSuccessful) {
|
||||
respondToTestRequest<FrontendConfig>(req, res, () => {
|
||||
currentConfig = {
|
||||
...initialConfig,
|
||||
|
@ -67,6 +73,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => {
|
|||
}
|
||||
return currentConfig
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default handler
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue