You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+29-27
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ You must use a version of Node.js respecting the following rule `>=10.14.2` or `
13
13
14
14
## Installation
15
15
16
-
To get started, start by [forking the repository](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo) on your personnal github account.
16
+
To get started, start by [forking the repository](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo) on your personal github account.
17
17
18
18
Then, clone the forked repository:
19
19
@@ -50,7 +50,7 @@ npm run storybook
50
50
51
51
## Keeping your forked repository up-to-date
52
52
53
-
Before you start developping, it is important to always keep your forked repository **up-to-date**.
53
+
Before you start developing, it is important to always keep your forked repository **up-to-date**.
54
54
55
55
### Link your forked repository to the original project
56
56
@@ -81,10 +81,12 @@ Here's an example in JS:
81
81
```text
82
82
├── dist/ : contains the generated JS/CSS files (in the postinstall process).
83
83
├── src/
84
-
| ├── __snapshots__ : generated storybook snapshots used to test the component.
84
+
| ├── __tests__
85
+
| | ├── GreatComponent.spec.js : all unit tests for the component.
86
+
| | ├── __snapshots__ : generated storybook snapshots used to test the component.
87
+
| | | ├── GreatComponent.spec.js.snap
85
88
| ├── GreatComponent.js : the react component code.
86
89
| ├── GreatComponent.md : more documentation about the component (props, ...).
87
-
| ├── GreatComponent.spec.js : all unit tests for the component.
88
90
| ├── GreatComponent.stories.js : examples to be shown in the Storybook tool.
89
91
| ├── great-component.scss : Sass file, complying to BEM convention
90
92
| └── index.js : should export your component(s).
@@ -101,7 +103,7 @@ Into a terminal, to start to develop a component you can run
101
103
npm run dev
102
104
```
103
105
104
-
Or, if you want to run your component in watch mode, execting one of command below
106
+
Or, if you want to run your component in watch mode, executing one of command below
105
107
106
108
```sh
107
109
# If your component is in js
@@ -111,7 +113,7 @@ npm run dev:js -- --scope=@axa-fr/react-toolkit-action
111
113
npm run dev:ts -- --scope=@axa-fr/react-toolkit-action
112
114
```
113
115
114
-
_scope_refer to package name of your component you are working on.
116
+
_scope_refers to package name of your component you are working on.
115
117
116
118
And then if you want to work on it, in isolation mode, you can run storybook
117
119
@@ -151,7 +153,7 @@ npm test -- --coverage
151
153
152
154
You can find the list of supported browser in the [List of supported browsers](./README.md#list-of-supported-browsers) section of the README.
153
155
154
-
If you are developping on a Mac, you will find some Virtual Machines to help you test, on [Microsoft Edge Tools](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/) webiste.
156
+
If you are developing on a Mac, you will find some Virtual Machines to help you test, on [Microsoft Edge Tools](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/) webiste.
155
157
156
158
### Documentation
157
159
@@ -165,29 +167,29 @@ There, do not forget to update the component status page, please!
165
167
166
168
We are using the [Angular commit message format](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format), you are expected to follow it. This is very important because our changlog is generated using commit messages.
167
169
168
-
Keep in mind, though, that your pull request will be squashed into master, so repository mainteners may use your commit message but are not entitled to use them as is.
170
+
Keep in mind, though, that your pull request will be squashed into master, so repository maintainers may use your commit message but are not entitled to use them as is.
With the tree shaking and the separation between CommonJS and ECMAScript files, you should'n import the components from the component folder of the react-toolkit-all package.
38
+
With the tree shaking and the separation between CommonJS and ECMAScript files, you shouldn't import the components from the component folder of the react-toolkit-all package.
39
39
40
40
Before :
41
41
@@ -116,3 +116,81 @@ The component `Title` (from `@axa-fr/react-toolkit-layout-header`) has been rena
116
116
- import { Title } from '@axa-fr/react-toolkit-all';
117
117
+ import { HeaderTitle } from '@axa-fr/react-toolkit-all';
118
118
```
119
+
120
+
## File Upload Data Handling
121
+
122
+
In 1.X
123
+
124
+
- Direct iteration over files and appending them to FormData.
125
+
126
+
```diff
127
+
- const data = new FormData();
128
+
- files.forEach(({ file, fieldname, referentialName, type }) => {
There has been a change in the representation of boolean values in the events associated with checkbox state changes. In 1.x, boolean values were directly used in events, but after in 2.0.x, these values are now represented as strings indicating the boolean state.
158
+
159
+
Here is an exemple to adapt to this change :
160
+
161
+
```diff
162
+
-export const handleChange = (e) => {
163
+
- const newValue = !e.value;
164
+
- // Rest of the logic
165
+
-}
166
+
167
+
+export const handleChange = (e) => {
168
+
+ const newValue = e.value === 'true';
169
+
+ // Rest of the logic
170
+
+}
171
+
```
172
+
173
+
## Input Components
174
+
175
+
There has been a requirement change regarding the label attribute for all types of inputs. In the 1.x version, providing a label for the TextInput component was optional. However, in the 2.0.x version, a label is mandatory for all input components.
176
+
177
+
Here's an example demonstrating how to adapt to this change:
178
+
179
+
```diff
180
+
- <TextInput
181
+
- name="textInputName"
182
+
- id="textInputId"
183
+
- value="textInputValue"
184
+
- onChange={e => handleChange(e)}
185
+
- />
186
+
187
+
+ <TextInput
188
+
+ name="textInputName"
189
+
+ id="textInputId"
190
+
+ value="textInputValue"
191
+
+ onChange={e => handleChange(e)}
192
+
+ label=""
193
+
+ />
194
+
```
195
+
196
+
In this example, the TextInput component previously didn't have a label specified, which now causes an issue. To resolve this, an empty label attribute has been added to comply with the new requirement.
0 commit comments