diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index d20171a2..cc5f5184 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -18,6 +18,11 @@ jobs: steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 + - name: Install Docker Compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - name: Export release code if: (success() || failure()) id: releasecode #version number in a more comprehensible format: 0.1.YearMonthDay in UTC diff --git a/pwa/src/apiService/apiService.ts b/pwa/src/apiService/apiService.ts index 74e82f79..707eb756 100644 --- a/pwa/src/apiService/apiService.ts +++ b/pwa/src/apiService/apiService.ts @@ -36,6 +36,8 @@ interface PromiseMessage { error?: string; } +export const DEFAULT_LIMIT = 200; + export type TSendFunction = ( instance: AxiosInstance, method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "DOWNLOAD", diff --git a/pwa/src/apiService/resources/application.ts b/pwa/src/apiService/resources/application.ts index b7ec7ac6..5d965d23 100644 --- a/pwa/src/apiService/resources/application.ts +++ b/pwa/src/apiService/resources/application.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Application { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Application { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/applications"); + const { data } = await this._send(this._instance, "GET", `/admin/applications?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/applications?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/applications?limit=${DEFAULT_LIMIT}`); return data?.map((application: any) => ({ label: application.name, value: application.id })); }; diff --git a/pwa/src/apiService/resources/attribute.ts b/pwa/src/apiService/resources/attribute.ts index 3bbc728e..16bf3284 100644 --- a/pwa/src/apiService/resources/attribute.ts +++ b/pwa/src/apiService/resources/attribute.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Attribute { private _instance: AxiosInstance; @@ -11,7 +11,7 @@ export default class Attribute { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/attributes"); + const { data } = await this._send(this._instance, "GET", `/admin/attributes?limit=${DEFAULT_LIMIT}`); return data; }; diff --git a/pwa/src/apiService/resources/cronjob.ts b/pwa/src/apiService/resources/cronjob.ts index c526bc13..30ce9dfa 100644 --- a/pwa/src/apiService/resources/cronjob.ts +++ b/pwa/src/apiService/resources/cronjob.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Cronjob { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Cronjob { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/cronjobs"); + const { data } = await this._send(this._instance, "GET", `/admin/cronjobs?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/cronjobs?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/cronjobs?limit=${DEFAULT_LIMIT}`); return data?.map((cronjob: any) => ({ label: cronjob.name, value: cronjob.id })); }; diff --git a/pwa/src/apiService/resources/dashboardCards.tsx b/pwa/src/apiService/resources/dashboardCards.tsx index b9d4975e..17ad7ecb 100644 --- a/pwa/src/apiService/resources/dashboardCards.tsx +++ b/pwa/src/apiService/resources/dashboardCards.tsx @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export type TEntity = | "Action" diff --git a/pwa/src/apiService/resources/database.ts b/pwa/src/apiService/resources/database.ts index 29472ea9..4c9afcf6 100644 --- a/pwa/src/apiService/resources/database.ts +++ b/pwa/src/apiService/resources/database.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Database { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Database { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/databases"); + const { data } = await this._send(this._instance, "GET", `/admin/databases?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/databases?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/databases?limit=${DEFAULT_LIMIT}`); return data?.map((database: any) => ({ label: database.name, value: database.id })); }; diff --git a/pwa/src/apiService/resources/endpoint.ts b/pwa/src/apiService/resources/endpoint.ts index db12462e..0874d048 100644 --- a/pwa/src/apiService/resources/endpoint.ts +++ b/pwa/src/apiService/resources/endpoint.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Endpoint { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Endpoint { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/endpoints"); + const { data } = await this._send(this._instance, "GET", `/admin/endpoints?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/endpoints"); + const { data } = await this._send(this._instance, "GET", `/admin/endpoints?limit=${DEFAULT_LIMIT}`); return data?.map((endpoint: any) => ({ label: endpoint.name, value: endpoint.id })); }; diff --git a/pwa/src/apiService/resources/mapping.ts b/pwa/src/apiService/resources/mapping.ts index d38cca03..be524347 100644 --- a/pwa/src/apiService/resources/mapping.ts +++ b/pwa/src/apiService/resources/mapping.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Mapping { private _instance: AxiosInstance; @@ -11,7 +11,7 @@ export default class Mapping { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/mappings"); + const { data } = await this._send(this._instance, "GET", `/admin/mappings?limit=${DEFAULT_LIMIT}`); return data; }; @@ -23,12 +23,11 @@ export default class Mapping { }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/mappings?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/mappings?limit=${DEFAULT_LIMIT}`); return data?.map((mapping: any) => ({ label: mapping.name, value: mapping.id })); }; - public delete = async (variables: { id: string }): Promise => { const { id } = variables; diff --git a/pwa/src/apiService/resources/object.ts b/pwa/src/apiService/resources/object.ts index 20693fc8..9ea86c1e 100644 --- a/pwa/src/apiService/resources/object.ts +++ b/pwa/src/apiService/resources/object.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; import { TDownloadType, downloadTypes } from "../../data/downloadTypes"; export default class Sources { private _instance: AxiosInstance; @@ -70,7 +70,7 @@ export default class Sources { }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/objects?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/objects?limit=${DEFAULT_LIMIT}`); return data?.results?.map((object: any) => ({ label: object.titel, value: object.id })); }; diff --git a/pwa/src/apiService/resources/organization.ts b/pwa/src/apiService/resources/organization.ts index 2f74cd98..2b558207 100644 --- a/pwa/src/apiService/resources/organization.ts +++ b/pwa/src/apiService/resources/organization.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Organization { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Organization { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/organizations"); + const { data } = await this._send(this._instance, "GET", `/admin/organizations?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/organizations?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/organizations?limit=${DEFAULT_LIMIT}`); return data?.map((organization: any) => ({ label: organization.name, value: organization.id })); }; diff --git a/pwa/src/apiService/resources/schema.ts b/pwa/src/apiService/resources/schema.ts index f43d38ee..0680911e 100644 --- a/pwa/src/apiService/resources/schema.ts +++ b/pwa/src/apiService/resources/schema.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; import { TDownloadType, downloadTypes } from "../../data/downloadTypes"; export default class Schema { @@ -12,13 +12,13 @@ export default class Schema { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/entities?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/entities?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/entities?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/entities?limit=${DEFAULT_LIMIT}`); return data?.map((schema: any) => ({ label: schema.name, value: schema.id })); }; diff --git a/pwa/src/apiService/resources/securityGroup.ts b/pwa/src/apiService/resources/securityGroup.ts index 32490f2d..ef01b8f1 100644 --- a/pwa/src/apiService/resources/securityGroup.ts +++ b/pwa/src/apiService/resources/securityGroup.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class SecurityGroup { private _instance: AxiosInstance; @@ -11,7 +11,7 @@ export default class SecurityGroup { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/user_groups"); + const { data } = await this._send(this._instance, "GET", `/admin/user_groups?limit=${DEFAULT_LIMIT}`); return data; }; diff --git a/pwa/src/apiService/resources/source.ts b/pwa/src/apiService/resources/source.ts index d29b4668..7c642bcc 100644 --- a/pwa/src/apiService/resources/source.ts +++ b/pwa/src/apiService/resources/source.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Source { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Source { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/gateways?order[name]=ASC"); + const { data } = await this._send(this._instance, "GET", `/admin/gateways?order[name]=ASC&limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/gateways?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/gateways?limit=${DEFAULT_LIMIT}`); return data?.map((source: any) => ({ label: source.name, value: source.id })); }; diff --git a/pwa/src/apiService/resources/synchronization.ts b/pwa/src/apiService/resources/synchronization.ts index 9358f341..119c1363 100644 --- a/pwa/src/apiService/resources/synchronization.ts +++ b/pwa/src/apiService/resources/synchronization.ts @@ -1,6 +1,6 @@ import { AxiosInstance } from "axios"; import { paramsToQueryParams } from "../../services/paramsToQueryParams"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Synchroniation { private _instance: AxiosInstance; @@ -12,7 +12,7 @@ export default class Synchroniation { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/synchronizations"); + const { data } = await this._send(this._instance, "GET", `/admin/synchronizations?limit=${DEFAULT_LIMIT}`); return data; }; diff --git a/pwa/src/apiService/resources/template.ts b/pwa/src/apiService/resources/template.ts index c06c6912..65bca857 100644 --- a/pwa/src/apiService/resources/template.ts +++ b/pwa/src/apiService/resources/template.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class Template { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class Template { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/templates"); + const { data } = await this._send(this._instance, "GET", `/admin/templates?limit=200`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/templates?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/templates?limit=${DEFAULT_LIMIT}`); return data?.map((template: any) => ({ label: template.name, value: template.id })); }; diff --git a/pwa/src/apiService/resources/user.ts b/pwa/src/apiService/resources/user.ts index 6b51774e..09060bf4 100644 --- a/pwa/src/apiService/resources/user.ts +++ b/pwa/src/apiService/resources/user.ts @@ -1,5 +1,5 @@ import { AxiosInstance } from "axios"; -import { TSendFunction } from "../apiService"; +import { DEFAULT_LIMIT, TSendFunction } from "../apiService"; export default class User { private _instance: AxiosInstance; @@ -11,13 +11,13 @@ export default class User { } public getAll = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/users"); + const { data } = await this._send(this._instance, "GET", `/admin/users?limit=${DEFAULT_LIMIT}`); return data; }; public getAllSelectOptions = async (): Promise => { - const { data } = await this._send(this._instance, "GET", "/admin/users?limit=200"); + const { data } = await this._send(this._instance, "GET", `/admin/users?limit=${DEFAULT_LIMIT}`); return data?.map((user: any) => ({ label: user.name, value: user.id })); };