Skip to content

Commit aae3375

Browse files
committed
feat: DocLink - add startIcon prop and update fullWidth default value; adjust type definitions for better flexibility
1 parent dc308fd commit aae3375

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

src/Shared/Components/DocLink/DocLink.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ export const DocLink = <T extends boolean = false>({
1212
docLinkKey,
1313
text = 'Learn more',
1414
dataTestId,
15+
startIcon,
1516
showExternalIcon,
1617
onClick,
1718
fontWeight,
1819
size = ComponentSizeType.medium,
1920
variant = ButtonVariantType.text,
2021
isExternalLink,
2122
openInNewTab = false,
22-
fullWidth = true,
23+
fullWidth = false,
2324
}: DocLinkProps<T>) => {
2425
// HOOKS
2526
const { isEnterprise, setSidePanelConfig } = useMainContext()
@@ -51,6 +52,7 @@ export const DocLink = <T extends boolean = false>({
5152
text={text}
5253
variant={variant}
5354
size={size}
55+
startIcon={startIcon}
5456
endIcon={showExternalIcon && <Icon name="ic-open-in-new" color={null} />}
5557
fullWidth={fullWidth}
5658
fontWeight={fontWeight}

src/Shared/Components/DocLink/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const DOCUMENTATION = {
1616
APP_METRICS: 'usage/applications/app-details/app-metrics',
1717
APP_OVERVIEW_TAGS: 'usage/applications/overview#manage-tags',
1818
APP_ROLLOUT_DEPLOYMENT_TEMPLATE: 'usage/applications/creating-application/deployment-template/rollout-deployment',
19-
BUILD_STAGE: 'usage/applications/creating-application/ci-pipeline#build-stage',
19+
BUILD_STAGE: 'usage/applications/creating-application/workflow/ci-pipeline#build-stage',
2020
APP_TAGS: 'usage/applications/create-application#tags',
2121
BLOB_STORAGE: 'configurations-overview/installation-configuration#configuration-of-blob-storage',
2222
BULK_UPDATE: 'usage/bulk-update',
@@ -45,7 +45,7 @@ export const DOCUMENTATION = {
4545
GLOBAL_CONFIG_CHART: 'getting-started/global-configurations/chart-repo',
4646
GLOBAL_CONFIG_CLUSTER: 'getting-started/global-configurations/cluster-and-environments',
4747
GLOBAL_CONFIG_CUSTOM_CHART: 'getting-started/global-configurations/custom-charts',
48-
GLOBAL_CONFIG_CUSTOM_CHART_PRE_REQUISITES: 'getting-started/global-configurations/custom-charts#prerequisites',
48+
GLOBAL_CONFIG_CUSTOM_CHART_PRE_REQUISITES: 'global-configurations/deployment-charts#preparing-a-deployment-chart',
4949
GLOBAL_CONFIG_DOCKER: 'getting-started/global-configurations/container-registries',
5050
GLOBAL_CONFIG_GIT: 'getting-started/global-configurations/git-accounts',
5151
GLOBAL_CONFIG_GITOPS: 'global-configurations/gitops',

src/Shared/Components/DocLink/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export type BaseDocLink<T extends boolean> = {
1010
docLinkKey: T extends true ? string : keyof typeof DOCUMENTATION
1111
}
1212

13-
export type DocLinkProps<T extends boolean> = Pick<
13+
export type DocLinkProps<T extends boolean = false> = Pick<
1414
ButtonProps<ButtonComponentType.anchor>,
15-
'dataTestId' | 'size' | 'variant' | 'fullWidth' | 'fontWeight'
15+
'dataTestId' | 'size' | 'variant' | 'fullWidth' | 'fontWeight' | 'startIcon'
1616
> &
1717
Omit<BaseDocLink<T>, 'isEnterprise'> & {
1818
text?: string

src/Shared/Components/FeatureDescription/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { DocLinkProps } from '../DocLink'
2222

2323
interface BaseFeatureDescriptionModalProps {
2424
renderDescriptionContent?: () => ReactNode
25-
docLink?: DocLinkProps<false>['docLinkKey']
25+
docLink?: DocLinkProps['docLinkKey']
2626
imageVariant?: ImageType
2727
SVGImage?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
2828
imageStyles?: React.CSSProperties

src/Shared/Components/ModalSidebarPanel/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ export interface ModalSidebarPanelProps {
2323
heading: string | null
2424
icon?: JSX.Element
2525
children?: ReactNode
26-
documentationLink: DocLinkProps<false>['docLinkKey']
26+
documentationLink: DocLinkProps['docLinkKey']
2727
}

0 commit comments

Comments
 (0)