Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(QTM-730): Avoiding forwarding no-gutters props to children other than Row and Container to avoid #582

Merged
merged 38 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4f4a5ad
chore(.eslintrc): Lint adjustment to check definition of defaultParam…
MarcosViniciusPC Jul 3, 2024
12cd95f
perf: Using defaultParams in component props instead of defaultProps
MarcosViniciusPC Jul 3, 2024
bcf605f
chore: Fix for problem with the scroll functionality of the InfiniteS…
MarcosViniciusPC Jul 3, 2024
35be80a
chore: Removed defaultProps in shared components
MarcosViniciusPC Jul 3, 2024
6c07fb0
chore: Removend defaultProps in generate components script
MarcosViniciusPC Jul 3, 2024
4f0f55a
chore: Fiz scroll on InfiniteScroll Component
MarcosViniciusPC Jul 3, 2024
67deb7c
test(InfiniteScroll.unit.test.jsx): Fix spy on function on component
MarcosViniciusPC Jul 3, 2024
0ff5aa7
build: updated yarn.lock
MarcosViniciusPC Jul 3, 2024
3cc421d
chore: Passing "key" prop outside of spreads in dropdown and radiogro…
MarcosViniciusPC Jul 3, 2024
c9cc538
chore: updated snapshots
MarcosViniciusPC Jul 3, 2024
7602e11
chore(Button.jsx): Removed defaultProps of Icon Button
MarcosViniciusPC Jul 5, 2024
88fe622
chore: Updated snapshots
MarcosViniciusPC Jul 5, 2024
06cdc3f
build(.nvmrc): Updated node version to 20.15.0
MarcosViniciusPC Jul 5, 2024
0849523
build(package.json): Removing transform-modern-regexp and transform-c…
MarcosViniciusPC Jul 8, 2024
05c47d8
Merge pull request #572 from catho/QTM-633
MarcosViniciusPC Jul 8, 2024
e74696b
Merge pull request #571 from catho/QTM-708
MarcosViniciusPC Jul 8, 2024
2318be4
Merge branch 'master' into QTM-580
MarcosViniciusPC Jul 10, 2024
06b03d8
build(yarn.lock): Updated
MarcosViniciusPC Jul 10, 2024
95d5cf3
Merge pull request #573 from catho/QTM-580
MarcosViniciusPC Jul 11, 2024
96815e8
ci(actions-publish,actions-development): Updated actions/cehckout and…
MarcosViniciusPC Jul 15, 2024
0e2a61b
chore: Grammar adjustments to the name of publication steps
MarcosViniciusPC Jul 16, 2024
f7328c5
Merge pull request #574 from catho/QTM-666
MarcosViniciusPC Jul 17, 2024
b8af967
feat(JAS-4013 add new icon):
carolnog Aug 21, 2024
b7973cd
Merge pull request #578 from catho/JAS-4013
alizeleal Aug 22, 2024
6b3c87d
feat: Updates Contributing.md
alizeleal Aug 23, 2024
4fe781a
Merge pull request #579 from catho/updateContributing
alizeleal Aug 23, 2024
2f5161e
fix(AutoComplete.jsx): Preventing auto complete from set a suggestion…
MarcosViniciusPC Aug 28, 2024
5453234
feat(adding new icon): adding new icon
leticiabiazioli Aug 29, 2024
fc4228a
Update components/shared/icons.js
leticiabiazioli Aug 29, 2024
efc4266
Update components/Icon/Icon.jsx
leticiabiazioli Aug 29, 2024
0de9779
Update components/Icon/Icon.jsx
leticiabiazioli Aug 29, 2024
e038055
chore(index.d.ts): Added new icon
MarcosViniciusPC Aug 29, 2024
819e5ef
Merge pull request #581 from catho/feat/RA-4854
MarcosViniciusPC Aug 29, 2024
c246b23
Merge pull request #580 from catho/QTM-775
MarcosViniciusPC Sep 2, 2024
f9dab0d
fix(Row.jsx): Avoiding forwarding no-gutters props to children other …
MarcosViniciusPC Sep 4, 2024
06f1bd2
chore(Row.jsx): Reordering Container component import
MarcosViniciusPC Sep 4, 2024
504f48c
Merge branch 'master' into QTM-730
MarcosViniciusPC Sep 4, 2024
63f4639
chore(CircularLoader.jsx): Fixed defaultProps lint error
MarcosViniciusPC Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
]
],
"plugins": [
"transform-class-properties",
"transform-modern-regexp",
"babel-plugin-styled-components",
"./scripts/babel-css-modules.js"
],
Expand Down
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"import/prefer-default-export": ["off", { "extensions": [".js"] }],
"react/prop-types": ["off", { "extensions": [".stories.jsx"] }]
"react/prop-types": ["off", { "extensions": [".stories.jsx"] }],
"react/require-default-props": [
"error",
{
"functions": "defaultArguments"
}
]
},
"globals": {
"window": true,
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/actions-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Read .nvmrc
run: echo NVMRC=$(cat .nvmrc) >> $GITHUB_OUTPUT
id: nvm
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
node-version-file: '.nvmrc'

- name: Install the dependencies
run: yarn

- name: run storybook
- name: Run storybook
run: yarn storybook --smoke-test

- name: run unit tests
- name: Run unit tests
run: yarn test:components

- name: run the regression tests
- name: Run the regression tests
run: yarn build:regression
30 changes: 14 additions & 16 deletions .github/workflows/actions-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,55 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Read .nvmrc
run: echo NVMRC=$(cat .nvmrc) >> $GITHUB_OUTPUT
id: nvm
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
node-version-file: '.nvmrc'

- name: Install the dependencies
run: yarn

- name: run storybook
- name: Run storybook
run: yarn storybook --smoke-test

- name: run unit tests
- name: Run unit tests
run: yarn test:components

- name: run the regression tests
- name: Run the regression tests
run: yarn build:regression

publish:
needs: tests
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Read .nvmrc
run: echo NVMRC=$(cat .nvmrc) >> $GITHUB_OUTPUT
id: nvm
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
node-version-file: '.nvmrc'

- name: Install the dependencies
run: yarn

- name: Build
run: yarn build
- name: setting npm token

- name: Setting NPM token
run: ./scripts/publish.sh
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Publish package
run: yarn semantic-release
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_URL: 'https://api.github.com/'

- name: Deploy storybook to Github Pages
if: ${{ github.ref == 'refs/heads/master' }}
run: yarn deploy-storybook -- --ci
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.1
20.15.0
14 changes: 8 additions & 6 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@

## Summary

- [Contribution Prerequisites](#contribution-prerequisites)
- [Important Notices](#important-notices)
- [Getting Started](#getting-started)
- [Editing a Component](#editing-a-component)
- [Contributor's Guide](#contributors-guide)
- [Summary](#summary)
- [Contribution Prerequisites](#contribution-prerequisites)
- [Important Notices ⚠️](#important-notices-️)
- [Getting Started](#getting-started)
- [Editing a Component](#editing-a-component)


---
You can contribute in many ways: opening or participating of a issue, reporting a bug, sending a [pull request](#submitting-a-pull-request).

## Contribution Prerequisites

- Node v16.17.1;
- Node v20.15.0;

Obs.: We have .nvmrc. When you run nvm use, it will set the node to the same version based on the .nvmrc file in the repository.
Obs.: We have .nvmrc. When you run `nvm use`, it will set the node to the same version based on the .nvmrc file in the repository.

- Yarn;

Expand Down
34 changes: 17 additions & 17 deletions components/Alert/Alert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,22 @@ const Wrapper = styled.div`
`}
`;

const Alert = ({ icon, children, theme, onClose, ...rest }) => {
const Alert = ({
icon = null,
skin = 'neutral',
children,
theme = {
colors,
baseFontSize: defaultBaseFontSize,
spacing,
breakpoints,
components: {
alert: components.alert,
},
},
onClose = undefined,
...rest
}) => {
const [show, setShow] = useState(true);

const handleClose = () => {
Expand All @@ -89,7 +104,7 @@ const Alert = ({ icon, children, theme, onClose, ...rest }) => {

return (
show && (
<Wrapper theme={theme} {...rest} role="alert">
<Wrapper theme={theme} skin={skin} {...rest} role="alert">
<Content>
{icon && <AlertIcon name={icon} />}
{children && <span>{children}</span>}
Expand All @@ -100,21 +115,6 @@ const Alert = ({ icon, children, theme, onClose, ...rest }) => {
);
};

Alert.defaultProps = {
icon: null,
skin: 'neutral',
onClose: undefined,
theme: {
colors,
baseFontSize: defaultBaseFontSize,
spacing,
breakpoints,
components: {
alert: components.alert,
},
},
};

Alert.propTypes = {
/** At least one children is required for Alert component properly works */
children: PropTypes.node.isRequired,
Expand Down
21 changes: 14 additions & 7 deletions components/Alert/__snapshots__/Alert.unit.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ exports[`Alert component Should match a skin snapshot 1`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c3 c4"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down Expand Up @@ -326,11 +327,12 @@ exports[`Alert component Should match a skin snapshot 2`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c3 c4"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down Expand Up @@ -499,11 +501,12 @@ exports[`Alert component Should match a skin snapshot 3`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c3 c4"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down Expand Up @@ -672,11 +675,12 @@ exports[`Alert component Should match a skin snapshot 4`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c3 c4"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down Expand Up @@ -845,11 +849,12 @@ exports[`Alert component Should match a skin snapshot 5`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c3 c4"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down Expand Up @@ -997,11 +1002,12 @@ exports[`Alert component Should match the snapshot of a simple alert 1`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c3 c4"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down Expand Up @@ -1171,11 +1177,12 @@ exports[`Alert component Should match the snapshot with an icon 1`] = `
</span>
<button
class="ButtonBase-module__button___-CVUK ButtonBase-module__button-medium___BtByl ButtonBase-module__button-default___K4Nmm ButtonBase-module__button-default-primary___X9GaT ButtonBase-module__shadow-2-neutral-500___mSG-z ButtonBase-module__shadow-4-primary-900___OVVjG ButtonBase-module__shadow-4-primary-700___OKpXZ ButtonBase-module__shadow-8-primary-900___cXlt5 ButtonBase-module__icon-button___nb2zK ButtonBase-module__icon-button-medium___-pGge ButtonBase-module__icon-button-neutral___CseSn c5 c6"
theme="[object Object]"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium ButtonBase-module__button-icon___s3a-2 ButtonBase-module__button-icon-medium___HY30Y css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="CloseIcon"
focusable="false"
Expand Down
Loading