Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit ac0d30f

Browse files
author
Alan
authored
Merge pull request #58 from Ultimaker/component-improvements
Component improvements
2 parents e8a85be + 069d3db commit ac0d30f

File tree

91 files changed

+2007
-876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2007
-876
lines changed

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"react-motion": "^0.5.2",
5353
"react-router-dom": "^4.1.1",
5454
"react-tag-input": "^5.1.1",
55+
"react-textarea-autosize": "^7.0.4",
5556
"typescript": "^2.9.2"
5657
},
5758
"devDependencies": {
@@ -68,21 +69,21 @@
6869
"@types/storybook__addon-links": "^3.3.1",
6970
"@types/storybook__react": "^3.0.7",
7071
"awesome-typescript-loader": "^3.4.1",
71-
"file-loader": "^1.1.11",
72-
"react-docgen-typescript-loader": "^2.1.1",
73-
"react-docgen-typescript-webpack-plugin": "^1.1.0",
74-
"sass-loader": "^7.0.3",
75-
"storybook-addon-jsx": "^5.3.0",
76-
"webpack": "3.11.0",
7772
"enzyme": "3.4.1",
7873
"enzyme-adapter-react-16": "^1.1.1",
7974
"enzyme-to-json": "^3.3.4",
75+
"file-loader": "^1.1.11",
8076
"jest": "^23.4.2",
8177
"jsdom": "^11.12.0",
8278
"jsdom-global": "^3.0.2",
79+
"react-docgen-typescript-loader": "^2.1.1",
80+
"react-docgen-typescript-webpack-plugin": "^1.1.0",
8381
"react-test-renderer": "^16.4.1",
8482
"react-web-components": "https://github.com/Ultimaker/react-web-components.git#v1.0.4",
85-
"ts-jest": "^23.0.1"
83+
"sass-loader": "^7.0.3",
84+
"storybook-addon-jsx": "^5.3.0",
85+
"ts-jest": "^23.0.1",
86+
"webpack": "3.11.0"
8687
},
8788
"jest": {
8889
"coverageDirectory": "coverage",
Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`The ImageFile component should render 1`] = `
4-
<t
5-
accept="image/jpeg, image/png"
6-
className="image-upload"
7-
disableClick={false}
8-
disablePreview={false}
9-
disabled={false}
10-
getDataTransferItems={[Function]}
11-
inputProps={Object {}}
12-
maxSize={Infinity}
13-
minSize={0}
14-
multiple={false}
15-
onDragEnter={[Function]}
16-
onDragLeave={[Function]}
17-
onDrop={[Function]}
18-
preventDropOnDocument={true}
19-
style={
20-
Object {
21-
"height": "18rem",
22-
"width": "18rem",
4+
<div>
5+
<t
6+
accept="image/jpeg, image/png"
7+
className="image-upload"
8+
disableClick={false}
9+
disablePreview={false}
10+
disabled={false}
11+
getDataTransferItems={[Function]}
12+
inputProps={Object {}}
13+
maxSize={Infinity}
14+
minSize={0}
15+
multiple={false}
16+
onDragEnter={[Function]}
17+
onDragLeave={[Function]}
18+
onDrop={[Function]}
19+
preventDropOnDocument={true}
20+
style={
21+
Object {
22+
"height": "18rem",
23+
"width": "18rem",
24+
}
2325
}
24-
}
25-
>
26-
<div
27-
className="hover-area"
2826
>
2927
<div
30-
className="hide"
28+
className="hover-area"
3129
>
32-
<UploadIcon />
30+
<div
31+
className="hide"
32+
>
33+
<Icon(UploadIcon) />
34+
</div>
3335
</div>
34-
</div>
35-
<div
36-
className="placeholder placeholder--round"
37-
/>
38-
</t>
36+
<div
37+
className="placeholder placeholder--round"
38+
/>
39+
</t>
40+
</div>
3941
`;

src/components/__tests__/__snapshots__/info_link.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports[`The InfoLink component should render 1`] = `
99
href="https://ultimaker.com/"
1010
target="_blank"
1111
>
12-
<LinkIcon />
12+
<Icon(LinkIcon) />
1313
</a>
1414
</div>
1515
`;

src/components/__tests__/__snapshots__/panel_arrow.test.tsx.snap

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ exports[`The PanelArrow component should render 1`] = `
99
}
1010
}
1111
>
12-
<svg
13-
viewBox="0 0 11 7"
14-
>
15-
<path
16-
d=" M 5.5 4.172 L 9.5 0.172 L 10.914 1.586 L 6.914 5.586 L 5.5 7 L 0.086 1.586 L 1.5 0.172 L 5.5 4.172 Z "
17-
fill="rgb(0,0,0)"
18-
/>
19-
</svg>
12+
<Icon(SingleArrowIcon) />
2013
</div>
2114
`;

src/components/__tests__/__snapshots__/popup.test.tsx.snap

