Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/taxonomy-editor-fron…
Browse files Browse the repository at this point in the history
…tend/typescript-5.4.5
  • Loading branch information
teolemon authored Jul 15, 2024
2 parents ce0d935 + d36b7d3 commit cbf3258
Show file tree
Hide file tree
Showing 26 changed files with 176 additions and 175 deletions.
136 changes: 68 additions & 68 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*"
18 changes: 9 additions & 9 deletions taxonomy-editor-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion taxonomy-editor-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion taxonomy-editor-frontend/src/client/core/ApiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ApiError extends Error {
constructor(
request: ApiRequestOptions,
response: ApiResult,
message: string
message: string,
) {
super(message);

Expand Down
8 changes: 4 additions & 4 deletions taxonomy-editor-frontend/src/client/core/CancelablePromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class CancelablePromise<T> implements Promise<T> {
executor: (
resolve: (value: T | PromiseLike<T>) => void,
reject: (reason?: any) => void,
onCancel: OnCancel
) => void
onCancel: OnCancel,
) => void,
) {
this.#isResolved = false;
this.#isRejected = false;
Expand Down Expand Up @@ -90,13 +90,13 @@ export class CancelablePromise<T> implements Promise<T> {

public then<TResult1 = T, TResult2 = never>(
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
): Promise<TResult1 | TResult2> {
return this.#promise.then(onFulfilled, onRejected);
}

public catch<TResult = never>(
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
): Promise<T | TResult> {
return this.#promise.catch(onRejected);
}
Expand Down
24 changes: 12 additions & 12 deletions taxonomy-editor-frontend/src/client/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { OnCancel } from "./CancelablePromise";
import type { OpenAPIConfig } from "./OpenAPI";

export const isDefined = <T>(
value: T | null | undefined
value: T | null | undefined,
): value is Exclude<T, null | undefined> => {
return value !== undefined && value !== null;
};
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -148,7 +148,7 @@ type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;

export const resolve = async <T>(
options: ApiRequestOptions,
resolver?: T | Resolver<T>
resolver?: T | Resolver<T>,
): Promise<T | undefined> => {
if (typeof resolver === "function") {
return (resolver as Resolver<T>)(options);
Expand All @@ -159,7 +159,7 @@ export const resolve = async <T>(
export const getHeaders = async (
config: OpenAPIConfig,
options: ApiRequestOptions,
formData?: FormData
formData?: FormData,
): Promise<Record<string, string>> => {
const [token, username, password, additionalHeaders] = await Promise.all([
resolve(options, config.TOKEN),
Expand All @@ -184,7 +184,7 @@ export const getHeaders = async (
...headers,
[key]: String(value),
}),
{} as Record<string, string>
{} as Record<string, string>,
);

if (isStringWithValue(token)) {
Expand Down Expand Up @@ -226,7 +226,7 @@ export const sendRequest = async <T>(
formData: FormData | undefined,
headers: Record<string, string>,
onCancel: OnCancel,
axiosClient: AxiosInstance
axiosClient: AxiosInstance,
): Promise<AxiosResponse<T>> => {
const source = axios.CancelToken.source();

Expand Down Expand Up @@ -254,7 +254,7 @@ export const sendRequest = async <T>(

export const getResponseHeader = (
response: AxiosResponse<any>,
responseHeader?: string
responseHeader?: string,
): string | undefined => {
if (responseHeader) {
const content = response.headers[responseHeader];
Expand All @@ -274,7 +274,7 @@ export const getResponseBody = (response: AxiosResponse<any>): any => {

export const catchErrorCodes = (
options: ApiRequestOptions,
result: ApiResult
result: ApiResult,
): void => {
const errors: Record<number, string> = {
400: "Bad Request",
Expand Down Expand Up @@ -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}`,
);
}
};
Expand All @@ -322,7 +322,7 @@ export const catchErrorCodes = (
export const request = <T>(
config: OpenAPIConfig,
options: ApiRequestOptions,
axiosClient: AxiosInstance = axios
axiosClient: AxiosInstance = axios,
): CancelablePromise<T> => {
return new CancelablePromise(async (resolve, reject, onCancel) => {
try {
Expand All @@ -340,12 +340,12 @@ export const request = <T>(
formData,
headers,
onCancel,
axiosClient
axiosClient,
);
const responseBody = getResponseBody(response);
const responseHeader = getResponseHeader(
response,
options.responseHeader
options.responseHeader,
);

const result: ApiResult = {
Expand Down
Loading

0 comments on commit cbf3258

Please sign in to comment.