Skip to content

Commit

Permalink
feat: Meged next into current
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayur committed Oct 8, 2024
2 parents b51600f + 64d617d commit f4ff8e1
Show file tree
Hide file tree
Showing 23 changed files with 11,652 additions and 15,993 deletions.
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test": "cross-env TZ=UTC NODE_ENV=test E2E_RUNNER=true mocha --timeout 10000 --require ts-node/register --exit"
},
"dependencies": {
"@amplitude/analytics-node": "^1.3.6",
"@impler/client": "workspace:^",
"@impler/dal": "workspace:^",
"@impler/services": "workspace:^",
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/app/review/review.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { SharedModule } from '@shared/shared.module';
import { AJVService } from './service/AJV.service';
import { Sandbox, SManager } from '../shared/services/sandbox';
import { QueueService } from '@shared/services/queue.service';
import { AmplitudeService } from '@shared/services/amplitude.service';

@Module({
imports: [SharedModule],
providers: [...USE_CASES, AJVService, QueueService, SManager, Sandbox],
providers: [...USE_CASES, AJVService, QueueService, SManager, Sandbox, AmplitudeService],
controllers: [ReviewController],
})
export class ReviewModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@impler/shared';
import { PaymentAPIService } from '@impler/services';
import { QueueService } from '@shared/services/queue.service';
import { AmplitudeService } from '@shared/services/amplitude.service';
import { DalService, TemplateEntity, UploadRepository } from '@impler/dal';

@Injectable()
Expand All @@ -18,6 +19,7 @@ export class StartProcess {
private dalService: DalService,
private queueService: QueueService,
private uploadRepository: UploadRepository,
private amplitudeService: AmplitudeService,
private paymentAPIService: PaymentAPIService
) {}

Expand Down Expand Up @@ -58,6 +60,12 @@ export class StartProcess {
);
}

this.amplitudeService.recordsImported(userEmail, {
records: uploadInfo.totalRecords,
valid: uploadInfo.validRecords,
invalid: uploadInfo.invalidRecords,
});

this.queueService.publishToQueue(QueuesEnum.END_IMPORT, {
uploadId: _uploadId,
destination: destination,
Expand Down
18 changes: 18 additions & 0 deletions apps/api/src/app/shared/services/amplitude.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Injectable } from '@nestjs/common';
import { init, track } from '@amplitude/analytics-node';

@Injectable()
export class AmplitudeService {
constructor() {
if (process.env.AMPLITUDE_ID) {
init(process.env.AMPLITUDE_ID);
}
}
recordsImported(email: string, data: { records: number; valid: number; invalid: number }) {
if (process.env.AMPLITUDE_ID) {
track('RECORDS IMPORTED', data, {
user_id: email,
});
}
}
}
2 changes: 2 additions & 0 deletions apps/api/src/types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ declare namespace NodeJS {
PAYMENT_API_BASE_URL: string;
PAYMENT_AUTH_KEY: string;
PAYMENT_AUTH_VALUE: string;

AMPLITUDE_ID: string;
}
}
10 changes: 0 additions & 10 deletions apps/web/assets/icons/Five.icon.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions apps/web/assets/icons/Four.icon.tsx

This file was deleted.

40 changes: 5 additions & 35 deletions apps/web/assets/icons/Integration.icon.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,16 @@
import { IconType } from '@types';
import { IconSizes } from 'config';

