Skip to content

Commit

Permalink
feat(FormStatus): remove deprecated status property (#1914)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored and tujoworker committed Feb 23, 2023
1 parent a2b34d2 commit c121d71
Show file tree
Hide file tree
Showing 36 changed files with 19 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ class AutocompleteInstance extends React.PureComponent {
label={label}
text_id={id + '-status'} // used for "aria-describedby"
text={status}
status={status_state}
state={status_state}
no_animation={status_no_animation}
skeleton={skeleton}
{...status_props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ exports[`Autocomplete markup have to match snapshot 1`] = `
size="default"
skeleton="skeleton"
state="error"
status="error"
stretch={null}
text="status"
text_id="autocomplete-id-status"
Expand Down Expand Up @@ -554,7 +553,6 @@ exports[`Autocomplete markup have to match snapshot 1`] = `
size="default"
skeleton="skeleton"
state="error"
status="error"
stretch={null}
text="error"
text_id="autocomplete-id-status"
Expand Down Expand Up @@ -809,7 +807,6 @@ exports[`Autocomplete markup have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="autocomplete-id-submit-button-status"
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default class Button extends React.PureComponent {
global_status_id={global_status_id}
label={text}
text={status}
status={status_state}
state={status_state}
text_id={this._id + '-status'} // used for "aria-describedby"
no_animation={status_no_animation}
skeleton={skeleton}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ exports[`Button component have to match default button snapshot 1`] = `
show={null}
size="default"
skeleton="skeleton"
state="error"
status="status_state"
state="status_state"
stretch={null}
text={null}
text_id="button-status"
Expand Down Expand Up @@ -871,8 +870,7 @@ exports[`Button component have to match href="..." snapshot 1`] = `
show={null}
size="default"
skeleton="skeleton"
state="error"
status="status_state"
state="status_state"
stretch={null}
text={null}
text_id="button-status"
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/checkbox/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default class Checkbox extends React.PureComponent {
text_id={id + '-status'} // used for "aria-describedby"
width_selector={id + ', ' + id + '-label'}
text={status}
status={status_state}
state={status_state}
no_animation={status_no_animation}
skeleton={skeleton}
{...status_props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ exports[`Checkbox component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="checkbox-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export default class DatePicker extends React.PureComponent {
text_id={id + '-status'} // used for "aria-describedby"
width_selector={id + '-shell'}
text={status}
status={status_state}
state={status_state}
no_animation={status_no_animation}
skeleton={skeleton}
{...status_props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ exports[`DatePicker component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text="status"
text_id="date-picker-id-status"
Expand Down Expand Up @@ -524,7 +523,6 @@ exports[`DatePicker component have to match snapshot 1`] = `
size="default"
skeleton={false}
state="error"
status="error"
stretch={null}
text="error"
text_id="date-picker-id__input-status"
Expand Down Expand Up @@ -1678,7 +1676,6 @@ exports[`DatePicker component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text="error"
text_id="date-picker-id-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ exports[`Dialog component snapshot should match component snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="dialog_id-status"
Expand Down Expand Up @@ -1292,7 +1291,6 @@ exports[`Dialog component snapshot should match component snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ exports[`Drawer component snapshot should match component snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="drawer_id-status"
Expand Down Expand Up @@ -1306,7 +1305,6 @@ exports[`Drawer component snapshot should match component snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class DropdownInstance extends React.PureComponent {
label={label}
text_id={id + '-status'} // used for "aria-describedby"
text={status}
status={status_state}
state={status_state}
no_animation={status_no_animation}
skeleton={skeleton}
{...status_props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ exports[`Dropdown markup have to match snapshot 1`] = `
size="default"
skeleton="skeleton"
state="error"
status="error"
stretch={null}
text="status"
text_id="dropdown-id-status"
Expand Down Expand Up @@ -685,7 +684,6 @@ exports[`Dropdown markup have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="dropdown-id-status"
Expand Down
10 changes: 1 addition & 9 deletions packages/dnb-eufemia/src/components/form-status/FormStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ export default class FormStatus extends React.PureComponent {
]),
variant: PropTypes.oneOf(['flat', 'outlined']),
size: PropTypes.oneOf(['default', 'large']),
// status is Deprecated
status: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.string,
PropTypes.oneOf(['error', 'warn', 'info']),
]),
global_status_id: PropTypes.string,
attributes: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
text_id: PropTypes.string,
Expand Down Expand Up @@ -94,7 +88,6 @@ export default class FormStatus extends React.PureComponent {
size: 'default',
variant: null,
state: 'error',
status: null, // Deprecated
global_status_id: null,
attributes: null,
text_id: null,
Expand Down Expand Up @@ -356,7 +349,6 @@ export default class FormStatus extends React.PureComponent {
const {
show, // eslint-disable-line
title,
status: rawStatus,
state: rawState,
size,
variant,
Expand All @@ -379,7 +371,7 @@ export default class FormStatus extends React.PureComponent {
...rest
} = props

const state = FormStatus.correctStatus(rawStatus || rawState)
const state = FormStatus.correctStatus(rawState)
const iconToRender = FormStatus.getIcon({
state,
icon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ exports[`FormStatus component have to match snapshot 1`] = `
"size": "'default'",
"skeleton": "skeleton",
"state": true,
"status": true,
"stretch": "stretch",
"text": "text",
"text_id": "text_id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ exports[`GlobalError snapshot have to match component snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,6 @@ exports[`GlobalStatus snapshot have to match component snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1481,7 +1480,6 @@ exports[`GlobalStatus snapshot have to match linked components snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1628,7 +1626,6 @@ exports[`GlobalStatus snapshot have to match linked components snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text="error-message"
text_id="switch-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ exports[`InputMasked component have to match type="text" snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="input-masked-status"
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export default class Input extends React.PureComponent {
global_status_id={global_status_id}
label={label}
text={status}
status={status_state}
state={status_state}
text_id={id + '-status'} // used for "aria-describedby"
no_animation={status_no_animation}
skeleton={skeleton}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ exports[`Input component have to match type="search" snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="input-status"
Expand Down Expand Up @@ -490,7 +489,6 @@ exports[`Input component have to match type="search" snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="input-submit-button-status"
Expand Down Expand Up @@ -685,7 +683,6 @@ exports[`Input component have to match type="text" snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="input-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ exports[`InputPassword component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="input-status"
Expand Down Expand Up @@ -427,7 +426,6 @@ exports[`InputPassword component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="input-submit-button-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ exports[`Modal component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="modal_id-status"
Expand Down Expand Up @@ -1284,7 +1283,6 @@ exports[`Modal component have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,6 @@ exports[`Pagination bar have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1070,7 +1069,6 @@ exports[`Pagination bar have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1198,7 +1196,6 @@ exports[`Pagination bar have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1323,7 +1320,6 @@ exports[`Pagination bar have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1447,7 +1443,6 @@ exports[`Pagination bar have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down Expand Up @@ -1571,7 +1566,6 @@ exports[`Pagination bar have to match snapshot 1`] = `
size="default"
skeleton={null}
state="error"
status="error"
stretch={null}
text={null}
text_id="null-status"
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export default class Radio extends React.PureComponent {
text_id={id + '-status'} // used for "aria-describedby"
width_selector={id + ', ' + id + '-label'}
text={status}
status={status_state}
state={status_state}
no_animation={status_no_animation}
skeleton={skeleton}
{...status_props}
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/radio/RadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export default class RadioGroup extends React.PureComponent {
global_status_id={global_status_id}
label={label}
text={status}
status={status_state}
state={status_state}
text_id={id + '-status'} // used for "aria-describedby"
width_selector={id + ', ' + id + '-label'}
no_animation={status_no_animation}
Expand Down
Loading

0 comments on commit c121d71

Please sign in to comment.