From edad967b0bf07ccedefd8518843abb25c8964a2f Mon Sep 17 00:00:00 2001 From: Augusto Moura Date: Tue, 9 Jan 2024 11:48:39 -0300 Subject: [PATCH] [FX-4483] Add Jira tickets for deprecated functionality (#4077) * Add placeholder for JIRA tickets * Add Jira tickets for deprecations --- jest.spec.mjs | 2 +- packages/picasso-forms/src/index.ts | 2 +- .../picasso-provider/src/Picasso/config/spacings.ts | 6 ++++-- .../src/RichTextEditor/RichTextEditor.tsx | 3 ++- packages/picasso/src/Autocomplete/Autocomplete.tsx | 3 ++- packages/picasso/src/Autocomplete/index.ts | 2 +- packages/picasso/src/Checkbox/index.ts | 2 +- packages/picasso/src/DatePicker/DatePicker.tsx | 3 ++- packages/picasso/src/Dropdown/Dropdown.tsx | 10 +++++----- packages/picasso/src/Dropzone/Dropzone.tsx | 3 ++- packages/picasso/src/FileInput/index.ts | 2 +- packages/picasso/src/Form/index.ts | 2 +- packages/picasso/src/Input/Input.tsx | 3 ++- packages/picasso/src/Input/index.ts | 2 +- packages/picasso/src/ListItem/ListItem.tsx | 5 ++++- packages/picasso/src/NumberInput/NumberInput.tsx | 1 + packages/picasso/src/OutlinedInput/OutlinedInput.tsx | 3 ++- packages/picasso/src/PasswordInput/PasswordInput.tsx | 1 + packages/picasso/src/Radio/index.ts | 2 +- packages/picasso/src/RadioGroup/index.ts | 2 +- packages/picasso/src/Select/Select.tsx | 1 + packages/picasso/src/SelectBase/types.ts | 2 +- packages/picasso/src/Switch/index.ts | 2 +- packages/picasso/src/TagSelector/TagSelector.tsx | 3 ++- .../src/TagSelectorInput/TagSelectorInput.tsx | 1 + packages/picasso/src/TimePicker/TimePicker.tsx | 1 + packages/picasso/src/Tooltip/index.ts | 2 +- packages/picasso/src/TreeView/TreeView.tsx | 12 ++++++++++-- packages/picasso/src/utils/kebab-to-camel-case.ts | 2 +- 29 files changed, 55 insertions(+), 30 deletions(-) diff --git a/jest.spec.mjs b/jest.spec.mjs index 6cd4bdc522..b65318715a 100644 --- a/jest.spec.mjs +++ b/jest.spec.mjs @@ -28,7 +28,7 @@ const config = { 'node_modules/(?!@toptal|@topkit|d3|internmap|robust-predicates|delaunator)', ], coverageReporters: ['json', 'text-summary'], - // @TODO This option does not work due to bug in davinci-qa https://toptal-core.atlassian.net/browse/FX-4311 + // TODO: This option does not work due to bug in davinci-qa https://toptal-core.atlassian.net/browse/FX-4311 // collectCoverageFrom: ['packages/**/*.{ts,tsx}'], } diff --git a/packages/picasso-forms/src/index.ts b/packages/picasso-forms/src/index.ts index c6216e6ae3..f9e327c5e7 100644 --- a/packages/picasso-forms/src/index.ts +++ b/packages/picasso-forms/src/index.ts @@ -41,7 +41,7 @@ export { export { FieldRequirements } from '@toptal/picasso' // Picasso Forms exports -/** @deprecated Use FormNonCompound instead for better tree-shaking */ +/** @deprecated [FX-4712] Use FormNonCompound instead for better tree-shaking */ export { FormCompound as Form } from './FormCompound' export { Form as FormNonCompound } from './Form' diff --git a/packages/picasso-provider/src/Picasso/config/spacings.ts b/packages/picasso-provider/src/Picasso/config/spacings.ts index 95695130da..9428b0d0ed 100644 --- a/packages/picasso-provider/src/Picasso/config/spacings.ts +++ b/packages/picasso-provider/src/Picasso/config/spacings.ts @@ -13,7 +13,9 @@ export type Sizes = export type SizeType = T -/** @deprecated **/ +/** + * @deprecated [FX-4438] Use {@link PicassoSpacing} or {@link ResponsiveSpacingType} instead + **/ export type DeprecatedSpacingType = | number | SizeType<'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'> @@ -51,7 +53,7 @@ class PicassoSpacing { } /** - * @deprecated Use "index" property directly + * @deprecated [FX-4713] Use "baseTokenIndex" property directly */ indexOf(): number { return this.baseTokenIndex diff --git a/packages/picasso-rich-text-editor/src/RichTextEditor/RichTextEditor.tsx b/packages/picasso-rich-text-editor/src/RichTextEditor/RichTextEditor.tsx index 747ad8bdd1..f9c298cf33 100644 --- a/packages/picasso-rich-text-editor/src/RichTextEditor/RichTextEditor.tsx +++ b/packages/picasso-rich-text-editor/src/RichTextEditor/RichTextEditor.tsx @@ -31,7 +31,7 @@ export interface Props extends BaseProps { /** unique identifier */ id: string /** - * @deprecated Use the `status` prop instead to both support success and error states + * @deprecated [FX-4715] Use the `status` prop instead to support success and error states * Indicate whether `RichTextEditor` is in error state */ error?: boolean @@ -124,6 +124,7 @@ export const RichTextEditor = forwardRef( const classes = useStyles() const wrapperRef = useRef(null) + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/Autocomplete/Autocomplete.tsx b/packages/picasso/src/Autocomplete/Autocomplete.tsx index 314be5ae66..a0eed78661 100644 --- a/packages/picasso/src/Autocomplete/Autocomplete.tsx +++ b/packages/picasso/src/Autocomplete/Autocomplete.tsx @@ -93,7 +93,7 @@ export interface Props /** ReactNode for labels that will be used as end InputAdornment - */ endAdornment?: ReactNode /** - * @deprecated Use the `status` prop instead to both support success and error states + * @deprecated [FX-4715] Use the `status` prop instead to both support success and error states * Indicate whether `Autocomplete` is in error state */ error?: boolean @@ -195,6 +195,7 @@ export const Autocomplete = forwardRef( ) } + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/Autocomplete/index.ts b/packages/picasso/src/Autocomplete/index.ts index 403c6ddcf5..a4d3bbb6d6 100644 --- a/packages/picasso/src/Autocomplete/index.ts +++ b/packages/picasso/src/Autocomplete/index.ts @@ -4,5 +4,5 @@ import type { Props as OuterProps } from './Autocomplete' export { default } from './Autocomplete' export * from './types' export type AutocompleteProps = OmitInternalProps -/** @deprecated Use AutocompleteProps instead */ +/** @deprecated [FX-4714] Use AutocompleteProps instead */ export type Props = AutocompleteProps diff --git a/packages/picasso/src/Checkbox/index.ts b/packages/picasso/src/Checkbox/index.ts index 69d277f8eb..db68487382 100644 --- a/packages/picasso/src/Checkbox/index.ts +++ b/packages/picasso/src/Checkbox/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalCheckboxProps } from './Checkbox' export { default } from './Checkbox' export type CheckboxProps = OmitInternalProps -/** @deprecated Use CheckboxProps instead */ +/** @deprecated [FX-4714] Use CheckboxProps instead */ export type Props = CheckboxProps diff --git a/packages/picasso/src/DatePicker/DatePicker.tsx b/packages/picasso/src/DatePicker/DatePicker.tsx index bc61716208..027efdeb3b 100644 --- a/packages/picasso/src/DatePicker/DatePicker.tsx +++ b/packages/picasso/src/DatePicker/DatePicker.tsx @@ -85,7 +85,7 @@ export interface Props /** Specify a value if want to enable browser autofill */ autoComplete?: string /** - * @deprecated Use the `status` prop instead to both support success and error states + * @deprecated [FX-4715] Use the `status` prop instead to both support success and error states * Indicate whether `DatePicker` is in error state */ error?: boolean @@ -154,6 +154,7 @@ export const DatePicker = (props: Props) => { } = props const classes = useStyles() + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/Dropdown/Dropdown.tsx b/packages/picasso/src/Dropdown/Dropdown.tsx index 43db30094d..c34dffc54c 100644 --- a/packages/picasso/src/Dropdown/Dropdown.tsx +++ b/packages/picasso/src/Dropdown/Dropdown.tsx @@ -63,15 +63,15 @@ type PropsWithBaseSpacing = InternalProps & { type PropsWithDeprecatedSpacing = InternalProps & { /** Offset of content element relative to anchor element */ - /** @deprecated */ + /** @deprecated [FX-4438] use {@link @toptal/picasso-provider#PicassoSpacing} instead */ offset?: { - /** @deprecated */ + /** @deprecated [FX-4438] */ top?: DeprecatedSpacingType - /** @deprecated */ + /** @deprecated [FX-4438] */ bottom?: DeprecatedSpacingType - /** @deprecated */ + /** @deprecated [FX-4438] */ left?: DeprecatedSpacingType - /** @deprecated */ + /** @deprecated [FX-4438] */ right?: DeprecatedSpacingType } } diff --git a/packages/picasso/src/Dropzone/Dropzone.tsx b/packages/picasso/src/Dropzone/Dropzone.tsx index 77ad6143a3..e8ba7a3445 100644 --- a/packages/picasso/src/Dropzone/Dropzone.tsx +++ b/packages/picasso/src/Dropzone/Dropzone.tsx @@ -45,7 +45,7 @@ export interface Props extends BaseProps { /** Value uses the File interface. */ value?: FileUpload[] /** - * @deprecated **Use value[n].error instead.** + * @deprecated [FX-4715] Use value[n].error instead. * Provide reasons why files couldn't be dropped into dropzone */ errorMessages?: string[] @@ -101,6 +101,7 @@ export const Dropzone = forwardRef(function Dropzone( const classes = useStyles() + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'errorMessages', diff --git a/packages/picasso/src/FileInput/index.ts b/packages/picasso/src/FileInput/index.ts index e6807272c2..f1af65e872 100644 --- a/packages/picasso/src/FileInput/index.ts +++ b/packages/picasso/src/FileInput/index.ts @@ -4,5 +4,5 @@ import type { Props as InternalFileInputProps } from './FileInput' export { default } from './FileInput' export * from './types' export type FileInputProps = OmitInternalProps -/** @deprecated Use FileInputProps instead */ +/** @deprecated [FX-4714] Use FileInputProps instead */ export type Props = FileInputProps diff --git a/packages/picasso/src/Form/index.ts b/packages/picasso/src/Form/index.ts index 0e050b4507..33a6e4ef76 100644 --- a/packages/picasso/src/Form/index.ts +++ b/packages/picasso/src/Form/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalFormProps } from './Form' export { default } from './Form' export type FormProps = OmitInternalProps -/** @deprecated Use FormProps instead */ +/** @deprecated [FX-4714] Use FormProps instead */ export type Props = FormProps diff --git a/packages/picasso/src/Input/Input.tsx b/packages/picasso/src/Input/Input.tsx index 4157f016fb..6e8643f1d3 100644 --- a/packages/picasso/src/Input/Input.tsx +++ b/packages/picasso/src/Input/Input.tsx @@ -40,7 +40,7 @@ export interface Props /** Placeholder for value */ placeholder?: string /** - * @deprecated Use the `status` prop instead to both support success and error states + * @deprecated [FX-4715] Use the `status` prop instead to both support success and error states * Indicate whether `Input` is in error state */ error?: boolean @@ -277,6 +277,7 @@ export const Input = forwardRef(function Input( ...rest } = purifyProps(props) + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/Input/index.ts b/packages/picasso/src/Input/index.ts index 71d015cfca..be92e271d0 100644 --- a/packages/picasso/src/Input/index.ts +++ b/packages/picasso/src/Input/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalInputProps } from './Input' export { default } from './Input' export type InputProps = OmitInternalProps -/** @deprecated Use InputProps instead */ +/** @deprecated [FX-4714] Use InputProps instead */ export type Props = InputProps diff --git a/packages/picasso/src/ListItem/ListItem.tsx b/packages/picasso/src/ListItem/ListItem.tsx index 54c4b1aa53..b2912967ba 100644 --- a/packages/picasso/src/ListItem/ListItem.tsx +++ b/packages/picasso/src/ListItem/ListItem.tsx @@ -17,7 +17,9 @@ export type Props = BaseProps & { children: ReactNode variant?: 'ordered' | 'unordered' index?: number - /** @deprecated if you need a custom icon that is not available on the prop `type`, please contact the BASE team to add it to the theme */ + /** + * @deprecated [FX-4717] if you need a custom icon that is not available on the prop `type`, please contact the BASE team to add it to the theme + **/ icon?: ReactNode /** Style of the bullet/ordinal */ type?: ListItemType @@ -48,6 +50,7 @@ export const ListItem = (props: Props) => { 'data-testid': testId, } = props + // TODO: [FX-4717] usePropDeprecationWarning({ props, componentName: ListItem.name, diff --git a/packages/picasso/src/NumberInput/NumberInput.tsx b/packages/picasso/src/NumberInput/NumberInput.tsx index 74fcd771f5..ce4afefac7 100644 --- a/packages/picasso/src/NumberInput/NumberInput.tsx +++ b/packages/picasso/src/NumberInput/NumberInput.tsx @@ -65,6 +65,7 @@ export const NumberInput = forwardRef( ...rest } = props + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/OutlinedInput/OutlinedInput.tsx b/packages/picasso/src/OutlinedInput/OutlinedInput.tsx index 1a70caacf1..02f49236ff 100644 --- a/packages/picasso/src/OutlinedInput/OutlinedInput.tsx +++ b/packages/picasso/src/OutlinedInput/OutlinedInput.tsx @@ -58,7 +58,7 @@ export interface Props /** Type attribute of the Input element. It should be a valid HTML5 input type */ type?: string /** - * @deprecated Use the `status` prop instead to both support success and error states + * @deprecated [FX-4715] Use the `status` prop instead to both support success and error states * Indicate whether input is in error state */ error?: boolean @@ -152,6 +152,7 @@ const OutlinedInput = forwardRef(function OutlinedInput( ...rest } = props + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/PasswordInput/PasswordInput.tsx b/packages/picasso/src/PasswordInput/PasswordInput.tsx index 98556c35ab..66a5e3a446 100644 --- a/packages/picasso/src/PasswordInput/PasswordInput.tsx +++ b/packages/picasso/src/PasswordInput/PasswordInput.tsx @@ -61,6 +61,7 @@ export const PasswordInput = forwardRef( ...rest } = props + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/Radio/index.ts b/packages/picasso/src/Radio/index.ts index d4336c4f2a..26531821e0 100644 --- a/packages/picasso/src/Radio/index.ts +++ b/packages/picasso/src/Radio/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalRadioProps } from './Radio' export { default } from './Radio' export type RadioProps = OmitInternalProps -/** @deprecated Use RadioProps instead */ +/** @deprecated [FX-4714] Use RadioProps instead */ export type Props = RadioProps diff --git a/packages/picasso/src/RadioGroup/index.ts b/packages/picasso/src/RadioGroup/index.ts index 5cd039d4d4..0b62a3c3cf 100644 --- a/packages/picasso/src/RadioGroup/index.ts +++ b/packages/picasso/src/RadioGroup/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalRadioGroupProps } from './RadioGroup' export { default } from './RadioGroup' export type RadioGroupProps = OmitInternalProps -/** @deprecated Use RadioGroupProps instead */ +/** @deprecated [FX-4714] Use RadioGroupProps instead */ export type Props = RadioGroupProps diff --git a/packages/picasso/src/Select/Select.tsx b/packages/picasso/src/Select/Select.tsx index dee21f8e42..e97bc0fbaf 100644 --- a/packages/picasso/src/Select/Select.tsx +++ b/packages/picasso/src/Select/Select.tsx @@ -37,6 +37,7 @@ export const Select = documentable( { native, ...props }: SelectProps, ref: React.Ref | null ) => { + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/SelectBase/types.ts b/packages/picasso/src/SelectBase/types.ts index 5cd9ac5492..b999726a5d 100644 --- a/packages/picasso/src/SelectBase/types.ts +++ b/packages/picasso/src/SelectBase/types.ts @@ -32,7 +32,7 @@ export interface SelectProps< disabled?: boolean /** Whether to render select options in portal. Should be disabled in Modals */ disablePortal?: boolean - /** @deprecated Indicate whether `Select` is in error state */ + /** @deprecated [FX-4715] Indicate whether `Select` is in error state */ error?: boolean /** Indicate whether `Select` is in `error` or `default` state */ status?: Extract diff --git a/packages/picasso/src/Switch/index.ts b/packages/picasso/src/Switch/index.ts index cdabe83d52..fb2daa9968 100644 --- a/packages/picasso/src/Switch/index.ts +++ b/packages/picasso/src/Switch/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalSwitchProps } from './Switch' export { default } from './Switch' export type SwitchProps = OmitInternalProps -/** @deprecated Use SwitchProps instead */ +/** @deprecated [FX-4714] Use SwitchProps instead */ export type Props = SwitchProps diff --git a/packages/picasso/src/TagSelector/TagSelector.tsx b/packages/picasso/src/TagSelector/TagSelector.tsx index 2b65ef43d8..30965532c5 100644 --- a/packages/picasso/src/TagSelector/TagSelector.tsx +++ b/packages/picasso/src/TagSelector/TagSelector.tsx @@ -57,7 +57,7 @@ export interface Props /** Disables `TagSelector` */ disabled?: boolean /** - * @deprecated Use the `status` prop instead to both support success and error states + * @deprecated [FX-4715] Use the `status` prop instead to both support success and error states * Indicate whether `TagSelector` is in error state */ error?: boolean @@ -146,6 +146,7 @@ export const TagSelector = forwardRef( ...rest } = props + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/TagSelectorInput/TagSelectorInput.tsx b/packages/picasso/src/TagSelectorInput/TagSelectorInput.tsx index 5572da4c58..de50f389bc 100644 --- a/packages/picasso/src/TagSelectorInput/TagSelectorInput.tsx +++ b/packages/picasso/src/TagSelectorInput/TagSelectorInput.tsx @@ -47,6 +47,7 @@ export const TagSelectorInput = forwardRef( ...rest } = props + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/TimePicker/TimePicker.tsx b/packages/picasso/src/TimePicker/TimePicker.tsx index adf592c8ad..ef5ff84bc1 100644 --- a/packages/picasso/src/TimePicker/TimePicker.tsx +++ b/packages/picasso/src/TimePicker/TimePicker.tsx @@ -88,6 +88,7 @@ export const TimePicker = (props: Props) => { } } + // TODO: [FX-4715] usePropDeprecationWarning({ props, name: 'error', diff --git a/packages/picasso/src/Tooltip/index.ts b/packages/picasso/src/Tooltip/index.ts index ba3ace2c73..8d493dea16 100644 --- a/packages/picasso/src/Tooltip/index.ts +++ b/packages/picasso/src/Tooltip/index.ts @@ -3,5 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props as InternalTooltipProps } from './Tooltip' export { default } from './Tooltip' export type TooltipProps = OmitInternalProps -/** @deprecated Use TooltipProps instead */ +/** @deprecated [FX-4714] Use TooltipProps instead */ export type Props = TooltipProps diff --git a/packages/picasso/src/TreeView/TreeView.tsx b/packages/picasso/src/TreeView/TreeView.tsx index 56caefa4ab..0f6cb85b70 100644 --- a/packages/picasso/src/TreeView/TreeView.tsx +++ b/packages/picasso/src/TreeView/TreeView.tsx @@ -32,15 +32,22 @@ export interface Props extends TreeViewPropsBase { showZoom?: boolean /** Scales the current zoom transform by coefficient */ scaleCoefficient?: number - /** Custom center translation vector (happens after zoom center translation on selected node is applied) */ + /** + * Custom center translation vector (happens after zoom center translation on selected node is applied) + * @deprecated [FX-4718] If you happen to rely on it, you are likely would want to migrate to StaticTreeView component instead of TreeView + */ centerTranslation?: Vector2 - /** Transition duration for centering animation in ms */ + /** + * Transition duration for centering animation in ms + * @deprecated [FX-4718] If you happen to rely on it, you are likely would want to migrate to StaticTreeView component instead of TreeView + */ transitionDuration?: number } const useStyles = makeStyles(styles, { name: 'PicassoTreeView' }) export const TreeView = (props: Props) => { + // TODO: [FX-4718] usePropDeprecationWarning({ props, name: 'centerTranslation', @@ -49,6 +56,7 @@ export const TreeView = (props: Props) => { 'If you happen to rely on it, you are likely would want to migrate to StaticTreeView component instead of TreeView', }) + // TODO: [FX-4718] usePropDeprecationWarning({ props, name: 'transitionDuration', diff --git a/packages/picasso/src/utils/kebab-to-camel-case.ts b/packages/picasso/src/utils/kebab-to-camel-case.ts index 22416434ea..7de9c73073 100644 --- a/packages/picasso/src/utils/kebab-to-camel-case.ts +++ b/packages/picasso/src/utils/kebab-to-camel-case.ts @@ -1,5 +1,5 @@ /** - * @deprecated Use kebabToCamelCase() from @toptal/picasso-provider package + * @deprecated [FX-4716] Use kebabToCamelCase() from @@toptal/picasso-provider package */ const kebabToCamelCase = (str: string) => str.replace(/-([a-z])/g, (substring: string) => substring[1].toUpperCase())