Lines changed: 10 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
exports[`The Popup component should render a confirm popup 1`] = `
44
<Modal>
5-
<form
5+
<div
66
className="popup"
7-
noValidate={true}
8-
onSubmit={[Function]}
97
>
108
<div
119
className="popup__header"
@@ -20,84 +18,15 @@ exports[`The Popup component should render a confirm popup 1`] = `
2018
>
2119
Popup body
2220
</p>
21+
<Form
22+
alwaysEnableSubmitButton={true}
23+
onSubmitHandler={[Function]}
24+
primaryBtnShowSpinner={false}
25+
primaryBtnText="Primary button"
26+
secondaryBtnHandler={[Function]}
27+
secondaryBtnShowSpinner={false}
28+
/>
2329
</div>
24-
<div
25-
className="popup__actions"
26-
>
27-
<div
28-
className="popup__btn-container"
29-
>
30-
<Button
31-
className=""
32-
disabled={false}
33-
linkToNewTab={false}
34-
shape="rectangle"
35-
showSpinner={false}
36-
style="primary"
37-
type="submit"
38-
>
39-
Primary button
40-
</Button>
41-
</div>
42-
</div>
43-
</form>
44-
</Modal>
45-
`;
46-
47-
exports[`The Popup component should render a prompt popup 1`] = `
48-
<Modal>
49-
<form
50-
className="popup"
51-
noValidate={true}
52-
onSubmit={[Function]}
53-
>
54-
<div
55-
className="popup__header"
56-
>
57-
Popup header
58-
</div>
59-
<div
60-
className="popup__body"
61-
>
62-
<p
63-
key="0"
64-
>
65-
Popup body
66-
</p>
67-
<div
68-
className="prompt-input"
69-
>
70-
<InputField
71-
focusOnLoad={true}
72-
id="prompt-input"
73-
labelLayoutWidth="1/1"
74-
labelWidthBreakpoint="sm"
75-
max={null}
76-
min={null}
77-
onChangeHandler={[Function]}
78-
type={null}
79-
/>
80-
</div>
81-
</div>
82-
<div
83-
className="popup__actions"
84-
>
85-
<div
86-
className="popup__btn-container"
87-
>
88-
<Button
89-
className=""
90-
disabled={false}
91-
linkToNewTab={false}
92-
shape="rectangle"
93-
showSpinner={false}
94-
style="primary"
95-
type="submit"
96-
>
97-
Primary button
98-
</Button>
99-
</div>
100-
</div>
101-
</form>
30+
</div>
10231
</Modal>
10332
`;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`The PopupPrompt component should render a prompt popup 1`] = `
4+
<Popup
5+
bodyText="PopupPrompt body"
6+
headerText="PopupPrompt header"
7+
primaryBtnHandler={[Function]}
8+
primaryBtnText="Primary button"
9+
validationErrors={null}
10+
>
11+
<InputField
12+
focusOnLoad={true}
13+
id="promptInput"
14+
labelLayoutWidth="1/1"
15+
labelWidthBreakpoint="sm"
16+
onChangeHandler={[Function]}
17+
type="text"
18+
/>
19+
</Popup>
20+
`;

src/components/__tests__/__snapshots__/profile_image.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports[`The ProfileImage component should render 1`] = `
88
disabled={true}
99
style="primary"
1010
>
11-
<ProfileIcon />
11+
<Icon(ProfileIcon) />
1212
</CircleIcon>
1313
</div>
1414
`;

src/components/__tests__/__snapshots__/tags_selector.test.tsx.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ exports[`The TagsSelector component should render 1`] = `
1010
Array [
1111
188,
1212
13,
13+
32,
1314
]
1415
}
1516
handleAddition={[Function]}
1617
handleDelete={[Function]}
1718
handleDrag={null}
1819
maxLength={30}
19-
suggestions={null}
20+
suggestions={Array []}
2021
tags={
2122
Array [
2223
Object {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`The Textarea component should render 1`] = `
4+
<div
5+
className="textarea"
6+
>
7+
<TextareaAutosize
8+
className="input"
9+
id="testTextarea"
10+
inputRef={[Function]}
11+
maxRows={3}
12+
minRows={3}
13+
onChange={[Function]}
14+
onHeightChange={[Function]}
15+
useCacheForDOMMeasurements={false}
16+
value=""
17+
/>
18+
</div>
19+
`;

src/components/__tests__/__snapshots__/user_account_menu.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ exports[`The UserAccountMenu component should display child section 1`] = `
9191
type="link"
9292
>
9393
Manage account
94-
<LinkIcon />
94+
<Icon(LinkIcon) />
9595
</Button>
9696
<Button
9797
className=""
@@ -193,7 +193,7 @@ exports[`The UserAccountMenu component should render 1`] = `
193193
type="link"
194194
>
195195
Manage account
196-
<LinkIcon />
196+
<Icon(LinkIcon) />
197197
</Button>
198198
<Button
199199
className=""

0 commit comments

Comments
 (0)