From a319492dc12fa3ea0eed2a2c6d0fc60180c81be9 Mon Sep 17 00:00:00 2001 From: Samyak Jain <56000318+samyakkkk@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:51:42 +0530 Subject: [PATCH] (feat): remove app insights --- web/package.json | 2 - .../lib/components/CreateAgentDialog.svelte | 30 +++------- .../components/chat/ChatIntroduction.svelte | 37 +------------ .../lib/components/chat/ChatMessage.svelte | 10 +--- web/src/lib/components/chat/ChatWindow.svelte | 55 +++++++------------ web/src/lib/utils/appInsights.ts | 26 ++++----- web/src/routes/+page.svelte | 25 +++------ web/src/routes/agent/+page.svelte | 19 +------ 8 files changed, 53 insertions(+), 151 deletions(-) diff --git a/web/package.json b/web/package.json index 817e30ca..fb98509c 100644 --- a/web/package.json +++ b/web/package.json @@ -35,9 +35,7 @@ "type": "module", "dependencies": { "@lottiefiles/svelte-lottie-player": "^0.3.1", - "@microsoft/applicationinsights-web": "^3.3.1", "@tailwindcss/typography": "^0.5.13", - "dotenv": "^16.4.5", "highlight.js": "^11.10.0", "isomorphic-dompurify": "^2.14.0", "showdown": "^2.1.0", diff --git a/web/src/lib/components/CreateAgentDialog.svelte b/web/src/lib/components/CreateAgentDialog.svelte index 8ce6b99a..f9ad7a5a 100644 --- a/web/src/lib/components/CreateAgentDialog.svelte +++ b/web/src/lib/components/CreateAgentDialog.svelte @@ -4,8 +4,7 @@ import { goto } from "$app/navigation"; import { toastStore } from "$lib/stores/ToastStores"; import { ToastType } from "$lib/types/Toast"; - import appInsights from "$lib/utils/appInsights"; // Import the appInsights instance - import IconClose from "~icons/carbon/close"; + import IconClose from "~icons/carbon/close"; import CarbonSearch from "~icons/carbon/search"; import CarbonGithub from "~icons/carbon/logo-github"; @@ -27,14 +26,6 @@ const onCreateAgent = () => { if (validateGithubURL(value)) { - // Track custom event for form submission - appInsights.trackEvent({ - name: "CreateAgentSubmitted", - properties: { - githubUrl: value, - }, - }); - goto(`${base}/agent?github=${value}`); } else { toastStore.set({ @@ -43,13 +34,6 @@ }); } }; - - $: if (showModal) { - // Track custom event for dialog opened - appInsights.trackEvent({ - name: "CreateAgentDialogOpened", - }); - } {#if showModal} @@ -64,11 +48,11 @@ >
+ class="flex items-center px-2.5 py-1 text-sm text-white" + on:click={onClose} + > + +

Create Agent with Github

-{/if} \ No newline at end of file +{/if} diff --git a/web/src/lib/components/chat/ChatIntroduction.svelte b/web/src/lib/components/chat/ChatIntroduction.svelte index b1d50854..621c484d 100644 --- a/web/src/lib/components/chat/ChatIntroduction.svelte +++ b/web/src/lib/components/chat/ChatIntroduction.svelte @@ -1,7 +1,6 @@
@@ -127,7 +96,6 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" - on:click={trackLinkClick} >
VSCode
@@ -177,8 +145,7 @@ {#each questionnaires as questionnaire} {/each} diff --git a/web/src/lib/components/chat/ChatMessage.svelte b/web/src/lib/components/chat/ChatMessage.svelte index 8d0e8638..b0aea399 100644 --- a/web/src/lib/components/chat/ChatMessage.svelte +++ b/web/src/lib/components/chat/ChatMessage.svelte @@ -2,7 +2,7 @@ import showdown from "showdown"; import hljs from "highlight.js"; import DOMPurify from "isomorphic-dompurify"; - import appInsights from "$lib/utils/appInsights"; + import { writable } from "svelte/store"; import Icon from "@iconify/svelte"; import IconVisualStudio from "../icons/IconVisualStudio.svelte"; @@ -180,13 +180,6 @@ }, ]; }; - - const trackLinkClick = () => { - appInsights.trackEvent({ - name: 'VSCodeLinkClicked', - - }); - } {#each messages as message, index} @@ -273,7 +266,6 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" - on:click={trackLinkClick} >
VSCode
diff --git a/web/src/lib/components/chat/ChatWindow.svelte b/web/src/lib/components/chat/ChatWindow.svelte index 453f4a6b..b9f4b420 100644 --- a/web/src/lib/components/chat/ChatWindow.svelte +++ b/web/src/lib/components/chat/ChatWindow.svelte @@ -1,6 +1,5 @@ @@ -70,7 +55,9 @@ {#if loading} {:else if !loading && !currentAgentDetails} -
+

Error:

{errorMessage}