Skip to content

Commit

Permalink
Fix: enable webapp to run larger api response
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmullapudi committed Jul 5, 2023
1 parent 75d3534 commit 7c9523a
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions engine-server/src/common/interfaces/query.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class QueryParams extends PaginationParams {
export class JustRawParams {
@IsBoolean()
@IsOptional()
@Transform(({ value }) => value === 'true' || value === 'True')
raw?: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions engine-webapp/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ module.exports = {
experimental: {
outputStandalone: true,
},
api: {
responseLimit: false,
},
};
4 changes: 2 additions & 2 deletions engine-webapp/src/modules/authentication/signin/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -75,7 +75,7 @@ export function Signin() {
Forgot password?
</Anchor>
</Group>
<Button fullWidth mt="xl" type="submit">
<Button fullWidth mt="xl" type="submit" loading={isLoading}>
Sign in
</Button>
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions engine-webapp/src/modules/settings/api_keys/api_keys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -64,7 +64,9 @@ export function APIKeys() {
/>

<Group position="right" mt="xl">
<Button type="submit">Create token</Button>
<Button type="submit" loading={isLoading}>
Create token
</Button>
</Group>
</form>
</Group>
Expand Down
2 changes: 1 addition & 1 deletion engine-webapp/src/modules/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function useGetIntegrationDefinitionSpecQuery(
queryParams: IntegrationDefinitionParams,
): UseQueryResult<Specification, XHRErrorResponse> {
return useQuery(
[GetIntegrationDefinitionSpec],
[GetIntegrationDefinitionSpec, queryParams.integrationDefinitionId],
() => getIntegrationDefinitionSpec(queryParams),
{
notifyOnChangeProps: 'tracked',
Expand Down
10 changes: 5 additions & 5 deletions integration_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integrations/mail/gmail/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/**/*.js

github/
gmail/
2 changes: 1 addition & 1 deletion integrations/mail/gmail/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poozle/gmail",
"version": "0.1.1",
"version": "0.1.2",
"description": "gmail extension for Poozle",
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion integrations/mail/gmail/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? ''),
Expand Down
1 change: 0 additions & 1 deletion integrations/ticketing/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"access": "public"
},
"dependencies": {
"@poozle/engine-edk": "^0.2.13",
"@poozle/engine-idk": "^0.1.3",
"axios": "^1.4.0"
},
Expand Down

0 comments on commit 7c9523a

Please sign in to comment.