PromucFlow_constructor/app/client/src/constants/DocumentationLinks.ts
Ankita Kinger 6244e28fed
chore: Update analytics to pass the correct source information in identify user call (#32591)
## Description

Updating analytics to pass the correct source information

Fixes [#32266](https://github.com/appsmithorg/appsmith/issues/32266)

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8750877755>
> Commit: 6fedefebd3867aee79877b7ed105c90888005cfd
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8750877755&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->
2024-04-19 15:06:50 +05:30

32 lines
1.1 KiB
TypeScript

import AnalyticsUtil from "@appsmith/utils/AnalyticsUtil";
export enum DocsLink {
CAPTURE_DATA = "CAPTURE_DATA",
WHITELIST_IP = "WHITELIST_IP",
CONNECT_DATA = "CONNECT_DATA",
QUERY = "QUERY",
TROUBLESHOOT_ERROR = "TROUBLESHOOT_ERROR",
}
const LinkData: Record<DocsLink, string> = {
CONNECT_DATA:
"https://docs.appsmith.com/core-concepts/connecting-to-data-sources",
QUERY:
"https://docs.appsmith.com/core-concepts/connecting-to-data-sources#docusaurus_skipToContent_fallback",
WHITELIST_IP:
"https://docs.appsmith.com/core-concepts/connecting-to-data-sources/connecting-to-databases",
CAPTURE_DATA:
"https://docs.appsmith.com/core-concepts/data-access-and-binding/capturing-data-write",
TROUBLESHOOT_ERROR:
"https://docs.appsmith.com/help-and-support/troubleshooting-guide",
};
export const openDoc = (type: DocsLink, link?: string, subType?: string) => {
let linkToOpen = LinkData[type];
if (link && link.length) {
linkToOpen = link;
}
AnalyticsUtil.logEvent("OPEN_DOCS", { source: type, queryType: subType });
window.open(linkToOpen, "_blank");
};