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

Commit

Permalink
Add replacement to deprecation warning (in dev console) (#1434)
Browse files Browse the repository at this point in the history
* show the html default first

* throw validation error not warning
  • Loading branch information
siddharthkp authored and landitus committed Sep 5, 2019
1 parent 8f31521 commit 8fdf81b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
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 @@ -213,10 +214,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

0 comments on commit 8fdf81b

Please sign in to comment.