export const IntegrationIcon = ({ size = 'lg' }: IconType) => {
export const IntegrationIcon = ({ size = 'md' }: IconType) => {
return (
<svg
fill="none"
strokeWidth="2"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
xmlns="http://www.w3.org/2000/svg"
viewBox="-2 -4 24 24"
fill="currentColor"
width={IconSizes[size]}
height={IconSizes[size]}
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_4865_3178)">
<path
d="M5.83333 7.16602L2.5 10.4993L5.83333 13.8327"
stroke="white"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M14.168 7.16602L17.5013 10.4993L14.168 13.8327"
stroke="white"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M11.6654 3.83398L8.33203 17.1673"
stroke="white"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_4865_3178">
<rect width="20" height="20" fill="white" transform="translate(0 0.5)" />
</clipPath>
</defs>
<path d="M12.7361611,0.063952038 C13.2551391,0.263360331 13.5227261,0.869148905 13.3338336,1.41701869 L8.54555162,15.3051026 C8.35665911,15.8529724 7.78281676,16.1354563 7.26383885,15.936048 C6.74486095,15.7366397 6.47727387,15.1308511 6.66616638,14.5829813 L11.4544484,0.694897379 C11.6433409,0.147027596 12.2171832,-0.135456255 12.7361611,0.063952038 Z M2.41421356,8.25614867 L5.94974747,11.9885083 C6.34027176,12.4007734 6.34027176,13.0691871 5.94974747,13.4814522 C5.55922318,13.8937173 4.9260582,13.8937173 4.53553391,13.4814522 L0.292893219,9.0026206 C-0.0976310729,8.59035554 -0.0976310729,7.9219418 0.292893219,7.50967674 L4.53553391,3.03084515 C4.9260582,2.61858008 5.55922318,2.61858008 5.94974747,3.03084515 C6.34027176,3.44311021 6.34027176,4.11152395 5.94974747,4.52378901 L2.41421356,8.25614867 Z M17.5857864,8.25614867 L14.0502525,4.52378901 C13.6597282,4.11152395 13.6597282,3.44311021 14.0502525,3.03084515 C14.4407768,2.61858008 15.0739418,2.61858008 15.4644661,3.03084515 L19.7071068,7.50967674 C20.0976311,7.9219418 20.0976311,8.59035554 19.7071068,9.0026206 L15.4644661,13.4814522 C15.0739418,13.8937173 14.4407768,13.8937173 14.0502525,13.4814522 C13.6597282,13.0691871 13.6597282,12.4007734 14.0502525,11.9885083 L17.5857864,8.25614867 Z" />
</svg>
);
};
10 changes: 0 additions & 10 deletions apps/web/assets/icons/One.icon.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions apps/web/assets/icons/Three.icon.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions apps/web/assets/icons/Two.icon.tsx

This file was deleted.

