From 135edce07160c76e8097b0071e73a4d83f8aea2f Mon Sep 17 00:00:00 2001 From: shivani170 Date: Wed, 14 May 2025 16:45:47 +0530 Subject: [PATCH 01/28] chore: doc link component added --- src/Common/Constants.ts | 14 +++++++------- .../CustomTagSelector/PropagateTagInfo.tsx | 3 ++- src/Common/DocLink/DocLink.tsx | 19 +++++++++++++++++++ src/Common/DocLink/index.ts | 1 + src/Common/DocLink/types.ts | 6 ++++++ src/Common/index.ts | 1 + .../DTApplicationMetricsFormField.tsx | 3 ++- .../BuildInfra/Descriptor.tsx | 3 ++- .../Components/CICDHistory/Artifacts.tsx | 12 +++++++++--- .../Components/CICDHistory/LogsRenderer.tsx | 15 +++++++-------- .../Components/License/License.components.tsx | 3 ++- 11 files changed, 58 insertions(+), 22 deletions(-) create mode 100644 src/Common/DocLink/DocLink.tsx create mode 100644 src/Common/DocLink/index.ts create mode 100644 src/Common/DocLink/types.ts diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 49ce89f06..84f5180b5 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -23,13 +23,13 @@ export const DOCUMENTATION_VERSION = '/v/v0.7' export const DISCORD_LINK = 'https://discord.devtron.ai/' export const DEFAULT_JSON_SCHEMA_URI = 'https://json-schema.org/draft/2020-12/schema' export const DOCUMENTATION = { - APP_METRICS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/app-details/app-metrics`, - APP_TAGS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/create-application#tags`, - APP_OVERVIEW_TAGS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/overview#manage-tags`, - BLOB_STORAGE: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/getting-started/install/installation-configuration#configuration-of-blob-storage`, - GLOBAL_CONFIG_BUILD_INFRA: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/global-configurations/build-infra`, - ENTERPRISE_LICENSE: `${DOCUMENTATION_HOME_PAGE}/enterprise-license`, - KUBE_CONFIG: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/resource-browser#running-kubectl-commands-locally`, + APP_METRICS: `usage/applications/app-details/app-metrics`, + APP_TAGS: `usage/applications/create-application#tags`, + APP_OVERVIEW_TAGS: `usage/applications/overview#manage-tags`, + BLOB_STORAGE: `getting-started/install/installation-configuration#configuration-of-blob-storage`, + GLOBAL_CONFIG_BUILD_INFRA: `global-configurations/build-infra`, + ENTERPRISE_LICENSE: `enterprise-license`, + KUBE_CONFIG: `usage/resource-browser#running-kubectl-commands-locally`, TENANT_INSTALLATION: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/software-distribution-hub/tenants`, } diff --git a/src/Common/CustomTagSelector/PropagateTagInfo.tsx b/src/Common/CustomTagSelector/PropagateTagInfo.tsx index e15f2d119..d01485e5e 100644 --- a/src/Common/CustomTagSelector/PropagateTagInfo.tsx +++ b/src/Common/CustomTagSelector/PropagateTagInfo.tsx @@ -20,6 +20,7 @@ import { ReactComponent as ICHelpOutline } from '../../Assets/Icon/ic-help-outli import { TippyCustomized } from '../TippyCustomized' import { TippyTheme } from '../Types' import { DOCUMENTATION } from '../Constants' +import { getDocumentationUrl } from '@Common/DocLink' export default function PropagateTagInfo({ isCreateApp }: { isCreateApp: boolean }) { const additionalInfo = () => ( @@ -47,7 +48,7 @@ export default function PropagateTagInfo({ isCreateApp }: { isCreateApp: boolean showCloseButton trigger="click" interactive - documentationLink={isCreateApp ? DOCUMENTATION.APP_TAGS : DOCUMENTATION.APP_OVERVIEW_TAGS} + documentationLink={isCreateApp ? getDocumentationUrl(DOCUMENTATION.APP_TAGS) : getDocumentationUrl(DOCUMENTATION.APP_OVERVIEW_TAGS)} documentationLinkText="View Documentation" >
diff --git a/src/Common/DocLink/DocLink.tsx b/src/Common/DocLink/DocLink.tsx new file mode 100644 index 000000000..9c7367ac3 --- /dev/null +++ b/src/Common/DocLink/DocLink.tsx @@ -0,0 +1,19 @@ +import { DOCUMENTATION_HOME_PAGE, DOCUMENTATION_VERSION } from '..' +import { DocLinkProps } from './types' + +export const appendUtmToUrl = (docLink: string) => `${docLink}?utm_source=product` + +export const getDocumentationUrl = (docLink: string) => + `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/${appendUtmToUrl(docLink)}` + +export const DocLink = ({ docLink, docLinkText = 'Learn more', dataTestId, className = 'dc__link' }: DocLinkProps) => ( + + {docLinkText} + +) diff --git a/src/Common/DocLink/index.ts b/src/Common/DocLink/index.ts new file mode 100644 index 000000000..996744a4c --- /dev/null +++ b/src/Common/DocLink/index.ts @@ -0,0 +1 @@ +export { DocLink, getDocumentationUrl } from './DocLink' diff --git a/src/Common/DocLink/types.ts b/src/Common/DocLink/types.ts new file mode 100644 index 000000000..dfd29ec27 --- /dev/null +++ b/src/Common/DocLink/types.ts @@ -0,0 +1,6 @@ +export interface DocLinkProps { + docLink: string + dataTestId: string + docLinkText?: string + className?: string +} diff --git a/src/Common/index.ts b/src/Common/index.ts index dc619f806..17f049562 100644 --- a/src/Common/index.ts +++ b/src/Common/index.ts @@ -30,6 +30,7 @@ export * from './DeleteCINodeButton' export { default as DevtronCopyright } from './DevtronCopyright' export * from './DevtronProgressing' export * from './Dialogs' +export * from './DocLink' export * from './DraggableWrapper' export * from './Drawer' export * from './EmptyState' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx index 4ca82f852..23f28d353 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx @@ -17,6 +17,7 @@ import { ReactComponent as ICInfoFilledOverride } from '@Icons/ic-info-filled-override.svg' import { Checkbox } from '@Common/Checkbox' import { DOCUMENTATION } from '@Common/Constants' +import { getDocumentationUrl } from '@Common/DocLink' import { Progressing } from '@Common/Progressing' import { Tooltip } from '@Common/Tooltip' import { CHECKBOX_VALUE } from '@Common/Types' @@ -96,7 +97,7 @@ const DTApplicationMetricsFormField = ({ diff --git a/src/Shared/Components/CICDHistory/Artifacts.tsx b/src/Shared/Components/CICDHistory/Artifacts.tsx index 9e4f2beda..40a2339b2 100644 --- a/src/Shared/Components/CICDHistory/Artifacts.tsx +++ b/src/Shared/Components/CICDHistory/Artifacts.tsx @@ -24,6 +24,7 @@ import folder from '@Icons/ic-folder.svg' import { ReactComponent as ICHelpOutline } from '@Icons/ic-help.svg' import { ReactComponent as MechanicalOperation } from '@Icons/ic-mechanical-operation.svg' import noartifact from '@Images/no-artifact.webp' +import { DocLink } from '@Common/DocLink' import { getIsApprovalPolicyConfigured } from '@Shared/Helpers' import { useDownload } from '@Shared/Hooks' @@ -274,14 +275,19 @@ const Artifacts = ({ {EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.StoreFiles} - {EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.ConfigureBlobStorage} - + */} +
diff --git a/src/Shared/Components/CICDHistory/LogsRenderer.tsx b/src/Shared/Components/CICDHistory/LogsRenderer.tsx index 3ef941bb6..fd09d0ff2 100644 --- a/src/Shared/Components/CICDHistory/LogsRenderer.tsx +++ b/src/Shared/Components/CICDHistory/LogsRenderer.tsx @@ -22,6 +22,7 @@ import DOMPurify from 'dompurify' import { ReactComponent as ICArrow } from '@Icons/ic-caret-down.svg' import { ReactComponent as ICCollapseAll } from '@Icons/ic-collapse-all.svg' import { ReactComponent as ICExpandAll } from '@Icons/ic-expand-all.svg' +import { DocLink } from '@Common/DocLink' import { ANSI_UP_REGEX, ComponentSizeType } from '@Shared/constants' import { escapeRegExp, sanitizeTargetPlatforms } from '@Shared/Helpers' import { AppThemeType, getComponentSpecificThemeClass } from '@Shared/Providers' @@ -82,14 +83,12 @@ const renderBlobNotConfigured = (): JSX.Element => (
Want to store logs to view later? - - Configure blob storage - + +
diff --git a/src/Shared/Components/License/License.components.tsx b/src/Shared/Components/License/License.components.tsx index df879988a..1306acce0 100644 --- a/src/Shared/Components/License/License.components.tsx +++ b/src/Shared/Components/License/License.components.tsx @@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from 'react' import { ReactComponent as ICCheck } from '@Icons/ic-check.svg' import { ReactComponent as ICClipboard } from '@Icons/ic-copy.svg' import { DOCUMENTATION } from '@Common/Constants' +import { getDocumentationUrl } from '@Common/DocLink' import { ClipboardButton, copyToClipboard, showError } from '@Common/index' import { Backdrop, Button, ButtonStyleType, ButtonVariantType, Icon, InfoIconTippy, QRCode } from '..' @@ -90,7 +91,7 @@ const InstallationFingerprintInfo = ({ fingerprint, showHelpTooltip = false }: I documentationLinkText="Documentation" iconClassName="icon-dim-20 fcn-6" placement="right" - documentationLink={DOCUMENTATION.ENTERPRISE_LICENSE} + documentationLink={getDocumentationUrl(DOCUMENTATION.ENTERPRISE_LICENSE)} /> )} From 82a037e45ce632b301186a4662305b994b214d51 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Thu, 15 May 2025 03:03:09 +0530 Subject: [PATCH 02/28] chore: added doc link in tippy customoze --- src/Common/DocLink/DocLink.tsx | 28 ++++++++++++++++++---------- src/Common/DocLink/types.ts | 6 ++++-- src/Common/TippyCustomized.tsx | 19 ++++++++----------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/Common/DocLink/DocLink.tsx b/src/Common/DocLink/DocLink.tsx index 9c7367ac3..ad134cfc8 100644 --- a/src/Common/DocLink/DocLink.tsx +++ b/src/Common/DocLink/DocLink.tsx @@ -1,3 +1,6 @@ +import { Button, ButtonComponentType, ButtonVariantType, Icon } from '@Shared/Components' +import { ComponentSizeType } from '@Shared/constants' + import { DOCUMENTATION_HOME_PAGE, DOCUMENTATION_VERSION } from '..' import { DocLinkProps } from './types' @@ -6,14 +9,19 @@ export const appendUtmToUrl = (docLink: string) => `${docLink}?utm_source=produc export const getDocumentationUrl = (docLink: string) => `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/${appendUtmToUrl(docLink)}` -export const DocLink = ({ docLink, docLinkText = 'Learn more', dataTestId, className = 'dc__link' }: DocLinkProps) => ( - - {docLinkText} - +export const DocLink = ({ docLink, docLinkText = 'Learn more', dataTestId, showEndIcon, onClick }: DocLinkProps) => ( +