diff --git a/.github/labeler.yml b/.github/labeler.yml index 1f903541..1fbec8f7 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,91 +2,91 @@ # for reference, see https://github.com/actions/labeler github: -- changed-files: - - any-glob-to-any-file: '.github/**/*' + - changed-files: + - any-glob-to-any-file: ".github/**/*" documentation: -- changed-files: - - any-glob-to-any-file: 'CONTRIBUTING.md' - - any-glob-to-any-file: 'LICENSE' - - any-glob-to-any-file: 'README.md' - - any-glob-to-any-file: 'backend/README.md' - - any-glob-to-any-file: 'doc/how-to-guides/develop-with-neo4j.md' - - any-glob-to-any-file: 'doc/how-to-guides/docker-compose-setup.md' - - any-glob-to-any-file: 'doc/introduction/setup-dev.md' - - any-glob-to-any-file: 'doc/references/taxonomy-parser.md' - - any-glob-to-any-file: 'doc/assets/.empty' - - any-glob-to-any-file: 'doc/**/*' + - changed-files: + - any-glob-to-any-file: "CONTRIBUTING.md" + - any-glob-to-any-file: "LICENSE" + - any-glob-to-any-file: "README.md" + - any-glob-to-any-file: "backend/README.md" + - any-glob-to-any-file: "doc/how-to-guides/develop-with-neo4j.md" + - any-glob-to-any-file: "doc/how-to-guides/docker-compose-setup.md" + - any-glob-to-any-file: "doc/introduction/setup-dev.md" + - any-glob-to-any-file: "doc/references/taxonomy-parser.md" + - any-glob-to-any-file: "doc/assets/.empty" + - any-glob-to-any-file: "doc/**/*" docker: -- changed-files: - - any-glob-to-any-file: 'backend/Dockerfile' - - any-glob-to-any-file: 'taxonomy-editor-frontend/Dockerfile' - - any-glob-to-any-file: 'docker-compose.yml' - - any-glob-to-any-file: 'docker/dev.yml' + - changed-files: + - any-glob-to-any-file: "backend/Dockerfile" + - any-glob-to-any-file: "taxonomy-editor-frontend/Dockerfile" + - any-glob-to-any-file: "docker-compose.yml" + - any-glob-to-any-file: "docker/dev.yml" backend: -- changed-files: - - any-glob-to-any-file: 'backend/editor/__init__.py' - - any-glob-to-any-file: 'backend/editor/api.py' - - any-glob-to-any-file: 'backend/editor/entries.py' - - any-glob-to-any-file: 'backend/editor/exceptions.py' - - any-glob-to-any-file: 'backend/editor/graph_db.py' - - any-glob-to-any-file: 'backend/editor/models.py' - - any-glob-to-any-file: 'backend/editor/normalizer.py' - - any-glob-to-any-file: 'backend/editor/settings.py' - - any-glob-to-any-file: 'backend/pyproject.toml' - - any-glob-to-any-file: 'backend/poetry.lock' - - any-glob-to-any-file: 'backend/sample/load.py' - - any-glob-to-any-file: 'backend/sample/schema.json' - - any-glob-to-any-file: 'backend/sample/test-neo4j.json' - - any-glob-to-any-file: 'backend/sample/test.json' - - any-glob-to-any-file: 'backend/sample/test.txt' - - any-glob-to-any-file: 'backend/**/*' + - changed-files: + - any-glob-to-any-file: "backend/editor/__init__.py" + - any-glob-to-any-file: "backend/editor/api.py" + - any-glob-to-any-file: "backend/editor/entries.py" + - any-glob-to-any-file: "backend/editor/exceptions.py" + - any-glob-to-any-file: "backend/editor/graph_db.py" + - any-glob-to-any-file: "backend/editor/models.py" + - any-glob-to-any-file: "backend/editor/normalizer.py" + - any-glob-to-any-file: "backend/editor/settings.py" + - any-glob-to-any-file: "backend/pyproject.toml" + - any-glob-to-any-file: "backend/poetry.lock" + - any-glob-to-any-file: "backend/sample/load.py" + - any-glob-to-any-file: "backend/sample/schema.json" + - any-glob-to-any-file: "backend/sample/test-neo4j.json" + - any-glob-to-any-file: "backend/sample/test.json" + - any-glob-to-any-file: "backend/sample/test.txt" + - any-glob-to-any-file: "backend/**/*" frontend: -- changed-files: - - any-glob-to-any-file: 'taxonomy-editor-frontend/**/*' + - changed-files: + - any-glob-to-any-file: "taxonomy-editor-frontend/**/*" dependencies: -- changed-files: - - any-glob-to-any-file: 'backend/pyproject.toml' - - any-glob-to-any-file: 'backend/poetry.lock' - - any-glob-to-any-file: 'parser/pyproject.toml' - - any-glob-to-any-file: 'parser/poetry.lock' - - any-glob-to-any-file: 'taxonomy-editor-frontend/package.json' + - changed-files: + - any-glob-to-any-file: "backend/pyproject.toml" + - any-glob-to-any-file: "backend/poetry.lock" + - any-glob-to-any-file: "parser/pyproject.toml" + - any-glob-to-any-file: "parser/poetry.lock" + - any-glob-to-any-file: "taxonomy-editor-frontend/package.json" api: -- changed-files: - - any-glob-to-any-file: 'backend/editor/api.py' + - changed-files: + - any-glob-to-any-file: "backend/editor/api.py" nginx: -- changed-files: - - any-glob-to-any-file: 'conf/nginx.conf' + - changed-files: + - any-glob-to-any-file: "conf/nginx.conf" neo4j: -- changed-files: - - any-glob-to-any-file: 'neo4j/**/*' + - changed-files: + - any-glob-to-any-file: "neo4j/**/*" parser: -- changed-files: - - any-glob-to-any-file: 'parser/Makefile' - - any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/__init__.py' - - any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/exception.py' - - any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/parser.py' - - any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/unparser.py' - - any-glob-to-any-file: 'parser/pyproject.toml' - - any-glob-to-any-file: 'parser/poetry.lock' - - any-glob-to-any-file: 'parser/setup.cfg' - - any-glob-to-any-file: 'parser/tests/__init__.py' - - any-glob-to-any-file: 'parser/tests/conftest.py' - - any-glob-to-any-file: 'parser/tests/data/test.txt' - - any-glob-to-any-file: 'parser/tests/integration/__init__.py' - - any-glob-to-any-file: 'parser/**/*' + - changed-files: + - any-glob-to-any-file: "parser/Makefile" + - any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/__init__.py" + - any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/exception.py" + - any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/parser.py" + - any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/unparser.py" + - any-glob-to-any-file: "parser/pyproject.toml" + - any-glob-to-any-file: "parser/poetry.lock" + - any-glob-to-any-file: "parser/setup.cfg" + - any-glob-to-any-file: "parser/tests/__init__.py" + - any-glob-to-any-file: "parser/tests/conftest.py" + - any-glob-to-any-file: "parser/tests/data/test.txt" + - any-glob-to-any-file: "parser/tests/integration/__init__.py" + - any-glob-to-any-file: "parser/**/*" tests: - - any-glob-to-any-file: 'parser/tests/__init__.py' - - any-glob-to-any-file: 'parser/tests/conftest.py' - - any-glob-to-any-file: 'parser/tests/data/test.txt' - - any-glob-to-any-file: 'parser/tests/integration/__init__.py' - - any-glob-to-any-file: 'parser/tests/**/*' + - any-glob-to-any-file: "parser/tests/__init__.py" + - any-glob-to-any-file: "parser/tests/conftest.py" + - any-glob-to-any-file: "parser/tests/data/test.txt" + - any-glob-to-any-file: "parser/tests/integration/__init__.py" + - any-glob-to-any-file: "parser/tests/**/*" diff --git a/taxonomy-editor-frontend/package-lock.json b/taxonomy-editor-frontend/package-lock.json index 7563b03b..e33a83b6 100644 --- a/taxonomy-editor-frontend/package-lock.json +++ b/taxonomy-editor-frontend/package-lock.json @@ -47,7 +47,7 @@ "husky": "^8.0.3", "lint-staged": "^15.2.0", "openapi-typescript-codegen": "^0.27.0", - "prettier": "2.8.2", + "prettier": "3.3.2", "vite": "^5.1.0", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.3.1" @@ -17063,15 +17063,15 @@ } }, "node_modules/prettier": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.2.tgz", - "integrity": "sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -35200,9 +35200,9 @@ "dev": true }, "prettier": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.2.tgz", - "integrity": "sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true }, "pretty-bytes": { diff --git a/taxonomy-editor-frontend/package.json b/taxonomy-editor-frontend/package.json index 7065bac3..02c3b2b8 100644 --- a/taxonomy-editor-frontend/package.json +++ b/taxonomy-editor-frontend/package.json @@ -52,7 +52,7 @@ "husky": "^8.0.3", "lint-staged": "^15.2.0", "openapi-typescript-codegen": "^0.27.0", - "prettier": "2.8.2", + "prettier": "3.3.2", "vite": "^5.1.0", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.3.1" diff --git a/taxonomy-editor-frontend/src/client/core/ApiError.ts b/taxonomy-editor-frontend/src/client/core/ApiError.ts index d9769d2e..ebc11612 100644 --- a/taxonomy-editor-frontend/src/client/core/ApiError.ts +++ b/taxonomy-editor-frontend/src/client/core/ApiError.ts @@ -15,7 +15,7 @@ export class ApiError extends Error { constructor( request: ApiRequestOptions, response: ApiResult, - message: string + message: string, ) { super(message); diff --git a/taxonomy-editor-frontend/src/client/core/CancelablePromise.ts b/taxonomy-editor-frontend/src/client/core/CancelablePromise.ts index 2e5b725d..b9701ddf 100644 --- a/taxonomy-editor-frontend/src/client/core/CancelablePromise.ts +++ b/taxonomy-editor-frontend/src/client/core/CancelablePromise.ts @@ -34,8 +34,8 @@ export class CancelablePromise implements Promise { executor: ( resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void, - onCancel: OnCancel - ) => void + onCancel: OnCancel, + ) => void, ) { this.#isResolved = false; this.#isRejected = false; @@ -90,13 +90,13 @@ export class CancelablePromise implements Promise { public then( onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null + onRejected?: ((reason: any) => TResult2 | PromiseLike) | null, ): Promise { return this.#promise.then(onFulfilled, onRejected); } public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null + onRejected?: ((reason: any) => TResult | PromiseLike) | null, ): Promise { return this.#promise.catch(onRejected); } diff --git a/taxonomy-editor-frontend/src/client/core/request.ts b/taxonomy-editor-frontend/src/client/core/request.ts index 220efd63..534f264f 100644 --- a/taxonomy-editor-frontend/src/client/core/request.ts +++ b/taxonomy-editor-frontend/src/client/core/request.ts @@ -19,7 +19,7 @@ import type { OnCancel } from "./CancelablePromise"; import type { OpenAPIConfig } from "./OpenAPI"; export const isDefined = ( - value: T | null | undefined + value: T | null | undefined, ): value is Exclude => { return value !== undefined && value !== null; }; @@ -116,7 +116,7 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { }; export const getFormData = ( - options: ApiRequestOptions + options: ApiRequestOptions, ): FormData | undefined => { if (options.formData) { const formData = new FormData(); @@ -148,7 +148,7 @@ type Resolver = (options: ApiRequestOptions) => Promise; export const resolve = async ( options: ApiRequestOptions, - resolver?: T | Resolver + resolver?: T | Resolver, ): Promise => { if (typeof resolver === "function") { return (resolver as Resolver)(options); @@ -159,7 +159,7 @@ export const resolve = async ( export const getHeaders = async ( config: OpenAPIConfig, options: ApiRequestOptions, - formData?: FormData + formData?: FormData, ): Promise> => { const [token, username, password, additionalHeaders] = await Promise.all([ resolve(options, config.TOKEN), @@ -184,7 +184,7 @@ export const getHeaders = async ( ...headers, [key]: String(value), }), - {} as Record + {} as Record, ); if (isStringWithValue(token)) { @@ -226,7 +226,7 @@ export const sendRequest = async ( formData: FormData | undefined, headers: Record, onCancel: OnCancel, - axiosClient: AxiosInstance + axiosClient: AxiosInstance, ): Promise> => { const source = axios.CancelToken.source(); @@ -254,7 +254,7 @@ export const sendRequest = async ( export const getResponseHeader = ( response: AxiosResponse, - responseHeader?: string + responseHeader?: string, ): string | undefined => { if (responseHeader) { const content = response.headers[responseHeader]; @@ -274,7 +274,7 @@ export const getResponseBody = (response: AxiosResponse): any => { export const catchErrorCodes = ( options: ApiRequestOptions, - result: ApiResult + result: ApiResult, ): void => { const errors: Record = { 400: "Bad Request", @@ -306,7 +306,7 @@ export const catchErrorCodes = ( throw new ApiError( options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`, ); } }; @@ -322,7 +322,7 @@ export const catchErrorCodes = ( export const request = ( config: OpenAPIConfig, options: ApiRequestOptions, - axiosClient: AxiosInstance = axios + axiosClient: AxiosInstance = axios, ): CancelablePromise => { return new CancelablePromise(async (resolve, reject, onCancel) => { try { @@ -340,12 +340,12 @@ export const request = ( formData, headers, onCancel, - axiosClient + axiosClient, ); const responseBody = getResponseBody(response); const responseHeader = getResponseHeader( response, - options.responseHeader + options.responseHeader, ); const result: ApiResult = { diff --git a/taxonomy-editor-frontend/src/client/services/DefaultService.ts b/taxonomy-editor-frontend/src/client/services/DefaultService.ts index d9fb6f9d..b016054d 100644 --- a/taxonomy-editor-frontend/src/client/services/DefaultService.ts +++ b/taxonomy-editor-frontend/src/client/services/DefaultService.ts @@ -60,7 +60,7 @@ export class DefaultService { */ public static getProjectInfoTaxonomyNameBranchProjectGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -86,7 +86,7 @@ export class DefaultService { public static setProjectStatusTaxonomyNameBranchSetProjectStatusGet( branch: string, taxonomyName: string, - status?: ProjectStatus | null + status?: ProjectStatus | null, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -113,7 +113,7 @@ export class DefaultService { */ public static findAllNodesTaxonomyNameBranchNodesGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -137,7 +137,7 @@ export class DefaultService { */ public static deleteNodeTaxonomyNameBranchNodesDelete( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "DELETE", @@ -161,7 +161,7 @@ export class DefaultService { */ public static findAllRootNodesTaxonomyNameBranchRootentriesGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -187,7 +187,7 @@ export class DefaultService { public static findOneEntryTaxonomyNameBranchEntryEntryGet( branch: string, taxonomyName: string, - entry: string + entry: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -216,7 +216,7 @@ export class DefaultService { public static editEntryTaxonomyNameBranchEntryEntryPost( branch: string, taxonomyName: string, - entry: string + entry: string, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -243,7 +243,7 @@ export class DefaultService { public static findOneEntryParentsTaxonomyNameBranchEntryEntryParentsGet( branch: string, taxonomyName: string, - entry: string + entry: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -270,7 +270,7 @@ export class DefaultService { public static findOneEntryChildrenTaxonomyNameBranchEntryEntryChildrenGet( branch: string, taxonomyName: string, - entry: string + entry: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -299,7 +299,7 @@ export class DefaultService { public static editEntryChildrenTaxonomyNameBranchEntryEntryChildrenPost( branch: string, taxonomyName: string, - entry: string + entry: string, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -326,7 +326,7 @@ export class DefaultService { public static findOneSynonymTaxonomyNameBranchSynonymSynonymGet( branch: string, taxonomyName: string, - synonym: string + synonym: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -355,7 +355,7 @@ export class DefaultService { public static editSynonymsTaxonomyNameBranchSynonymSynonymPost( branch: string, taxonomyName: string, - synonym: string + synonym: string, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -380,7 +380,7 @@ export class DefaultService { */ public static findAllSynonymsTaxonomyNameBranchSynonymGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -406,7 +406,7 @@ export class DefaultService { public static findOneStopwordTaxonomyNameBranchStopwordStopwordGet( branch: string, taxonomyName: string, - stopword: string + stopword: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -435,7 +435,7 @@ export class DefaultService { public static editStopwordsTaxonomyNameBranchStopwordStopwordPost( branch: string, taxonomyName: string, - stopword: string + stopword: string, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -460,7 +460,7 @@ export class DefaultService { */ public static findAllStopwordsTaxonomyNameBranchStopwordGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -484,7 +484,7 @@ export class DefaultService { */ public static findHeaderTaxonomyNameBranchHeaderGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -510,7 +510,7 @@ export class DefaultService { public static editHeaderTaxonomyNameBranchHeaderPost( branch: string, taxonomyName: string, - requestBody: Header + requestBody: Header, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -536,7 +536,7 @@ export class DefaultService { */ public static findFooterTaxonomyNameBranchFooterGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -562,7 +562,7 @@ export class DefaultService { public static editFooterTaxonomyNameBranchFooterPost( branch: string, taxonomyName: string, - requestBody: Footer + requestBody: Footer, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -588,7 +588,7 @@ export class DefaultService { */ public static findAllErrorsTaxonomyNameBranchParsingErrorsGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -615,7 +615,7 @@ export class DefaultService { branch: string, taxonomyName: string, q: string = "", - page: number = 1 + page: number = 1, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -642,7 +642,7 @@ export class DefaultService { */ public static exportToTextFileTaxonomyNameBranchDownloadexportGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -665,7 +665,7 @@ export class DefaultService { */ public static exportToGithubTaxonomyNameBranchGithubexportGet( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "GET", @@ -689,7 +689,7 @@ export class DefaultService { */ public static importFromGithubTaxonomyNameBranchImportPost( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -715,7 +715,7 @@ export class DefaultService { public static uploadTaxonomyTaxonomyNameBranchUploadPost( branch: string, taxonomyName: string, - formData: Body_upload_taxonomy__taxonomy_name___branch__upload_post + formData: Body_upload_taxonomy__taxonomy_name___branch__upload_post, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -743,7 +743,7 @@ export class DefaultService { public static createEntryNodeTaxonomyNameBranchEntryPost( branch: string, taxonomyName: string, - requestBody: EntryNodeCreate + requestBody: EntryNodeCreate, ): CancelablePromise { return __request(OpenAPI, { method: "POST", @@ -769,7 +769,7 @@ export class DefaultService { */ public static deleteProjectTaxonomyNameBranchDelete( branch: string, - taxonomyName: string + taxonomyName: string, ): CancelablePromise { return __request(OpenAPI, { method: "DELETE", diff --git a/taxonomy-editor-frontend/src/components/EntryNodesTableBody.tsx b/taxonomy-editor-frontend/src/components/EntryNodesTableBody.tsx index 8500c8ec..37cf89f3 100644 --- a/taxonomy-editor-frontend/src/components/EntryNodesTableBody.tsx +++ b/taxonomy-editor-frontend/src/components/EntryNodesTableBody.tsx @@ -34,7 +34,7 @@ const EntryTitle = ({ id }: { id: string }) => { const getTranslations = ( tags: Record, - shownLanguageCodes: string[] + shownLanguageCodes: string[], ) => { const result: string[] = []; @@ -76,7 +76,7 @@ export const EntryNodesTableBody = ({ localStorageShownLanguages = localStorageShownLanguages.filter( (item) => { return item === "xx" || ISO6391.validate(item); - } + }, ); } else { localStorageShownLanguages = []; diff --git a/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx b/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx index 3a6e8134..f7334414 100644 --- a/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx +++ b/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx @@ -18,7 +18,7 @@ import { useTranslation } from "react-i18next"; import logoUrl from "@/assets/logosmall.jpg"; const getDisplayedPages = ( - params: Params + params: Params, ): Array<{ translationKey: string; url: string }> => { if (!params.taxonomyName || !params.branchName) { return []; @@ -97,7 +97,7 @@ export const ResponsiveAppBar = () => { {t(page.translationKey)} - ) + ), )} diff --git a/taxonomy-editor-frontend/src/components/WarningParsingErrors.tsx b/taxonomy-editor-frontend/src/components/WarningParsingErrors.tsx index db025844..238e001f 100644 --- a/taxonomy-editor-frontend/src/components/WarningParsingErrors.tsx +++ b/taxonomy-editor-frontend/src/components/WarningParsingErrors.tsx @@ -21,7 +21,7 @@ export const WarningParsingErrors: React.FC = ({ queryFn: async () => { return await DefaultService.findAllErrorsTaxonomyNameBranchParsingErrorsGet( branchName, - taxonomyName + taxonomyName, ); }, }); diff --git a/taxonomy-editor-frontend/src/components/useFetch.ts b/taxonomy-editor-frontend/src/components/useFetch.ts index fb9cffc7..613e2cdf 100644 --- a/taxonomy-editor-frontend/src/components/useFetch.ts +++ b/taxonomy-editor-frontend/src/components/useFetch.ts @@ -27,7 +27,7 @@ type ActionsType = const reducer = ( state: ReducerStateType, - action: ActionsType + action: ActionsType, ): ReducerStateType => { switch (action.type) { case "fetching": diff --git a/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx b/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx index 57ef5ed5..599578a0 100644 --- a/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx +++ b/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx @@ -63,7 +63,7 @@ const ProjectsTable = ({ projects }: { projects: Project[] }) => { const onRowClick = (params: GridRowParams) => { navigate( - `/${toSnakeCase(params.row.taxonomyName)}/${params.row.branchName}/entry` + `/${toSnakeCase(params.row.taxonomyName)}/${params.row.branchName}/entry`, ); }; diff --git a/taxonomy-editor-frontend/src/pages/project/editentry/AccumulateAllComponents.tsx b/taxonomy-editor-frontend/src/pages/project/editentry/AccumulateAllComponents.tsx index 0eef90e3..b200418e 100644 --- a/taxonomy-editor-frontend/src/pages/project/editentry/AccumulateAllComponents.tsx +++ b/taxonomy-editor-frontend/src/pages/project/editentry/AccumulateAllComponents.tsx @@ -55,7 +55,7 @@ const AccumulateAllComponents = ({ return await DefaultService.findOneEntryTaxonomyNameBranchEntryEntryGet( branchName, taxonomyName, - id + id, ); }, }); @@ -78,7 +78,7 @@ const AccumulateAllComponents = ({ }, [rawNode]); const [nodeObject, setNodeObject] = useState( - null + null, ); // Storing updates to node const [originalNodeObject, setOriginalNodeObject] = useState(null); // For tracking changes @@ -176,7 +176,7 @@ const AccumulateAllComponents = ({ setPreviousUpdateChildren(updateChildren); if (newId !== id) { navigate( - `/${toSnakeCase(taxonomyName)}/${branchName}/entry/${newId}` + `/${toSnakeCase(taxonomyName)}/${branchName}/entry/${newId}`, ); } else { refetch(); diff --git a/taxonomy-editor-frontend/src/pages/project/editentry/LanguageSelectionDialog.tsx b/taxonomy-editor-frontend/src/pages/project/editentry/LanguageSelectionDialog.tsx index 0158a931..09673baf 100644 --- a/taxonomy-editor-frontend/src/pages/project/editentry/LanguageSelectionDialog.tsx +++ b/taxonomy-editor-frontend/src/pages/project/editentry/LanguageSelectionDialog.tsx @@ -43,7 +43,7 @@ const LanguageSelectionDialog = ({ value={newLanguageCodes.map((langCode) => ISO6391.getName(langCode))} onChange={(_event, newValue: string[]) => { setNewLanguageCodes( - newValue.map((langName) => ISO6391.getCode(langName)) + newValue.map((langName) => ISO6391.getCode(langName)), ); }} options={ISO6391.getAllNames() @@ -52,7 +52,7 @@ const LanguageSelectionDialog = ({ (languageName) => !shownLanguageCodes.includes(ISO6391.getCode(languageName)) && !newLanguageCodes.includes(ISO6391.getCode(languageName)) && - languageName !== ISO6391.getName(mainLanguageCode) + languageName !== ISO6391.getName(mainLanguageCode), )} getOptionLabel={(option) => option} renderInput={(params) => ( diff --git a/taxonomy-editor-frontend/src/pages/project/editentry/ListAllEntryProperties.tsx b/taxonomy-editor-frontend/src/pages/project/editentry/ListAllEntryProperties.tsx index f458e075..1d736588 100644 --- a/taxonomy-editor-frontend/src/pages/project/editentry/ListAllEntryProperties.tsx +++ b/taxonomy-editor-frontend/src/pages/project/editentry/ListAllEntryProperties.tsx @@ -28,7 +28,7 @@ const normalizeNameToDb = (name: string) => { }; const collectProperties = ( - entryNode: DestructuredEntryNode + entryNode: DestructuredEntryNode, ): RenderedPropertyType[] => { const renderedProperties: RenderedPropertyType[] = []; Object.keys(entryNode).forEach((key: string) => { @@ -71,7 +71,7 @@ const validatePropertyName = (propertyName: string): boolean => { const isPropertyNameUnique = ( propertyName: string, - otherProperties: RenderedPropertyType[] + otherProperties: RenderedPropertyType[], ): boolean => { for (const prop of otherProperties) { if (prop.propertyName === propertyName) return false; @@ -144,7 +144,7 @@ const ListAllEntryProperties = ({ new Promise((resolve, reject) => { if (!isPropertyNameUnique(newRow.propertyName, data)) { setErrorMessage( - `${newRow.propertyName} already exists` + `${newRow.propertyName} already exists`, ); reject(); } else { @@ -158,7 +158,7 @@ const ListAllEntryProperties = ({ // Add new key-value pair of a property in nodeObject changePropertyData( normalizeNameToDb(newRow.propertyName), - newRow.propertyValue + newRow.propertyValue, ); resolve(); } @@ -168,7 +168,7 @@ const ListAllEntryProperties = ({ // Delete property from rendered rows const updatedRows = [...data]; const index = updatedRows.findIndex( - (row) => row.id === selectedRow.id + (row) => row.id === selectedRow.id, ); updatedRows.splice(index, 1); setData(updatedRows); @@ -178,28 +178,28 @@ const ListAllEntryProperties = ({ }), onRowUpdate: ( updatedRow: RenderedPropertyType, - oldRow: RenderedPropertyType + oldRow: RenderedPropertyType, ) => new Promise((resolve, reject) => { const index = data.findIndex( - (row) => row.id === updatedRow.id + (row) => row.id === updatedRow.id, ); const otherProperties = [...data]; otherProperties.splice(index, 1); if ( !isPropertyNameUnique( updatedRow.propertyName, - otherProperties + otherProperties, ) ) { setErrorMessage( - `${updatedRow.propertyName} already exists` + `${updatedRow.propertyName} already exists`, ); reject(); } else { // Update row in rendered rows const updatedRows = data.map((el) => - el.id === oldRow.id ? updatedRow : el + el.id === oldRow.id ? updatedRow : el, ); setData(updatedRows); // Updation takes place by deletion + addition @@ -209,7 +209,7 @@ const ListAllEntryProperties = ({ // Add new property to nodeObject changePropertyData( normalizeNameToDb(updatedRow.propertyName), - updatedRow.propertyValue + updatedRow.propertyValue, ); resolve(); } diff --git a/taxonomy-editor-frontend/src/pages/project/editentry/ListAllNonEntryInfo.tsx b/taxonomy-editor-frontend/src/pages/project/editentry/ListAllNonEntryInfo.tsx index e2b65037..2c80e782 100644 --- a/taxonomy-editor-frontend/src/pages/project/editentry/ListAllNonEntryInfo.tsx +++ b/taxonomy-editor-frontend/src/pages/project/editentry/ListAllNonEntryInfo.tsx @@ -54,7 +54,7 @@ const ListAllNonEntryInfo = ({ nodeObject, id, setNodeObject }) => { tagsExtracted.push({ index: uuids[index], tag: tag, - }) + }), ); } } @@ -68,7 +68,7 @@ const ListAllNonEntryInfo = ({ nodeObject, id, setNodeObject }) => { const changeData = (index, value) => { const updatedTagObject = { index: index, tag: value }; const newRenderedNonEntryInfo = renderedNonEntryInfo.map((obj) => - obj.index === index ? updatedTagObject : obj + obj.index === index ? updatedTagObject : obj, ); setRenderedNonEntryInfo(newRenderedNonEntryInfo); // Set state @@ -100,7 +100,7 @@ const ListAllNonEntryInfo = ({ nodeObject, id, setNodeObject }) => { const handleDelete = (index) => { const newRenderedNonEntryInfo = renderedNonEntryInfo.filter( - (obj) => !(obj.index === index) + (obj) => !(obj.index === index), ); setRenderedNonEntryInfo(newRenderedNonEntryInfo); // Set state diff --git a/taxonomy-editor-frontend/src/pages/project/editentry/ListEntryChildren.tsx b/taxonomy-editor-frontend/src/pages/project/editentry/ListEntryChildren.tsx index 7727b94f..4587c2cb 100644 --- a/taxonomy-editor-frontend/src/pages/project/editentry/ListEntryChildren.tsx +++ b/taxonomy-editor-frontend/src/pages/project/editentry/ListEntryChildren.tsx @@ -63,7 +63,7 @@ const ListEntryChildren = ({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error incomingData.map((el) => - arrayData.push({ index: Math.random().toString(), child: el?.[0] }) + arrayData.push({ index: Math.random().toString(), child: el?.[0] }), ); setRelations(arrayData); } diff --git a/taxonomy-editor-frontend/src/pages/project/editentry/ListTranslations.tsx b/taxonomy-editor-frontend/src/pages/project/editentry/ListTranslations.tsx index 71f26b89..17263e51 100644 --- a/taxonomy-editor-frontend/src/pages/project/editentry/ListTranslations.tsx +++ b/taxonomy-editor-frontend/src/pages/project/editentry/ListTranslations.tsx @@ -68,7 +68,7 @@ export const ListTranslations = ({ let newShownLanguageCodes: string[]; if (shownLanguageCodes.includes(languageCode)) { newShownLanguageCodes = shownLanguageCodes.filter( - (langCode) => langCode !== languageCode + (langCode) => langCode !== languageCode, ); } else { newShownLanguageCodes = [...shownLanguageCodes, languageCode]; @@ -76,7 +76,7 @@ export const ListTranslations = ({ } localStorage.setItem( SHOWN_LANGUAGES_KEY, - JSON.stringify(newShownLanguageCodes) + JSON.stringify(newShownLanguageCodes), ); setShownLanguageCodes(newShownLanguageCodes); }; @@ -94,7 +94,7 @@ export const ListTranslations = ({ newLanguageCodes.forEach((languageCode) => { if (shownLanguageCodes.includes(languageCode)) { newShownLanguageCodes = newShownLanguageCodes.filter( - (langCode) => langCode !== languageCode + (langCode) => langCode !== languageCode, ); } else { newShownLanguageCodes.push(languageCode); @@ -103,7 +103,7 @@ export const ListTranslations = ({ }); localStorage.setItem( SHOWN_LANGUAGES_KEY, - JSON.stringify(newShownLanguageCodes) + JSON.stringify(newShownLanguageCodes), ); setShownLanguageCodes(newShownLanguageCodes); @@ -127,7 +127,7 @@ export const ListTranslations = ({ localStorageShownLanguages = localStorageShownLanguages.filter( (item) => { return item === "xx" || ISO6391.validate(item); - } + }, ); } else { localStorageShownLanguages = []; @@ -158,11 +158,11 @@ export const ListTranslations = ({ let languagesToShow: string[]; languagesToShow = shownLanguageCodes.filter( - (languageCode) => languageCode !== nodeObject.mainLanguage + (languageCode) => languageCode !== nodeObject.mainLanguage, ); if (shownLanguageCodes.includes("xx")) { languagesToShow = languagesToShow.filter( - (languageCode) => languageCode !== "xx" + (languageCode) => languageCode !== "xx", ); languagesToShow.unshift("xx"); } @@ -175,11 +175,12 @@ export const ListTranslations = ({ (key) => key.startsWith("tags_") && !key.startsWith("tags_ids_") && - (nodeObject[key]?.length > 0 || originalNodeObject[key]?.length > 0) + (nodeObject[key]?.length > 0 || + originalNodeObject[key]?.length > 0), ) .map((key) => key.slice(5)) .filter((languageCode) => !languagesToShow.includes(languageCode)) - .sort(sortByLanguageName) + .sort(sortByLanguageName), ); } @@ -188,7 +189,7 @@ export const ListTranslations = ({ originalNodeObject[`tags_${language}`]?.[0] && nodeObject[`tags_${language}`]?.[0] && nodeObject[`tags_${language}`]?.[0] !== - originalNodeObject[`tags_${language}`]?.[0] + originalNodeObject[`tags_${language}`]?.[0], ); const shownLanguagesInfo = languagesToShow.map((languageCode: string) => { @@ -299,7 +300,7 @@ export const ListTranslations = ({ ); - } + }, )}