Skip to content

Commit

Permalink
chore: move react-intl to peer dependencies and fix direction switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorrusakov committed Jun 16, 2022
1 parent 6db5cf2 commit 18760fd
Show file tree
Hide file tree
Showing 10 changed files with 1,371 additions and 93 deletions.
1,000 changes: 969 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"prop-types": "^15.8.1",
"react-bootstrap": "^1.6.4",
"react-focus-on": "^3.5.4",
"react-intl": "^5.25.0",
"react-popper": "^2.2.5",
"react-proptype-conditional-require": "^1.0.4",
"react-responsive": "^8.2.0",
Expand All @@ -66,7 +65,8 @@
},
"peerDependencies": {
"react": "^16.8.6 || ^17.0.0",
"react-dom": "^16.8.6 || ^17.0.0"
"react-dom": "^16.8.6 || ^17.0.0",
"react-intl": "^5.25.0"
},
"devDependencies": {
"@babel/cli": "^7.16.8",
Expand Down
2 changes: 1 addition & 1 deletion src/Alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Alert = React.forwardRef(({
{closeLabel || (
<FormattedMessage
id="pgn.Alert.closeLabel"
defaultMessage={ALERT_CLOSE_LABEL_TEXT}
defaultMessage="Dismiss"
description="Label of a close button on Alert component"
/>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/DataTable/ExpandAll.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const ExpandAll = ({ getToggleAllRowsExpandedProps, isAllRowsExpanded }) => (
<FormattedMessage
id="pgn.DataTable.ExpandAll.collapseAllLabel"
defaultMessage="Collapse all"
description="Title of the filters components"
description="Label of an action button that collapses all expandable rows of DataTable."
/>
</Button>
) : (
<Button variant="link" size="inline">
<FormattedMessage
id="pgn.DataTable.ExpandAll.expandAllLabel"
defaultMessage="Expand all"
description="Title of the filters components"
description="Label of an action button that expands all expandable rows of DataTable."
/>
</Button>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/DataTable/selection/BaseSelectionStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const BaseSelectionStatus = ({
<FormattedMessage
id="pgn.DataTable.BaseSelectionStatus.selectAllText"
defaultMessage="Select all {itemCount}"
description="Clear selection button label"
description="A label for select all button."
values={{ itemCount }}
/>
)}
Expand All @@ -68,7 +68,7 @@ const BaseSelectionStatus = ({
<FormattedMessage
id="pgn.DataTable.BaseSelectionStatus.clearSelectionText"
defaultMessage="Clear selection"
description="Clear selection button label"
description="A label of clear all selection button."
/>
)}
</Button>
Expand Down
7 changes: 6 additions & 1 deletion src/DataTable/tests/FilterStatus.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { mount } from 'enzyme';
import { IntlProvider } from 'react-intl';

import FilterStatus from '../FilterStatus';
import { Button } from '../..';
Expand All @@ -25,7 +26,11 @@ const filterPropsNoFiltered = {

// eslint-disable-next-line react/prop-types
const FilterStatusWrapper = ({ value, props }) => (
<DataTableContext.Provider value={value}><FilterStatus {...props} /></DataTableContext.Provider>
<IntlProvider locale="en" messages={{}}>
<DataTableContext.Provider value={value}>
<FilterStatus {...props} />
</DataTableContext.Provider>
</IntlProvider>
);

describe('<FilterStatus />', () => {
Expand Down
2 changes: 1 addition & 1 deletion www/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports.onCreateWebpackConfig = ({ actions }) => {
// in ./node_modules
react: path.resolve(__dirname, 'node_modules/react/'),
'react-dom': path.resolve(__dirname, 'node_modules/react-dom/'),
'react-intl': path.resolve(__dirname, '../node_modules/react-intl/'),
'react-intl': path.resolve(__dirname, 'node_modules/react-intl/'),
},
},
})
Expand Down
Loading

0 comments on commit 18760fd

Please sign in to comment.