From 7c9523afcf24769f9ebc808ae06b633da566dfad Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi Date: Tue, 4 Jul 2023 20:51:26 -0700 Subject: [PATCH] Fix: enable webapp to run larger api response --- .env | 4 ++-- docker-compose.yaml | 6 ++++-- engine-server/src/common/interfaces/query.interface.ts | 1 + .../mail/models/message/message.controller.ts | 2 +- engine-webapp/next.config.js | 3 +++ .../src/modules/authentication/signin/signin.tsx | 4 ++-- .../integration/new_integration/new_integration.tsx | 2 +- .../src/modules/settings/api_keys/api_keys.tsx | 6 ++++-- engine-webapp/src/modules/settings/settings.tsx | 2 +- .../integration_account/create_integration_account.ts | 2 +- .../get_spec_for_integration_definition.ts | 2 +- integration_definitions.json | 10 +++++----- integrations/mail/gmail/.eslintignore | 2 +- integrations/mail/gmail/package.json | 2 +- integrations/mail/gmail/src/index.ts | 2 +- .../mail/gmail/src/models/message/message.utils.ts | 2 +- integrations/ticketing/github/package.json | 1 - 17 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.env b/.env index 2109e714..d3713a49 100644 --- a/.env +++ b/.env @@ -1,8 +1,8 @@ ENGINE_VERSION=0.1.2-alpha # POSTGRES -POSTGRES_USER=poozle -POSTGRES_PASSWORD=poozle +POSTGRES_USER=docker +POSTGRES_PASSWORD=docker POSTGRES_DB=poozle # Nest run in docker, change host to database container name diff --git a/docker-compose.yaml b/docker-compose.yaml index 82cb4740..3b21a94f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,8 +7,6 @@ services: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} - ports: - - 5432:5432 networks: - poozle restart: unless-stopped @@ -17,6 +15,8 @@ services: image: poozlehq/engine-server:${ENGINE_VERSION} platform: linux/amd64 container_name: poozle-server + depends_on: + - db restart: unless-stopped networks: - poozle @@ -32,6 +32,8 @@ services: # Default User - USER_PASSWORD=${USER_PASSWORD} - USER_EMAIL=${USER_EMAIL} + - USER_FIRSTNAME=${USER_FIRSTNAME} + - USER_LASTNAME=${USER_LASTNAME} - CREATE_DEFAULT_USER=${CREATE_DEFAULT_USER} webapp: diff --git a/engine-server/src/common/interfaces/query.interface.ts b/engine-server/src/common/interfaces/query.interface.ts index 8c5d42bb..3989a5e8 100644 --- a/engine-server/src/common/interfaces/query.interface.ts +++ b/engine-server/src/common/interfaces/query.interface.ts @@ -15,6 +15,7 @@ export class QueryParams extends PaginationParams { export class JustRawParams { @IsBoolean() @IsOptional() + @Transform(({ value }) => value === 'true' || value === 'True') raw?: boolean; } diff --git a/engine-server/src/modules/categories/mail/models/message/message.controller.ts b/engine-server/src/modules/categories/mail/models/message/message.controller.ts index f5285121..d7eacd56 100644 --- a/engine-server/src/modules/categories/mail/models/message/message.controller.ts +++ b/engine-server/src/modules/categories/mail/models/message/message.controller.ts @@ -58,7 +58,7 @@ export class MessagesController { @Get('messages/:message_id') async getMessageId( - @Query() query: ListMessagesQueryParams, + @Query() query: CommonMessageQueryParams, @Param() params: PathParamsWithMessageId, @GetIntegrationAccount(IntegrationType.MAIL) diff --git a/engine-webapp/next.config.js b/engine-webapp/next.config.js index c42682ba..6a914bca 100644 --- a/engine-webapp/next.config.js +++ b/engine-webapp/next.config.js @@ -23,4 +23,7 @@ module.exports = { experimental: { outputStandalone: true, }, + api: { + responseLimit: false, + }, }; diff --git a/engine-webapp/src/modules/authentication/signin/signin.tsx b/engine-webapp/src/modules/authentication/signin/signin.tsx index 4e9295ae..b68262ca 100644 --- a/engine-webapp/src/modules/authentication/signin/signin.tsx +++ b/engine-webapp/src/modules/authentication/signin/signin.tsx @@ -27,7 +27,7 @@ interface FormValues { export function Signin() { const router = useRouter(); - const { mutate: signinMutate } = useSignInMutation({ + const { mutate: signinMutate, isLoading } = useSignInMutation({ onSuccess: () => router.replace('/workspaces'), }); const form = useForm({ @@ -75,7 +75,7 @@ export function Signin() { Forgot password? - diff --git a/engine-webapp/src/modules/integration/new_integration/new_integration.tsx b/engine-webapp/src/modules/integration/new_integration/new_integration.tsx index 5d2b81b3..b14c2685 100644 --- a/engine-webapp/src/modules/integration/new_integration/new_integration.tsx +++ b/engine-webapp/src/modules/integration/new_integration/new_integration.tsx @@ -1,5 +1,6 @@ /** Copyright (c) 2023, Poozle, all rights reserved. **/ +import { IntegrationDefinition } from '@@generated/integrationDefinition/entities'; import { Container, Divider, Group, Paper, Title } from '@mantine/core'; import { useRouter } from 'next/router'; import * as React from 'react'; @@ -14,7 +15,6 @@ import { Header, Select } from 'components'; import styles from './new_integration.module.scss'; import { NewIntegrationForm } from './new_integration_form'; -import { IntegrationDefinition } from '@@generated/integrationDefinition/entities'; export function NewIntegration() { const { diff --git a/engine-webapp/src/modules/settings/api_keys/api_keys.tsx b/engine-webapp/src/modules/settings/api_keys/api_keys.tsx index d6e6e4b5..af6b3d84 100644 --- a/engine-webapp/src/modules/settings/api_keys/api_keys.tsx +++ b/engine-webapp/src/modules/settings/api_keys/api_keys.tsx @@ -29,7 +29,7 @@ export function APIKeys() { }, }); const [token, setToken] = React.useState(''); - const { mutate: createToken } = useCreateTokenMutation({ + const { mutate: createToken, isLoading } = useCreateTokenMutation({ onSuccess: (data) => { setToken(data); form.reset(); @@ -64,7 +64,9 @@ export function APIKeys() { /> - + diff --git a/engine-webapp/src/modules/settings/settings.tsx b/engine-webapp/src/modules/settings/settings.tsx index 7cd76324..59f65a69 100644 --- a/engine-webapp/src/modules/settings/settings.tsx +++ b/engine-webapp/src/modules/settings/settings.tsx @@ -10,9 +10,9 @@ import { GetUserData } from 'wrappers/get_user_data'; import { Header } from 'components'; import { Account } from './account/account'; +import { APIKeys } from './api_keys/api_keys'; import { Integrations } from './integrations/integrations'; import { StyledTabs } from './styled_tab'; -import { APIKeys } from './api_keys/api_keys'; const enum TAB_KEYS { 'ACCOUNT' = 'ACCOUNT', diff --git a/engine-webapp/src/services/integration_account/create_integration_account.ts b/engine-webapp/src/services/integration_account/create_integration_account.ts index da52b2d7..15fad058 100644 --- a/engine-webapp/src/services/integration_account/create_integration_account.ts +++ b/engine-webapp/src/services/integration_account/create_integration_account.ts @@ -1,6 +1,6 @@ /** Copyright (c) 2023, Poozle, all rights reserved. **/ -import { IntegrationAccount } from '@@generated/integrationAccount/entities/integrationAccount.entity' +import { IntegrationAccount } from '@@generated/integrationAccount/entities/integrationAccount.entity'; import { useMutation } from 'react-query'; import { ajaxPost } from 'utils'; diff --git a/engine-webapp/src/services/integration_definition/get_spec_for_integration_definition.ts b/engine-webapp/src/services/integration_definition/get_spec_for_integration_definition.ts index 9ee14fc7..6bec6ad7 100644 --- a/engine-webapp/src/services/integration_definition/get_spec_for_integration_definition.ts +++ b/engine-webapp/src/services/integration_definition/get_spec_for_integration_definition.ts @@ -65,7 +65,7 @@ export function useGetIntegrationDefinitionSpecQuery( queryParams: IntegrationDefinitionParams, ): UseQueryResult { return useQuery( - [GetIntegrationDefinitionSpec], + [GetIntegrationDefinitionSpec, queryParams.integrationDefinitionId], () => getIntegrationDefinitionSpec(queryParams), { notifyOnChangeProps: 'tracked', diff --git a/integration_definitions.json b/integration_definitions.json index 3e0a1fb7..90349c92 100644 --- a/integration_definitions.json +++ b/integration_definitions.json @@ -2,25 +2,25 @@ "name": "Github", "key": "github", "icon": "github.svg", - "version": "0.1.1", + "version": "0.1.2", "releaseStage": "ALPHA", - "sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/ticketing/github/0.1.1/index.js", + "sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/ticketing/github/0.1.2/index.js", "integrationType": "TICKETING" }, { "name": "Jira", "key": "jira", "icon": "jira.svg", - "version": "0.1.1", + "version": "0.1.12", "releaseStage": "ALPHA", - "sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/ticketing/jira/0.1.1/index.js", + "sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/ticketing/jira/0.1.2/index.js", "integrationType": "TICKETING" }, { "name": "Gmail", "key": "gmail", "icon": "gmail.svg", - "version": "0.1.0", + "version": "0.1.1", "releaseStage": "ALPHA", "sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/mail/gmail/0.1.1/index.js", "integrationType": "MAIL" diff --git a/integrations/mail/gmail/.eslintignore b/integrations/mail/gmail/.eslintignore index 1bcfaaa5..64175101 100644 --- a/integrations/mail/gmail/.eslintignore +++ b/integrations/mail/gmail/.eslintignore @@ -1,3 +1,3 @@ /**/*.js -github/ +gmail/ diff --git a/integrations/mail/gmail/package.json b/integrations/mail/gmail/package.json index 413617c9..0090ce1e 100644 --- a/integrations/mail/gmail/package.json +++ b/integrations/mail/gmail/package.json @@ -1,6 +1,6 @@ { "name": "@poozle/gmail", - "version": "0.1.1", + "version": "0.1.2", "description": "gmail extension for Poozle", "exports": { ".": { diff --git a/integrations/mail/gmail/src/index.ts b/integrations/mail/gmail/src/index.ts index 983a8016..9672c426 100644 --- a/integrations/mail/gmail/src/index.ts +++ b/integrations/mail/gmail/src/index.ts @@ -7,12 +7,12 @@ import { GenericProxyModel, SpecificationResponse, } from '@poozle/engine-idk'; -import { fetchAccessToken } from 'utils'; import { GmailMessageModel } from 'models/message/message.model'; import { GmailThreadModel } from 'models/thread/thread.model'; import spec from './spec'; +import { fetchAccessToken } from './utils'; class GmailIntegration extends BaseIntegration { async spec(): SpecificationResponse { diff --git a/integrations/mail/gmail/src/models/message/message.utils.ts b/integrations/mail/gmail/src/models/message/message.utils.ts index b570cc55..7670c315 100644 --- a/integrations/mail/gmail/src/models/message/message.utils.ts +++ b/integrations/mail/gmail/src/models/message/message.utils.ts @@ -97,7 +97,7 @@ export function convertMessage(data: any) { thread_id: data.threadId, starred: labels.has('STARRED'), unread: labels.has('UNREAD'), - in_reply_to: responseHeaders['Message-ID'] ?? '', + in_reply_to: responseHeaders['Message-Id'] ?? '', cc: getReceipts(responseHeaders.Cc ?? ''), bcc: getReceipts(responseHeaders.Bcc ?? ''), from: getReceipts(responseHeaders.From ?? ''), diff --git a/integrations/ticketing/github/package.json b/integrations/ticketing/github/package.json index b2672ba6..2c2fac09 100644 --- a/integrations/ticketing/github/package.json +++ b/integrations/ticketing/github/package.json @@ -47,7 +47,6 @@ "access": "public" }, "dependencies": { - "@poozle/engine-edk": "^0.2.13", "@poozle/engine-idk": "^0.1.3", "axios": "^1.4.0" },