Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Add replacement to deprecation warning (in dev console) #1434

Merged
merged 2 commits into from Jan 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/components/atoms/button/button.js
Expand Up @@ -311,7 +311,7 @@ Button.propTypes = {
success: PropTypes.bool,

/** Type of button */
type: PropTypes.oneOf(['button', 'submit', 'reset']),
type: PropTypes.oneOf(['submit', 'button', 'reset']),

/** Handler to be called when the button is clicked */
onClick: PropTypes.func
Expand Down
11 changes: 7 additions & 4 deletions core/components/molecules/resource-list/item/item.js
Expand Up @@ -10,6 +10,7 @@ import { colors, spacing } from '@auth0/cosmos-tokens'
import Automation from '../../../_helpers/automation-attribute'
import { actionToButtonProps, buttonBuilder } from '../action-builder'
import widthString from '../../../_helpers/width-string-prop-validator'
import { deprecate } from '../../../_helpers/custom-validations'

const itemFocusOutline = '2px'

Expand Down Expand Up @@ -210,10 +211,12 @@ ListItem.propTypes = {
if (!React.isValidElement(firstAction)) {
// See: https://github.com/auth0/cosmos/issues/1133
// See: https://github.com/auth0/cosmos/issues/1222
console.warn(
'Passing objects in actions is deprecated and will be removed in Cosmos 1.0.' +
' See https://github.com/auth0/cosmos/pull/1133 for more information.'
)
return deprecate(props, {
name: 'actions',
oldAPI: 'Objects in actions',
replacement:
'<Button /> in actions. See https://github.com/auth0/cosmos/pull/1133 for an example.'
})
}
}
}
Expand Down