28 changes: 14 additions & 14 deletions apps/web/components/Integration/IntegrationData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const integrationData: Record<IntegrationEnum, Record<string, (data: ICon
[IntegrationEnum.JAVASCRIPT]: {
'1) Add Script': ({ embedScriptUrl }) => (
<>
<ModifiedText>Add embed script before closing body tag.</ModifiedText>
<ModifiedText>Add embed script before closing body tag</ModifiedText>
<CodeBlock
code={`<script type='text/javascript' src='${embedScriptUrl}' async></script>`}
language="javascript"
Expand Down Expand Up @@ -601,6 +601,7 @@ const { showWidget, isImplerInitiated } = useImpler({
[IntegrationEnum.ANGULAR]: {
'1) Add Script': ({ embedScriptUrl }) => (
<>
<ModifiedText>Add embed script before closing body tag</ModifiedText>
<CodeBlock
code={`<script type="text/javascript" src="${embedScriptUrl}" async></script>`}
language="javascript"
Expand Down Expand Up @@ -899,11 +900,6 @@ export class AppComponent {
<List type="ordered" styles={{ item: { margin: '10px 0', paddingLeft: '20px' } }}>
<List.Item>
<strong>Setting Up Bubble App</strong>
<List type="unordered">
<List.Item>
<strong>You must have a paid Bubble application plan to use the Bubble Data API.</strong>
</List.Item>
</List>
<List type="ordered">
<List.Item>Set up the data type.</List.Item>
<List.Item>Configure API settings.</List.Item>
Expand All @@ -921,23 +917,27 @@ export class AppComponent {
</List.Item>

<List.Item>
<strong>Using the Plugin</strong>
<strong>Use the Plugin</strong>
<List type="ordered">
<List.Item>Install the plugin.</List.Item>
<List.Item>Utilize the plugin features.</List.Item>
<List.Item>
Use the Plugin
<List type="ordered">
<List.Item>Initialize Importer on Page Load</List.Item>
<List.Item>Add a Button on the Page and Add Workflow</List.Item>
<List.Item>Add Workflow to Open Importer on Button Click</List.Item>
<List.Item>Configure Importer</List.Item>
</List>
</List.Item>
</List>
</List.Item>

<List.Item>
<strong>Considering UserId while Importing Data</strong>
</List.Item>

<List.Item>
<strong>Theming the Importer</strong>
<strong>Provide consideration for UserId if neede</strong>
</List.Item>

<List.Item>
<strong>Configuring Multiple Importers on Page (In Progress)</strong>
<strong>Theme the Importer by providing theme color</strong>
</List.Item>
</List>

Expand Down
12 changes: 4 additions & 8 deletions apps/web/components/Integration/IntegrationModal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import getConfig from 'next/config';
import { useEffect, useState } from 'react';

import { Flex, Title, useMantineColorScheme } from '@mantine/core';
import { Flex, NativeSelect, Title, useMantineColorScheme } from '@mantine/core';
import { track } from '@libs/amplitude';
import { colors } from '@config';
import { NativeSelect } from '@ui/native-select';
import { IntegrationEnum } from '@impler/shared';
import { IntegrationTabs } from './IntegrationTabs';
import { integrationData } from './IntegrationData';
Expand All @@ -29,7 +28,8 @@ export function IntegrationModal({ accessToken, projectId, templateId, integrati
setSelectedTab(Object.keys(integrationData[integration])[0]);
}, [integration]);

const onIntegrationFrameworkChange = (value: string) => {
const onIntegrationFrameworkChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
const value = event.target.value;
track({
name: 'CHANGE INTEGRATION FRAMEWORK',
properties: {
Expand Down Expand Up @@ -57,11 +57,7 @@ export function IntegrationModal({ accessToken, projectId, templateId, integrati
<Title order={3} color={colorScheme === 'dark' ? colors.StrokeLight : colors.StrokeDark}>
Integrate
</Title>
<NativeSelect
data={[IntegrationEnum.JAVASCRIPT, IntegrationEnum.REACT, IntegrationEnum.ANGULAR, IntegrationEnum.BUBBLE]}
onChange={onIntegrationFrameworkChange}
variant="default"
/>
<NativeSelect data={Object.values(IntegrationEnum)} onChange={onIntegrationFrameworkChange} variant="default" />
</Flex>

<IntegrationTabs
Expand Down
83 changes: 0 additions & 83 deletions apps/web/components/imports/Snippet.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web/config/constants.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const DOCUMENTATION_REFERENCE_LINKS = {
freezeColumns: 'https://docs.impler.io/features/freeze-columns',
frontendEndCallback: 'https://docs.impler.io/data-retrieval/using-frontend-callback',
webhook: 'https://docs.impler.io/data-retrieval/using-webhook',
bubbleIo: 'https://docs.impler.io/importer/bubble.io-embed.md',
bubbleIo: 'https://docs.impler.io/importer/bubble.io-embed',
subscriptionInformation: 'https://docs.impler.io/platform/how-subscription-works',
customValidation: 'https://docs.impler.io/features/custom-validation',
rangeValidator: 'https://docs.impler.io/validations/advanced#range',
Expand Down
4 changes: 4 additions & 0 deletions apps/web/hooks/useImportDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export function useImportDetails({ templateId }: useImportDetailProps) {
};

const onIntegrationClick = () => {
track({
name: 'INTEGRATE',
properties: {},
});
if (templateData && profileInfo) {
modals.open({
modalId: MODAL_KEYS.INTEGRATION_DETAILS,
Expand Down
Loading

0 comments on commit f4ff8e1

Please sign in to comment.