@procraft/widget-order 2.21.0 → 2.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/screenshots/.gitignore +2 -0
- package/cypress/videos/.gitignore +2 -0
- package/dist/CourseItem/index.js +7 -3
- package/dist/CourseItem/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +28 -28
- package/src/CourseItem/index.tsx +8 -3
- package/src/index.tsx +3 -0
- package/src/interfaces/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procraft/widget-order",
|
|
3
3
|
"description": "Order widget for landing",
|
|
4
|
-
"version": "2.21.
|
|
4
|
+
"version": "2.21.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist",
|
|
7
7
|
"scripts": {
|
|
@@ -44,29 +44,6 @@
|
|
|
44
44
|
"styled-components": "^5.2.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/cypress": "^1.1.3",
|
|
48
|
-
"@types/express": "^4.17.8",
|
|
49
|
-
"@types/lodash": "^4.14.161",
|
|
50
|
-
"@types/react": "^17.0.2",
|
|
51
|
-
"@types/react-dom": "^17.0.2",
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^2.25.0",
|
|
53
|
-
"@types/jest": "^26.0.22",
|
|
54
|
-
"@types/node": "^14.14.41",
|
|
55
|
-
"@types/styled-components": "^5.1.9",
|
|
56
|
-
"@typescript-eslint/parser": "^2.25.0",
|
|
57
|
-
"cypress": "^7.1.0",
|
|
58
|
-
"husky": "~4.3.8",
|
|
59
|
-
"jest": "^26.6.3",
|
|
60
|
-
"jest-styled-components": "^7.0.4",
|
|
61
|
-
"jest-watch-typeahead": "^0.6.3",
|
|
62
|
-
"lint-staged": "^10.0.10",
|
|
63
|
-
"lodash": "^4.17.20",
|
|
64
|
-
"prettier": "^2.0.2",
|
|
65
|
-
"rimraf": "^3.0.2",
|
|
66
|
-
"sass-loader": "^11.0.1",
|
|
67
|
-
"ts-jest": "^26.5.5",
|
|
68
|
-
"ts-node": "^9.0.0",
|
|
69
|
-
"typescript": "4.4.3",
|
|
70
47
|
"@apollo/client": "^3.3.15",
|
|
71
48
|
"@babel/plugin-transform-typescript": "^7.12.1",
|
|
72
49
|
"@graphql-codegen/add": "^2.0.1",
|
|
@@ -77,38 +54,61 @@
|
|
|
77
54
|
"@graphql-codegen/typescript-apollo-client-helpers": "^1.1.5",
|
|
78
55
|
"@graphql-codegen/typescript-operations": "^1.17.16",
|
|
79
56
|
"@graphql-codegen/typescript-react-apollo": "~2.2.4",
|
|
80
|
-
"@testing-library/react": "^11.2.6",
|
|
81
|
-
"@testing-library/react-hooks": "^5.1.2",
|
|
82
57
|
"@next/bundle-analyzer": "^9.5.5",
|
|
83
58
|
"@storybook/addon-actions": "^6.4.0",
|
|
84
59
|
"@storybook/addon-docs": "^6.4.0",
|
|
85
60
|
"@storybook/addon-links": "^6.4.0",
|
|
86
61
|
"@storybook/react": "^6.4.0",
|
|
87
62
|
"@testing-library/jest-dom": "^5.11.4",
|
|
63
|
+
"@testing-library/react": "^11.2.6",
|
|
64
|
+
"@testing-library/react-hooks": "^5.1.2",
|
|
88
65
|
"@testing-library/user-event": "^12.1.10",
|
|
89
66
|
"@types/chai": "^4.2.14",
|
|
67
|
+
"@types/cypress": "^1.1.3",
|
|
68
|
+
"@types/express": "^4.17.8",
|
|
90
69
|
"@types/http-proxy-middleware": "^0.19.3",
|
|
70
|
+
"@types/jest": "^26.0.22",
|
|
71
|
+
"@types/lodash": "^4.14.161",
|
|
72
|
+
"@types/node": "^14.14.41",
|
|
73
|
+
"@types/react": "^17.0.2",
|
|
74
|
+
"@types/react-dom": "^17.0.2",
|
|
75
|
+
"@types/styled-components": "^5.1.9",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "^2.25.0",
|
|
77
|
+
"@typescript-eslint/parser": "^2.25.0",
|
|
91
78
|
"chai": "^4.2.0",
|
|
92
79
|
"cross-env": "^7.0.2",
|
|
93
80
|
"css-loader": "^5.0.1",
|
|
81
|
+
"cypress": "^7.1.0",
|
|
94
82
|
"dotenv": "^8.2.0",
|
|
95
|
-
"graphql": "^15.3.0",
|
|
96
|
-
"http-proxy-middleware": "^1.0.6",
|
|
97
83
|
"eslint": "^7.0.0",
|
|
98
84
|
"eslint-config-prettier": "^6.10.1",
|
|
99
85
|
"eslint-plugin-cypress": "^2.11.2",
|
|
100
86
|
"eslint-plugin-deprecate": "^0.7.0",
|
|
101
87
|
"eslint-plugin-react": "^7.19.0",
|
|
102
88
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
89
|
+
"graphql": "^15.3.0",
|
|
90
|
+
"http-proxy-middleware": "^1.0.6",
|
|
91
|
+
"husky": "~4.3.8",
|
|
92
|
+
"jest": "^26.6.3",
|
|
93
|
+
"jest-styled-components": "^7.0.4",
|
|
94
|
+
"jest-watch-typeahead": "^0.6.3",
|
|
95
|
+
"lint-staged": "^10.0.10",
|
|
96
|
+
"lodash": "^4.17.20",
|
|
103
97
|
"moment": "^2.29.1",
|
|
104
98
|
"moment-locales-webpack-plugin": "^1.2.0",
|
|
105
99
|
"next": "^12.0.4",
|
|
106
100
|
"nodemon": "^2.0.13",
|
|
107
101
|
"npm": "^6.14.8",
|
|
102
|
+
"prettier": "^2.0.2",
|
|
108
103
|
"react": "^17.0.1",
|
|
109
104
|
"react-dom": "^17.0.1",
|
|
105
|
+
"rimraf": "^3.0.2",
|
|
106
|
+
"sass-loader": "^11.0.1",
|
|
110
107
|
"style-loader": "^2.0.0",
|
|
111
108
|
"styled-components": "^5.2.1",
|
|
109
|
+
"ts-jest": "^26.5.5",
|
|
110
|
+
"ts-node": "^9.0.0",
|
|
111
|
+
"typescript": "4.4.3",
|
|
112
112
|
"typescript-styled-plugin": "^0.15.0"
|
|
113
113
|
},
|
|
114
114
|
"resolutions": {},
|
package/src/CourseItem/index.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import { FieldValuesByType } from './FieldValuesByType'
|
|
|
24
24
|
// import { useCatalogItemSubscription } from '../hooks/useCatalogItemSubscription'
|
|
25
25
|
|
|
26
26
|
const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
|
|
27
|
-
const { orderLink, materialsLimit, course, catalogItem: item } = props
|
|
27
|
+
const { orderLink, materialsLimit, course, catalogItem: item, ratesVisible } = props;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* ID текущего элемента
|
|
@@ -138,6 +138,8 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
|
|
|
138
138
|
|
|
139
139
|
// const items: WidgetOrderCourseItem[] = []
|
|
140
140
|
|
|
141
|
+
console.log('>>> ratesVisible', ratesVisible)
|
|
142
|
+
|
|
141
143
|
return (
|
|
142
144
|
<>
|
|
143
145
|
<WidgetStyled>
|
|
@@ -147,10 +149,12 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
|
|
|
147
149
|
|
|
148
150
|
<BoxStyled>
|
|
149
151
|
<Typography className="title" component="h3">
|
|
150
|
-
{tariff?.name
|
|
152
|
+
{tariff?.name && tariff.name !== 'Единые условия'
|
|
153
|
+
? tariff.name
|
|
154
|
+
: course.name}
|
|
151
155
|
</Typography>
|
|
152
156
|
|
|
153
|
-
{item.reviewsCount ? (
|
|
157
|
+
{ratesVisible && item.reviewsCount ? (
|
|
154
158
|
<Reviews reviewsCount={item.reviewsCount} item={item} />
|
|
155
159
|
) : null}
|
|
156
160
|
|
|
@@ -258,6 +262,7 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
|
|
|
258
262
|
fieldValuesByType,
|
|
259
263
|
orderLink,
|
|
260
264
|
fieldsValueSelected,
|
|
265
|
+
ratesVisible,
|
|
261
266
|
])
|
|
262
267
|
}
|
|
263
268
|
|
package/src/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { WidgetOrderProps } from './interfaces'
|
|
|
3
3
|
import { WidgetOrderStyled } from './styles'
|
|
4
4
|
import CourseItem from './CourseItem'
|
|
5
5
|
import moment from 'moment'
|
|
6
|
+
import 'moment/locale/ru';
|
|
6
7
|
|
|
7
8
|
moment.locale('ru')
|
|
8
9
|
|
|
@@ -17,6 +18,7 @@ const WidgetOrder: React.FC<WidgetOrderProps> = ({
|
|
|
17
18
|
course,
|
|
18
19
|
...other
|
|
19
20
|
}) => {
|
|
21
|
+
|
|
20
22
|
return useMemo(() => {
|
|
21
23
|
// const currentItem = items.find(n => n.uid === currentItemId);
|
|
22
24
|
|
|
@@ -34,6 +36,7 @@ const WidgetOrder: React.FC<WidgetOrderProps> = ({
|
|
|
34
36
|
orderLink={orderLink}
|
|
35
37
|
materialsLimit={materialsLimit}
|
|
36
38
|
// courses={courses}
|
|
39
|
+
ratesVisible={other.ratesVisible}
|
|
37
40
|
course={course}
|
|
38
41
|
/>
|
|
39
42
|
</WidgetOrderStyled>
|