From 4faad5d179f15c56c9c644fca2a790850b7ed6c4 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 23 Aug 2024 13:55:59 +0530 Subject: [PATCH 01/99] feat: add bottom-right and bottom-left placement in tooltip --- src/packages/@deprecate/assets/save.svelte | 4 +- .../@library/ui/tooltip/Tooltip.svelte | 58 ++++++++++++++++++- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/packages/@deprecate/assets/save.svelte b/src/packages/@deprecate/assets/save.svelte index a39bf7b14..67a1a8ab1 100644 --- a/src/packages/@deprecate/assets/save.svelte +++ b/src/packages/@deprecate/assets/save.svelte @@ -7,8 +7,8 @@ { + if (title === "") { + show = false; + } else { + show = true; + } if (placement === "right") { top = ( @@ -76,6 +87,20 @@ "px"; bottom = "unset"; right = "unset"; + } else if (placement === "bottom-left") { + left = tooltipWrapper.getBoundingClientRect().right.toString() + "px"; + top = + (tooltipWrapper.getBoundingClientRect().bottom + distance).toString() + + "px"; + bottom = "unset"; + right = "unset"; + } else if (placement === "bottom-right") { + left = tooltipWrapper.getBoundingClientRect().left.toString() + "px"; + top = + (tooltipWrapper.getBoundingClientRect().bottom + distance).toString() + + "px"; + bottom = "unset"; + right = "unset"; } }; @@ -86,8 +111,8 @@ ? `tooltip-text-hover ${'tooltip-text-hover-' + placement.toString()}` : ''} tooltip-text invisible m-auto text-center bg-tertiary-700 text-lightGray position-fixed justify-content-center align-items-center opacity-0 {placement.toString()} " - style="top: {top}; left: {left}; right: {right}; bottom: {bottom}; transition: {transitionTime} ; padding:{spacing}; font-size:{fontSize}; z-index : {zIndex} ; border-radius: {borderRadius}; {styleProp}" - >{@html title} + style="top: {top}; left: {left}; right: {right}; bottom: {bottom}; transition: {transitionTime} ; padding:{spacing}; font-size:{fontSize}; z-index : {zIndex} ; border-radius: {borderRadius}; {styleProp} width: fit-content;" + >{@html title} {#if placement === "left"} + {:else if placement === "bottom-left"} + + + {:else if placement === "bottom-right"} + + {/if} {/if} @@ -149,6 +186,21 @@ .bottom { transform: translateX(-50%) scale(0.5); } + .bottom-left { + transform: translateX(-100%) scale(0.5); + } + + .tooltip-text-hover-bottom-left { + transform: translateX(-100%) scale(1); + } + + .bottom-right { + transform: translateX(0) scale(0.5); + } + + .tooltip-text-hover-bottom-right { + transform: translateX(0) scale(1); + } .tooltip-text { transform-origin: center; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.75); From 11351c8e52968e3ca24d4f6bb32da2231bedea49 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 23 Aug 2024 14:16:30 +0530 Subject: [PATCH 02/99] fix: save button of api request - guest cannot save reqest now - disable save icon color updated --- src/packages/@app/styles/style.scss | 2 ++ .../http-url-section/HttpUrlSection.svelte | 20 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/packages/@app/styles/style.scss b/src/packages/@app/styles/style.scss index 96820fcaa..e2e9eeef6 100644 --- a/src/packages/@app/styles/style.scss +++ b/src/packages/@app/styles/style.scss @@ -480,6 +480,8 @@ $theme-red-2B1C1D: #2B1C1D; --icon-danger-800 : #{$theme-red-f33346}; --icon-danger-900 : #{$theme-red-fe2e2e}; --icon-danger-1000 : #{$theme-red-312325}; + + --icon-disabled-100 : #{$theme-grey-333333}; } // $button-color: linear-gradient(270deg, #6147ff -1.72%, #1193f0 100%); diff --git a/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte b/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte index abd1654c5..c6d06b80a 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte @@ -38,6 +38,7 @@ const handleDropdown = (tab: string) => { onUpdateRequestMethod(tab); }; + /** * @description - save request handler */ @@ -68,6 +69,7 @@ let isHovered = false; function handleMouseEnter() { + if (requestUrl === "") return; isHovered = true; } @@ -179,13 +181,21 @@ onUpdateRequestState({ requestSplitterDirection: e.detail }); }} /> --> - + @@ -206,6 +218,10 @@ padding: 7px; background-color: var(--bg-secondary-400); } + + .save-disk:disabled { + background-color: var(--bg-secondary-550); + } :global(.url-red-border) { border: 1px solid var(--border-danger-200) !important; } From 1ebabf1062a542c1712f2fc40983ec8f74bf069a Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 23 Aug 2024 14:18:41 +0530 Subject: [PATCH 03/99] fix: overflow of response body will only be visible on hover --- .../components/response-body/ResponseBody.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/packages/@workspaces/features/rest-explorer/components/response-body/ResponseBody.svelte b/src/packages/@workspaces/features/rest-explorer/components/response-body/ResponseBody.svelte index aa3892c06..e1854ac08 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/response-body/ResponseBody.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/response-body/ResponseBody.svelte @@ -60,8 +60,7 @@ on:change={() => {}} isEditable={false} isFormatted={true} - /> - {/if} + />{/if} @@ -69,4 +68,13 @@ iframe { pointer-events: none; } + + .response-body { + overflow-y: hidden; + transition: overflow 0.3s ease-in-out; + } + + .response-body:hover { + overflow-y: auto; + } From 42ab7e1de6b5ed6227a331549dbb4babe610406b Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 23 Aug 2024 15:07:32 +0530 Subject: [PATCH 04/99] feat: align sparrow icon and action buttons on default empty page --- .../workspace-default/layout/WorkspaceDefault.svelte | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/packages/@workspaces/features/workspace-default/layout/WorkspaceDefault.svelte b/src/packages/@workspaces/features/workspace-default/layout/WorkspaceDefault.svelte index 41d9b9eec..fda2240b3 100644 --- a/src/packages/@workspaces/features/workspace-default/layout/WorkspaceDefault.svelte +++ b/src/packages/@workspaces/features/workspace-default/layout/WorkspaceDefault.svelte @@ -26,10 +26,10 @@
-
+
@@ -143,3 +143,9 @@
+ + From d0ab45cab60f58ac281a5c6c66c0493ce8f70c5e Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 23 Aug 2024 15:31:56 +0530 Subject: [PATCH 05/99] fix: improve styling of AI suggestion button for better box-shadow --- src/packages/@app/styles/style.scss | 2 ++ .../components/ai-suggestion-box/AISuggestionBox.svelte | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/packages/@app/styles/style.scss b/src/packages/@app/styles/style.scss index e2e9eeef6..95f9e45bb 100644 --- a/src/packages/@app/styles/style.scss +++ b/src/packages/@app/styles/style.scss @@ -145,6 +145,7 @@ $theme-blue-303F4F: #303F4F; $theme-blue-1D3650: #1D3650; $theme-blue-74AEF6: #74AEF6; $theme-blue-11253a: #11253a; +$theme-blue-1E2A47: #1E2A47; $theme-violet-676A80: #676A80; $theme-violet-37394E: #37394E; @@ -327,6 +328,7 @@ $theme-red-2B1C1D: #2B1C1D; --bg-primary-500 : #{$theme-blue-2B5ED4}; --bg-primary-600 : #{$theme-blue-1D3650}; --bg-primary-700 : #{$theme-blue-11253a}; + --bg-primary-800 : #{$theme-blue-1E2A47}; --bg-secondary-100 : #{$theme-grey-ffffff}; --bg-secondary-110 : #{$theme-grey-F5F5F5}; diff --git a/src/packages/@workspaces/features/chat-bot/components/ai-suggestion-box/AISuggestionBox.svelte b/src/packages/@workspaces/features/chat-bot/components/ai-suggestion-box/AISuggestionBox.svelte index 5ffed8582..50a55a03b 100644 --- a/src/packages/@workspaces/features/chat-bot/components/ai-suggestion-box/AISuggestionBox.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/ai-suggestion-box/AISuggestionBox.svelte @@ -41,7 +41,7 @@ } .suggestion-button:hover { - background-color: #1e2a47; - box-shadow: 2px 2px 12px 0.5px var(--bg-primary-300); + background-color: var(--bg-primary-800); + box-shadow: 0px 0px 6px 0px var(--bg-primary-300); } From 439eef600980d51a812287fd49fa33fc23d37fc6 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 23 Aug 2024 16:45:16 +0530 Subject: [PATCH 06/99] fix: request area regenrate button margin increased --- .../components/request-doc/RequestDoc.svelte | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/packages/@workspaces/features/rest-explorer/components/request-doc/RequestDoc.svelte b/src/packages/@workspaces/features/rest-explorer/components/request-doc/RequestDoc.svelte index 356e8c898..e6714ccdd 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/request-doc/RequestDoc.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/request-doc/RequestDoc.svelte @@ -21,14 +21,14 @@
Documentation
-
+
@@ -77,10 +77,27 @@
From 01f03924ca0563ad7793a2f061bc7d2f6affb44d Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Tue, 27 Aug 2024 15:34:35 +0530 Subject: [PATCH 07/99] WIP: tick on copy --- src/packages/@app/components/App.svelte | 3 +- src/packages/@library/icons/Tick.svelte | 25 +++ src/packages/@library/icons/index.ts | 1 + .../features/chat-bot/assests/Tick.svg | 10 + .../features/chat-bot/assests/index.ts | 1 + .../components/chat-item/ChatItem.svelte | 190 ++++++++---------- 6 files changed, 124 insertions(+), 106 deletions(-) create mode 100644 src/packages/@library/icons/Tick.svelte create mode 100644 src/packages/@workspaces/features/chat-bot/assests/Tick.svg diff --git a/src/packages/@app/components/App.svelte b/src/packages/@app/components/App.svelte index 3e83cb0e2..7fd4ab4ff 100644 --- a/src/packages/@app/components/App.svelte +++ b/src/packages/@app/components/App.svelte @@ -106,7 +106,8 @@
- {#if 1} + + {#if 0} diff --git a/src/packages/@library/icons/Tick.svelte b/src/packages/@library/icons/Tick.svelte new file mode 100644 index 000000000..fca3f868a --- /dev/null +++ b/src/packages/@library/icons/Tick.svelte @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/src/packages/@library/icons/index.ts b/src/packages/@library/icons/index.ts index ae8c35470..1669aa330 100644 --- a/src/packages/@library/icons/index.ts +++ b/src/packages/@library/icons/index.ts @@ -63,3 +63,4 @@ export { default as DustbinIcon } from "./Dustbin.svelte"; export { default as ArrowUpward } from "./ArrowUpward.svelte"; export { default as ArrowDownward } from "./ArrowDownward.svelte"; export { default as DownloadIcon } from "./Download.svelte"; +export { default as TickIcon } from "./Tick.svelte"; diff --git a/src/packages/@workspaces/features/chat-bot/assests/Tick.svg b/src/packages/@workspaces/features/chat-bot/assests/Tick.svg new file mode 100644 index 000000000..82f1cf756 --- /dev/null +++ b/src/packages/@workspaces/features/chat-bot/assests/Tick.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/packages/@workspaces/features/chat-bot/assests/index.ts b/src/packages/@workspaces/features/chat-bot/assests/index.ts index 5872deadc..4cef6b8a4 100644 --- a/src/packages/@workspaces/features/chat-bot/assests/index.ts +++ b/src/packages/@workspaces/features/chat-bot/assests/index.ts @@ -1 +1,2 @@ export { default as copyIcon } from "./Copy.svg"; +export { default as tickIcon } from "./Tick.svg"; diff --git a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte index 450106071..6733d973a 100644 --- a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte @@ -2,7 +2,8 @@ import { onDestroy } from "svelte"; import { marked } from "marked"; import { notifications } from "@library/ui/toast/Toast"; - import { copyIcon } from "../../assests"; + import { copyIcon, tickIcon } from "../../assests"; + import { tick } from "svelte"; import hljs from "highlight.js"; import "highlight.js/styles/atom-one-dark.css"; @@ -11,6 +12,7 @@ DislikeIcon, LikeIcon, RefreshIcon, + TickIcon, } from "@library/icons"; import { SparrowAIIcon } from "@common/icons"; import { Tooltip } from "@library/ui"; @@ -19,7 +21,7 @@ import { MessageTypeEnum } from "@common/types/workspace"; export let message: string; - export let messageId; + export let messageId: string; export let type; export let isLiked; export let isDisliked; @@ -28,68 +30,64 @@ export let isLastRecieverMessage; export let status; - /** - * Decodes an HTML string by parsing it, processing
 elements, and wrapping them
-   * in custom containers with additional copy paste functionality.
-   *
-   * @param htmlString - The HTML string to decode and process.
-   * @returns The processed HTML string.
-   */
+  let showTickIcon: boolean = false;
+  let showMyTickIcon: {
+    [key: string]: boolean;
+  } = {};
 
   const decodeMessage = (htmlString: string): string => {
     const parser = new DOMParser();
     const doc = parser.parseFromString(htmlString, "text/html");
 
-    // Select all 
 elements
     const codeElements = doc.querySelectorAll("pre > code");
     const preElements = Array.from(codeElements)
-      .filter((elem) => {
-        if (elem.innerHTML.trim()) return true;
-        return false;
-      })
+      .filter((elem) => elem.innerHTML.trim())
       .map((codeElem) => codeElem.parentElement);
 
-    // Iterate over each 
 element
-    preElements.forEach((pre) => {
+    preElements.forEach((pre, index) => {
       if (pre) {
-        // Create a new container div
+        showMyTickIcon[String(index)] = false;
         const container = document.createElement("div");
         container.className = "wrapper";
         const lang = pre.querySelector("code")?.getAttribute("class");
         hljs.highlightBlock(pre.querySelector("code"));
-        // Add content or value to the container div
+
         container.innerHTML = `
-      
+
${lang?.split("-")[1] ?? ""} - - - + +
`; - // Move the
 element into the new container
         pre.parentNode?.insertBefore(container, pre);
         container.appendChild(pre);
       }
     });
 
-    // Serialize the DOM back into a string
     const serializer = new XMLSerializer();
     return serializer.serializeToString(doc);
   };
 
-  /**
-   * Handles the click event to copy code from a specified wrapper to the clipboard.
-   *
-   * @param event - The mouse event triggered by clicking on the wrapper.
-   */
-  const handleCopyCode = (event: MouseEvent) => {
+  const handleCopyCode = async (event: MouseEvent) => {
+    // const id = (event.target as HTMLElement).id;
+    // const targetElement = event.target as HTMLElement;
+    // console.log("target", targetElement);
+    // const parentElement = targetElement.parentElement;
+    // const firstChild = targetElement.children[0];
+    // const tagName = targetElement.tagName;
+    // console.log("firstChild", firstChild);
+    // console.log("parentElement", parentElement);
+    // console.log("Tag name:", tagName);
+    // if(tagName === "IMG") {
+    //   parentElement
+    // }
     const target = (event.target as HTMLElement).closest(
       ".wrapper",
     ) as HTMLElement | null;
@@ -99,50 +97,48 @@
       ) as HTMLElement | null;
       if (codeElement) {
         const code = codeElement.textContent || "";
-        navigator.clipboard
-          .writeText(code)
-          .then(() => {
-            notifications.success("Code copied to clipboard!");
-          })
-          .catch((err) => {
-            console.error("Failed to copy code: ", err);
-          });
+        try {
+          await navigator.clipboard.writeText(code);
+          notifications.success("Code copied to clipboard!");
+          // if (id) {
+          //   showMyTickIcon[id] = true;
+          //   await tick();
+          //   setTimeout(() => {
+          //     showMyTickIcon[id] = false;
+          //   }, 5000);
+          // }
+        } catch (err) {
+          console.error("Failed to copy code: ", err);
+        }
       }
     }
   };
 
-  /**
-   * Handles the response copy to clipboard functionality.
-   */
-  const handleCopyResponse = () => {
-    const response = message;
-    navigator.clipboard
-      .writeText(response)
-      .then(() => {
-        notifications.success("Response copied to clipboard!");
-      })
-      .catch((err) => {
-        console.error("Failed to copy code: ", err);
-      });
-    MixpanelEvent(Events.AI_Copy_Response);
+  const handleCopyResponse = async () => {
+    try {
+      await navigator.clipboard.writeText(message);
+      notifications.success("Response copied to clipboard!");
+      showTickIcon = true;
+      await tick();
+      setTimeout(() => {
+        showTickIcon = false;
+      }, 5000);
+      MixpanelEvent(Events.AI_Copy_Response);
+    } catch (err) {
+      console.error("Failed to copy response: ", err);
+    }
   };
 
   let cleanUpListeners: () => void = () => {};
 
   let extractedMessage = "";
 
-  /**
-   * Embeds click listeners to copy code from dynamically inserted wrappers.
-   * @returns A promise that resolves when the listeners are embedded.
-   */
   const embedListenerToCopyCode = async () => {
     extractedMessage = decodeMessage(await marked(message));
-    // Add event listeners to all dynamically inserted wrappers
 
     setTimeout(() => {
       const wrappers = document.querySelectorAll(`.copy-code-${messageId}`);
 
-      // Remove previous event listeners
       cleanUpListeners();
 
       cleanUpListeners = () => {
@@ -156,20 +152,13 @@
     }, 200);
   };
 
-  /**
-   * Reactive statement to embed listeners for copying code when the message changes.
-   */
   $: {
     if (message) {
       embedListenerToCopyCode();
     }
   }
 
-  /**
-   * Cleanup function to remove event listeners when the component is destroyed.
-   */
   onDestroy(() => {
-    // Clean up event listeners to destroy copy code element
     if (cleanUpListeners) {
       cleanUpListeners();
     }
@@ -178,30 +167,15 @@
 
 
{#if type === MessageTypeEnum.SENDER} -

{@html message}

{:else} -
{#if status} - {/if}
- {#if isLastRecieverMessage} - { - regenerateAiResponse(); - }} + on:click={regenerateAiResponse} > - + {/if} - - +
@@ -310,11 +282,19 @@ } :global(.action-button) { height: 30px; + background-color: transparent; + box-shadow: none; + border: none; width: 30px; } :global(.action-button:hover) { background-color: var(--bg-tertiary-190); } + + button:disabled { + background-color: inherit; + } + .error-message { background-color: var(--bg-danger-1200); border: 0.2px solid var(--border-danger-200); From ff381d457fadd755abcde5570fba1014437b9bd6 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Tue, 27 Aug 2024 17:45:33 +0530 Subject: [PATCH 08/99] feat: change copy to tick in ai chat after copying --- .../features/chat-bot/assests/Tick.png | Bin 0 -> 268 bytes .../features/chat-bot/assests/Tick.svg | 4 +- .../components/chat-item/ChatItem.svelte | 61 +++++++++++------- 3 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 src/packages/@workspaces/features/chat-bot/assests/Tick.png diff --git a/src/packages/@workspaces/features/chat-bot/assests/Tick.png b/src/packages/@workspaces/features/chat-bot/assests/Tick.png new file mode 100644 index 0000000000000000000000000000000000000000..b105d32ad3e10749f18de644430b799faa3e07e5 GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9S!3-p~d(N!@QuYBpA+A8Wp`l^Yq)B~!ecj#N zKz3VOTN4-n+4#Z#|NpOkJa-3Zgm6iaUoZm;J0~}fsIlpksnfRX+_ihp!A}Xns)0ah z#w2fd7m-Q#PnrTbF`h1tArhC@PVnYyFyL@;{1c{ob?5)sT+>?)G1GWIOp>&7>1|3c zb1Bp5b5W4ElzZUf|B0`{Lp+NF1&#_uF^W2Sm`L;ZSIvE&7Gk`5!{^}8XWulhY5lv= dDZS?nlkXyyo$UNpjzD`DJYD@<);T3K0RX@;W+DIp literal 0 HcmV?d00001 diff --git a/src/packages/@workspaces/features/chat-bot/assests/Tick.svg b/src/packages/@workspaces/features/chat-bot/assests/Tick.svg index 82f1cf756..5cbb0eef6 100644 --- a/src/packages/@workspaces/features/chat-bot/assests/Tick.svg +++ b/src/packages/@workspaces/features/chat-bot/assests/Tick.svg @@ -1,10 +1,10 @@ - + - + diff --git a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte index 6733d973a..36baa5986 100644 --- a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte @@ -2,7 +2,8 @@ import { onDestroy } from "svelte"; import { marked } from "marked"; import { notifications } from "@library/ui/toast/Toast"; - import { copyIcon, tickIcon } from "../../assests"; + import { copyIcon } from "../../assests"; + import tickIcon from "../../assests/tick.png"; import { tick } from "svelte"; import hljs from "highlight.js"; @@ -56,9 +57,7 @@
${lang?.split("-")[1] ?? ""} @@ -76,18 +75,36 @@ }; const handleCopyCode = async (event: MouseEvent) => { - // const id = (event.target as HTMLElement).id; - // const targetElement = event.target as HTMLElement; - // console.log("target", targetElement); - // const parentElement = targetElement.parentElement; - // const firstChild = targetElement.children[0]; - // const tagName = targetElement.tagName; - // console.log("firstChild", firstChild); - // console.log("parentElement", parentElement); - // console.log("Tag name:", tagName); - // if(tagName === "IMG") { - // parentElement - // } + const id = (event.target as HTMLElement).id; + const targetElement = event.target as + | HTMLImageElement + | HTMLButtonElement + | any; + console.log("target", targetElement); + const parentElement = targetElement.parentElement; + const firstChild = targetElement.children[0]; + const tagName = targetElement.tagName; + console.log("firstChild", firstChild); + console.log("parentElement", parentElement); + console.log("Tag name:", tagName); + if (tagName === "IMG" && parentElement) { + const originalSrc = targetElement?.src; + targetElement.src = tickIcon; + targetElement.classList.add("tick-icon"); + setTimeout(() => { + targetElement.src = originalSrc; + targetElement.classList.remove("tick-icon"); + }, 5000); + } + if (tagName === "BUTTON" && firstChild) { + const originalSrc = firstChild?.src; + firstChild.src = tickIcon; + firstChild.classList.add("tick-icon"); + setTimeout(() => { + firstChild.src = originalSrc; + firstChild.classList.remove("tick-icon"); + }, 5000); + } const target = (event.target as HTMLElement).closest( ".wrapper", ) as HTMLElement | null; @@ -100,13 +117,6 @@ try { await navigator.clipboard.writeText(code); notifications.success("Code copied to clipboard!"); - // if (id) { - // showMyTickIcon[id] = true; - // await tick(); - // setTimeout(() => { - // showMyTickIcon[id] = false; - // }, 5000); - // } } catch (err) { console.error("Failed to copy code: ", err); } @@ -299,6 +309,11 @@ background-color: var(--bg-danger-1200); border: 0.2px solid var(--border-danger-200); } + + :global(.tick-icon) { + height: 16px; + } + :global(.copy-code-tooltip) { transition: 0.3s ease; font-weight: 400; From 7a48cb2be2cbe888a7babc78a1be4122803b3e3f Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Tue, 27 Aug 2024 18:27:50 +0530 Subject: [PATCH 09/99] fix: remove consoles --- src/packages/@app/components/App.svelte | 3 +- .../components/chat-item/ChatItem.svelte | 68 +++++++++++++++---- .../http-url-section/HttpUrlSection.svelte | 3 +- 3 files changed, 59 insertions(+), 15 deletions(-) diff --git a/src/packages/@app/components/App.svelte b/src/packages/@app/components/App.svelte index 7fd4ab4ff..3e83cb0e2 100644 --- a/src/packages/@app/components/App.svelte +++ b/src/packages/@app/components/App.svelte @@ -106,8 +106,7 @@
- - {#if 0} + {#if 1} diff --git a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte index 36baa5986..f385e778c 100644 --- a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte @@ -32,27 +32,35 @@ export let status; let showTickIcon: boolean = false; - let showMyTickIcon: { - [key: string]: boolean; - } = {}; + /** + * Decodes an HTML string by parsing it, processing
 elements, and wrapping them
+   * in custom containers with additional copy paste functionality.
+   *
+   * @param htmlString - The HTML string to decode and process.
+   * @returns The processed HTML string.
+   */
   const decodeMessage = (htmlString: string): string => {
     const parser = new DOMParser();
     const doc = parser.parseFromString(htmlString, "text/html");
 
+    // Select all 
 elements
     const codeElements = doc.querySelectorAll("pre > code");
     const preElements = Array.from(codeElements)
-      .filter((elem) => elem.innerHTML.trim())
+      .filter((elem) => {
+        if (elem.innerHTML.trim()) return true;
+        return false;
+      })
       .map((codeElem) => codeElem.parentElement);
 
     preElements.forEach((pre, index) => {
       if (pre) {
-        showMyTickIcon[String(index)] = false;
+        // Create a new container div
         const container = document.createElement("div");
         container.className = "wrapper";
         const lang = pre.querySelector("code")?.getAttribute("class");
         hljs.highlightBlock(pre.querySelector("code"));
-
+        // Add content or value to the container div
         container.innerHTML = `
       
${lang?.split("-")[1] ?? ""} @@ -74,20 +82,20 @@ return serializer.serializeToString(doc); }; + /** + * Handles the click event to copy code from a specified wrapper to the clipboard. + * + * @param event - The mouse event triggered by clicking on the wrapper. + */ const handleCopyCode = async (event: MouseEvent) => { const id = (event.target as HTMLElement).id; const targetElement = event.target as | HTMLImageElement | HTMLButtonElement | any; - console.log("target", targetElement); - const parentElement = targetElement.parentElement; const firstChild = targetElement.children[0]; const tagName = targetElement.tagName; - console.log("firstChild", firstChild); - console.log("parentElement", parentElement); - console.log("Tag name:", tagName); - if (tagName === "IMG" && parentElement) { + if (tagName === "IMG") { const originalSrc = targetElement?.src; targetElement.src = tickIcon; targetElement.classList.add("tick-icon"); @@ -124,6 +132,9 @@ } }; + /** + * Handles the response copy to clipboard functionality. + */ const handleCopyResponse = async () => { try { await navigator.clipboard.writeText(message); @@ -143,12 +154,18 @@ let extractedMessage = ""; + /** + * Embeds click listeners to copy code from dynamically inserted wrappers. + * @returns A promise that resolves when the listeners are embedded. + */ const embedListenerToCopyCode = async () => { extractedMessage = decodeMessage(await marked(message)); + // Add event listeners to all dynamically inserted wrappers setTimeout(() => { const wrappers = document.querySelectorAll(`.copy-code-${messageId}`); + // Remove previous event listeners cleanUpListeners(); cleanUpListeners = () => { @@ -162,13 +179,20 @@ }, 200); }; + /** + * Reactive statement to embed listeners for copying code when the message changes. + */ $: { if (message) { embedListenerToCopyCode(); } } + /** + * Cleanup function to remove event listeners when the component is destroyed. + */ onDestroy(() => { + // Clean up event listeners to destroy copy code element if (cleanUpListeners) { cleanUpListeners(); } @@ -176,16 +200,31 @@
+ {#if type === MessageTypeEnum.SENDER}

{@html message}

{:else} +
{#if status} + {/if}
+ {#if isLastRecieverMessage}
-
+
+ {#if conversations?.length && isResponseGenerating} +

+ +

+ {/if} diff --git a/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte b/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte index 020a44133..b59060912 100644 --- a/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte @@ -8,6 +8,16 @@ export let prompt: string = ""; export let onUpdateAiPrompt; export let isResponseGenerating; + + let isHovered = false; + + function handleMouseEnter() { + isHovered = true; + } + + function handleMouseLeave() { + isHovered = false; + }
@@ -42,11 +52,15 @@ MixpanelEvent(Events.AI_Initiate_Response); } }} + on:mouseenter={handleMouseEnter} + on:mouseleave={handleMouseLeave} >
{:else} From 92e855bdc5e7a0ab9321cce3328fb67c153b2201 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Thu, 29 Aug 2024 16:24:49 +0530 Subject: [PATCH 12/99] feat: change ai-chat in and out animation --- .../ai-chat-interface/AIChatInterface.svelte | 60 ++++++++----------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/src/packages/@workspaces/features/chat-bot/components/ai-chat-interface/AIChatInterface.svelte b/src/packages/@workspaces/features/chat-bot/components/ai-chat-interface/AIChatInterface.svelte index 69a5f4aee..8fd50f3dc 100644 --- a/src/packages/@workspaces/features/chat-bot/components/ai-chat-interface/AIChatInterface.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/ai-chat-interface/AIChatInterface.svelte @@ -7,6 +7,7 @@ import MixpanelEvent from "$lib/utils/mixpanel/MixpanelEvent"; import { Events } from "$lib/utils/enums"; import type { Conversation } from "@common/types/workspace"; + import { fade, fly } from "svelte/transition"; export let conversations: Conversation[] = []; export let prompt = ""; @@ -18,26 +19,6 @@ export let onUpdateRequestState; export let scrollList; - /** - * A Svelte transition function that animates elements sliding in and out. - * - * @param node - The DOM element to apply the transition to. - * @param params - Configuration object for the transition. - */ - const slide = (node: HTMLElement, { duration }: { duration: number }) => { - return { - duration, - css: (t: number) => { - const easing = cubicOut(t); - const translateY = (1 - easing) * 20; - return ` - transform: translateY(${translateY}%); - - `; - }, - }; - }; - let chatContainer: HTMLElement; /** * @description - scrolls the list container to top or bottom @@ -69,13 +50,15 @@
@@ -99,6 +82,7 @@ {#if !conversations?.length}
@@ -143,19 +127,21 @@ {:else}
{#each conversations as chat, index} - +
+ +
{/each}
{/if} @@ -165,7 +151,10 @@
{#if conversations?.length && isResponseGenerating} -

+

{/if} @@ -202,6 +191,7 @@ height: 30px; width: 30px; border-radius: 4px; + transition: background-color 0.2s ease; } .close-btn:hover { cursor: pointer; From e93a24455e858656771b5b95038607e09e933823 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Thu, 29 Aug 2024 19:08:49 +0530 Subject: [PATCH 13/99] fix: change input on-focus border color --- src/packages/@workspaces/common/utils/auth-input-theme.ts | 2 +- src/packages/@workspaces/common/utils/url-input-theme.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/@workspaces/common/utils/auth-input-theme.ts b/src/packages/@workspaces/common/utils/auth-input-theme.ts index a6e37d67d..79c71231d 100644 --- a/src/packages/@workspaces/common/utils/auth-input-theme.ts +++ b/src/packages/@workspaces/common/utils/auth-input-theme.ts @@ -64,7 +64,7 @@ export class AuthInputTheme { fontWeight: 400, }, "&.cm-editor.cm-focused": { - border: "1px solid var(--border-primary-900)", + border: "1px solid var(--border-primary-300)", borderRadius: "4px", }, ".cm-scroller::-webkit-scrollbar": { diff --git a/src/packages/@workspaces/common/utils/url-input-theme.ts b/src/packages/@workspaces/common/utils/url-input-theme.ts index c181635ef..f193458de 100644 --- a/src/packages/@workspaces/common/utils/url-input-theme.ts +++ b/src/packages/@workspaces/common/utils/url-input-theme.ts @@ -63,7 +63,7 @@ export class UrlInputTheme { borderRadius: "0", }, "&.cm-editor.cm-focused": { - border: "1px solid var(--border-primary-200)", + border: "1px solid var(--border-primary-300)", borderRadius: "0", }, ".cm-scroller::-webkit-scrollbar": { From 2d39fa6693ef9e78b6c58e6756f2eb5676ac9525 Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Fri, 30 Aug 2024 11:01:27 +0530 Subject: [PATCH 14/99] fix: delete workspace and teams operations --- .../Collections/CollectionPage.ViewModel.ts | 9 ++++++- .../TeamExplorerPage.ViewModel.ts | 24 +++++++++++++++---- .../WorkspaceExplorerPage.ViewModel.ts | 7 +++++- .../@app/repositories/team.repository.ts | 2 +- .../@app/repositories/workspace.repository.ts | 23 ++++-------------- src/packages/@app/services/team.service.ts | 5 +--- 6 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts b/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts index d2a997c76..5c416213f 100644 --- a/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts +++ b/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts @@ -1992,7 +1992,14 @@ export default class CollectionsViewModel { this.collectionRepository.deleteCollection(collection.id); this.deleteCollectioninWorkspace(workspaceId, collection.id); notifications.success(`"${collection.name}" Collection deleted.`); - this.removeMultipleTabs(deletedIds); + // this.removeMultipleTabs(deletedIds); + await this.tabRepository.removeTabsByQuery({ + selector: { + "path.collectionId": collection.id, + }, + }); + //////////////////////////////////////////////// + // active any tab random tab here MixpanelEvent(Events.DELETE_COLLECTION, { source: "Collection list", }); diff --git a/src/packages/@app/pages/TeamExplorerPage/TeamExplorerPage.ViewModel.ts b/src/packages/@app/pages/TeamExplorerPage/TeamExplorerPage.ViewModel.ts index 40de51b0c..cb890c9bf 100644 --- a/src/packages/@app/pages/TeamExplorerPage/TeamExplorerPage.ViewModel.ts +++ b/src/packages/@app/pages/TeamExplorerPage/TeamExplorerPage.ViewModel.ts @@ -5,6 +5,8 @@ import { Events, UntrackedItems, WorkspaceRole } from "$lib/utils/enums"; import type { MakeRequestResponse } from "$lib/utils/interfaces/common.interface"; import MixpanelEvent from "$lib/utils/mixpanel/MixpanelEvent"; import type { WorkspaceDocument } from "@app/database/database"; +import { CollectionRepository } from "@app/repositories/collection.repository"; +import { EnvironmentRepository } from "@app/repositories/environment.repository"; import { GuestUserRepository } from "@app/repositories/guest-user.repository"; import { TabRepository } from "@app/repositories/tab.repository"; import { TeamRepository } from "@app/repositories/team.repository"; @@ -23,6 +25,8 @@ export class TeamExplorerPageViewModel { private teamRepository = new TeamRepository(); private tabRepository = new TabRepository(); private workspaceRepository = new WorkspaceRepository(); + private collectionRepository = new CollectionRepository(); + private environmentRepository = new EnvironmentRepository(); private workspaceService = new WorkspaceService(); private teamService = new TeamService(); private guestUserRepository = new GuestUserRepository(); @@ -626,14 +630,13 @@ export class TeamExplorerPageViewModel { "path.workspaceId": workspace._id, }, }); + await this.collectionRepository.removeCollections(workspace._id); + await this.environmentRepository.removeEnvironments(workspace._id); + await this.teamRepository.removeWorkspaceFromTeam( workspace.team?.teamId, workspace._id, ); - const tabs = await this.tabRepository.getTabDocs(); - if (!tabs) { - await this.tabRepository.activateInitialTab(); - } notifications.success( `${workspace.name} is removed from ${workspace?.team?.teamName}.`, ); @@ -675,6 +678,19 @@ export class TeamExplorerPageViewModel { ); return response; } + await this.teamRepository.removeTeam(teamId); + const workspaceDoc = + await this.workspaceRepository.findWorkspaceByTeamId(teamId); + for (let i = 0; i < workspaceDoc.length; i++) { + await this.collectionRepository.removeCollections(workspaceDoc[i]._id); + await this.environmentRepository.removeEnvironments(workspaceDoc[i]._id); + await this.workspaceRepository.deleteWorkspace(workspaceDoc[i]._id); + await this.tabRepository.removeTabsByQuery({ + selector: { + "path.workspaceId": workspaceDoc[i]._id, + }, + }); + } await new Promise((resolve) => setTimeout(async () => { diff --git a/src/packages/@app/pages/WorkspaceExplorerPage/WorkspaceExplorerPage.ViewModel.ts b/src/packages/@app/pages/WorkspaceExplorerPage/WorkspaceExplorerPage.ViewModel.ts index c4e2e1ed3..642c795df 100644 --- a/src/packages/@app/pages/WorkspaceExplorerPage/WorkspaceExplorerPage.ViewModel.ts +++ b/src/packages/@app/pages/WorkspaceExplorerPage/WorkspaceExplorerPage.ViewModel.ts @@ -5,6 +5,8 @@ import MixpanelEvent from "$lib/utils/mixpanel/MixpanelEvent"; import { throttle } from "$lib/utils/throttle"; import type { TeamDocument, WorkspaceDocument } from "@app/database/database"; import type { UpdatesDocType } from "@app/models/updates.model"; +import { CollectionRepository } from "@app/repositories/collection.repository"; +import { EnvironmentRepository } from "@app/repositories/environment.repository"; import { TabRepository } from "@app/repositories/tab.repository"; import { TeamRepository } from "@app/repositories/team.repository"; import { UpdatesRepository } from "@app/repositories/updates.repository"; @@ -22,6 +24,8 @@ export default class WorkspaceExplorerViewModel { private workspaceRepository = new WorkspaceRepository(); private teamRepository = new TeamRepository(); private updatesRepository = new UpdatesRepository(); + private collectionRepository = new CollectionRepository(); + private environmentRepository = new EnvironmentRepository(); // Private Services private collectionService = new CollectionService(); @@ -157,7 +161,8 @@ export default class WorkspaceExplorerViewModel { "path.workspaceId": workspace._id, }, }); - await this.tabRepository.activateInitialTab(); + await this.collectionRepository.removeCollections(workspace._id); + await this.environmentRepository.removeEnvironments(workspace._id); notifications.success( `${workspace.name} is removed from ${workspace?.team?.teamName}.`, ); diff --git a/src/packages/@app/repositories/team.repository.ts b/src/packages/@app/repositories/team.repository.ts index 698e0daba..930eb6d3f 100644 --- a/src/packages/@app/repositories/team.repository.ts +++ b/src/packages/@app/repositories/team.repository.ts @@ -266,7 +266,7 @@ export class TeamRepository { }, }) .exec(); - await this.workspaceRepository.removeWorkspaces(teamId); + return await team.remove(); }; diff --git a/src/packages/@app/repositories/workspace.repository.ts b/src/packages/@app/repositories/workspace.repository.ts index 1b65cb6b6..7496260b4 100644 --- a/src/packages/@app/repositories/workspace.repository.ts +++ b/src/packages/@app/repositories/workspace.repository.ts @@ -185,28 +185,13 @@ export class WorkspaceRepository { /** * remove workspaces by teamId */ - public removeWorkspaces = async (teamId: string): Promise => { + public findWorkspaceByTeamId = async (teamId: string): Promise => { const workspaces = await RxDB.getInstance().rxdb.workspace.find({ selector: { "team.teamId": teamId, }, }); - const workspaceDoc = await workspaces.exec(); - for (let i = 0; i < workspaceDoc.length; i++) { - await this.collectionRepository.removeCollections(workspaceDoc[i]._id); - await this.environmentRepository.removeEnvironments(workspaceDoc[i]._id); - await this.tabRepository.removeTabsByQuery({ - selector: { - "path.workspaceId": workspaceDoc[i]._id, - }, - }); - - const tabs = await this.tabRepository.getTabDocs(); - if (!tabs) { - await this.tabRepository.activateInitialTab(); - } - } - return await workspaces.remove(); + return await workspaces.exec(); }; /** @@ -335,8 +320,8 @@ export class WorkspaceRepository { }, }) .exec(); - await this.collectionRepository.removeCollections(workspaceId); - await this.environmentRepository.removeEnvironments(workspaceId); + // await this.collectionRepository.removeCollections(workspaceId); + // await this.environmentRepository.removeEnvironments(workspaceId); return await workspace.remove(); }; public addUserInWorkspace = async ( diff --git a/src/packages/@app/services/team.service.ts b/src/packages/@app/services/team.service.ts index de486ba0a..155338069 100644 --- a/src/packages/@app/services/team.service.ts +++ b/src/packages/@app/services/team.service.ts @@ -49,9 +49,6 @@ export class TeamService { headers: getAuthHeaders(), }, ); - if (response.isSuccessful) { - await this.teamRepository.removeTeam(teamId); - } return response; }; @@ -100,7 +97,7 @@ export class TeamService { headers: getAuthHeaders(), }, ); - return response; + return response; }; public promoteToOwnerAtTeam = async (teamId: string, userId: string) => { From ea0cb78e64f95df9ca998dff4313df4ef42d362a Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Fri, 30 Aug 2024 13:02:05 +0530 Subject: [PATCH 15/99] feat: Added community section [#1447] --- src/packages/@app/pages/Help/HelpPage.svelte | 22 ++- .../@support/features/community/index.ts | 1 + .../community/layout/Community.svelte | 180 ++++++++++++++++++ .../features/community/layout/index.ts | 1 + .../layout/FeedbackToast.svelte | 89 +++++---- 5 files changed, 246 insertions(+), 47 deletions(-) create mode 100644 src/packages/@support/features/community/index.ts create mode 100644 src/packages/@support/features/community/layout/Community.svelte create mode 100644 src/packages/@support/features/community/layout/index.ts diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index 0e09db19a..739cfb47e 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -11,6 +11,7 @@ import { onMount } from "svelte"; import { Motion } from "svelte-motion"; import { pagesMotion } from "@app/constants"; + import { Community } from "@support/features/community"; const _viewModel = new HelpPageViewModel(); @@ -52,12 +53,18 @@ > Feedback
- +
+
setActiveTab("community")} + > + Community +
+ {:else if activeTab === "updates"} - + /> + + {:else if activeTab === "community"} + + {/if}
diff --git a/src/packages/@support/features/community/index.ts b/src/packages/@support/features/community/index.ts new file mode 100644 index 000000000..eec9d1e67 --- /dev/null +++ b/src/packages/@support/features/community/index.ts @@ -0,0 +1 @@ +export * from "./layout"; diff --git a/src/packages/@support/features/community/layout/Community.svelte b/src/packages/@support/features/community/layout/Community.svelte new file mode 100644 index 000000000..9e726f74f --- /dev/null +++ b/src/packages/@support/features/community/layout/Community.svelte @@ -0,0 +1,180 @@ + + +
+
+
+

Community

+

+ Stay updated with all feedback, from planning to progress, on a single + roadmap. +

+
+ + +
+

+ +
+ Welcome to Sparrow’s Community Hub! +
+

+

+ We're excited to hear your thoughts and suggestions on how we can + improve Sparrow, your go-to API management application. Whether it's a + new feature idea, a bug report, or general feedback, every comment is + valuable to us. +

+
+ +
+

Connect with Us

+

+ Utilize our integrated Discord community to send messages directly to + our team and other users, even if you don't have a Discord account. Your + messages will appear instantly in our Discord channel, ensuring you get + quick responses and can engage in real-time discussions. +

+ + +
+

Key Features

+

+ Switchable Channel:Easily navigate between different feedback and support channels. +

+

+ Rich media sharing: + Share screenshots , videos and other files to provide comprehensive + feedback. +

+

+ Tagging: Tag your feedback for easy categorization and searchability. +

+

+ Join our community and start contributing to Sparrow. +

+
+ + +
+

{ + isReadMore = !isReadMore; + }} + > + +

+
+
+
+
+ + \ No newline at end of file diff --git a/src/packages/@support/features/community/layout/index.ts b/src/packages/@support/features/community/layout/index.ts new file mode 100644 index 000000000..36bf1fb75 --- /dev/null +++ b/src/packages/@support/features/community/layout/index.ts @@ -0,0 +1 @@ +export { default as Community } from "./Community.svelte"; diff --git a/src/packages/@support/features/feedback-toast/layout/FeedbackToast.svelte b/src/packages/@support/features/feedback-toast/layout/FeedbackToast.svelte index cc9183aa4..06ebc7814 100644 --- a/src/packages/@support/features/feedback-toast/layout/FeedbackToast.svelte +++ b/src/packages/@support/features/feedback-toast/layout/FeedbackToast.svelte @@ -7,8 +7,15 @@ let isReadMore = false; -
-
+
+
+
+

Community

+

+ Stay updated with all feedback, from planning to progress, on a single + roadmap. +

+
From 15a0a69b1a9262fb0ea9aac3c6e3fa814c6bbb19 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 30 Aug 2024 16:29:41 +0530 Subject: [PATCH 16/99] fix: response status color and spacing --- .../response-status/ResponseStatus.svelte | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/packages/@workspaces/features/rest-explorer/components/response-status/ResponseStatus.svelte b/src/packages/@workspaces/features/rest-explorer/components/response-status/ResponseStatus.svelte index bd18187fb..39bbb180e 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/response-status/ResponseStatus.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/response-status/ResponseStatus.svelte @@ -25,20 +25,20 @@ style="font-size: 12px;" > - + {response.status.split(" ")[0]} + + + - - - {response.time}

ms

@@ -74,12 +74,10 @@ class="d-flex align-items-center ps-1 pe-1 justify-content-center rounded border-0 text-backgroundColor gap-1 size-primary1" style="font-size: 12px;" > - - - - - {response.size?.toFixed(2)} + + + {response.size?.toFixed(2)}

KB

@@ -95,7 +93,7 @@ } .time-primary1 { - color: var(--success-color) !important; + color: var(--request-get) !important; background-color: transparent; } .size-primary1 { From ece6a445764c4c380076500941b0d04f8c594580 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 30 Aug 2024 16:51:18 +0530 Subject: [PATCH 17/99] fix: Implement Review Suggestions --- .../features/chat-bot/assests/Tick.png | Bin 268 -> 0 bytes .../components/chat-item/ChatItem.svelte | 3 +-- .../components/prompt-input/PromptInput.svelte | 16 ++++++++-------- .../http-url-section/HttpUrlSection.svelte | 6 ++++-- .../ResponseDefaultScreen.svelte | 6 +++--- 5 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 src/packages/@workspaces/features/chat-bot/assests/Tick.png diff --git a/src/packages/@workspaces/features/chat-bot/assests/Tick.png b/src/packages/@workspaces/features/chat-bot/assests/Tick.png deleted file mode 100644 index b105d32ad3e10749f18de644430b799faa3e07e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9S!3-p~d(N!@QuYBpA+A8Wp`l^Yq)B~!ecj#N zKz3VOTN4-n+4#Z#|NpOkJa-3Zgm6iaUoZm;J0~}fsIlpksnfRX+_ihp!A}Xns)0ah z#w2fd7m-Q#PnrTbF`h1tArhC@PVnYyFyL@;{1c{ob?5)sT+>?)G1GWIOp>&7>1|3c zb1Bp5b5W4ElzZUf|B0`{Lp+NF1&#_uF^W2Sm`L;ZSIvE&7Gk`5!{^}8XWulhY5lv= dDZS?nlkXyyo$UNpjzD`DJYD@<);T3K0RX@;W+DIp diff --git a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte index f385e778c..4275adee3 100644 --- a/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/chat-item/ChatItem.svelte @@ -2,8 +2,7 @@ import { onDestroy } from "svelte"; import { marked } from "marked"; import { notifications } from "@library/ui/toast/Toast"; - import { copyIcon } from "../../assests"; - import tickIcon from "../../assests/tick.png"; + import { copyIcon, tickIcon } from "../../assests"; import { tick } from "svelte"; import hljs from "highlight.js"; diff --git a/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte b/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte index b59060912..bf8b34550 100644 --- a/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte +++ b/src/packages/@workspaces/features/chat-bot/components/prompt-input/PromptInput.svelte @@ -9,15 +9,15 @@ export let onUpdateAiPrompt; export let isResponseGenerating; - let isHovered = false; + let isSendButtonHovered = false; - function handleMouseEnter() { - isHovered = true; - } + const handleMouseEnter = () => { + isSendButtonHovered = true; + }; - function handleMouseLeave() { - isHovered = false; - } + const handleMouseLeave = () => { + isSendButtonHovered = false; + };
@@ -58,7 +58,7 @@ diff --git a/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte b/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte index 14103b4f8..e2d91bd79 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte @@ -199,7 +199,9 @@ isGuestUser ? true : false} - style="background-color: {isSave ? 'var(--icon-secondary-550)' : 'var(--bg-secondary-400)'}; color: white;" + style="background-color: {isSave + ? 'var(--icon-secondary-550)' + : 'var(--bg-secondary-400)'}; color: white;" > diff --git a/src/packages/@workspaces/features/rest-explorer/components/response-default-screen/ResponseDefaultScreen.svelte b/src/packages/@workspaces/features/rest-explorer/components/response-default-screen/ResponseDefaultScreen.svelte index fa5526b6a..da631e8d6 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/response-default-screen/ResponseDefaultScreen.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/response-default-screen/ResponseDefaultScreen.svelte @@ -31,7 +31,7 @@
@@ -113,13 +113,13 @@ cursor: pointer; } - .overflow-show-on-hover { + .default-screen-scroller { overflow-y: hidden; transition: overflow 0.3s ease-in-out; padding-right: 10px; } - .overflow-show-on-hover:hover { + .default-screen-scroller:hover { padding-right: 0; overflow-y: auto; } From 09b1b677ed8cec3149c285983ffa055eace3bb90 Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 30 Aug 2024 17:08:57 +0530 Subject: [PATCH 18/99] fix: Implement Review Suggestions --- src/packages/@library/ui/tooltip/Tooltip.svelte | 5 ----- .../http-url-section/HttpUrlSection.svelte | 16 ++-------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/packages/@library/ui/tooltip/Tooltip.svelte b/src/packages/@library/ui/tooltip/Tooltip.svelte index ba92a6b92..4aa0849c0 100644 --- a/src/packages/@library/ui/tooltip/Tooltip.svelte +++ b/src/packages/@library/ui/tooltip/Tooltip.svelte @@ -26,11 +26,6 @@ let isDelayed = false; const toggleTooltip = () => { - if (title === "") { - show = false; - } else { - show = true; - } if (placement === "right") { top = ( diff --git a/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte b/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte index e2d91bd79..62f8753ef 100644 --- a/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte +++ b/src/packages/@workspaces/features/rest-explorer/components/http-url-section/HttpUrlSection.svelte @@ -69,7 +69,6 @@ let isHovered = false; function handleMouseEnter() { - if (requestUrl === "") return; isHovered = true; } @@ -181,22 +180,13 @@ onUpdateRequestState({ requestSplitterDirection: e.detail }); }} /> --> - + From 72e11f70ffbcf78fa69cfe14cc4d3209d11ebf4c Mon Sep 17 00:00:00 2001 From: mitesh darda Date: Fri, 30 Aug 2024 17:10:33 +0530 Subject: [PATCH 19/99] fix: Implement Review Suggestions --- src/packages/@app/styles/style.scss | 946 ++++++++++++++-------------- 1 file changed, 459 insertions(+), 487 deletions(-) diff --git a/src/packages/@app/styles/style.scss b/src/packages/@app/styles/style.scss index f270c916c..09872d1f5 100644 --- a/src/packages/@app/styles/style.scss +++ b/src/packages/@app/styles/style.scss @@ -50,109 +50,100 @@ $sparrow-selectedSideBarTab: #11253a; $sparrow-selectedSideBarTab: #11253a; $sparrow-recentApiText: #f3e4e4d7; $sparrow-errorTextColor: #fe8c98; -$sparrow-editor-operator-color: #FE2E2E; -$sparrow-editor-bool-color: #82DB42; -$sparrow-editor-name-color: #9CDCFE; -$sparrow-editor-varible-color: #ECCD43; -$sparrow-editor-bracket-color: #9217F6; -$sparrow-editor-square-bracket-color: #FF8000; -$sparrow-editor-number-color: #8DC599; +$sparrow-editor-operator-color: #fe2e2e; +$sparrow-editor-bool-color: #82db42; +$sparrow-editor-name-color: #9cdcfe; +$sparrow-editor-varible-color: #eccd43; +$sparrow-editor-bracket-color: #9217f6; +$sparrow-editor-square-bracket-color: #ff8000; +$sparrow-editor-number-color: #8dc599; $sparrow-editor-angle-bracket-color: #636566; -$sparrow-editor-tag-color: #246BB8; -$sparrow-editor-string-color: #CE9178; -$sparrow-email-invite-bg-color: #1E1E1E; +$sparrow-editor-tag-color: #246bb8; +$sparrow-editor-string-color: #ce9178; +$sparrow-email-invite-bg-color: #1e1e1e; $sparrow-dropdown-border-color: rgb(44, 44, 44); $sparrow-small-text-size: 0.75rem; $sparrow-base-text-size: 0.875rem; $sparrow-medium-text-size: 1.125rem; $sparrow-right-click-menu: #232527; -$sparrow-active-sync: #8DC599; +$sparrow-active-sync: #8dc599; $deleted-api-method: #939699; -$button-active: #1D3650; -$sparrow-nav-bar-active-slash: #4661FA; +$button-active: #1d3650; +$sparrow-nav-bar-active-slash: #4661fa; $sparrow-nav-bar-hover-background: #29303c; $right-border: #313233; -$sparrow-dropdown: #3670F7; -$sparrow-dropdown-hover: #5980DC; -$sparrow-dropdown-container: #22232E; -$sparrow-dropdown-option-hover: #2E2F3D; -$sparrow-dropdown-option-active: #1C1D27; -$sparrow-send-button-line: #D3D1D154; +$sparrow-dropdown: #3670f7; +$sparrow-dropdown-hover: #5980dc; +$sparrow-dropdown-container: #22232e; +$sparrow-dropdown-option-hover: #2e2f3d; +$sparrow-dropdown-option-active: #1c1d27; +$sparrow-send-button-line: #d3d1d154; $sparrow-tab-request-default: #324035; -$sparrow-tab-request-text-default: #4A4D4F; -$sparrow-tab-unsave-icon: #CB4A4A; -$sparrow-cross-icon: #F5F5F5; +$sparrow-tab-request-text-default: #4a4d4f; +$sparrow-tab-unsave-icon: #cb4a4a; +$sparrow-cross-icon: #f5f5f5; -$sparrow-bg-container: #8989890D; +$sparrow-bg-container: #8989890d; $sparrow-bg-container-border: #313233; -$sparrow-bg-container-one: #1392F0; -$sparrow-bg-container-two: #4165F9; -$sparrow-bg-container-three: #5652FD; -$sparrow-bg-container-four: #376FF7; +$sparrow-bg-container-one: #1392f0; +$sparrow-bg-container-two: #4165f9; +$sparrow-bg-container-three: #5652fd; +$sparrow-bg-container-four: #376ff7; -$theme-grey-ffffff: #FFFFFF; -$theme-grey-F5F5F5: #F5F5F5; +$theme-grey-ffffff: #ffffff; +$theme-grey-F5F5F5: #f5f5f5; $theme-grey-e5e5e5: #e5e5e5; -$theme-grey-C4CBDA: #C4CBDA; -$theme-grey-A5B5CA: #A5B5CA; -$theme-grey-B6B5B5: #B6B5B5; -$theme-grey-8A9299: #8A9299; +$theme-grey-C4CBDA: #c4cbda; +$theme-grey-A5B5CA: #a5b5ca; +$theme-grey-B6B5B5: #b6b5b5; +$theme-grey-8A9299: #8a9299; $theme-grey-999999: #999999; -$theme-grey-9CA0B2: #9CA0B2; -$theme-grey-CCCCCC :#CCCCCC; +$theme-grey-9CA0B2: #9ca0b2; +$theme-grey-CCCCCC: #cccccc; $theme-grey-888888: #888888; -$theme-grey-83899F: #83899F; +$theme-grey-83899F: #83899f; $theme-grey-808080: #808080; $theme-grey-636566: #636566; -$theme-grey-60616B: #60616B; +$theme-grey-60616B: #60616b; $theme-grey-484848: #484848; -$theme-grey-4D4D4D: #4D4D4D; -$theme-grey-45494D: #45494D; +$theme-grey-4D4D4D: #4d4d4d; +$theme-grey-45494D: #45494d; $theme-grey-353646: #353646; $theme-grey-333333: #333333; -$theme-grey-3E415A: #3E415A; +$theme-grey-3E415A: #3e415a; $theme-grey-313233: #313233; -$theme-grey-2B343D: #2B343D; +$theme-grey-2B343D: #2b343d; $theme-grey-272727: #272727; $theme-grey-212222: #212222; -$theme-grey-1A1A1A: #1A1A1A; +$theme-grey-1A1A1A: #1a1a1a; $theme-grey-161617: #161617; $theme-grey-151515: #151515; $theme-grey-000000: #000000; $theme-grey-191919: #191919; $theme-grey-121212: #121212; - - - - - - - - - -$theme-blue-F5F6F8: #F5F6F8; +$theme-blue-F5F6F8: #f5f6f8; $theme-blue-B0B0B0: #b0b0b0; -$theme-blue-9CDCFE: #9CDCFE; -$theme-blue-85C2FF: #85C2FF; +$theme-blue-9CDCFE: #9cdcfe; +$theme-blue-85C2FF: #85c2ff; $theme-blue-87b9f7: #87b9f7; -$theme-blue-5980DC: #5980DC; -$theme-blue-1193F0: #1193F0; -$theme-blue-3670F7: #3670F7; -$theme-blue-0B5ED7: #0B5ED7; -$theme-blue-2B5ED4: #2B5ED4; -$theme-blue-303F4F: #303F4F; -$theme-blue-1D3650: #1D3650; -$theme-blue-74AEF6: #74AEF6; +$theme-blue-5980DC: #5980dc; +$theme-blue-1193F0: #1193f0; +$theme-blue-3670F7: #3670f7; +$theme-blue-0B5ED7: #0b5ed7; +$theme-blue-2B5ED4: #2b5ed4; +$theme-blue-303F4F: #303f4f; +$theme-blue-1D3650: #1d3650; +$theme-blue-74AEF6: #74aef6; $theme-blue-11253a: #11253a; -$theme-blue-1E2A47: #1E2A47; +$theme-blue-1E2A47: #1e2a47; -$theme-violet-676A80: #676A80; -$theme-violet-37394E: #37394E; -$theme-violet-2A2C3C: #2A2C3C; -$theme-violet-22232E: #22232E; +$theme-violet-676A80: #676a80; +$theme-violet-37394E: #37394e; +$theme-violet-2A2C3C: #2a2c3c; +$theme-violet-22232E: #22232e; $theme-violet-272831: #272831; -$theme-violet-2E2F3D: #2E2F3D; +$theme-violet-2E2F3D: #2e2f3d; $theme-violet-323548: #323548; $theme-violet-1c1d27: #1c1d27; $theme-violet-1C1D2B: #1c1d2b; @@ -169,10 +160,7 @@ $theme-red-fe2e2e: #fe2e2e; $theme-red-6f2828: #6f2828; $theme-red-312325: #312325; $theme-red-230408: #230408; -$theme-red-2B1C1D: #2B1C1D; - - - +$theme-red-2B1C1D: #2b1c1d; :root { --tab-bar-hover: #{$sparrow-email-invite-bg-color}; @@ -213,22 +201,22 @@ $theme-red-2B1C1D: #2B1C1D; --selected-active-sidebar: #{$sparrow-selectedSideBarTab}; --sparrow-blue: #{$sparrow-blue}; --sparrow-button-background: #{$sparrow-button-background}; - --editor-operator:#{$sparrow-editor-operator-color}; - --editor-bool:#{$sparrow-editor-bool-color}; - --editor-name:#{$sparrow-editor-name-color}; - --editor-variable:#{$sparrow-editor-varible-color}; - --editor-bracket:#{$sparrow-editor-bracket-color}; - --editor-square-bracket:#{$sparrow-editor-square-bracket-color}; + --editor-operator: #{$sparrow-editor-operator-color}; + --editor-bool: #{$sparrow-editor-bool-color}; + --editor-name: #{$sparrow-editor-name-color}; + --editor-variable: #{$sparrow-editor-varible-color}; + --editor-bracket: #{$sparrow-editor-bracket-color}; + --editor-square-bracket: #{$sparrow-editor-square-bracket-color}; --error--color: #{$sparrow-errorTextColor}; - --sparrow-text-color:#{$sparrow-text-color}; - --editor-number:#{$sparrow-editor-number-color}; - --editor-angle-bracket:#{$sparrow-editor-angle-bracket-color}; + --sparrow-text-color: #{$sparrow-text-color}; + --editor-number: #{$sparrow-editor-number-color}; + --editor-angle-bracket: #{$sparrow-editor-angle-bracket-color}; --editor-tag-color: #{$sparrow-editor-tag-color}; --editor-string-color: #{$sparrow-editor-string-color}; --base-text: #{$sparrow-base-text-size}; --small-text: #{$sparrow-small-text-size}; --medium-text: #{$sparrow-medium-text-size}; - --right-click-menu : #{$sparrow-right-click-menu}; + --right-click-menu: #{$sparrow-right-click-menu}; --button-disabled: #{$sparrow-button-disabled}; --active-sync-btn: #{$sparrow-active-sync}; --deleted-api-method: #{$deleted-api-method}; @@ -257,290 +245,285 @@ $theme-red-2B1C1D: #2B1C1D; // // - // Sets text color + // Sets text color // // - --text-primary-100 : #{$theme-blue-9CDCFE}; - --text-primary-150 : #{$theme-blue-85C2FF}; - --text-primary-200 : #{$theme-blue-1193F0}; - --text-primary-250 : #{$theme-blue-B0B0B0}; - --text-primary-300 : #{$theme-blue-3670F7}; - --text-primary-350 : #{$theme-blue-74AEF6}; - --text-primary-400 : #{$theme-blue-0B5ED7}; - --text-primary-500 : #{$theme-blue-87b9f7}; - - --text-secondary-50 : #{$theme-grey-999999}; - --text-secondary-100 : #{$theme-grey-ffffff}; - --text-secondary-110 : #{$theme-grey-F5F5F5}; - --text-secondary-150 : #{$theme-grey-e5e5e5}; - --text-secondary-200 : #{$theme-grey-8A9299}; - --text-secondary-250 : #{$theme-grey-83899F}; - --text-secondary-290 : #{$theme-grey-484848}; - --text-secondary-300 : #{$theme-grey-45494D}; - --text-secondary-350 : #{$theme-grey-636566}; - --text-secondary-370 : #{$theme-grey-60616B}; - --text-secondary-400 : #{$theme-grey-313233}; - --text-secondary-450 : #{$theme-grey-191919}; - --text-secondary-500 : #{$theme-grey-272727}; - --text-secondary-550 : #{$theme-grey-808080}; - --text-secondary-600 : #{$theme-grey-212222}; - --text-secondary-700 : #{$theme-grey-161617}; - --text-secondary-800 : #{$theme-grey-151515}; - --text-secondary-850 : #{$theme-grey-121212}; - --text-secondary-900 : #{$theme-grey-000000}; + --text-primary-100: #{$theme-blue-9CDCFE}; + --text-primary-150: #{$theme-blue-85C2FF}; + --text-primary-200: #{$theme-blue-1193F0}; + --text-primary-250: #{$theme-blue-B0B0B0}; + --text-primary-300: #{$theme-blue-3670F7}; + --text-primary-350: #{$theme-blue-74AEF6}; + --text-primary-400: #{$theme-blue-0B5ED7}; + --text-primary-500: #{$theme-blue-87b9f7}; + + --text-secondary-50: #{$theme-grey-999999}; + --text-secondary-100: #{$theme-grey-ffffff}; + --text-secondary-110: #{$theme-grey-F5F5F5}; + --text-secondary-150: #{$theme-grey-e5e5e5}; + --text-secondary-200: #{$theme-grey-8A9299}; + --text-secondary-250: #{$theme-grey-83899F}; + --text-secondary-290: #{$theme-grey-484848}; + --text-secondary-300: #{$theme-grey-45494D}; + --text-secondary-350: #{$theme-grey-636566}; + --text-secondary-370: #{$theme-grey-60616B}; + --text-secondary-400: #{$theme-grey-313233}; + --text-secondary-450: #{$theme-grey-191919}; + --text-secondary-500: #{$theme-grey-272727}; + --text-secondary-550: #{$theme-grey-808080}; + --text-secondary-600: #{$theme-grey-212222}; + --text-secondary-700: #{$theme-grey-161617}; + --text-secondary-800: #{$theme-grey-151515}; + --text-secondary-850: #{$theme-grey-121212}; + --text-secondary-900: #{$theme-grey-000000}; --text-secondary-1000: #{$theme-grey-CCCCCC}; - --text-secondary-1100 : #{$theme-grey-2B343D}; - - --text-tertiary-100 : #{$theme-violet-676A80}; - --text-tertiary-190 : #{$theme-violet-37394E}; - --text-tertiary-200 : #{$theme-violet-323548}; - --text-tertiary-300 : #{$theme-violet-2A2C3C}; - --text-tertiary-400 : #{$theme-violet-22232E}; - --text-tertiary-500 : #{$theme-violet-272831}; - --text-tertiary-600 : #{$theme-violet-2E2F3D}; - --text-tertiary-700 : #{$theme-violet-1c1d27}; - --text-tertiary-750 : #{$theme-violet-1C1D2B}; - - --text-danger-100 : #{$theme-red-e5acb2}; - --text-danger-200 : #{$theme-red-fe8c98}; - --text-danger-300 : #{$theme-red-ff7878}; - --text-danger-400 : #{$theme-red-f16674}; - --text-danger-500 : #{$theme-red-fc6574}; - --text-danger-600 : #{$theme-red-ef5262}; - --text-danger-700 : #{$theme-red-f34b5c}; - --text-danger-800 : #{$theme-red-f33346}; - --text-danger-850 : #{$theme-red-6f2828}; - --text-danger-900 : #{$theme-red-fe2e2e}; - --text-danger-1000 : #{$theme-red-312325}; - --text-danger-1200 : #{$theme-red-2B1C1D}; + --text-secondary-1100: #{$theme-grey-2B343D}; + + --text-tertiary-100: #{$theme-violet-676A80}; + --text-tertiary-190: #{$theme-violet-37394E}; + --text-tertiary-200: #{$theme-violet-323548}; + --text-tertiary-300: #{$theme-violet-2A2C3C}; + --text-tertiary-400: #{$theme-violet-22232E}; + --text-tertiary-500: #{$theme-violet-272831}; + --text-tertiary-600: #{$theme-violet-2E2F3D}; + --text-tertiary-700: #{$theme-violet-1c1d27}; + --text-tertiary-750: #{$theme-violet-1C1D2B}; + + --text-danger-100: #{$theme-red-e5acb2}; + --text-danger-200: #{$theme-red-fe8c98}; + --text-danger-300: #{$theme-red-ff7878}; + --text-danger-400: #{$theme-red-f16674}; + --text-danger-500: #{$theme-red-fc6574}; + --text-danger-600: #{$theme-red-ef5262}; + --text-danger-700: #{$theme-red-f34b5c}; + --text-danger-800: #{$theme-red-f33346}; + --text-danger-850: #{$theme-red-6f2828}; + --text-danger-900: #{$theme-red-fe2e2e}; + --text-danger-1000: #{$theme-red-312325}; + --text-danger-1200: #{$theme-red-2B1C1D}; // // // Sets background color // // - --bg-primary-100 : #{$theme-blue-9CDCFE}; - --bg-primary-150 : #{$theme-blue-F5F6F8}; - --bg-primary-200 : #{$theme-blue-1193F0}; - --bg-primary-250 : #{$theme-blue-5980DC}; - --bg-primary-300 : #{$theme-blue-3670F7}; - --bg-primary-400 : #{$theme-blue-0B5ED7}; - --bg-primary-500 : #{$theme-blue-2B5ED4}; - --bg-primary-600 : #{$theme-blue-1D3650}; - --bg-primary-700 : #{$theme-blue-11253a}; - --bg-primary-800 : #{$theme-blue-1E2A47}; - - --bg-secondary-100 : #{$theme-grey-ffffff}; - --bg-secondary-110 : #{$theme-grey-F5F5F5}; - --bg-secondary-150 : #{$theme-grey-e5e5e5}; - --bg-secondary-200 : #{$theme-grey-8A9299}; - --bg-secondary-290 : #{$theme-grey-484848}; - --bg-secondary-300 : #{$theme-grey-45494D}; - --bg-secondary-320 : #{$theme-grey-353646}; - --bg-secondary-330 : #{$theme-grey-333333}; - --bg-secondary-350 : #{$theme-grey-888888}; - --bg-secondary-400 : #{$theme-grey-313233}; - --bg-secondary-420 : #{$theme-grey-3E415A}; - --bg-secondary-450 : #{$theme-grey-191919}; - --bg-secondary-500 : #{$theme-grey-272727}; - --bg-secondary-550 : #{$theme-grey-1A1A1A}; - --bg-secondary-600 : #{$theme-grey-212222}; - --bg-secondary-700 : #{$theme-grey-161617}; - --bg-secondary-750 : #{$theme-grey-4D4D4D}; - --bg-secondary-800 : #{$theme-grey-151515}; - --bg-secondary-850 : #{$theme-grey-121212}; - --bg-secondary-900 : #{$theme-grey-000000}; - --bg-secondary-950 : #{$theme-grey-808080}; - --bg-secondary-1000 : #{$theme-grey-CCCCCC}; - --bg-secondary-1100 : #{$theme-grey-2B343D}; - - --bg-tertiary-100 : #{$theme-violet-676A80}; - --bg-tertiary-190 : #{$theme-violet-37394E}; - --bg-tertiary-300 : #{$theme-violet-2A2C3C}; - --bg-tertiary-400 : #{$theme-violet-22232E}; - --bg-tertiary-500 : #{$theme-violet-272831}; - --bg-tertiary-600 : #{$theme-violet-2E2F3D}; - --bg-tertiary-650 : #{$theme-violet-323548}; - --bg-tertiary-700 : #{$theme-violet-1c1d27}; - --bg-tertiary-750 : #{$theme-violet-1C1D2B}; - - - --bg-danger-100 : #{$theme-red-e5acb2}; - --bg-danger-200 : #{$theme-red-fe8c98}; - --bg-danger-300 : #{$theme-red-ff7878}; - --bg-danger-400 : #{$theme-red-f16674}; - --bg-danger-500 : #{$theme-red-fc6574}; - --bg-danger-600 : #{$theme-red-ef5262}; - --bg-danger-700 : #{$theme-red-f34b5c}; - --bg-danger-800 : #{$theme-red-f33346}; - --bg-danger-900 : #{$theme-red-fe2e2e}; - --bg-danger-1000 : #{$theme-red-312325}; - --bg-danger-1100 : #{$theme-red-230408}; - --bg-danger-1200 : #{$theme-red-2B1C1D}; - + --bg-primary-100: #{$theme-blue-9CDCFE}; + --bg-primary-150: #{$theme-blue-F5F6F8}; + --bg-primary-200: #{$theme-blue-1193F0}; + --bg-primary-250: #{$theme-blue-5980DC}; + --bg-primary-300: #{$theme-blue-3670F7}; + --bg-primary-400: #{$theme-blue-0B5ED7}; + --bg-primary-500: #{$theme-blue-2B5ED4}; + --bg-primary-600: #{$theme-blue-1D3650}; + --bg-primary-700: #{$theme-blue-11253a}; + --bg-primary-800: #{$theme-blue-1E2A47}; + + --bg-secondary-100: #{$theme-grey-ffffff}; + --bg-secondary-110: #{$theme-grey-F5F5F5}; + --bg-secondary-150: #{$theme-grey-e5e5e5}; + --bg-secondary-200: #{$theme-grey-8A9299}; + --bg-secondary-290: #{$theme-grey-484848}; + --bg-secondary-300: #{$theme-grey-45494D}; + --bg-secondary-320: #{$theme-grey-353646}; + --bg-secondary-330: #{$theme-grey-333333}; + --bg-secondary-350: #{$theme-grey-888888}; + --bg-secondary-400: #{$theme-grey-313233}; + --bg-secondary-420: #{$theme-grey-3E415A}; + --bg-secondary-450: #{$theme-grey-191919}; + --bg-secondary-500: #{$theme-grey-272727}; + --bg-secondary-550: #{$theme-grey-1A1A1A}; + --bg-secondary-600: #{$theme-grey-212222}; + --bg-secondary-700: #{$theme-grey-161617}; + --bg-secondary-750: #{$theme-grey-4D4D4D}; + --bg-secondary-800: #{$theme-grey-151515}; + --bg-secondary-850: #{$theme-grey-121212}; + --bg-secondary-900: #{$theme-grey-000000}; + --bg-secondary-950: #{$theme-grey-808080}; + --bg-secondary-1000: #{$theme-grey-CCCCCC}; + --bg-secondary-1100: #{$theme-grey-2B343D}; + + --bg-tertiary-100: #{$theme-violet-676A80}; + --bg-tertiary-190: #{$theme-violet-37394E}; + --bg-tertiary-300: #{$theme-violet-2A2C3C}; + --bg-tertiary-400: #{$theme-violet-22232E}; + --bg-tertiary-500: #{$theme-violet-272831}; + --bg-tertiary-600: #{$theme-violet-2E2F3D}; + --bg-tertiary-650: #{$theme-violet-323548}; + --bg-tertiary-700: #{$theme-violet-1c1d27}; + --bg-tertiary-750: #{$theme-violet-1C1D2B}; + + --bg-danger-100: #{$theme-red-e5acb2}; + --bg-danger-200: #{$theme-red-fe8c98}; + --bg-danger-300: #{$theme-red-ff7878}; + --bg-danger-400: #{$theme-red-f16674}; + --bg-danger-500: #{$theme-red-fc6574}; + --bg-danger-600: #{$theme-red-ef5262}; + --bg-danger-700: #{$theme-red-f34b5c}; + --bg-danger-800: #{$theme-red-f33346}; + --bg-danger-900: #{$theme-red-fe2e2e}; + --bg-danger-1000: #{$theme-red-312325}; + --bg-danger-1100: #{$theme-red-230408}; + --bg-danger-1200: #{$theme-red-2B1C1D}; // // // Sets border color // // - --border-primary-100 : #{$theme-blue-9CDCFE}; - --border-primary-200 : #{$theme-blue-1193F0}; - --border-primary-300 : #{$theme-blue-3670F7}; - --border-primary-400 : #{$theme-blue-0B5ED7}; - --border-primary-900 : #{$theme-blue-303F4F}; - - --border-secondary-100 : #{$theme-grey-ffffff}; - --border-secondary-110 : #{$theme-grey-F5F5F5}; - --border-secondary-150 : #{$theme-grey-e5e5e5}; - --border-secondary-200 : #{$theme-grey-8A9299}; - --border-secondary-290 : #{$theme-grey-484848}; - --border-secondary-300 : #{$theme-grey-45494D}; - --border-secondary-320 : #{$theme-grey-353646}; - --border-secondary-400 : #{$theme-grey-313233}; - --border-secondary-450 : #{$theme-grey-191919}; - --border-secondary-500 : #{$theme-grey-272727}; - --border-secondary-600 : #{$theme-grey-212222}; - --border-secondary-700 : #{$theme-grey-161617}; - --border-secondary-800 : #{$theme-grey-151515}; - --border-secondary-900 : #{$theme-grey-000000}; - --border-secondary-950 : #{$theme-grey-808080}; - --border-secondary-1100 : #{$theme-grey-2B343D}; - - - --border-tertiary-100 : #{$theme-violet-676A80}; - --border-tertiary-190 : #{$theme-violet-37394E}; - --border-tertiary-300 : #{$theme-violet-2A2C3C}; - --border-tertiary-400 : #{$theme-violet-22232E}; - --border-tertiary-500 : #{$theme-violet-272831}; - --border-tertiary-600 : #{$theme-violet-2E2F3D}; - --border-tertiary-700 : #{$theme-violet-1c1d27}; - --border-tertiary-750 : #{$theme-violet-1C1D2B}; - - --border-danger-100 : #{$theme-red-e5acb2}; - --border-danger-200 : #{$theme-red-fe8c98}; - --border-danger-300 : #{$theme-red-ff7878}; - --border-danger-400 : #{$theme-red-f16674}; - --border-danger-500 : #{$theme-red-fc6574}; - --border-danger-600 : #{$theme-red-ef5262}; - --border-danger-700 : #{$theme-red-f34b5c}; - --border-danger-800 : #{$theme-red-f33346}; - --border-danger-900 : #{$theme-red-fe2e2e}; - --border-danger-1000 : #{$theme-red-312325}; - --border-danger-1200 : #{$theme-red-2B1C1D}; + --border-primary-100: #{$theme-blue-9CDCFE}; + --border-primary-200: #{$theme-blue-1193F0}; + --border-primary-300: #{$theme-blue-3670F7}; + --border-primary-400: #{$theme-blue-0B5ED7}; + --border-primary-900: #{$theme-blue-303F4F}; + + --border-secondary-100: #{$theme-grey-ffffff}; + --border-secondary-110: #{$theme-grey-F5F5F5}; + --border-secondary-150: #{$theme-grey-e5e5e5}; + --border-secondary-200: #{$theme-grey-8A9299}; + --border-secondary-290: #{$theme-grey-484848}; + --border-secondary-300: #{$theme-grey-45494D}; + --border-secondary-320: #{$theme-grey-353646}; + --border-secondary-400: #{$theme-grey-313233}; + --border-secondary-450: #{$theme-grey-191919}; + --border-secondary-500: #{$theme-grey-272727}; + --border-secondary-600: #{$theme-grey-212222}; + --border-secondary-700: #{$theme-grey-161617}; + --border-secondary-800: #{$theme-grey-151515}; + --border-secondary-900: #{$theme-grey-000000}; + --border-secondary-950: #{$theme-grey-808080}; + --border-secondary-1100: #{$theme-grey-2B343D}; + + --border-tertiary-100: #{$theme-violet-676A80}; + --border-tertiary-190: #{$theme-violet-37394E}; + --border-tertiary-300: #{$theme-violet-2A2C3C}; + --border-tertiary-400: #{$theme-violet-22232E}; + --border-tertiary-500: #{$theme-violet-272831}; + --border-tertiary-600: #{$theme-violet-2E2F3D}; + --border-tertiary-700: #{$theme-violet-1c1d27}; + --border-tertiary-750: #{$theme-violet-1C1D2B}; + + --border-danger-100: #{$theme-red-e5acb2}; + --border-danger-200: #{$theme-red-fe8c98}; + --border-danger-300: #{$theme-red-ff7878}; + --border-danger-400: #{$theme-red-f16674}; + --border-danger-500: #{$theme-red-fc6574}; + --border-danger-600: #{$theme-red-ef5262}; + --border-danger-700: #{$theme-red-f34b5c}; + --border-danger-800: #{$theme-red-f33346}; + --border-danger-900: #{$theme-red-fe2e2e}; + --border-danger-1000: #{$theme-red-312325}; + --border-danger-1200: #{$theme-red-2B1C1D}; // // // Sets icon color // // - --icon-primary-100 : #{$theme-blue-9CDCFE}; - --icon-primary-200 : #{$theme-blue-1193F0}; - --icon-primary-300 : #{$theme-blue-3670F7}; - --icon-primary-400 : #{$theme-blue-0B5ED7}; - --icon-primary-900 : #{$theme-blue-303F4F}; - - - - --icon-secondary-100 : #{$theme-grey-ffffff}; - --icon-secondary-110 : #{$theme-grey-F5F5F5}; - --icon-secondary-130 : #{$theme-grey-A5B5CA}; - --icon-secondary-150 : #{$theme-grey-e5e5e5}; - --icon-secondary-170 : #{$theme-grey-9CA0B2}; - --icon-secondary-200 : #{$theme-grey-8A9299}; - --icon-secondary-220 : #{$theme-grey-60616B}; - --icon-secondary-290 : #{$theme-grey-484848}; - --icon-secondary-300 : #{$theme-grey-45494D}; - --icon-secondary-380 : #{$theme-grey-333333}; - --icon-secondary-400 : #{$theme-grey-313233}; - --icon-secondary-450 : #{$theme-grey-191919}; - --icon-secondary-500 : #{$theme-grey-272727}; - --icon-secondary-550 : #{$theme-grey-1A1A1A}; - --icon-secondary-600 : #{$theme-grey-212222}; - --icon-secondary-700 : #{$theme-grey-161617}; - --icon-secondary-800 : #{$theme-grey-151515}; - --icon-secondary-900 : #{$theme-grey-000000}; - --icon-secondary-950 : #{$theme-grey-808080}; - --icon-secondary-1000 : #{$theme-grey-CCCCCC}; - --icon-secondary-1100 : #{$theme-grey-2B343D}; - - - --icon-tertiary-100 : #{$theme-violet-676A80}; - --icon-tertiary-190 : #{$theme-violet-37394E}; - --icon-tertiary-300 : #{$theme-violet-2A2C3C}; - --icon-tertiary-400 : #{$theme-violet-22232E}; - --icon-tertiary-500 : #{$theme-violet-272831}; - --icon-tertiary-600 : #{$theme-violet-2E2F3D}; - --icon-tertiary-700 : #{$theme-violet-1c1d27}; - --icon-tertiary-750 : #{$theme-violet-1C1D2B}; - - --icon-danger-100 : #{$theme-red-e5acb2}; - --icon-danger-200 : #{$theme-red-fe8c98}; - --icon-danger-300 : #{$theme-red-ff7878}; - --icon-danger-400 : #{$theme-red-f16674}; - --icon-danger-500 : #{$theme-red-fc6574}; - --icon-danger-600 : #{$theme-red-ef5262}; - --icon-danger-700 : #{$theme-red-f34b5c}; - --icon-danger-800 : #{$theme-red-f33346}; - --icon-danger-900 : #{$theme-red-fe2e2e}; - --icon-danger-1000 : #{$theme-red-312325}; - - --icon-disabled-100 : #{$theme-grey-333333}; + --icon-primary-100: #{$theme-blue-9CDCFE}; + --icon-primary-200: #{$theme-blue-1193F0}; + --icon-primary-300: #{$theme-blue-3670F7}; + --icon-primary-400: #{$theme-blue-0B5ED7}; + --icon-primary-900: #{$theme-blue-303F4F}; + + --icon-secondary-100: #{$theme-grey-ffffff}; + --icon-secondary-110: #{$theme-grey-F5F5F5}; + --icon-secondary-130: #{$theme-grey-A5B5CA}; + --icon-secondary-150: #{$theme-grey-e5e5e5}; + --icon-secondary-170: #{$theme-grey-9CA0B2}; + --icon-secondary-200: #{$theme-grey-8A9299}; + --icon-secondary-220: #{$theme-grey-60616B}; + --icon-secondary-290: #{$theme-grey-484848}; + --icon-secondary-300: #{$theme-grey-45494D}; + --icon-secondary-380: #{$theme-grey-333333}; + --icon-secondary-400: #{$theme-grey-313233}; + --icon-secondary-450: #{$theme-grey-191919}; + --icon-secondary-500: #{$theme-grey-272727}; + --icon-secondary-550: #{$theme-grey-1A1A1A}; + --icon-secondary-600: #{$theme-grey-212222}; + --icon-secondary-700: #{$theme-grey-161617}; + --icon-secondary-800: #{$theme-grey-151515}; + --icon-secondary-900: #{$theme-grey-000000}; + --icon-secondary-950: #{$theme-grey-808080}; + --icon-secondary-1000: #{$theme-grey-CCCCCC}; + --icon-secondary-1100: #{$theme-grey-2B343D}; + + --icon-tertiary-100: #{$theme-violet-676A80}; + --icon-tertiary-190: #{$theme-violet-37394E}; + --icon-tertiary-300: #{$theme-violet-2A2C3C}; + --icon-tertiary-400: #{$theme-violet-22232E}; + --icon-tertiary-500: #{$theme-violet-272831}; + --icon-tertiary-600: #{$theme-violet-2E2F3D}; + --icon-tertiary-700: #{$theme-violet-1c1d27}; + --icon-tertiary-750: #{$theme-violet-1C1D2B}; + + --icon-danger-100: #{$theme-red-e5acb2}; + --icon-danger-200: #{$theme-red-fe8c98}; + --icon-danger-300: #{$theme-red-ff7878}; + --icon-danger-400: #{$theme-red-f16674}; + --icon-danger-500: #{$theme-red-fc6574}; + --icon-danger-600: #{$theme-red-ef5262}; + --icon-danger-700: #{$theme-red-f34b5c}; + --icon-danger-800: #{$theme-red-f33346}; + --icon-danger-900: #{$theme-red-fe2e2e}; + --icon-danger-1000: #{$theme-red-312325}; } // $button-color: linear-gradient(270deg, #6147ff -1.72%, #1193f0 100%); -$theme-colors: map-merge($theme-colors, - ("primaryColor": $sparrow-blue, - "recentApiText": $sparrow-recentApiText, - - "secondaryColor": $sparrow-yellow, - "blackColor": $sparrow-black, - "successColor": $sparrow-success, - "borderColor": $sparrow-error, - "defaultColor": $sparrow-default, - "dangerColor": $sparrow-danger, - "whiteColor": $sparrow-white, - "lightGray": $sparrow-light-gray, - "backgroundColor": $sparrow-background, - "backgroundLight": $sparrow-background-light, - "backgroundDark": $sparrow-background-dark, - "backgroundDropdown": $sparrow-background-dropdown, - "plusButton": $sparrow-plusbutton, - "lightBackground": $sparrow-border-color, - "requestBodyColor": $sparrow-request-body, - "labelColor": $sparrow-send-button, - "buttonBackColor": $sparrow-button-background, - "buttonColor": $sparrow-button-color, - "redColor": $sparrow-gradient, - "getColor": $sparrow-get, - "putColor": $sparrow-put, - "postColor": $sparrow-post, - "deleteColor": $sparrow-delete, - "headColor": $sparrow-head, - "patchColor": $sparrow-patc, - "optionsColor": $sparrow-opt, - "textColor": $sparrow-text-color, - "keyValuePairColor": $sparrow-key-value-pair, - "dullBackground": $sparrow-dull-background, - "sparrowBottomBorder": $sparrow-bottom-border, - "emailInviteBackgroundColor":$sparrow-email-invite-bg-color, - "dropdownBorderColor":$sparrow-dropdown-border-color, - "activeSyncBtn": $sparrow-active-sync, - "dropdownButton": $sparrow-dropdown, - "dropdownHover": $sparrow-dropdown-hover, - "dropdownContainer": $sparrow-dropdown-container, - "dropdownOptionHover": $sparrow-dropdown-option-hover, - "dropdownOptionActive": $sparrow-dropdown-option-active, - "saveButtonLine": $sparrow-send-button-line, - - "sparrowBgContainer": $sparrow-bg-container, - "sparrowBgContainerBorder": $sparrow-bg-container-border, - "sparrowBgContainerOne": $sparrow-bg-container-one, - "sparrowBgContainerTwo": $sparrow-bg-container-two, - "sparrowBgContainerThree": $sparrow-bg-container-three, - "sparrowBgContainerFour": $sparrow-bg-container-four )); - +$theme-colors: map-merge( + $theme-colors, + ( + "primaryColor": $sparrow-blue, + "recentApiText": $sparrow-recentApiText, + + "secondaryColor": $sparrow-yellow, + "blackColor": $sparrow-black, + "successColor": $sparrow-success, + "borderColor": $sparrow-error, + "defaultColor": $sparrow-default, + "dangerColor": $sparrow-danger, + "whiteColor": $sparrow-white, + "lightGray": $sparrow-light-gray, + "backgroundColor": $sparrow-background, + "backgroundLight": $sparrow-background-light, + "backgroundDark": $sparrow-background-dark, + "backgroundDropdown": $sparrow-background-dropdown, + "plusButton": $sparrow-plusbutton, + "lightBackground": $sparrow-border-color, + "requestBodyColor": $sparrow-request-body, + "labelColor": $sparrow-send-button, + "buttonBackColor": $sparrow-button-background, + "buttonColor": $sparrow-button-color, + "redColor": $sparrow-gradient, + "getColor": $sparrow-get, + "putColor": $sparrow-put, + "postColor": $sparrow-post, + "deleteColor": $sparrow-delete, + "headColor": $sparrow-head, + "patchColor": $sparrow-patc, + "optionsColor": $sparrow-opt, + "textColor": $sparrow-text-color, + "keyValuePairColor": $sparrow-key-value-pair, + "dullBackground": $sparrow-dull-background, + "sparrowBottomBorder": $sparrow-bottom-border, + "emailInviteBackgroundColor": $sparrow-email-invite-bg-color, + "dropdownBorderColor": $sparrow-dropdown-border-color, + "activeSyncBtn": $sparrow-active-sync, + "dropdownButton": $sparrow-dropdown, + "dropdownHover": $sparrow-dropdown-hover, + "dropdownContainer": $sparrow-dropdown-container, + "dropdownOptionHover": $sparrow-dropdown-option-hover, + "dropdownOptionActive": $sparrow-dropdown-option-active, + "saveButtonLine": $sparrow-send-button-line, + + "sparrowBgContainer": $sparrow-bg-container, + "sparrowBgContainerBorder": $sparrow-bg-container-border, + "sparrowBgContainerOne": $sparrow-bg-container-one, + "sparrowBgContainerTwo": $sparrow-bg-container-two, + "sparrowBgContainerThree": $sparrow-bg-container-three, + "sparrowBgContainerFour": $sparrow-bg-container-four, + ) +); // Define a map for font sizes in pixels $sparrow-font-sizes: ( @@ -572,7 +555,7 @@ $sparrow-font-sizes: ( // 20px in rem 28: 1.75rem, // 28px in rem - 36: 2.25rem // 36px in rem + 36: 2.25rem // 36px in rem, ); // Define a map for border radius in pixels @@ -587,147 +570,146 @@ $sparrow-border-radius: ( // Define a map for text colors $sparrow-text-colors: ( - primary-100 : $theme-blue-9CDCFE, - primary-150 : $theme-blue-85C2FF, - primary-200 : $theme-blue-1193F0, - primary-300 : $theme-blue-3670F7, - primary-400 : $theme-blue-0B5ED7, - - secondary-100 : $theme-grey-ffffff, - secondary-110 : $theme-grey-F5F5F5, - secondary-150 : $theme-grey-e5e5e5, - secondary-170 : $theme-grey-C4CBDA, - secondary-180 : $theme-grey-B6B5B5, - secondary-200 : $theme-grey-8A9299, - secondary-250 : $theme-grey-636566, - secondary-270 : $theme-grey-60616B, - secondary-290 : $theme-grey-484848, - secondary-300 : $theme-grey-45494D, - secondary-400 : $theme-grey-313233, - secondary-500 : $theme-grey-272727, - secondary-550 : $theme-grey-1A1A1A, - secondary-600 : $theme-grey-212222, - secondary-700 : $theme-grey-161617, - secondary-800 : $theme-grey-151515, - secondary-850 : $theme-grey-121212, - secondary-900 : $theme-grey-000000, + primary-100: $theme-blue-9CDCFE, + primary-150: $theme-blue-85C2FF, + primary-200: $theme-blue-1193F0, + primary-300: $theme-blue-3670F7, + primary-400: $theme-blue-0B5ED7, + + secondary-100: $theme-grey-ffffff, + secondary-110: $theme-grey-F5F5F5, + secondary-150: $theme-grey-e5e5e5, + secondary-170: $theme-grey-C4CBDA, + secondary-180: $theme-grey-B6B5B5, + secondary-200: $theme-grey-8A9299, + secondary-250: $theme-grey-636566, + secondary-270: $theme-grey-60616B, + secondary-290: $theme-grey-484848, + secondary-300: $theme-grey-45494D, + secondary-400: $theme-grey-313233, + secondary-500: $theme-grey-272727, + secondary-550: $theme-grey-1A1A1A, + secondary-600: $theme-grey-212222, + secondary-700: $theme-grey-161617, + secondary-800: $theme-grey-151515, + secondary-850: $theme-grey-121212, + secondary-900: $theme-grey-000000, secondary-1000: $theme-grey-CCCCCC, - secondary-1100 : $theme-grey-2B343D, - - tertiary-100 : $theme-violet-676A80, - tertiary-190 : $theme-violet-37394E, - tertiary-300 : $theme-violet-2A2C3C, - tertiary-400 : $theme-violet-22232E, - tertiary-500 : $theme-violet-272831, - tertiary-600 : $theme-violet-2E2F3D, - tertiary-700 : $theme-violet-1c1d27, - tertiary-750 : $theme-violet-1C1D2B, - - danger-100 : $theme-red-e5acb2, - danger-200 : $theme-red-fe8c98, - danger-300 : $theme-red-ff7878, - danger-400 : $theme-red-f16674, - danger-500 : $theme-red-fc6574, - danger-600 : $theme-red-ef5262, - danger-700 : $theme-red-f34b5c, - danger-800 : $theme-red-f33346, - danger-900 : $theme-red-fe2e2e, - danger-1000 : $theme-red-312325, + secondary-1100: $theme-grey-2B343D, + + tertiary-100: $theme-violet-676A80, + tertiary-190: $theme-violet-37394E, + tertiary-300: $theme-violet-2A2C3C, + tertiary-400: $theme-violet-22232E, + tertiary-500: $theme-violet-272831, + tertiary-600: $theme-violet-2E2F3D, + tertiary-700: $theme-violet-1c1d27, + tertiary-750: $theme-violet-1C1D2B, + + danger-100: $theme-red-e5acb2, + danger-200: $theme-red-fe8c98, + danger-300: $theme-red-ff7878, + danger-400: $theme-red-f16674, + danger-500: $theme-red-fc6574, + danger-600: $theme-red-ef5262, + danger-700: $theme-red-f34b5c, + danger-800: $theme-red-f33346, + danger-900: $theme-red-fe2e2e, + danger-1000: $theme-red-312325, ); // Define a map for background colors $sparrow-bg-colors: ( - primary-100 : $theme-blue-9CDCFE, - primary-200 : $theme-blue-1193F0, - primary-300 : $theme-blue-3670F7, - primary-400 : $theme-blue-0B5ED7, - - secondary-100 : $theme-grey-ffffff, - secondary-110 : $theme-grey-F5F5F5, - secondary-150 : $theme-grey-e5e5e5, - secondary-170 : $theme-grey-C4CBDA, - secondary-180 : $theme-grey-B6B5B5, - secondary-200 : $theme-grey-8A9299, - secondary-290 : $theme-grey-484848, - secondary-300 : $theme-grey-45494D, - secondary-400 : $theme-grey-313233, - secondary-500 : $theme-grey-272727, - secondary-550 : $theme-grey-1A1A1A, - secondary-600 : $theme-grey-212222, - secondary-700 : $theme-grey-161617, - secondary-800 : $theme-grey-151515, - secondary-850 : $theme-grey-121212, - secondary-900 : $theme-grey-000000, - secondary-1000 : $theme-grey-CCCCCC, - secondary-1100 : $theme-grey-2B343D, - - tertiary-100 : $theme-violet-676A80, - tertiary-190 : $theme-violet-37394E, - tertiary-300 : $theme-violet-2A2C3C, - tertiary-400 : $theme-violet-22232E, - tertiary-500 : $theme-violet-272831, - tertiary-600 : $theme-violet-2E2F3D, - tertiary-650 : $theme-violet-323548, - tertiary-700 : $theme-violet-1c1d27, - tertiary-750 : $theme-violet-1C1D2B, - - danger-100 : $theme-red-e5acb2, - danger-200 : $theme-red-fe8c98, - danger-300 : $theme-red-ff7878, - danger-400 : $theme-red-f16674, - danger-500 : $theme-red-fc6574, - danger-600 : $theme-red-ef5262, - danger-700 : $theme-red-f34b5c, - danger-800 : $theme-red-f33346, - danger-900 : $theme-red-fe2e2e, - danger-1000 : $theme-red-312325, + primary-100: $theme-blue-9CDCFE, + primary-200: $theme-blue-1193F0, + primary-300: $theme-blue-3670F7, + primary-400: $theme-blue-0B5ED7, + + secondary-100: $theme-grey-ffffff, + secondary-110: $theme-grey-F5F5F5, + secondary-150: $theme-grey-e5e5e5, + secondary-170: $theme-grey-C4CBDA, + secondary-180: $theme-grey-B6B5B5, + secondary-200: $theme-grey-8A9299, + secondary-290: $theme-grey-484848, + secondary-300: $theme-grey-45494D, + secondary-400: $theme-grey-313233, + secondary-500: $theme-grey-272727, + secondary-550: $theme-grey-1A1A1A, + secondary-600: $theme-grey-212222, + secondary-700: $theme-grey-161617, + secondary-800: $theme-grey-151515, + secondary-850: $theme-grey-121212, + secondary-900: $theme-grey-000000, + secondary-1000: $theme-grey-CCCCCC, + secondary-1100: $theme-grey-2B343D, + + tertiary-100: $theme-violet-676A80, + tertiary-190: $theme-violet-37394E, + tertiary-300: $theme-violet-2A2C3C, + tertiary-400: $theme-violet-22232E, + tertiary-500: $theme-violet-272831, + tertiary-600: $theme-violet-2E2F3D, + tertiary-650: $theme-violet-323548, + tertiary-700: $theme-violet-1c1d27, + tertiary-750: $theme-violet-1C1D2B, + + danger-100: $theme-red-e5acb2, + danger-200: $theme-red-fe8c98, + danger-300: $theme-red-ff7878, + danger-400: $theme-red-f16674, + danger-500: $theme-red-fc6574, + danger-600: $theme-red-ef5262, + danger-700: $theme-red-f34b5c, + danger-800: $theme-red-f33346, + danger-900: $theme-red-fe2e2e, + danger-1000: $theme-red-312325, ); - // Define a map for border colors $sparrow-border-colors: ( - primary-100 : $theme-blue-9CDCFE, - primary-200 : $theme-blue-1193F0, - primary-300 : $theme-blue-3670F7, - primary-400 : $theme-blue-0B5ED7, - - secondary-100 : $theme-grey-ffffff, - secondary-110 : $theme-grey-F5F5F5, - secondary-150 : $theme-grey-e5e5e5, - secondary-170 : $theme-grey-C4CBDA, - secondary-180 : $theme-grey-B6B5B5, - secondary-200 : $theme-grey-8A9299, - secondary-290 : $theme-grey-484848, - secondary-300 : $theme-grey-45494D, - secondary-400 : $theme-grey-313233, - secondary-500 : $theme-grey-272727, - secondary-550 : $theme-grey-1A1A1A, - secondary-600 : $theme-grey-212222, - secondary-700 : $theme-grey-161617, - secondary-800 : $theme-grey-151515, - secondary-900 : $theme-grey-000000, - secondary-1000 : $theme-grey-CCCCCC, - secondary-1100 : $theme-grey-2B343D, - - tertiary-100 : $theme-violet-676A80, - tertiary-190 : $theme-violet-37394E, - tertiary-300 : $theme-violet-2A2C3C, - tertiary-400 : $theme-violet-22232E, - tertiary-500 : $theme-violet-272831, - tertiary-600 : $theme-violet-2E2F3D, - tertiary-700 : $theme-violet-1c1d27, - tertiary-750 : $theme-violet-1C1D2B, - - danger-100 : $theme-red-e5acb2, - danger-200 : $theme-red-fe8c98, - danger-300 : $theme-red-ff7878, - danger-400 : $theme-red-f16674, - danger-500 : $theme-red-fc6574, - danger-600 : $theme-red-ef5262, - danger-700 : $theme-red-f34b5c, - danger-800 : $theme-red-f33346, - danger-900 : $theme-red-fe2e2e, - danger-1000 : $theme-red-312325, + primary-100: $theme-blue-9CDCFE, + primary-200: $theme-blue-1193F0, + primary-300: $theme-blue-3670F7, + primary-400: $theme-blue-0B5ED7, + + secondary-100: $theme-grey-ffffff, + secondary-110: $theme-grey-F5F5F5, + secondary-150: $theme-grey-e5e5e5, + secondary-170: $theme-grey-C4CBDA, + secondary-180: $theme-grey-B6B5B5, + secondary-200: $theme-grey-8A9299, + secondary-290: $theme-grey-484848, + secondary-300: $theme-grey-45494D, + secondary-400: $theme-grey-313233, + secondary-500: $theme-grey-272727, + secondary-550: $theme-grey-1A1A1A, + secondary-600: $theme-grey-212222, + secondary-700: $theme-grey-161617, + secondary-800: $theme-grey-151515, + secondary-900: $theme-grey-000000, + secondary-1000: $theme-grey-CCCCCC, + secondary-1100: $theme-grey-2B343D, + + tertiary-100: $theme-violet-676A80, + tertiary-190: $theme-violet-37394E, + tertiary-300: $theme-violet-2A2C3C, + tertiary-400: $theme-violet-22232E, + tertiary-500: $theme-violet-272831, + tertiary-600: $theme-violet-2E2F3D, + tertiary-700: $theme-violet-1c1d27, + tertiary-750: $theme-violet-1C1D2B, + + danger-100: $theme-red-e5acb2, + danger-200: $theme-red-fe8c98, + danger-300: $theme-red-ff7878, + danger-400: $theme-red-f16674, + danger-500: $theme-red-fc6574, + danger-600: $theme-red-ef5262, + danger-700: $theme-red-f34b5c, + danger-800: $theme-red-f33346, + danger-900: $theme-red-fe2e2e, + danger-1000: $theme-red-312325, ); // Generate utility classes @@ -811,15 +793,12 @@ span { width: 1px; } - .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } - - /* Customize scrollbar for WebKit browsers */ /* Set the width of the scrollbar */ @@ -854,30 +833,24 @@ span { width: 5px; } - /* Up arrow */ ::-webkit-scrollbar-button:vertical:start:decrement { - background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNiIgdmlld0JveD0iMCAwIDEwIDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik01LjU4ODc4IDAuNzQ0MTQxQzUuMjYzMjYgMC40MTg2MiA0LjczNDYxIDAuNDE4NjIgNC40MDkwOSAwLjc0NDE0MUwxLjA3NTc2IDQuMDc3NDdDMC44MzYxNzMgNC4zMTcwNiAwLjc2NTg2IDQuNjczODMgMC44OTYwNjggNC45ODYzM0MxLjAyNjI4IDUuMjk4ODMgMS4zMjgzNiA1LjUwMTk1IDEuNjY2OTAgNS41MDE5NUg4LjMzMzU3QzguNjY5NTEgNS41MDE5NSA4Ljk3NDE5IDUuMjk4ODMgOS4xMDQwIDQuOTg2MzNDOS4yMzQ2MSA0LjY3MzgzIDkuMTYxNjkgNC4zMTcwNiA4LjkyNDcyIDQuMDc3NDdMNS41OTEzOCAwLjc0NDE0MUg1LjU4ODc4WiIgZmlsbD0iIzY3NkE4MCIvPgo8L3N2Zz4K'); + background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNiIgdmlld0JveD0iMCAwIDEwIDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik01LjU4ODc4IDAuNzQ0MTQxQzUuMjYzMjYgMC40MTg2MiA0LjczNDYxIDAuNDE4NjIgNC40MDkwOSAwLjc0NDE0MUwxLjA3NTc2IDQuMDc3NDdDMC44MzYxNzMgNC4zMTcwNiAwLjc2NTg2IDQuNjczODMgMC44OTYwNjggNC45ODYzM0MxLjAyNjI4IDUuMjk4ODMgMS4zMjgzNiA1LjUwMTk1IDEuNjY2OTAgNS41MDE5NUg4LjMzMzU3QzguNjY5NTEgNS41MDE5NSA4Ljk3NDE5IDUuMjk4ODMgOS4xMDQwIDQuOTg2MzNDOS4yMzQ2MSA0LjY3MzgzIDkuMTYxNjkgNC4zMTcwNiA4LjkyNDcyIDQuMDc3NDdMNS41OTEzOCAwLjc0NDE0MUg1LjU4ODc4WiIgZmlsbD0iIzY3NkE4MCIvPgo8L3N2Zz4K"); display: block; background-size: 12px; background-position: center; /* Adjusted size */ - } /* Down arrow */ ::-webkit-scrollbar-button:vertical:end:increment { - background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxMCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzYxNTVfMjEyMzkpIj4KPHBhdGggZD0iTTQuNDExNjEgOS4yNTc4MUM0LjczNzEzIDkuNTgzMzMgNS4yNjU3NyA5LjU4MzMzIDUuNTkxMjkgOS4yNTc4MUw4LjkyNDYzIDUuOTI0NDhDOS4xNjQyMSA1LjY4NDkgOS4yMzQ1MiA1LjMyODEzIDkuMTA0MzEgNS4wMTU2M0M4Ljk3NDExIDQuNzAzMTMgOC42NzIwMiA0LjUgOC4zMzM0OCA0LjVMMDEuNjY2ODEgNC41MDI2MEMxLjMzMDg4IDQuNTAyNiAxLjAyNjE5IDQuNzA1NzMgMC44OTU5ODEgNS4wMTgyM0MwLjc2NTc3MyA1LjMzMDczIDAuODM4Njg5IDUuNjg3NSAxLjA3NTY3IDUuOTI3MDhMNC40MDkwMDkgOS4yNjA0Mkw0LjQxMTYxIDkuMjU3ODFaIiBmaWxsPSIjNjc2QTgwIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfNjE1NV8yMTIzOSI+CjxyZWN0IHdpZHRoPSI4LjMzMzMzIiBoZWlnaHQ9IjEzLjMzMzMiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjgzMzQ5NiAwLjMzMzk4NCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K'); + background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxMCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzYxNTVfMjEyMzkpIj4KPHBhdGggZD0iTTQuNDExNjEgOS4yNTc4MUM0LjczNzEzIDkuNTgzMzMgNS4yNjU3NyA5LjU4MzMzIDUuNTkxMjkgOS4yNTc4MUw4LjkyNDYzIDUuOTI0NDhDOS4xNjQyMSA1LjY4NDkgOS4yMzQ1MiA1LjMyODEzIDkuMTA0MzEgNS4wMTU2M0M4Ljk3NDExIDQuNzAzMTMgOC42NzIwMiA0LjUgOC4zMzM0OCA0LjVMMDEuNjY2ODEgNC41MDI2MEMxLjMzMDg4IDQuNTAyNiAxLjAyNjE5IDQuNzA1NzMgMC44OTU5ODEgNS4wMTgyM0MwLjc2NTc3MyA1LjMzMDczIDAuODM4Njg5IDUuNjg3NSAxLjA3NTY3IDUuOTI3MDhMNC40MDkwMDkgOS4yNjA0Mkw0LjQxMTYxIDkuMjU3ODFaIiBmaWxsPSIjNjc2QTgwIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfNjE1NV8yMTIzOSI+CjxyZWN0IHdpZHRoPSI4LjMzMzMzIiBoZWlnaHQ9IjEzLjMzMzMiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjgzMzQ5NiAwLjMzMzk4NCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K"); display: block; background-size: 12px; background-position: center; } - - .env-highlight { - - &.env-found { color: var(--text-primary-400); cursor: pointer; @@ -905,9 +878,8 @@ span { &.hover-not-found { color: var(--text-danger-200); } - } textarea { resize: none; -} \ No newline at end of file +} From 38c02502f524f4db2d5627236833358f8fa067e9 Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Fri, 30 Aug 2024 19:53:48 +0530 Subject: [PATCH 20/99] fix: import local collection --- .../@app/pages/Collections/CollectionPage.ViewModel.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts b/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts index d2a997c76..a868f5af3 100644 --- a/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts +++ b/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts @@ -3072,10 +3072,9 @@ export default class CollectionsViewModel { }; const initCollectionTab = new InitCollectionTab( - response.data.data._id, + response.data.data.collection._id, currentWorkspaceId, ); - initCollectionTab.updatePath(path); initCollectionTab.updateName(response.data.data.collection.name); From 865009c009b1cdb28b5c41fda32e535168e97d85 Mon Sep 17 00:00:00 2001 From: Isha Dubey Date: Tue, 3 Sep 2024 11:53:45 +0530 Subject: [PATCH 21/99] fix: Added the list of posts [#1431] --- .../@app/pages/Help/HelpPage.ViewModel.ts | 15 ++ src/packages/@app/pages/Help/HelpPage.svelte | 2 + src/packages/@app/services/canny.service.ts | 17 ++ src/packages/@library/icons/Comment.svelte | 18 ++ src/packages/@library/icons/Sort.svelte | 18 ++ src/packages/@library/icons/Triangle.svelte | 15 ++ src/packages/@library/icons/index.ts | 3 + .../@support/common/components/Upvote.svelte | 12 ++ .../@support/common/components/index.ts | 1 + .../@support/common/types/feedback.ts | 7 + src/packages/@support/common/types/index.ts | 1 + .../add-feedback/layout/AddFeedback.svelte | 8 +- .../layout/FeedbackDefault.svelte | 32 ++++ .../layout/FeedbackFilters.svelte | 129 ++++++++++++++ .../layout/FeedbackPost.svelte | 82 +++++++++ .../layout/FeedbackSection.svelte | 161 +++++++++++++++--- 16 files changed, 486 insertions(+), 35 deletions(-) create mode 100644 src/packages/@library/icons/Comment.svelte create mode 100644 src/packages/@library/icons/Sort.svelte create mode 100644 src/packages/@library/icons/Triangle.svelte create mode 100644 src/packages/@support/common/components/Upvote.svelte create mode 100644 src/packages/@support/common/components/index.ts create mode 100644 src/packages/@support/common/types/feedback.ts create mode 100644 src/packages/@support/common/types/index.ts create mode 100644 src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte create mode 100644 src/packages/@support/features/feedback-section/layout/FeedbackFilters.svelte create mode 100644 src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte diff --git a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts index 49fc0f0d7..49fec101e 100644 --- a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts +++ b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts @@ -192,6 +192,21 @@ class HelpPageViewModel { return categoryID; }; + retrievePostData = async (postID: string) => { + const response = await this.cannyService.retrievePost(postID); + console.log(response, "response"); + + return response; + }; + + public getListOfPOsts = async () => { + const boards = await this.RetrieveBoards(); + + const boardID = boards?.data?.boards[0]?.id; + const response = await this.cannyService.listPosts(boardID); + return response; + }; + /** * Creates a post on the feedback board retrieved from Canny service with the given title and description. * diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index 9998c0575..dd2df1a39 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -77,6 +77,8 @@ {:else if activeTab === "updates"} { + const response = await makeRequest( + "POST", + `${this.apiUrl}/posts/retrieve`, + { + body: { + apiKey: this.apiKey, + id: postID, + }, + headers: { + "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], + }, + }, + ); + return response; + }; + // returns the list of posts available public listPosts = async (boardID: string) => { const response = await makeRequest("POST", `${this.apiUrl}/posts/list`, { diff --git a/src/packages/@library/icons/Comment.svelte b/src/packages/@library/icons/Comment.svelte new file mode 100644 index 000000000..a8f203c7d --- /dev/null +++ b/src/packages/@library/icons/Comment.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/src/packages/@library/icons/Sort.svelte b/src/packages/@library/icons/Sort.svelte new file mode 100644 index 000000000..178ae0c7c --- /dev/null +++ b/src/packages/@library/icons/Sort.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/src/packages/@library/icons/Triangle.svelte b/src/packages/@library/icons/Triangle.svelte new file mode 100644 index 000000000..0253889b2 --- /dev/null +++ b/src/packages/@library/icons/Triangle.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/src/packages/@library/icons/index.ts b/src/packages/@library/icons/index.ts index a9a9285b8..b7c2109d1 100644 --- a/src/packages/@library/icons/index.ts +++ b/src/packages/@library/icons/index.ts @@ -65,3 +65,6 @@ export { default as ArrowDownward } from "./ArrowDownward.svelte"; export { default as DownloadIcon } from "./Download.svelte"; export { default as Help } from "./Help.svelte"; export { default as CategoryIcon } from "./Category.svelte"; +export { default as SortIcon } from "./Sort.svelte"; +export { default as TriangleIcon } from "./Triangle.svelte"; +export { default as CommentIcon } from "./Comment.svelte"; diff --git a/src/packages/@support/common/components/Upvote.svelte b/src/packages/@support/common/components/Upvote.svelte new file mode 100644 index 000000000..5275727f4 --- /dev/null +++ b/src/packages/@support/common/components/Upvote.svelte @@ -0,0 +1,12 @@ + + +
+
+ +
+ 21 +
diff --git a/src/packages/@support/common/components/index.ts b/src/packages/@support/common/components/index.ts new file mode 100644 index 000000000..da696905d --- /dev/null +++ b/src/packages/@support/common/components/index.ts @@ -0,0 +1 @@ +export { default as UpvoteIcon } from "./Upvote.svelte"; diff --git a/src/packages/@support/common/types/feedback.ts b/src/packages/@support/common/types/feedback.ts new file mode 100644 index 000000000..8088abe47 --- /dev/null +++ b/src/packages/@support/common/types/feedback.ts @@ -0,0 +1,7 @@ +export enum FeedbackType { + FEATURE_REQUEST = "Feature Request", + UI_IMPROVEMENT = "UI Improvement", + BUG = "Bug", + ALL_CATEGORY = "Uncategorized", + CATEGORY = "Category", +} diff --git a/src/packages/@support/common/types/index.ts b/src/packages/@support/common/types/index.ts new file mode 100644 index 000000000..926e27886 --- /dev/null +++ b/src/packages/@support/common/types/index.ts @@ -0,0 +1 @@ +export { FeedbackType } from "./feedback"; diff --git a/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte b/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte index 5a34d145e..4daf4ea47 100644 --- a/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte +++ b/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte @@ -5,16 +5,10 @@ import Drop from "../components/Drop/Drop.svelte"; import { notifications } from "@library/ui/toast/Toast"; import Tooltip from "@library/ui/tooltip/Tooltip.svelte"; + import { FeedbackType } from "@support/common/types"; export let onAddFeedback; export let onInputFeedback; - enum FeedbackType { - FEATURE_REQUEST = "Feature Request", - UI_IMPROVEMENT = "UI Improvement", - BUG = "Bug", - ALL_CATEGORY = "Uncategorized", - CATEGORY = "Category", - } let type: FeedbackType = FeedbackType.CATEGORY; let feedbackDescription = ""; diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte new file mode 100644 index 000000000..3bc429542 --- /dev/null +++ b/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte @@ -0,0 +1,32 @@ + + +
+
+ Feedbacks +
+

+ Share your feedback to help us refine and enhance your experience. +

+
+
+
+
+ +
+
+ Hey {userInfo?.name}, share your feedback +
+
+
+ +
+
diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackFilters.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackFilters.svelte new file mode 100644 index 000000000..055720e13 --- /dev/null +++ b/src/packages/@support/features/feedback-section/layout/FeedbackFilters.svelte @@ -0,0 +1,129 @@ + + +
+
+
+ + +
+
+ +
+
+ {}} + disabled={false} + borderType={"none"} + borderActiveType={"none"} + borderHighlight={"hover-active"} + headerHighlight={"hover-active"} + headerHeight={"26px"} + minBodyWidth={"150px"} + minHeaderWidth={"150px"} + maxHeaderWidth={"200px"} + borderRounded={"2px"} + headerTheme={"violet2"} + bodyTheme={"violet"} + menuItem={"v2"} + headerFontSize={"10px"} + isDropIconFilled={true} + position={"absolute"} + /> +
+
+
+ + diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte new file mode 100644 index 000000000..05b791e86 --- /dev/null +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -0,0 +1,82 @@ + + +
+
{ + isPostopen = false; + }} + > + + back +
+
+
+
+ Not able to login + In Progress +
+
+
+
+ +
+ {userInfo?.name} +
+
+
+ After login, the user is navigated to create a new account page, + whereas the user should be able to navigate to the home page. +
+
+ 3 hours ago + | + Edit post +
+
+
+
+
+ +
+
+
+
+ + diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 0877dbc83..4bc9c0d71 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -1,40 +1,145 @@ -
-
- Feedbacks -
-

- Share your feedback to help us refine and enhance your experience. -

-
-
-
-
- -
-
- Hey {userInfo?.name}, share your feedback +
+ + + + {#if !isPostopen} +
+
+
+ + + Sort By +
+
+ + + +
+
+ +
+ {#each posts as post} +
+
+
+
{ + id = post?.id; + isPostopen = true; + }} + > + {post?.title} +
+
+ {post?.tags[0]?.name} +
+
+ + +
+ +
+

+ {post?.details} +

+
+ +
+ + + + {post?.commentCount} +
+
+ {/each} +
-
-
- -
+ {/if} + + {#if isPostopen} + + {/if}
+ + From a9aef862a58e0a32d5a350c7214c46e8f4529de1 Mon Sep 17 00:00:00 2001 From: Isha Dubey Date: Tue, 3 Sep 2024 11:54:08 +0530 Subject: [PATCH 22/99] fix: Added the list of posts [#1431] --- src/packages/@app/pages/Help/HelpPage.ViewModel.ts | 4 +--- src/packages/@app/services/canny.service.ts | 1 + .../feedback-section/layout/FeedbackSection.svelte | 9 ++------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts index 49fec101e..e58c6450d 100644 --- a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts +++ b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts @@ -191,11 +191,9 @@ class HelpPageViewModel { )?.id; return categoryID; }; - + // write js docs retrievePostData = async (postID: string) => { const response = await this.cannyService.retrievePost(postID); - console.log(response, "response"); - return response; }; diff --git a/src/packages/@app/services/canny.service.ts b/src/packages/@app/services/canny.service.ts index 405e9b14a..42dce046c 100644 --- a/src/packages/@app/services/canny.service.ts +++ b/src/packages/@app/services/canny.service.ts @@ -20,6 +20,7 @@ export class CannyIoService { return response; }; + // returns the post data for a specific post retrievePost = async (postID: string) => { const response = await makeRequest( "POST", diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 4bc9c0d71..a3960c3b2 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -1,11 +1,6 @@
@@ -13,7 +14,7 @@

{status.title}

- {status.category} + {status.category.name}
- {status.votes} + {status.score}
diff --git a/src/packages/@support/features/roadmap/layout/Roadmap.svelte b/src/packages/@support/features/roadmap/layout/Roadmap.svelte index 9ddcb5f06..bb339966a 100644 --- a/src/packages/@support/features/roadmap/layout/Roadmap.svelte +++ b/src/packages/@support/features/roadmap/layout/Roadmap.svelte @@ -62,8 +62,8 @@ function transformPostsToProductStatus(posts) { const statusMap = { "under review": { status: "Under Review", products: [] }, - complete: { status: "In Progress", products: [] }, - open: { status: "Planned", products: [] }, + "in progress": { status: "In Progress", products: [] }, + planned: { status: "Planned", products: [] }, }; posts.forEach((post) => { @@ -186,14 +186,22 @@ {status}
- {#if products.length === 0} + {#if !(filteredProducts?.length == 0 && searchTerm.length > 0) && products.length === 0}

No Data is there.

- {:else} + {/if} + + {#if filteredProducts?.length == 0 && searchTerm.length > 0} +

+ No Result Found. +

{:else} {/if}
From 00ed850697d75f6e5deb2555241436c0a3077d96 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Wed, 4 Sep 2024 12:42:12 +0530 Subject: [PATCH 32/99] fix: Fixed some ui part[#1447] --- src/packages/@app/pages/Help/HelpPage.svelte | 2 +- .../community/layout/Community.svelte | 343 +++++++++--------- 2 files changed, 174 insertions(+), 171 deletions(-) diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index 739cfb47e..a09308c03 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -77,7 +77,7 @@ style="width: calc(100% - 274px );" class="ps-3 pe-2 pt-3 pb-2 h-100" > -
+
{#if activeTab === "feedback"} - import Ellipse from "@library/icons/Ellipse.svelte"; - import LogoSymbol from "@library/icons/LogoSymbol.svelte"; - import { Tooltip } from "@library/ui/tooltip"; - import { ArrowUnfilledIcon } from "@library/icons"; - - let isReadMore = false; - - -
-
-
-

Community

-

- Stay updated with all feedback, from planning to progress, on a single - roadmap. -

-
- - -
-

Connect with Us

-

- Utilize our integrated Discord community to send messages directly to - our team and other users, even if you don't have a Discord account. Your - messages will appear instantly in our Discord channel, ensuring you get - quick responses and can engage in real-time discussions. -

- - -
-

Key Features

-

- Switchable Channel:Easily navigate between different feedback and support channels. -

-

- Rich media sharing: - Share screenshots , videos and other files to provide comprehensive - feedback. -

-

+ Switchable Channel:Easily navigate between different feedback and support channels. - Tagging: Tag your feedback for easy categorization and searchability. -

-

+

+ Rich media sharing: + Share screenshots , videos and other files to provide comprehensive + feedback. - Join our community and start contributing to Sparrow. -

-
- - -
-

{ - isReadMore = !isReadMore; - }} +

+

+ Tagging: + Tag your feedback for easy categorization and searchability. - -

-
+

+

+ Join our community and start contributing to Sparrow. +

+
+ +
+

{ + isReadMore = !isReadMore; + }} + >

- - \ No newline at end of file +
+ + From 55441ff369068c0dbdef5ef00804ecf157204524 Mon Sep 17 00:00:00 2001 From: pratikshinde590 Date: Wed, 4 Sep 2024 13:56:19 +0530 Subject: [PATCH 33/99] build: Specify the branch name in app-center build [] --- .github/workflows/development.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 2f2c37c5a..984970d03 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -179,8 +179,8 @@ jobs: appcenter login --token ${{ secrets.APPCENTER_API_TOKEN }} branch_name="${{ steps.pr_branch.outputs.branch }}" echo "Branch Name: $branch_name" - appcenter distribute release -f /Users/runner/work/sparrow-app/sparrow-app/src-tauri/target/debug/bundle/dmg/*.dmg -g Collaborators --app techdome/Sparrow-1 --build-version test-${branch_name} --build-number ${{ github.run_number }} - appcenter distribute release -f msi_files/*.msi -g Collaborators --app techdome/Sparrow --build-version test-${branch_name} --build-number ${{ github.run_number }} + appcenter distribute release -f /Users/runner/work/sparrow-app/sparrow-app/src-tauri/target/debug/bundle/dmg/*.dmg -g Collaborators --app techdome/Sparrow-1 --build-version branch-development --build-number ${{ github.run_number }} + appcenter distribute release -f msi_files/*.msi -g Collaborators --app techdome/Sparrow --build-version branch-development --build-number ${{ github.run_number }} - name: status check and upload uses: neonidian/teams-notify-build-status@v3 if: always() From c26eb571c2aab5f8f4a2306f04d79dcf7cd97500 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Wed, 4 Sep 2024 17:34:29 +0530 Subject: [PATCH 34/99] feat: Added Category functionality [#1448] --- src/packages/@app/pages/Help/HelpPage.svelte | 4 +- .../HelpInfo-Card/HelpInfoCard.svelte | 15 +-- .../@support/common/components/Upvote.svelte | 6 +- .../features/roadmap/layout/Roadmap.svelte | 96 ++++++++----------- 4 files changed, 51 insertions(+), 70 deletions(-) diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index eaae45b06..ce90f3036 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -69,7 +69,9 @@ Roadmap
diff --git a/src/packages/@support/common/components/HelpInfo-Card/HelpInfoCard.svelte b/src/packages/@support/common/components/HelpInfo-Card/HelpInfoCard.svelte index 60030ca66..39a16a56f 100644 --- a/src/packages/@support/common/components/HelpInfo-Card/HelpInfoCard.svelte +++ b/src/packages/@support/common/components/HelpInfo-Card/HelpInfoCard.svelte @@ -1,6 +1,7 @@
- 21 + {score}
diff --git a/src/packages/@support/features/roadmap/layout/Roadmap.svelte b/src/packages/@support/features/roadmap/layout/Roadmap.svelte index bb339966a..0ebc893ab 100644 --- a/src/packages/@support/features/roadmap/layout/Roadmap.svelte +++ b/src/packages/@support/features/roadmap/layout/Roadmap.svelte @@ -6,6 +6,12 @@ import HelpInfoCard from "@support/common/components/HelpInfo-Card/HelpInfoCard.svelte"; import { onMount } from "svelte"; + export let fetchPosts; + + let productStatus = []; + + let searchTerm = ""; + function getColor(status) { if (status === "Under Review") return "white"; if (status === "In Progress") return "#DF77F9"; @@ -20,45 +26,6 @@ return "white"; // Default border color } - let searchTerm = ""; - - // $: filteredProductStatus = productStatus.map((status) => ({ - // ...status, - // products: - // searchTerm.trim().length > 0 - // ? status.products.filter((product) => - // product.title - // .toLowerCase() - // .includes(searchTerm.trim().toLowerCase()), - // ) - // : status.products, - // })); - - export let fetchPosts; - let productStatus = []; - - onMount(async () => { - const response = await fetchPosts(); - if (response?.data?.posts) { - transformPostsToProductStatus(response.data.posts); - } - console.log("THis is response", response); - }); - - // function transformPostsToProductStatus(posts) { - // const statusMap = {}; - - // posts.forEach((post) => { - // const { status } = post; - // if (!statusMap[status]) { - // statusMap[status] = { status, products: [] }; - // } - // statusMap[status].products.push(post); - // }); - - // productStatus = Object.values(statusMap); - // } - function transformPostsToProductStatus(posts) { const statusMap = { "under review": { status: "Under Review", products: [] }, @@ -67,9 +34,7 @@ }; posts.forEach((post) => { - // Map "open" status to "Under Review" - let mappedStatus = post.status; // === "open" ? "Under Review" : post.status; - + let mappedStatus = post.status; // Check if mappedStatus exists in statusMap, if not, use it as it is if (statusMap[mappedStatus]) { statusMap[mappedStatus].products.push(post); @@ -82,13 +47,34 @@ $: filteredProductStatus = productStatus.map((status) => ({ ...status, - filteredProducts: - searchTerm.trim().length > 0 - ? status.products.filter((product) => - product.title.toLowerCase().includes(searchTerm.toLowerCase()), - ) - : status.products, + filteredProducts: status.products.filter((product) => { + // Filter by search term + const matchesSearchTerm = + searchTerm.trim().length === 0 || + product.title.toLowerCase().includes(searchTerm.toLowerCase()); + + // Filter by category + const matchesCategory = + type === "allCategories" || + (type === "featureRequest" && + product.category.name === "Feature Request") || + (type === "UI Improvement" && + product.category.name === "UI Improvement") || + (type === "bug" && product.category.name === "Bug"); + + return matchesSearchTerm && matchesCategory; + }), })); + + onMount(async () => { + const response = await fetchPosts(); + console.log("Thisis respoines", response); + if (response?.data?.posts) { + transformPostsToProductStatus(response.data.posts); + } + }); + + let type = "allCategories";
@@ -102,7 +88,7 @@
-
+
{}} disabled={false} + iconRequired={true} + icon={StatusIcon} borderType={"none"} borderActiveType={"none"} borderHighlight={"hover-active"} @@ -97,8 +116,6 @@
diff --git a/src/packages/@teams/features/team-explorer/components/workspace-list-view/WorkspaceListView.svelte b/src/packages/@teams/features/team-explorer/components/workspace-list-view/WorkspaceListView.svelte index 0b1e83b79..7ad457887 100644 --- a/src/packages/@teams/features/team-explorer/components/workspace-list-view/WorkspaceListView.svelte +++ b/src/packages/@teams/features/team-explorer/components/workspace-list-view/WorkspaceListView.svelte @@ -39,6 +39,16 @@ "Last Updated", "", ]; + + $: filteredProductStatus = productStatus.map((status) => ({ + ...status, + filteredProducts: + searchTerm.trim().length > 0 + ? status.products.filter((product) => + product.title.toLowerCase().includes(searchTerm.toLowerCase()), + ) + : status.products, + }));
@@ -92,15 +102,15 @@ -
- Team-Skelton -
+
+ Team-Skelton +
{/if} {#if !isGuestUser} From 6c94dd3a8e406a70036523e908b03c80085419af Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Thu, 5 Sep 2024 11:32:46 +0530 Subject: [PATCH 38/99] feat: add automation id --- .../pages/Auth/entry-point/EntryPoint.svelte | 2 ++ src/packages/@library/ui/button/Button.svelte | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/packages/@app/pages/Auth/entry-point/EntryPoint.svelte b/src/packages/@app/pages/Auth/entry-point/EntryPoint.svelte index 344e227bb..e36092a2b 100644 --- a/src/packages/@app/pages/Auth/entry-point/EntryPoint.svelte +++ b/src/packages/@app/pages/Auth/entry-point/EntryPoint.svelte @@ -119,6 +119,7 @@ handleRedirect(true); openDefaultBrowser(); }} + id="create_account_or_sign_in" > Create an Account or Sign In @@ -132,6 +133,7 @@
+
+ {/if} + + + {#if comment.replies && comment.replies.length > 0} +
+ {#each comment.replies as reply} + + {/each} +
+ {/if} +
+
+ + diff --git a/src/packages/@support/common/components/Upvote.svelte b/src/packages/@support/common/components/Upvote.svelte index 8fce02f41..29783e18b 100644 --- a/src/packages/@support/common/components/Upvote.svelte +++ b/src/packages/@support/common/components/Upvote.svelte @@ -1,13 +1,77 @@
-
- +
+ {#if hasUpvoted} + + {:else} + + + {/if} +
{upvote}
+ + diff --git a/src/packages/@support/common/components/index.ts b/src/packages/@support/common/components/index.ts index da696905d..14e4a044d 100644 --- a/src/packages/@support/common/components/index.ts +++ b/src/packages/@support/common/components/index.ts @@ -1 +1,3 @@ export { default as UpvoteIcon } from "./Upvote.svelte"; +export { default as CommentCard } from "./CommentCard.svelte"; + diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte index a19356555..a1f473490 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -1,18 +1,30 @@ +
+ +
{ + isPostopen = false; + }} + > + + back +
+ + + +
+
+
+ {post?.title} + {post?.status} +
+ +
+
+
+ +
+ {userInfo?.name} +
+
+
+ {post?.details} +
+
+ {#each postImages as postImage} + { + isImageOpen = true; + currentImage = postImage; + }} + src={postImage} + alt="post image" + style="width:100px; display:inline; height: 100px; margin-top: 20px; border-radius: 2px; margin:10px;" + /> + { + isImageOpen = flag; + }} + > + post image + + {/each} +
+ +
+ {createdAt} + | + { + isExposeFeedbackForm = true; + }}>Edit post +
+
+ +
+ +
+
+ + +
+ { + handleAddCommentInput(e); + }} + bind:value={commentValue} + /> + +
+ + +
+
+ + + {#if nestedComments.length > 0} +
+
+
Activity Feed
+ + -
-
-
-
- diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index ace059b55..1fbcd7177 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -19,12 +19,18 @@ export let onAddFeedback; export let fetchPosts; export let onRetrievePost; + export let onAddComment; + export let fetchComments; + export let createVote; + export let deleteVote; + export let listVote; let searchTerm = ""; let currentSort = "trending"; let posts = []; let userInfo: any = {}; + let votelist = []; user.subscribe((value) => { userInfo = value; }); @@ -37,6 +43,8 @@ currentSort = sortType; const listPosts = await fetchPosts(sortType, searchQuery, status); posts = listPosts?.data?.posts; + // votelist = await listVote(post.id); + // console.log("THis is votelist", votelist); }; let status = "open,under review,planned,in progress,complete"; @@ -44,6 +52,11 @@ onMount(async () => { getPosts(currentSort, searchTerm, status); }); + + const handleUpvote = (e) => { + getPosts(currentSort, searchTerm, status); + }; + let isPostopen = false; // Function to handle input change @@ -79,129 +92,131 @@
-
-
-
- - { - handleInputChange(e.target.value); - }} - /> -
-
-
-
- { + handleInputChange(e.target.value); + }} + /> +
-
- { + type = id; + handleCategoryChange(id); + }} + titleId={type} + zIndex={499} + disabled={false} + borderType={"none"} + borderActiveType={"none"} + borderHighlight={"hover-active"} + headerHighlight={"hover-active"} + headerHeight={"26px"} + minBodyWidth={"150px"} + minHeaderWidth={"150px"} + maxHeaderWidth={"200px"} + borderRounded={"2px"} + headerTheme={"violet2"} + bodyTheme={"violet"} + placeholderText={"Categories"} + menuItem={"v2"} + headerFontSize={"10px"} + isDropIconFilled={true} + position={"absolute"} + /> +
+
+ { + handleInputChange(e.target.value); + }} + /> +
+
+
+
+ { + handleStatusChange(id); + }} + titleId={feedbackStatusType} + placeholderText={"Status"} + id={"feeds"} + zIndex={499} + disabled={false} + iconRequired={true} + icon={StatusIcon} + borderType={"none"} + borderActiveType={"none"} + borderHighlight={"hover-active"} + headerHighlight={"hover-active"} + headerHeight={"26px"} + minBodyWidth={"150px"} + minHeaderWidth={"150px"} + maxHeaderWidth={"200px"} + borderRounded={"2px"} + headerTheme={"violet2"} + bodyTheme={"violet"} + menuItem={"v2"} + headerFontSize={"10px"} + isDropIconFilled={true} + position={"absolute"} + /> +
+
+
+ + {#if !isPostopen} +
+ +
+

Posts

+ + {#if posts.length > 0} +
    + {#each posts as post} +
  • + +
    +
    +
    ((id = post?.id), (isPostopen = true))} + > + {post?.title} +
    + +
    +
    +
    + {post?.status} +
    +
    +

    {post?.details}

    +
    + +
    +
    +
  • + {/each} +
+ {:else} +

No posts available at the moment.

+ {/if} + +
+ +
+

Comments

+ {#if comments.length > 0} +
    + {#each comments as comment} +
  • (isHovering = comment.id)} + on:mouseleave={() => (isHovering = null)} + > + +
    +
    +
    +
    {comment.author.name}
    +
    {comment.value}
    +
    + + {#if isHovering === comment.id} + ( + (id = comment?.post?.id), (isPostopen = true) + )} + class="go-to-post" + style="font-size: 12px; letter-spacing: 0.25px; font-weight: 400;" + >Go to post ↗ + {/if} +
    + +
    +
    + + {timeAgo(comment.created)} + + Reply + Edit comment +
    +
    + + +
    +
    +
    +
  • + {/each} +
+ {:else} +

+ No comments available at the moment. +

+ {/if} +
+ +
+
+

+ Posts you liked +

+ + {#if posts.length > 0} +
    + {#each posts as post} +
  • + +
    +
    +
    ((id = post?.id), (isPostopen = true))} + > + {post?.title} +
    + +
    +
    +
    + {post?.status} +
    +
    +

    {post?.details}

    +
    + +
    +
    +
  • + {/each} +
+ {:else} +

No posts available at the moment.

+ {/if} +
+
+
+ {/if} + + {#if isPostopen} + + {/if} +
+ + diff --git a/src/packages/@support/features/my-activity/layout/index.ts b/src/packages/@support/features/my-activity/layout/index.ts new file mode 100644 index 000000000..1354f7f54 --- /dev/null +++ b/src/packages/@support/features/my-activity/layout/index.ts @@ -0,0 +1 @@ +export { default as MyActivity } from "./MyActivity.svelte"; diff --git a/src/packages/@support/features/release-notes/index.ts b/src/packages/@support/features/release-notes/index.ts new file mode 100644 index 000000000..eec9d1e67 --- /dev/null +++ b/src/packages/@support/features/release-notes/index.ts @@ -0,0 +1 @@ +export * from "./layout"; diff --git a/src/packages/@support/features/release-notes/layout/ReleaseNotes.svelte b/src/packages/@support/features/release-notes/layout/ReleaseNotes.svelte new file mode 100644 index 000000000..118dd28a9 --- /dev/null +++ b/src/packages/@support/features/release-notes/layout/ReleaseNotes.svelte @@ -0,0 +1,446 @@ + + +
+
+
+

Updates

+

+ Check out our latest releases designed to boost your productivity and + efficiency. +

+
+ +
+
+
+ + + + {#if searchQuery.length != 0} +
{ + clearSearch(); + }} + > + +
+ {/if} +
+
+ +
+ { - handleInputChange(e.target.value); - }} - /> -
-
-
-
- { - handleStatusChange(id); - }} - titleId={feedbackStatusType} - placeholderText={"Status"} - id={"feeds"} - zIndex={499} - disabled={false} - iconRequired={true} - icon={StatusIcon} - borderType={"none"} - borderActiveType={"none"} - borderHighlight={"hover-active"} - headerHighlight={"hover-active"} - headerHeight={"26px"} - minBodyWidth={"150px"} - minHeaderWidth={"150px"} - maxHeaderWidth={"200px"} - borderRounded={"2px"} - headerTheme={"violet2"} - bodyTheme={"violet"} - menuItem={"v2"} - headerFontSize={"10px"} - isDropIconFilled={true} - position={"absolute"} - /> -
-
-
- - {#if !isPostopen} -
- -
-

Posts

- - {#if posts.length > 0} -
    - {#each posts as post} -
  • - -
    -
    -
    ((id = post?.id), (isPostopen = true))} - > - {post?.title} -
    - -
    -
    -
    - {post?.status} -
    -
    -

    {post?.details}

    -
    - -
    -
    -
  • - {/each} -
- {:else} -

No posts available at the moment.

- {/if} - -
- -
-

Comments

- {#if comments.length > 0} -
    - {#each comments as comment} -
  • (isHovering = comment.id)} - on:mouseleave={() => (isHovering = null)} - > - -
    -
    -
    -
    {comment.author.name}
    -
    {comment.value}
    -
    - - {#if isHovering === comment.id} - ( - (id = comment?.post?.id), (isPostopen = true) - )} - class="go-to-post" - style="font-size: 12px; letter-spacing: 0.25px; font-weight: 400;" - >Go to post ↗ - {/if} -
    - -
    -
    - - {timeAgo(comment.created)} - - Reply - Edit comment -
    -
    - - -
    -
    -
    -
  • - {/each} -
- {:else} -

- No comments available at the moment. -

- {/if} -
- -
-
-

- Posts you liked -

- - {#if posts.length > 0} -
    - {#each posts as post} -
  • - -
    -
    -
    ((id = post?.id), (isPostopen = true))} - > - {post?.title} -
    - -
    -
    -
    - {post?.status} -
    -
    -

    {post?.details}

    -
    - -
    -
    -
  • - {/each} -
- {:else} -

No posts available at the moment.

- {/if} -
-
-
- {/if} - - {#if isPostopen} - - {/if} -
- - diff --git a/src/packages/@support/features/my-activity/layout/index.ts b/src/packages/@support/features/my-activity/layout/index.ts deleted file mode 100644 index 1354f7f54..000000000 --- a/src/packages/@support/features/my-activity/layout/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as MyActivity } from "./MyActivity.svelte"; diff --git a/src/packages/@support/features/roadmap/layout/Roadmap.svelte b/src/packages/@support/features/roadmap/layout/Roadmap.svelte index 2d5cfa83d..5c995400a 100644 --- a/src/packages/@support/features/roadmap/layout/Roadmap.svelte +++ b/src/packages/@support/features/roadmap/layout/Roadmap.svelte @@ -1,5 +1,7 @@ diff --git a/src/packages/@teams/features/team-invite/layout/TeamInvite.svelte b/src/packages/@teams/features/team-invite/layout/TeamInvite.svelte index faff4e085..af2b9b49c 100644 --- a/src/packages/@teams/features/team-invite/layout/TeamInvite.svelte +++ b/src/packages/@teams/features/team-invite/layout/TeamInvite.svelte @@ -60,7 +60,7 @@ */ const isEmailAlreadyExistInTeam = (email: string) => { for (let i = 0; i < users.length; i++) { - if (email === users[i].email) { + if (email.toLowerCase() === users[i].email.toLowerCase()) { return true; } } From 9982ae1369ad42b39c656dc9954c58cccbaf28de Mon Sep 17 00:00:00 2001 From: anujnema5 Date: Wed, 11 Sep 2024 14:33:47 +0530 Subject: [PATCH 64/99] feat: added my-activity-section [#1452] --- .../@app/pages/Help/HelpPage.ViewModel.ts | 19 +- src/packages/@app/pages/Help/HelpPage.svelte | 22 +- src/packages/@app/services/canny.service.ts | 60 +- src/packages/@library/ui/like/Like.svelte | 20 + src/packages/@library/ui/like/index.ts | 1 + .../layout/FeedbackPost.svelte | 5 +- .../layout/FeedbackSection.svelte | 14 +- .../update-toast/layout/UpdateToast.svelte | 722 +++++++++++++++--- 8 files changed, 759 insertions(+), 104 deletions(-) create mode 100644 src/packages/@library/ui/like/Like.svelte create mode 100644 src/packages/@library/ui/like/index.ts diff --git a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts index b500885dd..1c55df644 100644 --- a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts +++ b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts @@ -197,11 +197,11 @@ class HelpPageViewModel { return response; }; - public getListOfPOsts = async (sort) => { + public getListOfPOsts = async (sort, userID) => { const boards = await this.RetrieveBoards(); const boardID = boards?.data?.boards[0]?.id; - const response = await this.cannyService.listPosts(boardID, sort); + const response = await this.cannyService.listPosts(boardID, sort, userID); return response; }; @@ -263,6 +263,21 @@ class HelpPageViewModel { const response = await this.cannyService.updatePost(postID, {}); return response; }; + + public getUserPosts = async (sort: string, userId: string) => { + const response = await this.cannyService.listUsersPost(sort, userId) + return response + } + + public retreiveComments = async (body: object, authorID: string) => { + const response = await this.cannyService.retreiveComments({}, authorID) + return response; + } + + public retrieveUserVotes = async (userID: string) => { + const response = await this.cannyService.retrieveVotes({}, userID) + return response + } } export default HelpPageViewModel; diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index dd2df1a39..5d40abf40 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -17,6 +17,8 @@ document.addEventListener("contextmenu", (event) => event.preventDefault()); let activeTab = "feedback"; + let isPostopenFromActivity = false; + let postIdFromActivity; function setActiveTab(tab) { if (tab !== "faq") { @@ -25,6 +27,15 @@ } } + function setActiveTabFromActivity(tab, postID) { + if (tab !== "faq") { + // Disable FAQ tab + isPostopenFromActivity = true; + activeTab = tab; + postIdFromActivity = postID; + } + } + let releaseNotesData = []; onMount(async () => { @@ -79,11 +90,18 @@ onAddFeedback={_viewModel.addFeedback} fetchPosts={_viewModel.getListOfPOsts} onRetrievePost={_viewModel.retrievePostData} + {postIdFromActivity} + {isPostopenFromActivity} /> {:else if activeTab === "updates"} {/if}
diff --git a/src/packages/@app/services/canny.service.ts b/src/packages/@app/services/canny.service.ts index e108dfb8c..0ea0709f8 100644 --- a/src/packages/@app/services/canny.service.ts +++ b/src/packages/@app/services/canny.service.ts @@ -53,12 +53,13 @@ export class CannyIoService { }; // returns the list of posts available - public listPosts = async (boardID: string, sort: string) => { + public listPosts = async (boardID: string, sort: string, userID?: string) => { const response = await makeRequest("POST", `${this.apiUrl}/posts/list`, { body: { apiKey: this.apiKey, boardID, sort, + userID }, headers: { "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], @@ -117,4 +118,61 @@ export class CannyIoService { ); return response; }; + + public listUsersPost = async (sort: string, userId: string,) => { + const response = await makeRequest("POST", `${this.apiUrl}/posts/list`, { + body: { + apiKey: this.apiKey, + // authorID: userId, + sort, + }, + headers: { + "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], + }, + }); + console.log(response) + return response + } + + public retreiveComments = async (body?: object, authorID?: string) => { + + const response = await makeRequest( + "POST", + `${this.apiUrl}/comments/list`, + { + body: { + apiKey: this.apiKey, + // authorID, + ...body + }, + headers: { + "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], + }, + }, + ); + return response; + } + + public retrieveVotes = async (body?: object, userID: string) => { + const response = await makeRequest( + "POST", + `https://canny.io/api/v1/votes/list`, + { + body: { + apiKey: this.apiKey, + userID, // just for now testing + ...body + }, + headers: { + "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], + }, + }, + ); + + return response; + } + + public updateComment = async (commentID: string) => { + + } } diff --git a/src/packages/@library/ui/like/Like.svelte b/src/packages/@library/ui/like/Like.svelte new file mode 100644 index 000000000..c2e0c36a5 --- /dev/null +++ b/src/packages/@library/ui/like/Like.svelte @@ -0,0 +1,20 @@ + + + + + + diff --git a/src/packages/@library/ui/like/index.ts b/src/packages/@library/ui/like/index.ts new file mode 100644 index 000000000..59b368d7d --- /dev/null +++ b/src/packages/@library/ui/like/index.ts @@ -0,0 +1 @@ +export { default as Like } from './Like.svelte' \ No newline at end of file diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte index c261f2b7f..0b29d180d 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -13,6 +13,8 @@ export let userInfo; export let id; export let onRetrievePost; + export let postIdFromActivity; + let post = []; let currentImage = ""; let createdAt = ""; @@ -35,10 +37,9 @@ let isImageOpen = false; onMount(async () => { - const res = await onRetrievePost(id); + const res = await onRetrievePost(id || postIdFromActivity); post = await res?.data; console.log(post, "post"); - createdAt = timeAgo(post?.created); postImages = post?.imageURLs; console.log(postImage, "iiiiiiiiiiiiiiiiiiiiiiiiiiiii"); diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 0bfdd44f4..6f0db1b25 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -16,6 +16,8 @@ export let onAddFeedback; export let fetchPosts; export let onRetrievePost; + export let postIdFromActivity: any; + export let isPostopenFromActivity; let currentSort = "newest"; let posts = []; let filteredPosts = []; @@ -24,6 +26,7 @@ user.subscribe((value) => { userInfo = value; }); + let id = ""; const getPosts = async (sortType) => { currentSort = sortType; // Added: Update the sorting type @@ -45,7 +48,8 @@ onMount(async () => { getPosts(currentSort); }); - let isPostopen = false; + + let isPostopen = isPostopenFromActivity || false; const filterPosts = () => { if (searchTerm) { @@ -261,7 +265,13 @@ {/if} {#if isPostopen} - + {/if}
diff --git a/src/packages/@support/features/update-toast/layout/UpdateToast.svelte b/src/packages/@support/features/update-toast/layout/UpdateToast.svelte index a87b8e64b..fcacf72b6 100644 --- a/src/packages/@support/features/update-toast/layout/UpdateToast.svelte +++ b/src/packages/@support/features/update-toast/layout/UpdateToast.svelte @@ -1,126 +1,658 @@ - -
-
-
-

- Release Notes -

-

- Check out our latest releases designed to boost your productivity and - efficiency. -

- - - - -
- {#each items as item, index} -
-
- -
-
-

{item.dateCreated}

-

- {index === 0 ? "Latest Version:" : "Version:"} - {item.versionName} -

-
- -
-

Features

-

- {#each item.features as feature} -

{feature}

- {/each} -

- -
-
{ - onLearnMore(item.versionName); - }} - > - Learn more +
+
+
My Activity
+

+ Find all your posts, comments, and likes in one place and easily keep + track of them. +

+
+
+ +
+ +
+
+ + {#if !isPostopen} +
+ +
+

Posts

+ + {#if posts.length > 0} +
    + {#each posts as post} +
  • + +
    +
    +
    ((id = post?.id), (isPostopen = true))} + > + {post?.title} +
    + +
    +
    +
    + {post?.status} +
    +
    +

    {post?.details}

    +
    +
    -
-
-
- {/each} + + {/each} + + {:else} +

No posts available at the moment.

+ {/if} + +
+ +
+

Comments

+ {#if comments.length > 0} +
    + {#each comments as comment} +
  • (isHovering = comment.id)} + on:mouseleave={() => (isHovering = null)} + > + +
    +
    +
    +
    {comment.author.name}
    +
    {comment.value}
    +
    + + {#if isHovering === comment.id} + ( + ((id = comment?.post?.id), (isPostopen = true)), + setActiveTabFromActivity( + "feedback", + comment.post?.id, + ) + )} + class="go-to-post" + style="font-size: 12px; letter-spacing: 0.25px; font-weight: 400;" + >Go to post ↗ + {/if} +
    + +
    +
    + + {timeAgo(comment.created)} + + Reply + Edit comment +
    +
    + + +
    +
    +
    +
  • + {/each} +
+ {:else} +

+ No comments available at the moment. +

+ {/if} +
+ +
+
+

+ Posts you liked +

+ + {#if posts.length > 0} +
    + {#each posts as post} +
  • + +
    +
    +
    ((id = post?.id), (isPostopen = true))} + > + {post?.title} +
    + +
    +
    +
    + {post?.status} +
    +
    +

    {post?.details}

    +
    + +
    +
    +
  • + {/each} +
+ {:else} +

No posts available at the moment.

+ {/if} +
-
-
+ {/if} + + {#if isPostopen} + + {/if}
From 1d76e56c48ab4383843f5edaadefe232ef31dc5c Mon Sep 17 00:00:00 2001 From: Astitva Patle Date: Wed, 11 Sep 2024 15:06:53 +0530 Subject: [PATCH 65/99] fix: fixed base env in workflow [] --- .github/workflows/development.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index d6ca873ce..436d56d84 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -21,7 +21,7 @@ env: VITE_AZURE_INSIGHTS_CONNECTION_STRING: ${{ vars.VITE_AZURE_INSIGHTS_CONNECTION_STRING }} VITE_CANNY_API: ${{ vars.VITE_CANNY_API }} VITE_CANNY_URL: ${{ vars.VITE_CANNY_URL }} - VITE_BASE_URL: $${{ vars.VITE_BASE_URL }} + VITE_BASE_URL: ${{ vars.VITE_BASE_URL }} ACTIONS_ALLOW_UNSECURE_COMMANDS: true jobs: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 34a47bbcb..324b3286e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ env: VITE_AZURE_INSIGHTS_CONNECTION_STRING: ${{ vars.VITE_AZURE_INSIGHTS_CONNECTION_STRING }} VITE_CANNY_API: ${{ vars.VITE_CANNY_API }} VITE_CANNY_URL: ${{ vars.VITE_CANNY_URL }} - VITE_BASE_URL: $${{ vars.VITE_BASE_URL }} + VITE_BASE_URL: ${{ vars.VITE_BASE_URL }} ACTIONS_ALLOW_UNSECURE_COMMANDS: true jobs: From a6b5f4670cfd3ac04e98caa8698d79ed565d2baf Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Wed, 11 Sep 2024 16:57:11 +0530 Subject: [PATCH 66/99] fix: environemnt permissions for viewer [#1509] --- src/packages/@app/styles/style.scss | 5 + .../empty-collection/EmptyCollection.svelte | 30 ++--- .../layout/CollectionList.svelte | 94 +++++++------- .../layout/EnvironmentList.svelte | 116 ++++++++++-------- .../layout/WorkspaceActions.svelte | 4 +- 5 files changed, 135 insertions(+), 114 deletions(-) diff --git a/src/packages/@app/styles/style.scss b/src/packages/@app/styles/style.scss index 274fad82c..e55f589c0 100644 --- a/src/packages/@app/styles/style.scss +++ b/src/packages/@app/styles/style.scss @@ -890,3 +890,8 @@ span { textarea { resize: none; } + +button:disabled{ + pointer-events: none !important; + opacity: 0.7; +} diff --git a/src/packages/@workspaces/features/collection-list/components/empty-collection/EmptyCollection.svelte b/src/packages/@workspaces/features/collection-list/components/empty-collection/EmptyCollection.svelte index 285225080..edcec9b95 100644 --- a/src/packages/@workspaces/features/collection-list/components/empty-collection/EmptyCollection.svelte +++ b/src/packages/@workspaces/features/collection-list/components/empty-collection/EmptyCollection.svelte @@ -31,19 +31,22 @@
- -

- Add Collections to your Workspace to group your requests or send an API - request directly -

-
+ + {#if userRole !== WorkspaceRole.WORKSPACE_VIEWER} +

+ Add Collections to your Workspace to group your requests or send an API + request directly +

+ {/if} +
{#if userRole !== WorkspaceRole.WORKSPACE_VIEWER} -

{ if (isGuestUser === true) { onItemCreated("collection", { @@ -64,11 +67,10 @@ style="color: var(--text-secondary-200)" class="ps-2 fw-bold text-fs-12">Add Collection -

+ {/if} -

{ diff --git a/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte b/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte index 6f0bafe1c..8210bdee1 100644 --- a/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte +++ b/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte @@ -180,7 +180,7 @@

+
- - - + + + {/if}
{#if isExpandCollection} -
+
{#if collectionListDocument?.length > 0} {#if searchData.length > 0} {#if collectionFilter.length > 0} @@ -277,7 +282,7 @@ bind:scrollList height={"auto"} overflowY={"auto"} - classProps={"pe-1"} + classProps={"pe-0"} > {#each collectionFilter as col}

{#each collectionListDocument as col} - - {#if searchData.length !==0 } -

- No Result Found -

- {/if} + {#if searchData.length !== 0} +

+ No Result Found +

+ {/if} {/if}
{/if} diff --git a/src/packages/@workspaces/features/environment-list/layout/EnvironmentList.svelte b/src/packages/@workspaces/features/environment-list/layout/EnvironmentList.svelte index ff6a7a1d6..69b233034 100644 --- a/src/packages/@workspaces/features/environment-list/layout/EnvironmentList.svelte +++ b/src/packages/@workspaces/features/environment-list/layout/EnvironmentList.svelte @@ -138,11 +138,11 @@
+
- - - - + + + {/if}
{#if isExpandEnvironment} -
- {#if filteredLocalEnvironment && localEnvironment.length === 0 && loggedUserRoleInWorkspace !== WorkspaceRole.WORKSPACE_VIEWER} +
+ {#if filteredLocalEnvironment && localEnvironment.length === 0} {#if filteredGlobalEnvironment && filteredGlobalEnvironment.length > 0}

{/if} -
-

- Add Environments in your Workspace for precise API testing with - relevant resources and constraints. -

-

{ - onCreateEnvironment(localEnvironment); - }} - > - - Add Environment + {#if loggedUserRoleInWorkspace !== WorkspaceRole.WORKSPACE_VIEWER} +

-

+ Add Environments in your Workspace for precise API testing with + relevant resources and constraints. +

+ + {/if}
{/if} - {#if filteredGlobalEnvironment && filteredGlobalEnvironment.length > 0 && localEnvironment.length !== 0 } + {#if filteredGlobalEnvironment && filteredGlobalEnvironment.length > 0 && localEnvironment.length !== 0}

{#each filteredLocalEnvironment as env} diff --git a/src/packages/@workspaces/features/workspace-actions/layout/WorkspaceActions.svelte b/src/packages/@workspaces/features/workspace-actions/layout/WorkspaceActions.svelte index 4e4980179..6259a9700 100644 --- a/src/packages/@workspaces/features/workspace-actions/layout/WorkspaceActions.svelte +++ b/src/packages/@workspaces/features/workspace-actions/layout/WorkspaceActions.svelte @@ -321,7 +321,7 @@

-
+
- - {#if nestedComments.length > 0} -
-
-
Activity Feed
- - { + type = id; + handleSortChange(); + console.log("Test"); + }} + titleId={type} + placeholderText={"Sort By"} + zIndex={499} + disabled={false} + iconRequired={true} + icon={SortIcon} + borderType={"none"} + borderActiveType={"none"} + borderHighlight={"hover-active"} + headerHighlight={"hover-active"} + headerHeight={"26px"} + minBodyWidth={"150px"} + minHeaderWidth={"150px"} + maxHeaderWidth={"200px"} + borderRounded={"2px"} + headerTheme={"violet2"} + bodyTheme={"violet"} + menuItem={"v2"} + headerFontSize={"10px"} + isDropIconFilled={true} + position={"absolute"} /> - {/each} +
+ + +
+ {#each nestedComments as comment} + + {/each} +
-
- {:else} -

- No Comments Yet -

- {/if} + {:else} +

+ No Comments Yet +

+ {/if} +
-
+{/if} { userInfo = value; }); @@ -43,8 +45,10 @@ status: string, ) => { currentSort = sortType; + isLoading = true; const listPosts = await fetchPosts(sortType, searchQuery, status); posts = listPosts?.data?.posts; + isLoading = false; // votelist = await listVote(post.id); // console.log("THis is votelist", votelist); }; @@ -88,10 +92,12 @@ await getPosts(currentSort, searchTerm, status); } else { // Fetch and filter posts by the selected category + isLoading = true; const listPosts = await fetchPosts(currentSort, searchTerm, status); posts = listPosts?.data?.posts.filter( (post) => post?.category?.name === selectedCategory, ); + isLoading = false; } }; @@ -99,6 +105,7 @@
{#if !isPostopen} +
-
- -
@@ -240,87 +244,112 @@ >
-
- {#each posts as post} -
+ {#if isLoading} +
+ {:else} + + {#if posts.length > 0} +
+ {#each posts as post}
-
-
{ - id = post?.id; - isPostopen = true; - }} - > - {post?.title} +
+
+
{ + id = post?.id; + isPostopen = true; + }} + > + {post?.title} +
+
+ + {post?.status + ? post.status.charAt(0).toUpperCase() + + post.status.slice(1) + : ""} + +
-
- {post?.status} -
-
- -
+ +
-
-

- {post?.details} -

-
+
+

+ {post?.details} +

+
-
- - - - {post?.commentCount} +
+ + + + {post?.commentCount} +
-
- {/each} -
+ {/each} +
+ {:else} +

+ No Result Found +

+ {/if} + {/if}
{/if} @@ -392,6 +421,7 @@ border: none !important; font-weight: 500; } + .sort-buttons:hover { color: #3670f7 !important; } @@ -399,14 +429,20 @@ .sort-buttons:focus-within { color: #3670f7 !important; } + .tick-icon { display: none; } + /* When a button has the 'active' class */ + .sort-buttons.active { + color: #3670f7 !important; /* Blue color for active sort */ + } + + .sort-buttons.active .tick-icon { + display: revert; /* Show tick icon for active sort */ + } /* .sort-buttons:hover .tick-icon { display: revert; } */ - .sort-buttons:focus-within .tick-icon { - display: revert; - } From 7dfdf9167416ddd9ce13bbbb8810199a39b98d72 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Thu, 12 Sep 2024 14:22:55 +0530 Subject: [PATCH 77/99] feat: Added upvote button [#123] --- .../@app/pages/Help/HelpPage.ViewModel.ts | 43 +++++-------------- src/packages/@app/services/canny.service.ts | 4 +- .../@support/common/components/Upvote.svelte | 19 ++++---- .../layout/FeedbackSection.svelte | 30 ++++++------- .../features/roadmap/layout/Roadmap.svelte | 4 +- 5 files changed, 37 insertions(+), 63 deletions(-) diff --git a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts index 46844cb63..95e621f19 100644 --- a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts +++ b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts @@ -218,7 +218,15 @@ class HelpPageViewModel { const boards = await this.RetrieveBoards(); const boardID = boards?.data?.boards[0]?.id; const response = await this.cannyService.listPosts(boardID, sort, search,status ); - return response; + let voteList = await this.listVote(); + let result = response.data.posts.map( (post) => { + + const isLiked = voteList.data.votes.some( + (vote) => vote.post.id === post.id, + ); + return { ...post, isPostLiked: isLiked }; + }); + return result; }; /** @@ -438,45 +446,16 @@ public deleteVote= async (postID:string) =>{ userID: userInfo?._id, }); } - - const UserId = userResponse?.data?.id; // Use the retrieved or newly created user's ID - - if (UserId) { - const result = await this.cannyService.listVotes(postID); - return result; - } - } - - - - public listVote= async (postID:string) =>{ - - let userInfo; - await user.subscribe((value) => { - userInfo = value; - }); - - let userResponse = await this.cannyService.retrieveUser(userInfo.email); - - // If user does not exist, create a new user - if (!userResponse?.data) { - userResponse = await this.cannyService.createUser({ - name: userInfo?.name, - email: userInfo?.email, - userID: userInfo?._id, - }); - } - const UserId = userResponse?.data?.id; // Use the retrieved or newly created user's ID if (UserId) { - const result = await this.cannyService.listVotes(postID); + console.log("This is user ID", UserId) + const result = await this.cannyService.listVotes(UserId); return result; } } - public listChangeLog= async (type:string) =>{ const result = await this.cannyService.listChangeLog(type); return result; diff --git a/src/packages/@app/services/canny.service.ts b/src/packages/@app/services/canny.service.ts index 1ecd630d9..118b59e13 100644 --- a/src/packages/@app/services/canny.service.ts +++ b/src/packages/@app/services/canny.service.ts @@ -247,11 +247,11 @@ export class CannyIoService { * @param postID - The ID of the post whose votes are being retrieved. * @returns {Promise} The response from the server with the list of votes. */ - public listVotes = async (postID: string ) => { + public listVotes = async (userID: string ) => { const response = await makeRequest("POST", `${this.apiUrl}/votes/list`, { body: { apiKey: this.apiKey, - postID, + userID, }, headers: { diff --git a/src/packages/@support/common/components/Upvote.svelte b/src/packages/@support/common/components/Upvote.svelte index 36d013b70..f1b86c8a7 100644 --- a/src/packages/@support/common/components/Upvote.svelte +++ b/src/packages/@support/common/components/Upvote.svelte @@ -5,35 +5,34 @@ export let upvote: number; // Current upvote count export let postID: string; // Post ID - export let hasUpvoted: boolean = false; // Track if the user has upvoted export let likePost: (postId: string) => void; // Function to call `Upvote` export let dislikePost: (postId: string) => void; // Function to call `UndoUpvote` - export let authordId: string; export let handleUpvote; - let upvoteValue = upvote; + export let isPostLiked; + const handleClick = () => { - if (hasUpvoted) { + if (isPostLiked) { dislikePost(postID); - handleUpvote(); // Remove upvote + upvote--; } else { - likePost(postID); // Add upvote - handleUpvote(); + likePost(postID); + upvote++; } - hasUpvoted = !hasUpvoted; // Toggle the upvote state + isPostLiked = !isPostLiked; // Toggle the upvote state };
- {#if hasUpvoted} + {#if isPostLiked} {:else} diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 3a4620ff6..4cfd2a904 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -46,11 +46,8 @@ ) => { currentSort = sortType; isLoading = true; - const listPosts = await fetchPosts(sortType, searchQuery, status); - posts = listPosts?.data?.posts; + posts = await fetchPosts(sortType, searchQuery, status); isLoading = false; - // votelist = await listVote(post.id); - // console.log("THis is votelist", votelist); }; const defaultStaus = "open,under review,planned,in progress,complete"; @@ -105,7 +102,6 @@
{#if !isPostopen} -
{#if isLoading} -
- {:else} - - {#if posts.length > 0} +
+ +
+ {:else if posts.length > 0}
{/each}
- {:else} + {:else}

- No Result Found -

- {/if} + class=" text-fs-12 mb-0 text-center" + style=" margin-left:250px; margin-top:45px; font-weight:300;color: var(--text-secondary-550); letter-spacing: 0.5px;" + > + No Result Found +

{/if}
{/if} diff --git a/src/packages/@support/features/roadmap/layout/Roadmap.svelte b/src/packages/@support/features/roadmap/layout/Roadmap.svelte index 5c995400a..b5d42210b 100644 --- a/src/packages/@support/features/roadmap/layout/Roadmap.svelte +++ b/src/packages/@support/features/roadmap/layout/Roadmap.svelte @@ -73,8 +73,8 @@ onMount(async () => { const response = await fetchPosts(); - if (response?.data?.posts) { - transformPostsToProductStatus(response.data.posts); + if (response) { + transformPostsToProductStatus(response); } }); From c5144e11ddf21563f5a76c50ffb360d9ac33a5a2 Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Thu, 12 Sep 2024 16:17:07 +0530 Subject: [PATCH 78/99] fix: handle query params for curl [#1513] --- .../@app/pages/Collections/CollectionPage.ViewModel.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts b/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts index a868f5af3..1f4779ea9 100644 --- a/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts +++ b/src/packages/@app/pages/Collections/CollectionPage.ViewModel.ts @@ -85,6 +85,7 @@ import { SocketTabAdapter } from "@app/adapter/socket-tab"; import type { CollectionDocType } from "@app/models/collection.model"; import type { GuideQuery } from "@app/types/user-guide"; import type { FeatureQuery } from "@app/types/feature-switch"; +import { ReduceQueryParams } from "@workspaces/features/rest-explorer/utils"; export default class CollectionsViewModel { private tabRepository = new TabRepository(); @@ -724,7 +725,14 @@ export default class CollectionsViewModel { ) => { const response = await this.collectionService.importCollectionFromCurl(importCurl); + if (response.isSuccessful) { + const req = response.data.data.request; + const reducedQueryParams = new ReduceQueryParams(req.queryParams); + const paramString = reducedQueryParams.getValue(); + if (paramString) { + response.data.data.request.url = req.url + "?" + paramString; + } const requestTabAdapter = new RequestTabAdapter(); const tabId = UntrackedItems.UNTRACKED + uuidv4(); const adaptedRequest = requestTabAdapter.adapt( From 3ba1ec6bcf2935ef3716cf34d33b3db7f7ec4475 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Thu, 12 Sep 2024 17:15:25 +0530 Subject: [PATCH 79/99] feat: Added upvote funtionality [#123] --- .../features/feedback-section/layout/FeedbackPost.svelte | 4 ++-- .../features/feedback-section/layout/FeedbackSection.svelte | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte index ebef430af..fb7d26798 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -195,12 +195,12 @@ > {createdAt} | - { isExposeFeedbackForm = true; }}>Edit post + > -->
diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 4cfd2a904..a0226332c 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -271,7 +271,7 @@
- {:else if posts.length > 0} + {:else if posts?.length > 0}
Date: Thu, 12 Sep 2024 19:02:33 +0530 Subject: [PATCH 80/99] fix: dropdown filter fix and activity dropdown added [#1453] --- .../@app/pages/Help/HelpPage.ViewModel.ts | 4 +- src/packages/@app/services/canny.service.ts | 4 +- .../@library/ui/spinner/Spinner.svelte | 5 + .../@support/common/types/activity.ts | 14 + .../activity-section/ActivitySection.svelte | 508 +++++++----------- .../layout/FeedbackPost.svelte | 339 ++++++------ .../layout/CollectionList.svelte | 17 +- 7 files changed, 412 insertions(+), 479 deletions(-) create mode 100644 src/packages/@support/common/types/activity.ts diff --git a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts index f8dec7844..3e017ff84 100644 --- a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts +++ b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts @@ -297,8 +297,8 @@ class HelpPageViewModel { return response } - public retrieveUserVotes = async (userID: string) => { - const response = await this.cannyService.retrieveVotes({}, userID) + public retrieveUserVotes = async (userID: string, sort?: string, search?: string, status?: string) => { + const response = await this.cannyService.retrieveVotes(userID, sort, search, status) return response } diff --git a/src/packages/@app/services/canny.service.ts b/src/packages/@app/services/canny.service.ts index 5490105c6..cbbf31b0f 100644 --- a/src/packages/@app/services/canny.service.ts +++ b/src/packages/@app/services/canny.service.ts @@ -345,7 +345,7 @@ export class CannyIoService { return response; } - public retrieveVotes = async (body?: object, userID: string) => { + public retrieveVotes = async (userID: string, sort: string, search: string, status: string) => { const response = await makeRequest( "POST", `https://canny.io/api/v1/votes/list`, @@ -353,7 +353,7 @@ export class CannyIoService { body: { apiKey: this.apiKey, userID, // just for now testing - ...body + sort, search, status }, headers: { "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], diff --git a/src/packages/@library/ui/spinner/Spinner.svelte b/src/packages/@library/ui/spinner/Spinner.svelte index 9a92b3c8c..bca9ea345 100644 --- a/src/packages/@library/ui/spinner/Spinner.svelte +++ b/src/packages/@library/ui/spinner/Spinner.svelte @@ -28,4 +28,9 @@ transform: rotate(360deg); } } + + .small { + width: 50px; + height: 50px; + } diff --git a/src/packages/@support/common/types/activity.ts b/src/packages/@support/common/types/activity.ts new file mode 100644 index 000000000..5708d429e --- /dev/null +++ b/src/packages/@support/common/types/activity.ts @@ -0,0 +1,14 @@ +export enum ActivityType { + FEATURE_REQUEST = "Feature Request", + UI_IMPROVEMENT = "UI Improvement", + BUG = "Bug", + ALL_CATEGORIES = "All Categories", +} + + +export enum ActivityStatusType { + COMMENT = "comment", + POST = "post", + ALL_ACTIVITY = "all activity", +} + diff --git a/src/packages/@support/features/activity-section/ActivitySection.svelte b/src/packages/@support/features/activity-section/ActivitySection.svelte index 4e9deb2ad..96233ea9c 100644 --- a/src/packages/@support/features/activity-section/ActivitySection.svelte +++ b/src/packages/@support/features/activity-section/ActivitySection.svelte @@ -7,16 +7,21 @@ import { SearchIcon } from "$lib/assets/app.asset"; import { Select } from "@library/forms"; import { CategoryIcon, StatusIcon } from "@library/icons"; + import { FeedbackStatusType, FeedbackType, } from "@support/common/types/feedback"; - - export let type = FeedbackType.ALL_CATEGORY; import { tickIcon } from "@library/forms/select/svgs"; import { IconFallback } from "@library/ui"; import { Like } from "@library/ui/like"; + import { + ActivityStatusType, + ActivityType, + } from "@support/common/types/activity"; + import Spinner from "@library/ui/spinner/Spinner.svelte"; + export let type = FeedbackType.ALL_CATEGORY; export let onInputFeedback; export let onAddFeedback; export let fetchPosts; @@ -24,87 +29,122 @@ export let fetchComments; export let fetchLikedPosts; export let setActiveTabFromActivity; - // export let userInfo; let currentSort = "newest"; let posts = []; let filteredPosts = []; + let filteredComments = []; let searchTerm = ""; let userInfo: any = {}; let comments = []; - let isHovering = null; // Keep track of which comment is being hovered let likedPosts = []; - // let comments = []; + let isHovering = null; // Keep track of which comment is being hovered + let isPostopen = false; + let activityType = ActivityType.ALL_CATEGORIES; + let activityStatusType: string = ActivityStatusType.ALL_ACTIVITY; + const defaultStaus = "all activity"; + let status = defaultStaus; + let id = ""; + let loading = false; user.subscribe((value) => { userInfo = value; }); - let id = ""; - const getPosts = async ( - sortType: string, - searchTerm?: string, - status?: string, - ) => { - currentSort = sortType; + // Fetch all data once on mount + const getAllData = async () => { + try { + loading = true; + const [postsData, commentsData, likedPostsData] = await Promise.all([ + fetchPosts(currentSort, userInfo._id), + fetchComments(userInfo._id), + fetchLikedPosts(currentSort, userInfo._id), + ]); + + if (!commentsData || !postsData || !likedPostsData) { + loading = false; + } + posts = postsData?.data?.posts || []; + comments = commentsData?.data?.comments || []; + likedPosts = likedPostsData?.data?.votes || []; + + filterPosts(); + filterComments(); + // sortComments(currentSort); + loading = false; + } catch (error) { + loading = false; + } + }; + + onMount(async () => { + await getAllData(); + }); - const listPosts = await fetchPosts( - currentSort, - userInfo._id, - searchTerm, - status, + const filterPosts = () => { + filteredPosts = posts.filter((post) => + post.title.toLowerCase().includes(searchTerm.toLowerCase()), ); - console.log(listPosts); - posts = listPosts?.data?.posts; }; - const getComments = async (sortBy?: string) => { - const listComments = await fetchComments( - userInfo._id, - currentSort, - userInfo._id, - searchTerm, - status, + const filterComments = () => { + filteredComments = comments.filter((comment) => + comment.value.toLowerCase().includes(searchTerm.toLowerCase()), ); - console.log(listComments); + }; - if (sortBy === "newest") { - comments = listComments.data.comments.filter((_) => _.value); - comments = comments.sort( - (a, b) => new Date(b.created) - new Date(a.created), - ); - } else if (sortBy === "oldest") { - comments = listComments.data.comments.filter((_) => _.value); - comments = comments.sort( - (a, b) => new Date(a.created) - new Date(b.created), - ); - } else { - comments = listComments.data.comments.filter((_) => _.value); - } + const sortPosts = async (sort) => { + const response = await fetchPosts(sort, userInfo._id); + filteredPosts = response?.data?.posts; }; - const getLikedPosts = async () => { - const listsPosts = await fetchLikedPosts(userInfo._id); - likedPosts = listsPosts.data.votes; - console.log(listsPosts); + const sortComments = (sortType) => { + if (sortType === "newest") { + filteredComments = comments + .filter((comment) => comment.value) + .sort((a, b) => new Date(b.created) - new Date(a.created)); + } else if (sortType === "oldest") { + filteredComments = comments + .filter((comment) => comment.value) + .sort((a, b) => new Date(a.created) - new Date(b.created)); + } }; - onMount(async () => { - getPosts(currentSort); - getComments(); - getLikedPosts(); - }); + const handleInputChange = (searchQuery) => { + searchTerm = searchQuery; + filterPosts(); + }; - let isPostopen = false; + const handleSortChange = async (sortType) => { + currentSort = sortType; + await sortComments(sortType); + await sortPosts(sortType); + }; - let activityType = FeedbackType.ALL_CATEGORY; - let activityStatusType: string = FeedbackStatusType.ALL_STATUS; + const handleCategoryChange = (selectedCategory) => { + activityType = selectedCategory; + if (selectedCategory === ActivityType.ALL_CATEGORIES) { + filteredPosts = posts; + } else { + filteredPosts = posts.filter( + (post) => post?.category?.name === selectedCategory, + ); + } + }; - const defaultStaus = "open,under review,planned,in progress,complete"; - let status = defaultStaus; + const handleActivityChanges = (selectedStatus) => { + activityStatusType = selectedStatus; - const firstLetterCapital = (str: string) => { - return str.charAt(0).toUpperCase() + str.slice(1); + if (selectedStatus === ActivityStatusType.POST) { + filteredPosts = posts; + filteredComments = []; + } else if (selectedStatus === ActivityStatusType.COMMENT) { + filteredPosts = []; + filteredComments = comments; + } else { + filteredPosts = posts; + filteredComments = comments; + } }; function timeAgo(createdTime: string) { @@ -114,59 +154,13 @@ const hours = Math.floor(difference / (1000 * 60 * 60)); // convert to hours if (hours < 1) { - return firstLetterCapital("less than an hour ago"); + return "less than an hour ago"; } else if (hours === 1) { return "1 hour ago"; } else { return `${hours} hours ago`; } } - - const filterComments = () => { - if (searchTerm.trim() === "") { - getComments(); - } else { - // Filter comments based on the search term - comments = comments.filter((comment) => { - const commentContent = comment.value.toLowerCase(); - return commentContent.includes(searchTerm.toLowerCase()); - }); - } - console.log("Filtered Comments:", comments); - }; - - const handleInputChange = async (searchQuery: string) => { - searchTerm = searchQuery; - await getPosts(currentSort, searchTerm); - filterComments(); - }; - - const handleStatusChange = async (_status: string) => { - console.log(_status); - activityStatusType = _status; - - if (_status == "all status") { - status = defaultStaus; - } else { - status = _status; - } - await getPosts(currentSort, searchTerm, status); - }; - - const handleCategoryChange = async (selectedCategory) => { - activityStatusType = selectedCategory; - - if (selectedCategory === FeedbackType.ALL_CATEGORY) { - // Show all posts if "All Categories" is selected - await getPosts(currentSort, searchTerm, status); - } else { - // Fetch and filter posts by the selected category - const listPosts = await fetchPosts(currentSort, searchTerm, status); - posts = listPosts?.data?.posts.filter( - (post) => post?.category?.name === selectedCategory, - ); - } - };
@@ -180,50 +174,34 @@
-
- +
+ { - handleInputChange(e.target.value); - }} + on:input={(e) => handleInputChange(e.target.value)} />
-
+
{ - console.log("second drop down" + id); - handleStatusChange(id); + handleActivityChanges(id); }} titleId={activityStatusType} - placeholderText={"Status"} - id={"feeds"} + placeholderText="Status" zIndex={499} disabled={false} iconRequired={true} - icon={StatusIcon} borderType={"none"} borderActiveType={"none"} borderHighlight={"hover-active"} @@ -302,6 +256,7 @@
+ {#if !isPostopen}
-
-

Posts

- - {#if posts.length > 0} -
    - {#each posts as post} -
  • - -
    -
    -
    ((id = post?.id), (isPostopen = true))} - > - {post?.title} -
    - -
    -
    -
    - {post?.status} -
    -
    -

    {post?.details}

    -
    - -
    -
    -
  • - {/each} -
- {:else} -

- No Result Found -

- {/if} - -
- -
-

Comments

- {#if comments.length > 0} -
    - {#each comments as comment} -
  • (isHovering = comment.id)} - on:mouseleave={() => (isHovering = null)} - > - -
    -
    -
    -
    {comment.author.name}
    -
    {comment.value}
    -
    - - {#if isHovering === comment.id} - ( - ((id = comment?.post?.id), (isPostopen = true)), - setActiveTabFromActivity( - "feedback", - comment.post?.id, - ) - )} - class="go-to-post" - style="font-size: 12px; letter-spacing: 0.25px; font-weight: 400;" - >Go to post ↗ - {/if} -
    -
    -
    - - {timeAgo(comment.created)} - - Reply -
    -
    - - -
    -
    -
    -
  • - {/each} -
- {:else} -

- No Result Found -

- {/if} + {#if loading} +
+
- -
-
-

- Posts you liked -

- - {#if posts.length > 0} -
    - {#each posts as post} + {:else} +
    + {#if filteredPosts.length > 0} +

    Posts

    +
      + {#each filteredPosts as post}
    • - -
      +
      {/each}
    - {:else} -

    - No Result Found -

    {/if} + +
    + {#if comments.length > 0} +

    Comments

    +
      + {#each filteredComments as comment} +
    • (isHovering = comment.id)} + on:mouseleave={() => (isHovering = null)} + > + +
      +
      +
      +
      + {comment.author.name} +
      +
      {comment.value}
      +
      + + {#if isHovering === comment.id} + ( + ((id = comment?.post?.id), (isPostopen = true)), + setActiveTabFromActivity( + "feedback", + comment.post?.id, + ) + )} + class="go-to-post" + style="font-size: 12px; letter-spacing: 0.25px; font-weight: 400;" + >Go to post ↗ + {/if} +
      + +
      +
      + + {timeAgo(comment.created)} + + Reply +
      +
      + + +
      +
      +
      +
    • + {/each} +
    + {:else} +

    + No Result Found +

    + {/if} +
    -
+ {/if}
{/if} diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte index 048803f2f..29bde2e81 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -12,6 +12,7 @@ import { Button, IconFallback, Modal } from "@library/ui"; import ImageModal from "@library/ui/image-modal/ImageModal.svelte"; + import Spinner from "@library/ui/spinner/Spinner.svelte"; import { CommentCard, UpvoteIcon } from "@support/common/components"; import { FeedbackType } from "@support/common/types"; import { FeedbackStatusType } from "@support/common/types/feedback"; @@ -36,6 +37,7 @@ let isLoading = false; let postImages = []; let commentValue = ""; + let loading = false; const timeAgo = (date) => { const diffInSeconds = (new Date() - new Date(date)) / 1000; @@ -74,12 +76,19 @@ }; onMount(async () => { - const res = await onRetrievePost(id || postIdFromActivity); - post = await res?.data; - console.log(post, "post"); - createdAt = timeAgo(post?.created); - postImages = post?.imageURLs; - comments = await fetchComments(id); + try { + loading = true; + console.log(post); + const res = await onRetrievePost(id || postIdFromActivity); + post = await res?.data; + console.log(post); + console.log(post, "post"); + createdAt = timeAgo(post?.created); + postImages = post?.imageURLs; + comments = await fetchComments(id); + } catch (error) { + loading = false; + } }); $: { @@ -103,185 +112,193 @@ -
-
+
+ {#if post.length === 0}
- {post?.title} - {post?.status} +
- -
+ {:else} +
-
- -
- - {post?.author?.name} + {post?.title} + {post?.status} +
+ +
+
+
+ +
+ + {post?.author?.name} +
-
-
- {post?.details} -
-
- {#each postImages as postImage} - { - isImageOpen = true; - currentImage = postImage; - }} - src={postImage} - alt="post image" - style="width:100px; display:inline; height: 100px; margin-top: 20px; border-radius: 2px; margin:10px;" - /> - { - isImageOpen = flag; - }} - > +
+ {post?.details} +
+
+ {#each postImages as postImage} { + isImageOpen = true; + currentImage = postImage; + }} + src={postImage} alt="post image" - style="width:100%; height:100%;" + style="width:100px; display:inline; height: 100px; margin-top: 20px; border-radius: 2px; margin:10px;" /> - - {/each} -
+ { + isImageOpen = flag; + }} + > + post image + + {/each} +
-
- {createdAt} - | - { - isExposeFeedbackForm = true; - }}>Edit post + {createdAt} + | + { + isExposeFeedbackForm = true; + }}>Edit post +
-
-
- +
+ +
-
- - -
- { - commentValue = e.target.value; - }} - bind:value={commentValue} - /> - -
- -
- - {#if nestedComments.length > 0} -
-
-
Activity Feed
- - {}} + titleId={type} + placeholderText={"Sort By"} + zIndex={499} + disabled={false} + iconRequired={true} + icon={SortIcon} + borderType={"none"} + borderActiveType={"none"} + borderHighlight={"hover-active"} + headerHighlight={"hover-active"} + headerHeight={"26px"} + minBodyWidth={"150px"} + minHeaderWidth={"150px"} + maxHeaderWidth={"200px"} + borderRounded={"2px"} + headerTheme={"violet2"} + bodyTheme={"violet"} + menuItem={"v2"} + headerFontSize={"10px"} + isDropIconFilled={true} + position={"absolute"} /> - {/each} +
+ + +
+ {#each nestedComments as comment} + + {/each} +
-
- {:else} -

- No Comments Yet -

- {/if} -
+ {:else} +

+ No Comments Yet +

+ {/if} +
+ {/if}
diff --git a/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte b/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte index 6f0bafe1c..0e8a5f020 100644 --- a/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte +++ b/src/packages/@workspaces/features/collection-list/layout/CollectionList.svelte @@ -349,15 +349,14 @@ {isGuestUser} /> - - {#if searchData.length !==0 } -

- No Result Found -

- {/if} + {#if searchData.length !== 0} +

+ No Result Found +

+ {/if} {/if}
{/if} From 71907477329b9199a113aa1c7097611fd932cf3e Mon Sep 17 00:00:00 2001 From: anujnema5 Date: Fri, 13 Sep 2024 02:21:48 +0530 Subject: [PATCH 81/99] feat: upvoted posts UI integration and filters added --- .../@app/pages/Help/HelpPage.ViewModel.ts | 4 +- src/packages/@app/services/canny.service.ts | 5 +- .../@support/common/types/activity.ts | 1 + .../activity-section/ActivitySection.svelte | 87 +++++++++++++++++-- 4 files changed, 87 insertions(+), 10 deletions(-) diff --git a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts index 3e017ff84..f8dec7844 100644 --- a/src/packages/@app/pages/Help/HelpPage.ViewModel.ts +++ b/src/packages/@app/pages/Help/HelpPage.ViewModel.ts @@ -297,8 +297,8 @@ class HelpPageViewModel { return response } - public retrieveUserVotes = async (userID: string, sort?: string, search?: string, status?: string) => { - const response = await this.cannyService.retrieveVotes(userID, sort, search, status) + public retrieveUserVotes = async (userID: string) => { + const response = await this.cannyService.retrieveVotes({}, userID) return response } diff --git a/src/packages/@app/services/canny.service.ts b/src/packages/@app/services/canny.service.ts index cbbf31b0f..42152f07a 100644 --- a/src/packages/@app/services/canny.service.ts +++ b/src/packages/@app/services/canny.service.ts @@ -345,15 +345,14 @@ export class CannyIoService { return response; } - public retrieveVotes = async (userID: string, sort: string, search: string, status: string) => { + public retrieveVotes = async (body: object, userID: string) => { const response = await makeRequest( "POST", `https://canny.io/api/v1/votes/list`, { body: { apiKey: this.apiKey, - userID, // just for now testing - sort, search, status + // userID, }, headers: { "Content-type": ContentTypeEnum["application/x-www-form-urlencoded"], diff --git a/src/packages/@support/common/types/activity.ts b/src/packages/@support/common/types/activity.ts index 5708d429e..1826ab163 100644 --- a/src/packages/@support/common/types/activity.ts +++ b/src/packages/@support/common/types/activity.ts @@ -10,5 +10,6 @@ export enum ActivityStatusType { COMMENT = "comment", POST = "post", ALL_ACTIVITY = "all activity", + UPVOTED_POSTS = 'upvoted posts' } diff --git a/src/packages/@support/features/activity-section/ActivitySection.svelte b/src/packages/@support/features/activity-section/ActivitySection.svelte index bc1cc6375..1f02f18c3 100644 --- a/src/packages/@support/features/activity-section/ActivitySection.svelte +++ b/src/packages/@support/features/activity-section/ActivitySection.svelte @@ -35,6 +35,7 @@ let posts = []; let filteredPosts = []; let filteredComments = []; + let filteredLikedPosts = []; let searchTerm = ""; let userInfo: any = {}; let comments = []; @@ -59,7 +60,7 @@ const [postsData, commentsData, likedPostsData] = await Promise.all([ fetchPosts(currentSort, userInfo._id), fetchComments(userInfo._id), - fetchLikedPosts(currentSort, userInfo._id), + fetchLikedPosts(userInfo._id), ]); if (!commentsData || !postsData || !likedPostsData) { @@ -69,8 +70,11 @@ comments = commentsData?.data?.comments || []; likedPosts = likedPostsData?.data?.votes || []; + console.log(likedPosts); + filterPosts(); filterComments(); + filterLikedPosts(); // sortComments(currentSort); loading = false; } catch (error) { @@ -94,6 +98,12 @@ ); }; + const filterLikedPosts = () => { + filteredLikedPosts = likedPosts.filter((vote) => + vote.post.title.toLowerCase().includes(searchTerm.toLowerCase()), + ); + }; + const sortPosts = async (sort) => { const response = await fetchPosts(sort, userInfo._id); filteredPosts = response?.data?.posts; @@ -111,6 +121,18 @@ } }; + const sortLikedPosts = (sortType) => { + if (sortType === "newest") { + filteredLikedPosts = likedPosts + .filter((vote) => vote.post.title) + .sort((a, b) => new Date(b.created) - new Date(a.created)); + } else if (sortType === "oldest") { + filteredLikedPosts = likedPosts + .filter((vote) => vote.post.value) + .sort((a, b) => new Date(a.created) - new Date(b.created)); + } + }; + const handleInputChange = (searchQuery) => { searchTerm = searchQuery; filterPosts(); @@ -118,18 +140,24 @@ const handleSortChange = async (sortType) => { currentSort = sortType; - await sortComments(sortType); + sortComments(sortType); await sortPosts(sortType); + sortLikedPosts(sortPosts); }; const handleCategoryChange = (selectedCategory) => { activityType = selectedCategory; if (selectedCategory === ActivityType.ALL_CATEGORIES) { filteredPosts = posts; + filteredLikedPosts = likedPosts; } else { filteredPosts = posts.filter( (post) => post?.category?.name === selectedCategory, ); + + filteredLikedPosts = likedPosts.filter( + (vote) => vote.post.category?.name === selectedCategory, + ); } }; @@ -139,12 +167,19 @@ if (selectedStatus === ActivityStatusType.POST) { filteredPosts = posts; filteredComments = []; + filteredLikedPosts = []; } else if (selectedStatus === ActivityStatusType.COMMENT) { filteredPosts = []; + filteredLikedPosts = []; filteredComments = comments; + } else if (selectedStatus === ActivityStatusType.UPVOTED_POSTS) { + filteredPosts = []; + filteredComments = []; + filteredLikedPosts = likedPosts; } else { filteredPosts = posts; filteredComments = comments; + filteredLikedPosts = likedPosts; } }; @@ -228,6 +263,7 @@ data={[ { name: "Comment", id: ActivityStatusType.COMMENT }, { name: "Post", id: ActivityStatusType.POST }, + { name: "Upvoted Posts", id: ActivityStatusType.UPVOTED_POSTS }, { name: "All Activity", id: ActivityStatusType.ALL_ACTIVITY }, ]} onclick={(id = "") => { @@ -329,7 +365,7 @@ {/if}
- {#if comments.length > 0} + {#if filteredComments.length > 0}

Comments

    {#each filteredComments as comment} @@ -390,13 +426,54 @@ {/each}
- {:else} + + {/if} +
+ +
+ {#if filteredLikedPosts.length > 0} +

Upvoted Posts

+
    + {#each filteredLikedPosts as { post }} +
  • +
    +
    +
    ( + (id = post?.id), (isPostopen = true) + )} + > + {post?.title} +
    + +
    +
    +
    + {post?.status} +
    +
    +

    {post?.details}

    +
    + +
    +
    +
  • + {/each} +
{/if}
From 737cda98e5d5eb6b217cf4a5105897137e39f27f Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Fri, 13 Sep 2024 09:36:35 +0530 Subject: [PATCH 82/99] fix :fixed some general issues [#123] --- .../common/components/CommentCard.svelte | 37 +- .../layout/FeedbackPost.svelte | 388 ++++++++++-------- .../layout/FeedbackSection.svelte | 32 +- .../features/roadmap/layout/Roadmap.svelte | 6 +- 4 files changed, 258 insertions(+), 205 deletions(-) diff --git a/src/packages/@support/common/components/CommentCard.svelte b/src/packages/@support/common/components/CommentCard.svelte index dd1b9afaa..c049f3a4a 100644 --- a/src/packages/@support/common/components/CommentCard.svelte +++ b/src/packages/@support/common/components/CommentCard.svelte @@ -13,22 +13,26 @@ let parentID = comment?.id; - function timeAgo(createdTime) { - const now = new Date(); - const commentTime = new Date(createdTime); - const difference = now - commentTime; - const hours = Math.floor(difference / (1000 * 60 * 60)); // convert to hours - - if (hours < 1) { - return "less than an hour ago"; - } else if (hours === 1) { - return "1 hour ago"; - } else { - return `${hours} hours ago`; - } + + + const timeAgo = (date) => { + const diffInSeconds = (new Date() - new Date(date)) / 1000; + const minutes = Math.floor(diffInSeconds / 60); + const hours = Math.floor(minutes / 60); + const days = Math.floor(hours / 24); + + if (days >= 1) { + return `${days} day${days > 1 ? "s" : ""} ago`; + } else if (hours >= 1) { + return `${hours} hour${hours > 1 ? "s" : ""} ago`; + } else if (minutes >= 1) { + return `${minutes} minute${minutes > 1 ? "s" : ""} ago`; + } else { + const seconds = Math.floor(diffInSeconds); + return `${seconds} second${seconds > 1 ? "s" : ""} ago`; } +}; - const commentTime = timeAgo(comment.created); // Format the time in hours let isReplying = false; let commentValue = ""; @@ -37,6 +41,7 @@ }; +
- {commentTime} + { timeAgo(comment.created)} {#if !comment.parentID}

(isReplying = !isReplying)} @@ -65,7 +70,7 @@

{/if} {#if isAuthor} - Edit comment + {/if}
diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte index 1e6881937..4039952ec 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -24,6 +24,7 @@ export let onAddComment; export let fetchComments; export let postId; + export let handleUpvote; let post = []; let currentImage = ""; @@ -38,11 +39,17 @@ const timeAgo = (date) => { const diffInSeconds = (new Date() - new Date(date)) / 1000; - const hours = Math.floor(diffInSeconds / 3600); - - return hours >= 1 - ? `${hours} hour${hours > 1 ? "s" : ""} ago` - : `${Math.floor(diffInSeconds / 60)} minutes ago`; + const minutes = Math.floor(diffInSeconds / 60); + const hours = Math.floor(minutes / 60); + const days = Math.floor(hours / 24); + + if (days >= 1) { + return `${days} day${days > 1 ? "s" : ""} ago`; + } else if (hours >= 1) { + return `${hours} hour${hours > 1 ? "s" : ""} ago`; + } else { + return `${minutes} minute${minutes > 1 ? "s" : ""} ago`; + } }; let isImageOpen = false; @@ -73,17 +80,18 @@ }; onMount(async () => { + isLoading = true; const res = await onRetrievePost(postId); post = await res?.data; createdAt = timeAgo(post?.created); postImages = post?.imageURLs; comments = await fetchComments(postId); + isLoading = false; }); $: { if (comments) { nestedComments = nestComments(comments); - console.log("This is nested comments", nestedComments); } } @@ -97,8 +105,22 @@ .sort((a, b) => new Date(a.created) - new Date(b.created)); } - const handleSortChange = () => { - nestedComments = sortCommentsOldToNew(nestedComments); + function sortCommentsNewToOld(comments) { + if (!Array.isArray(comments)) { + console.error("Invalid comments data: expected an array."); + return []; + } + return comments + .slice() + .sort((a, b) => new Date(b.created) - new Date(a.created)); // Reversed comparison + } + + const handleSortChange = (id) => { + if (id == "new first") { + nestedComments = sortCommentsNewToOld(nestedComments); + } else { + nestedComments = sortCommentsOldToNew(nestedComments); + } }; @@ -108,6 +130,7 @@ class="back-button" on:click={() => { isPostopen = false; + handleUpvote(); }} > @@ -116,203 +139,208 @@ -
-
-
- {post?.title} - - {post?.status - ? post.status.charAt(0).toUpperCase() + post.status.slice(1) - : ""} -
- -
+ {#if isLoading} +
+ +
+ {:else} +
+
-
- -
- {post.author?.name} + {post?.title} + + {post?.status + ? post.status.charAt(0).toUpperCase() + post.status.slice(1) + : ""} +
+ +
+
+
+ +
+ {post.author?.name} +
-
-
- {post?.details} -
-
-
- {#each postImages as postImage} - { - isImageOpen = true; - currentImage = postImage; - }} - src={postImage} - alt="post image" - style="display:inline; height: 100px; margin-top: 20px; border-radius: 2px; margin:10px;" - /> - { - isImageOpen = flag; - }} - > +
+ {post?.details} +
+
+
+ {#each postImages as postImage} { + isImageOpen = true; + currentImage = postImage; + }} + src={postImage} alt="post image" - style="width:100%; height:100%;" + style="display:inline; height: 100px; margin-top: 20px; border-radius: 2px; margin:10px;" /> - - {/each} -
- -
- {createdAt} - | - +
-
-
- +
+ +
- -
- - -
- { - commentValue = e.target.value; - }} - bind:value={commentValue} - /> - -
- - -
- {#if nestedComments.length > 0} -
-
-
Activity Feed
- - { + type = id; + handleSortChange(id); + console.log("Test"); + }} + titleId={type} + placeholderText={"Sort By"} + zIndex={499} + disabled={false} + iconRequired={true} + icon={SortIcon} + borderType={"none"} + borderActiveType={"none"} + borderHighlight={"hover-active"} + headerHighlight={"hover-active"} + headerHeight={"26px"} + minBodyWidth={"150px"} + minHeaderWidth={"150px"} + maxHeaderWidth={"200px"} + borderRounded={"2px"} + headerTheme={"violet2"} + bodyTheme={"violet"} + menuItem={"v2"} + headerFontSize={"10px"} + isDropIconFilled={true} + position={"absolute"} /> - {/each} +
+ + +
+ {#each nestedComments as comment} + + {/each} +
-
- {:else} -

- No Comments Yet -

- {/if} -
+ {:else} +

+ No Comments Yet +

+ {/if} +
+ {/if}
{ + const handleUpvote = () => { getPosts(currentSort, searchTerm, status); }; @@ -101,6 +101,20 @@ isLoading = false; } }; + + /** + * Returns a color code based on the provided status. + * + * @param status - The current status of the product (e.g., "Under Review", "In Progress", "Planned"). + * @returns The corresponding color code. + */ + function getColor(status) { + if (status === "under review") return "white"; + if (status === "in progress") return "#DF77F9"; + if (status === "planned") return "#FFE47E"; + if(status ==="open") return "#00a86b"; + return "white"; + }
@@ -301,7 +315,17 @@
- {post?.status} + + {post?.status + ? post.status.charAt(0).toUpperCase() + + post.status.slice(1) + : ""} +
{/if}
@@ -401,10 +426,7 @@ .category { background-color: #171302; - color: #ffe47e; - opacity: 0.5; padding: 1px 4px; - border: 0.2px solid #ffe47e; border-radius: 4px; font-size: 12px; line-height: 16px; diff --git a/src/packages/@support/features/roadmap/layout/Roadmap.svelte b/src/packages/@support/features/roadmap/layout/Roadmap.svelte index ab5d36c56..4c0ff0294 100644 --- a/src/packages/@support/features/roadmap/layout/Roadmap.svelte +++ b/src/packages/@support/features/roadmap/layout/Roadmap.svelte @@ -111,7 +111,7 @@ type="text" id="search-input" class={`bg-transparent w-100 border-0 my-auto`} - placeholder="Search workspaces" + placeholder="Search Roadmap" on:input={(e) => { searchTerm = e.target.value; }} @@ -181,9 +181,7 @@ style="width:100%; background-color: var(--bg-secondary-800); overflow: hidden;" >
{status}
From 69c40b32d508741f875f0d2ee6e2061a2059e03a Mon Sep 17 00:00:00 2001 From: Astitva Patle Date: Fri, 13 Sep 2024 11:52:55 +0530 Subject: [PATCH 83/99] feat: added env in workflow [] --- .env.example | 3 ++- .github/workflows/development.yaml | 1 + .github/workflows/release.yaml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index de9b342df..b6dea432c 100644 --- a/.env.example +++ b/.env.example @@ -10,4 +10,5 @@ VITE_RELEASE_NOTES_PAT_TOKEN="" VITE_RELEASE_NOTES_API="https://api.github.com/repos/sparrowapp-dev/sparrow-app/releases" VITE_AZURE_CDN_URL= VITE_AZURE_INSIGHTS_CONNECTION_STRING= -VITE_BASE_URL= \ No newline at end of file +VITE_BASE_URL= +VITE_SPARROW_LINKEDIN= \ No newline at end of file diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 436d56d84..688854d05 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -22,6 +22,7 @@ env: VITE_CANNY_API: ${{ vars.VITE_CANNY_API }} VITE_CANNY_URL: ${{ vars.VITE_CANNY_URL }} VITE_BASE_URL: ${{ vars.VITE_BASE_URL }} + VITE_SPARROW_LINKEDIN: ${{ vars.VITE_SPARROW_LINKEDIN }} ACTIONS_ALLOW_UNSECURE_COMMANDS: true jobs: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 324b3286e..d87cf0e39 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,7 @@ env: VITE_CANNY_API: ${{ vars.VITE_CANNY_API }} VITE_CANNY_URL: ${{ vars.VITE_CANNY_URL }} VITE_BASE_URL: ${{ vars.VITE_BASE_URL }} + VITE_SPARROW_LINKEDIN: ${{ vars.VITE_SPARROW_LINKEDIN }} ACTIONS_ALLOW_UNSECURE_COMMANDS: true jobs: From aed056811a7b8a0698c3aa72ba36abb6d0cabad1 Mon Sep 17 00:00:00 2001 From: Astitva Patle Date: Fri, 13 Sep 2024 14:46:12 +0530 Subject: [PATCH 84/99] fix: solve some bugs [] --- src/packages/@app/pages/Help/HelpPage.svelte | 16 ++++++---------- .../add-feedback/layout/AddFeedback.svelte | 3 ++- .../layout/FeedbackDefault.svelte | 2 +- .../layout/FeedbackSection.svelte | 16 +++++++++++----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index 76b7d5682..ac1e98988 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -49,13 +49,13 @@ let isPostopenFromActivity = false; - let postId = ""; + let postId = ""; - function setPostId(tab, postID) { + function setPostId(tab, postID) { if (tab !== "faq") { isPostopenFromActivity = true; activeTab = tab; - postId = postID; + postId = postID; } } @@ -185,14 +185,9 @@ bind:isPostopenFromActivity /> {:else if activeTab === "updates"} - + {:else if activeTab === "roadmap"} - + {:else if activeTab === "community"} @@ -207,6 +202,7 @@
diff --git a/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte b/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte index 4daf4ea47..e3023ab81 100644 --- a/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte +++ b/src/packages/@support/features/add-feedback/layout/AddFeedback.svelte @@ -9,6 +9,7 @@ export let onAddFeedback; export let onInputFeedback; + export let selectId = ""; let type: FeedbackType = FeedbackType.CATEGORY; let feedbackDescription = ""; @@ -150,7 +151,7 @@ iconRequired={true} icon={CategoryIcon} placeholderText={"Category"} - id={"feeds"} + id={`feeds-${selectId}`} zIndex={499} titleId={type} onclick={(id = "") => { diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte index 3bc429542..953c0d34d 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackDefault.svelte @@ -27,6 +27,6 @@
- +
diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 310afeaca..184cfca67 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -86,6 +86,7 @@ }; const handleCategoryChange = async (selectedCategory) => { + // debugger; feedbackType = selectedCategory; if (selectedCategory === FeedbackType.ALL_CATEGORY) { @@ -95,9 +96,14 @@ // Fetch and filter posts by the selected category isLoading = true; const listPosts = await fetchPosts(currentSort, searchTerm, status); - posts = listPosts?.data?.posts.filter( - (post) => post?.category?.name === selectedCategory, - ); + // debugger; + console.log("list----", listPosts, selectedCategory); + posts = listPosts?.filter((post) => { + // debugger; + console.log("post", post?.category?.name); + return post?.category?.name === selectedCategory; + }); + console.log("postsss", posts); isLoading = false; } }; @@ -112,7 +118,7 @@ if (status === "under review") return "white"; if (status === "in progress") return "#DF77F9"; if (status === "planned") return "#FFE47E"; - if(status ==="open") return "#00a86b"; + if (status === "open") return "#00a86b"; return "white"; } @@ -131,7 +137,7 @@ type="text" id="search-input" class={`bg-transparent w-100 border-0 my-auto`} - placeholder="Search updates" + placeholder="Search Feedbacks" on:input={(e) => { handleInputChange(e.target.value); }} From 7cda9f87b22c4e01c935160434f36979e531a8cb Mon Sep 17 00:00:00 2001 From: Astitva Patle Date: Fri, 13 Sep 2024 14:47:27 +0530 Subject: [PATCH 85/99] fix: solve some bugs [] --- .../features/feedback-section/layout/FeedbackSection.svelte | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte index 184cfca67..d3893d942 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackSection.svelte @@ -96,14 +96,10 @@ // Fetch and filter posts by the selected category isLoading = true; const listPosts = await fetchPosts(currentSort, searchTerm, status); - // debugger; - console.log("list----", listPosts, selectedCategory); + posts = listPosts?.filter((post) => { - // debugger; - console.log("post", post?.category?.name); return post?.category?.name === selectedCategory; }); - console.log("postsss", posts); isLoading = false; } }; From c11592106f0f1657cbc9673dfe5c9904b6b6e877 Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Fri, 13 Sep 2024 15:41:22 +0530 Subject: [PATCH 86/99] Update settings.json --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7c1aebe3b..d0cfd9bd4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.minimap.enabled": false, "[javascript]": { - "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "svelte.enable-ts-plugin": true, "[typescript]": { From db5ecf08c2aa051fd434f2f95d32a89dc639275c Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Fri, 13 Sep 2024 15:43:10 +0530 Subject: [PATCH 87/99] Update settings.json --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d0cfd9bd4..62813c343 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,11 @@ { "editor.minimap.enabled": false, "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" }, "svelte.enable-ts-plugin": true, "[typescript]": { - "editor.defaultFormatter": "vscode.typescript-language-features" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescriptreact]": { "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" From 0d8aa0230918f148c3f9290f663e2dd4c80848cf Mon Sep 17 00:00:00 2001 From: anujnema5 Date: Fri, 13 Sep 2024 15:50:48 +0530 Subject: [PATCH 88/99] updatetoast page removed [#1453] --- src/packages/@app/pages/Help/HelpPage.svelte | 2 + .../layout/ActivitySection.svelte | 5 +- .../update-toast/layout/UpdateToast.svelte | 658 ------------------ 3 files changed, 5 insertions(+), 660 deletions(-) delete mode 100644 src/packages/@support/features/update-toast/layout/UpdateToast.svelte diff --git a/src/packages/@app/pages/Help/HelpPage.svelte b/src/packages/@app/pages/Help/HelpPage.svelte index 5576564b1..dce40b253 100644 --- a/src/packages/@app/pages/Help/HelpPage.svelte +++ b/src/packages/@app/pages/Help/HelpPage.svelte @@ -39,6 +39,8 @@ } function setActiveTabFromActivity(tab, postID) { + console.log(tab, postID); + if (tab !== "faq") { // Disable FAQ tab isPostopenFromActivity = true; diff --git a/src/packages/@support/features/activity-section/layout/ActivitySection.svelte b/src/packages/@support/features/activity-section/layout/ActivitySection.svelte index 23f5a5c0f..f53fbd3fe 100644 --- a/src/packages/@support/features/activity-section/layout/ActivitySection.svelte +++ b/src/packages/@support/features/activity-section/layout/ActivitySection.svelte @@ -370,10 +370,11 @@ {#if isHovering === comment.id} ( - ((id = comment?.post?.id), (isPostopen = true)), + ((postId = comment?.post?.id), + (isPostopen = true)), setActiveTabFromActivity( "feedback", - comment.post?.id, + comment?.post?.id, ) )} class="go-to-post" diff --git a/src/packages/@support/features/update-toast/layout/UpdateToast.svelte b/src/packages/@support/features/update-toast/layout/UpdateToast.svelte deleted file mode 100644 index fcacf72b6..000000000 --- a/src/packages/@support/features/update-toast/layout/UpdateToast.svelte +++ /dev/null @@ -1,658 +0,0 @@ - - -
-
-
My Activity
-

- Find all your posts, comments, and likes in one place and easily keep - track of them. -

-
-
- -
- -
-
- - {#if !isPostopen} -
- -
-

Posts

- - {#if posts.length > 0} -
    - {#each posts as post} -
  • - -
    -
    -
    ((id = post?.id), (isPostopen = true))} - > - {post?.title} -
    - -
    -
    -
    - {post?.status} -
    -
    -

    {post?.details}

    -
    - -
    -
    -
  • - {/each} -
- {:else} -

No posts available at the moment.

- {/if} - -
- -
-

Comments

- {#if comments.length > 0} -
    - {#each comments as comment} -
  • (isHovering = comment.id)} - on:mouseleave={() => (isHovering = null)} - > - -
    -
    -
    -
    {comment.author.name}
    -
    {comment.value}
    -
    - - {#if isHovering === comment.id} - ( - ((id = comment?.post?.id), (isPostopen = true)), - setActiveTabFromActivity( - "feedback", - comment.post?.id, - ) - )} - class="go-to-post" - style="font-size: 12px; letter-spacing: 0.25px; font-weight: 400;" - >Go to post ↗ - {/if} -
    - -
    -
    - - {timeAgo(comment.created)} - - Reply - Edit comment -
    -
    - - -
    -
    -
    -
  • - {/each} -
- {:else} -

- No comments available at the moment. -

- {/if} -
- -
-
-

- Posts you liked -

- - {#if posts.length > 0} -
    - {#each posts as post} -
  • - -
    -
    -
    ((id = post?.id), (isPostopen = true))} - > - {post?.title} -
    - -
    -
    -
    - {post?.status} -
    -
    -

    {post?.details}

    -
    - -
    -
    -
  • - {/each} -
- {:else} -

No posts available at the moment.

- {/if} -
-
-
- {/if} - - {#if isPostopen} - - {/if} -
- - From 99985018497634a702229485bee734ae6356eb74 Mon Sep 17 00:00:00 2001 From: Md Asif Raza Date: Fri, 13 Sep 2024 15:53:14 +0530 Subject: [PATCH 89/99] Update Spinner.svelte --- src/packages/@library/ui/spinner/Spinner.svelte | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/packages/@library/ui/spinner/Spinner.svelte b/src/packages/@library/ui/spinner/Spinner.svelte index bca9ea345..9a92b3c8c 100644 --- a/src/packages/@library/ui/spinner/Spinner.svelte +++ b/src/packages/@library/ui/spinner/Spinner.svelte @@ -28,9 +28,4 @@ transform: rotate(360deg); } } - - .small { - width: 50px; - height: 50px; - } From a5092fd0cfe00f0b8f180d954b17d2264bdfbd14 Mon Sep 17 00:00:00 2001 From: Astitva Patle Date: Fri, 13 Sep 2024 16:00:54 +0530 Subject: [PATCH 90/99] fix: solve some bugs [] --- .../features/feedback-section/layout/FeedbackPost.svelte | 4 ++-- .../features/feedback-section/layout/FeedbackSection.svelte | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte index 4039952ec..2f07a1199 100644 --- a/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte +++ b/src/packages/@support/features/feedback-section/layout/FeedbackPost.svelte @@ -250,11 +250,11 @@ />
- + /> -->