@omniumretail/component-library 1.0.74 → 1.0.76
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/.storybook/main.js +16 -16
- package/.storybook/preview-head.html +20 -20
- package/.storybook/preview.js +27 -27
- package/NPMPUBLISH.md +29 -29
- package/README.md +54 -54
- package/bitbucket-pipelines.yml +94 -94
- package/dist/bundle.js +247 -291
- package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +5 -5
- package/dist/types/components/AnalyticsBar/helpers/codeMutation.d.ts +4 -4
- package/dist/types/components/AnalyticsBar/index.d.ts +2 -2
- package/dist/types/components/AnalyticsBar/interfaces/analyticsBar.d.ts +12 -12
- package/dist/types/components/Button/Button.stories.d.ts +6 -6
- package/dist/types/components/Button/index.d.ts +7 -7
- package/dist/types/components/Category/Category.stories.d.ts +4 -4
- package/dist/types/components/Category/CategoryContent/index.d.ts +7 -7
- package/dist/types/components/Category/CategorySidebar/index.d.ts +26 -26
- package/dist/types/components/Category/index.d.ts +7 -7
- package/dist/types/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +4 -4
- package/dist/types/components/CategoryReadOnly/evaluationOptions.d.ts +10 -10
- package/dist/types/components/CategoryReadOnly/index.d.ts +9 -9
- package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +4 -4
- package/dist/types/components/CategoryResponse/evaluationOptions.d.ts +10 -10
- package/dist/types/components/CategoryResponse/index.d.ts +9 -9
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +5 -5
- package/dist/types/components/DatePicker/index.d.ts +8 -8
- package/dist/types/components/DatePickerTag/DatePickerTag.stories.d.ts +5 -5
- package/dist/types/components/DatePickerTag/index.d.ts +6 -6
- package/dist/types/components/Footer/Footer.stories.d.ts +5 -5
- package/dist/types/components/Footer/index.d.ts +4 -4
- package/dist/types/components/Input/Input.stories.d.ts +5 -5
- package/dist/types/components/Input/index.d.ts +10 -10
- package/dist/types/components/InputCountryCode/index.d.ts +10 -10
- package/dist/types/components/InputCountryCode/inputCountryCode.stories.d.ts +5 -5
- package/dist/types/components/Label/Label.stories.d.ts +6 -6
- package/dist/types/components/Label/index.d.ts +7 -7
- package/dist/types/components/Link/Link.stories.d.ts +7 -7
- package/dist/types/components/Link/index.d.ts +7 -7
- package/dist/types/components/Menu/Menu.stories.d.ts +5 -5
- package/dist/types/components/Menu/helpers/codeMutation.d.ts +4 -4
- package/dist/types/components/Menu/index.d.ts +3 -2
- package/dist/types/components/ModalConfirmation/ModalConfirmation.stories.d.ts +5 -5
- package/dist/types/components/ModalConfirmation/ModalStatusList.d.ts +5 -5
- package/dist/types/components/ModalConfirmation/index.d.ts +9 -9
- package/dist/types/components/ModalWithTable/ModalWithTable.stories.d.ts +5 -5
- package/dist/types/components/ModalWithTable/index.d.ts +13 -13
- package/dist/types/components/Navigation/Navigation.stories.d.ts +5 -5
- package/dist/types/components/Navigation/index.d.ts +10 -10
- package/dist/types/components/Notification/Notification.stories.d.ts +5 -5
- package/dist/types/components/Notification/index.d.ts +9 -9
- package/dist/types/components/Questions/Questions.stories.d.ts +4 -4
- package/dist/types/components/Questions/SingleQuestion/index.d.ts +1 -1
- package/dist/types/components/Questions/index.d.ts +5 -5
- package/dist/types/components/Radio/Radio.stories.d.ts +5 -5
- package/dist/types/components/Radio/index.d.ts +10 -10
- package/dist/types/components/Select/Select.stories.d.ts +6 -6
- package/dist/types/components/Select/index.d.ts +5 -5
- package/dist/types/components/Separator/Separator.stories.d.ts +6 -6
- package/dist/types/components/Separator/index.d.ts +11 -11
- package/dist/types/components/Sidebar/Sidebar.stories.d.ts +6 -6
- package/dist/types/components/Sidebar/index.d.ts +15 -15
- package/dist/types/components/Switch/Switch.stories.d.ts +5 -5
- package/dist/types/components/Switch/index.d.ts +2 -2
- package/dist/types/components/Table/Table.stories.d.ts +9 -9
- package/dist/types/components/Table/index.d.ts +37 -37
- package/dist/types/components/Tag/Tag.stories.d.ts +5 -5
- package/dist/types/components/Tag/index.d.ts +8 -8
- package/dist/types/components/Upload/Upload.stories.d.ts +4 -4
- package/dist/types/components/Upload/index.d.ts +8 -8
- package/dist/types/components/UserInfo/UserInfo.stories.d.ts +4 -4
- package/dist/types/components/UserInfo/index.d.ts +8 -8
- package/dist/types/components/index.d.ts +25 -25
- package/dist/types/constants/i18n.d.ts +1 -1
- package/dist/types/constants/translationHelper.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +198 -198
- package/src/assets/scss/_global.scss +89 -89
- package/src/assets/scss/index.scss +2 -2
- package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +236 -236
- package/src/components/AnalyticsBar/helpers/codeMutation.tsx +19 -19
- package/src/components/AnalyticsBar/index.tsx +76 -76
- package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +13 -13
- package/src/components/AnalyticsBar/styles.module.scss +108 -108
- package/src/components/Button/Button.stories.tsx +26 -26
- package/src/components/Button/index.tsx +24 -24
- package/src/components/Button/styles.module.scss +65 -65
- package/src/components/Category/Category.stories.tsx +88 -88
- package/src/components/Category/CategoryContent/index.tsx +188 -188
- package/src/components/Category/CategoryContent/styles.module.scss +51 -51
- package/src/components/Category/CategorySidebar/index.tsx +268 -268
- package/src/components/Category/CategorySidebar/styles.module.scss +28 -28
- package/src/components/Category/index.tsx +76 -76
- package/src/components/Category/styles.module.scss +13 -13
- package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +270 -270
- package/src/components/CategoryReadOnly/evaluationOptions.tsx +81 -81
- package/src/components/CategoryReadOnly/index.tsx +254 -254
- package/src/components/CategoryReadOnly/styles.module.scss +184 -184
- package/src/components/CategoryResponse/CategoryResponse.stories.tsx +251 -251
- package/src/components/CategoryResponse/evaluationOptions.tsx +81 -81
- package/src/components/CategoryResponse/index.tsx +277 -277
- package/src/components/CategoryResponse/styles.module.scss +180 -180
- package/src/components/DatePicker/DatePicker.stories.tsx +16 -16
- package/src/components/DatePicker/index.tsx +38 -38
- package/src/components/DatePicker/styles.module.scss +3 -3
- package/src/components/DatePickerTag/DatePickerTag.stories.tsx +19 -19
- package/src/components/DatePickerTag/index.tsx +89 -89
- package/src/components/DatePickerTag/styles.module.scss +31 -31
- package/src/components/Footer/Footer.stories.tsx +14 -14
- package/src/components/Footer/index.tsx +38 -38
- package/src/components/Footer/styles.module.scss +38 -38
- package/src/components/Input/Input.stories.tsx +13 -13
- package/src/components/Input/index.tsx +31 -31
- package/src/components/Input/styles.module.scss +8 -8
- package/src/components/InputCountryCode/index.tsx +75 -75
- package/src/components/InputCountryCode/inputCountryCode.stories.tsx +55 -55
- package/src/components/InputCountryCode/styles.module.scss +3 -3
- package/src/components/Label/Label.stories.tsx +21 -21
- package/src/components/Label/index.tsx +19 -19
- package/src/components/Label/styles.module.scss +16 -16
- package/src/components/Link/Link.stories.tsx +30 -30
- package/src/components/Link/index.tsx +21 -21
- package/src/components/Link/styles.module.scss +24 -24
- package/src/components/Menu/Menu.stories.tsx +178 -178
- package/src/components/Menu/helpers/codeMutation.tsx +19 -19
- package/src/components/Menu/index.tsx +23 -23
- package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +40 -40
- package/src/components/ModalConfirmation/ModalStatusList.tsx +5 -5
- package/src/components/ModalConfirmation/index.tsx +70 -70
- package/src/components/ModalConfirmation/styles.module.scss +62 -62
- package/src/components/ModalWithTable/ModalWithTable.stories.tsx +96 -96
- package/src/components/ModalWithTable/index.tsx +232 -232
- package/src/components/ModalWithTable/styles.module.scss +77 -77
- package/src/components/Navigation/Navigation.stories.tsx +17 -17
- package/src/components/Navigation/index.tsx +33 -33
- package/src/components/Navigation/styles.module.scss +59 -59
- package/src/components/Notification/Notification.stories.tsx +29 -29
- package/src/components/Notification/index.tsx +21 -21
- package/src/components/Questions/Questions.stories.tsx +37 -37
- package/src/components/Questions/SingleQuestion/index.tsx +84 -84
- package/src/components/Questions/SingleQuestion/styles.module.scss +81 -81
- package/src/components/Questions/index.tsx +78 -78
- package/src/components/Radio/Radio.stories.tsx +43 -43
- package/src/components/Radio/index.tsx +26 -26
- package/src/components/Radio/styles.module.scss +23 -23
- package/src/components/Select/Select.stories.tsx +39 -39
- package/src/components/Select/index.tsx +27 -27
- package/src/components/Select/styles.module.scss +13 -13
- package/src/components/Separator/Separator.stories.tsx +22 -22
- package/src/components/Separator/index.tsx +27 -27
- package/src/components/Separator/styles.module.scss +25 -25
- package/src/components/Sidebar/Sidebar.stories.tsx +85 -85
- package/src/components/Sidebar/index.tsx +103 -103
- package/src/components/Sidebar/styles.module.scss +85 -85
- package/src/components/Switch/Switch.stories.tsx +14 -14
- package/src/components/Switch/index.tsx +8 -8
- package/src/components/Switch/styles.module.scss +7 -7
- package/src/components/Table/Table.stories.tsx +222 -222
- package/src/components/Table/index.tsx +279 -275
- package/src/components/Table/styles.module.scss +75 -75
- package/src/components/Tag/Tag.stories.tsx +22 -22
- package/src/components/Tag/index.tsx +189 -189
- package/src/components/Tag/styles.module.scss +60 -60
- package/src/components/Upload/Upload.stories.tsx +45 -45
- package/src/components/Upload/index.tsx +91 -91
- package/src/components/UserInfo/UserInfo.stories.tsx +38 -37
- package/src/components/UserInfo/index.tsx +77 -62
- package/src/components/UserInfo/styles.module.scss +30 -29
- package/src/components/index.tsx +25 -25
- package/src/constants/i18n.ts +25 -25
- package/src/constants/translationHelper.ts +7 -7
- package/src/index.ts +2 -2
- package/src/locales/en.json +86 -86
- package/src/locales/es.json +86 -86
- package/src/locales/pt.json +86 -86
- package/src/types/Global.d.ts +4 -4
- package/tsconfig.json +29 -29
- package/webpack.config.js +51 -51
|
@@ -1,270 +1,270 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { Button } from "components/Button";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { CategoryReadOnly } from '.';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'CategoryReadOnly',
|
|
8
|
-
component: CategoryReadOnly,
|
|
9
|
-
} as Meta;
|
|
10
|
-
|
|
11
|
-
const Template: Story<any> = (args) => {
|
|
12
|
-
const [serverData, setServerData] = useState<any>();
|
|
13
|
-
const categoryResponseRef = useRef(null);
|
|
14
|
-
const [hasNext, setHasNext] = useState(true);
|
|
15
|
-
const [hasPrevious, setHasPrevious] = useState(false);
|
|
16
|
-
|
|
17
|
-
const handleNextCategoryAvailabilityChange = (hasNext: boolean) => {
|
|
18
|
-
setHasNext(hasNext);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const handlePreviousCategoryAvailabilityChange = (hasPrevious: boolean) => {
|
|
22
|
-
setHasPrevious(hasPrevious);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const handleNextClickOutside = () => {
|
|
26
|
-
(categoryResponseRef.current as any).handleNextClick();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const handlePreviousClickOutside = () => {
|
|
30
|
-
(categoryResponseRef.current as any).handlePreviousClick();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
console.log(serverData);
|
|
35
|
-
}, [serverData])
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div style={{ height: '600px' }}>
|
|
39
|
-
<div>
|
|
40
|
-
<CategoryReadOnly
|
|
41
|
-
{...args}
|
|
42
|
-
serverReadyData={setServerData}
|
|
43
|
-
ref={categoryResponseRef}
|
|
44
|
-
onNextCategoryAvailabilityChange={handleNextCategoryAvailabilityChange}
|
|
45
|
-
onPreviousCategoryAvailabilityChange={handlePreviousCategoryAvailabilityChange}
|
|
46
|
-
>
|
|
47
|
-
</CategoryReadOnly>
|
|
48
|
-
</div>
|
|
49
|
-
<div>
|
|
50
|
-
|
|
51
|
-
{hasPrevious && (
|
|
52
|
-
<Button onClick={handlePreviousClickOutside}>Previous on Parent</Button>
|
|
53
|
-
)}
|
|
54
|
-
|
|
55
|
-
{hasNext && (
|
|
56
|
-
<Button onClick={handleNextClickOutside}>Next on Parent</Button>
|
|
57
|
-
)}
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
)
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const Primary = Template.bind({});
|
|
64
|
-
Primary.args = {
|
|
65
|
-
data: {
|
|
66
|
-
"Id": "E985B66B-5EA4-4A6F-81B9-0B12CAA99343",
|
|
67
|
-
"EvaluationCycleId": "A3FE0C73-E771-40BB-B87D-1E40597841A6",
|
|
68
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
69
|
-
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
70
|
-
"TargetUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
71
|
-
"StartDate": 1678707055,
|
|
72
|
-
"EndDate": 1679707055,
|
|
73
|
-
"Status": "A",
|
|
74
|
-
"UserFinalScore": "4",
|
|
75
|
-
"SupervisorFinalScore": "3.6",
|
|
76
|
-
"UserColor": "#09168B",
|
|
77
|
-
"SupervisorColor": "#FF674C",
|
|
78
|
-
"CategoryAnswers": [
|
|
79
|
-
{
|
|
80
|
-
"Title": "Competências",
|
|
81
|
-
"Key": "1",
|
|
82
|
-
"Data": {
|
|
83
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
84
|
-
"CategoryId": "CATEGORYID1",
|
|
85
|
-
"CategoryName": "Competências",
|
|
86
|
-
"OpenAnswer": false,
|
|
87
|
-
"GeneralEvaluationLevel": 2,
|
|
88
|
-
"Grade": "0",
|
|
89
|
-
"Description": "Inserir resposta numa escala numérica entre 1 e 5, sendo que 1 corresponde a “Mau” e 5 corresponde a “Excelente”",
|
|
90
|
-
"Score": "3.4",
|
|
91
|
-
"SupervisorScore": "3.4",
|
|
92
|
-
"Questions": [
|
|
93
|
-
{
|
|
94
|
-
"Id": "65562A64-A24B-425A-A345-560238CA2468",
|
|
95
|
-
"QuestionId": "7D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
96
|
-
"Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
97
|
-
"Description": "This is a description",
|
|
98
|
-
"Grade": "0",
|
|
99
|
-
"UserAnswer": "3.4",
|
|
100
|
-
"SupervisorAnswer": "3.4",
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"Id": "85562A64-A24B-425A-A345-560238CA2468",
|
|
104
|
-
"QuestionId": "8D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
105
|
-
"Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
106
|
-
"Description": "This is a description ",
|
|
107
|
-
"Grade": "0",
|
|
108
|
-
"UserAnswer": "3.4",
|
|
109
|
-
"SupervisorAnswer": "3.4",
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"Title": "Category 2",
|
|
116
|
-
"Key": "2",
|
|
117
|
-
"Data": {
|
|
118
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
119
|
-
"CategoryId": "CATEGORYID2",
|
|
120
|
-
"CategoryName": "Category 2",
|
|
121
|
-
"OpenAnswer": false,
|
|
122
|
-
"GeneralEvaluationLevel": 0,
|
|
123
|
-
"Grade": "100",
|
|
124
|
-
"Description": "This is a description",
|
|
125
|
-
"Score": "3.4",
|
|
126
|
-
"SupervisorScore": "3.4",
|
|
127
|
-
"Questions": []
|
|
128
|
-
},
|
|
129
|
-
"Children": [
|
|
130
|
-
{
|
|
131
|
-
"Title": "Category 2.1",
|
|
132
|
-
"Key": "2.1",
|
|
133
|
-
"Data": {
|
|
134
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
135
|
-
"CategoryId": "1CDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
136
|
-
"CategoryName": "Category 2.1",
|
|
137
|
-
"OpenAnswer": false,
|
|
138
|
-
"GeneralEvaluationLevel": 0,
|
|
139
|
-
"Grade": "50",
|
|
140
|
-
"Description": "This is a description",
|
|
141
|
-
"Score": "0.000",
|
|
142
|
-
"SupervisorScore": "0.000",
|
|
143
|
-
"Questions": []
|
|
144
|
-
},
|
|
145
|
-
"Children": [
|
|
146
|
-
{
|
|
147
|
-
"Title": "Category 2.1.1",
|
|
148
|
-
"Key": "2.1.1",
|
|
149
|
-
"Data": {
|
|
150
|
-
"Id": "37A06838-67F9-4726-BC36-719A0C797484",
|
|
151
|
-
"CategoryId": "3CDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
152
|
-
"CategoryName": "Category 2.1.1",
|
|
153
|
-
"OpenAnswer": false,
|
|
154
|
-
"GeneralEvaluationLevel": 0,
|
|
155
|
-
"Grade": "50",
|
|
156
|
-
"Description": "This is a description",
|
|
157
|
-
"Score": "3.4",
|
|
158
|
-
"SupervisorScore": "3.4",
|
|
159
|
-
"Questions": [
|
|
160
|
-
{
|
|
161
|
-
"Id": "365562A64-A24B-425A-A345-560238CA2468",
|
|
162
|
-
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
163
|
-
"Subject": "This is a Subject",
|
|
164
|
-
"Description": "This is a description",
|
|
165
|
-
"Grade": "50",
|
|
166
|
-
"UserAnswer": "3.4",
|
|
167
|
-
"SupervisorAnswer": "3.4",
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"Id": "35562A64-A24B-425A-A345-560238CA2468",
|
|
171
|
-
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
172
|
-
"Subject": "This is a Subject",
|
|
173
|
-
"Description": "This is a description",
|
|
174
|
-
"Grade": "25",
|
|
175
|
-
"UserAnswer": "3.4",
|
|
176
|
-
"SupervisorAnswer": "3.4",
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"Id": "35562A64-A24B-425A-A345-560238CA2468",
|
|
180
|
-
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
181
|
-
"Subject": "This is a Subject",
|
|
182
|
-
"Description": "This is a description",
|
|
183
|
-
"Grade": "25",
|
|
184
|
-
"UserAnswer": "3.4",
|
|
185
|
-
"SupervisorAnswer": "3.4",
|
|
186
|
-
}
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"Title": "Category 2.2",
|
|
194
|
-
"Key": "2.2",
|
|
195
|
-
"Data": {
|
|
196
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
197
|
-
"CategoryId": "PCDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
198
|
-
"CategoryName": "Category 2.2",
|
|
199
|
-
"OpenAnswer": false,
|
|
200
|
-
"GeneralEvaluationLevel": 0,
|
|
201
|
-
"Grade": "50",
|
|
202
|
-
"Description": "This is a description",
|
|
203
|
-
"Score": "3.4",
|
|
204
|
-
"SupervisorScore": "3.4",
|
|
205
|
-
"Questions": [
|
|
206
|
-
{
|
|
207
|
-
"Id": "P5562A64-A24B-425A-A345-560238CA2468",
|
|
208
|
-
"QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
209
|
-
"Subject": "This is a Subject",
|
|
210
|
-
"Description": "This is a description",
|
|
211
|
-
"Grade": "50",
|
|
212
|
-
"UserAnswer": "3.4",
|
|
213
|
-
"SupervisorAnswer": "3.4",
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"Id": "P5562A64-A24B-425A-A345-560238CA2468",
|
|
217
|
-
"QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
218
|
-
"Subject": "This is a Subject",
|
|
219
|
-
"Description": "This is a description",
|
|
220
|
-
"Grade": "50",
|
|
221
|
-
"UserAnswer": "3.4",
|
|
222
|
-
"SupervisorAnswer": "3.4",
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
"Children": []
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"Title": "Category 3",
|
|
232
|
-
"Key": "3",
|
|
233
|
-
"Data": {
|
|
234
|
-
"Id": "97A06838-67F9-4726-BC36-719A0C797484",
|
|
235
|
-
"CategoryId": "CATEGORYID3",
|
|
236
|
-
"CategoryName": "Category 3",
|
|
237
|
-
"OpenAnswer": true,
|
|
238
|
-
"GeneralEvaluationLevel": 0,
|
|
239
|
-
"Grade": "0",
|
|
240
|
-
"Description": "This is a description",
|
|
241
|
-
"Score": "3.4",
|
|
242
|
-
"SupervisorScore": "3.4",
|
|
243
|
-
"Questions": [
|
|
244
|
-
{
|
|
245
|
-
"Id": "95562A64-A24B-425A-A345-560238CA2468",
|
|
246
|
-
"QuestionId": "9D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
247
|
-
"Subject": "This is a Subject",
|
|
248
|
-
"Description": "This is a description",
|
|
249
|
-
"Grade": "0",
|
|
250
|
-
"UserAnswer": "3.4",
|
|
251
|
-
"SupervisorAnswer": "3.4",
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
"Id": "93862A64-A24B-425A-A345-560238CA2468",
|
|
255
|
-
"QuestionId": "9D38A8A5-E299-47D3-AB49-684135DB23A3",
|
|
256
|
-
"Subject": "This is a Subject",
|
|
257
|
-
"Description": "This is a description",
|
|
258
|
-
"Grade": "0",
|
|
259
|
-
"UserAnswer": "3.4",
|
|
260
|
-
"SupervisorAnswer": "3.4",
|
|
261
|
-
}
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
]
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { Button } from "components/Button";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { CategoryReadOnly } from '.';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'CategoryReadOnly',
|
|
8
|
+
component: CategoryReadOnly,
|
|
9
|
+
} as Meta;
|
|
10
|
+
|
|
11
|
+
const Template: Story<any> = (args) => {
|
|
12
|
+
const [serverData, setServerData] = useState<any>();
|
|
13
|
+
const categoryResponseRef = useRef(null);
|
|
14
|
+
const [hasNext, setHasNext] = useState(true);
|
|
15
|
+
const [hasPrevious, setHasPrevious] = useState(false);
|
|
16
|
+
|
|
17
|
+
const handleNextCategoryAvailabilityChange = (hasNext: boolean) => {
|
|
18
|
+
setHasNext(hasNext);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const handlePreviousCategoryAvailabilityChange = (hasPrevious: boolean) => {
|
|
22
|
+
setHasPrevious(hasPrevious);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const handleNextClickOutside = () => {
|
|
26
|
+
(categoryResponseRef.current as any).handleNextClick();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const handlePreviousClickOutside = () => {
|
|
30
|
+
(categoryResponseRef.current as any).handlePreviousClick();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
console.log(serverData);
|
|
35
|
+
}, [serverData])
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div style={{ height: '600px' }}>
|
|
39
|
+
<div>
|
|
40
|
+
<CategoryReadOnly
|
|
41
|
+
{...args}
|
|
42
|
+
serverReadyData={setServerData}
|
|
43
|
+
ref={categoryResponseRef}
|
|
44
|
+
onNextCategoryAvailabilityChange={handleNextCategoryAvailabilityChange}
|
|
45
|
+
onPreviousCategoryAvailabilityChange={handlePreviousCategoryAvailabilityChange}
|
|
46
|
+
>
|
|
47
|
+
</CategoryReadOnly>
|
|
48
|
+
</div>
|
|
49
|
+
<div>
|
|
50
|
+
|
|
51
|
+
{hasPrevious && (
|
|
52
|
+
<Button onClick={handlePreviousClickOutside}>Previous on Parent</Button>
|
|
53
|
+
)}
|
|
54
|
+
|
|
55
|
+
{hasNext && (
|
|
56
|
+
<Button onClick={handleNextClickOutside}>Next on Parent</Button>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Primary = Template.bind({});
|
|
64
|
+
Primary.args = {
|
|
65
|
+
data: {
|
|
66
|
+
"Id": "E985B66B-5EA4-4A6F-81B9-0B12CAA99343",
|
|
67
|
+
"EvaluationCycleId": "A3FE0C73-E771-40BB-B87D-1E40597841A6",
|
|
68
|
+
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
69
|
+
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
70
|
+
"TargetUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
71
|
+
"StartDate": 1678707055,
|
|
72
|
+
"EndDate": 1679707055,
|
|
73
|
+
"Status": "A",
|
|
74
|
+
"UserFinalScore": "4",
|
|
75
|
+
"SupervisorFinalScore": "3.6",
|
|
76
|
+
"UserColor": "#09168B",
|
|
77
|
+
"SupervisorColor": "#FF674C",
|
|
78
|
+
"CategoryAnswers": [
|
|
79
|
+
{
|
|
80
|
+
"Title": "Competências",
|
|
81
|
+
"Key": "1",
|
|
82
|
+
"Data": {
|
|
83
|
+
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
84
|
+
"CategoryId": "CATEGORYID1",
|
|
85
|
+
"CategoryName": "Competências",
|
|
86
|
+
"OpenAnswer": false,
|
|
87
|
+
"GeneralEvaluationLevel": 2,
|
|
88
|
+
"Grade": "0",
|
|
89
|
+
"Description": "Inserir resposta numa escala numérica entre 1 e 5, sendo que 1 corresponde a “Mau” e 5 corresponde a “Excelente”",
|
|
90
|
+
"Score": "3.4",
|
|
91
|
+
"SupervisorScore": "3.4",
|
|
92
|
+
"Questions": [
|
|
93
|
+
{
|
|
94
|
+
"Id": "65562A64-A24B-425A-A345-560238CA2468",
|
|
95
|
+
"QuestionId": "7D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
96
|
+
"Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
97
|
+
"Description": "This is a description",
|
|
98
|
+
"Grade": "0",
|
|
99
|
+
"UserAnswer": "3.4",
|
|
100
|
+
"SupervisorAnswer": "3.4",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"Id": "85562A64-A24B-425A-A345-560238CA2468",
|
|
104
|
+
"QuestionId": "8D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
105
|
+
"Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
106
|
+
"Description": "This is a description ",
|
|
107
|
+
"Grade": "0",
|
|
108
|
+
"UserAnswer": "3.4",
|
|
109
|
+
"SupervisorAnswer": "3.4",
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"Title": "Category 2",
|
|
116
|
+
"Key": "2",
|
|
117
|
+
"Data": {
|
|
118
|
+
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
119
|
+
"CategoryId": "CATEGORYID2",
|
|
120
|
+
"CategoryName": "Category 2",
|
|
121
|
+
"OpenAnswer": false,
|
|
122
|
+
"GeneralEvaluationLevel": 0,
|
|
123
|
+
"Grade": "100",
|
|
124
|
+
"Description": "This is a description",
|
|
125
|
+
"Score": "3.4",
|
|
126
|
+
"SupervisorScore": "3.4",
|
|
127
|
+
"Questions": []
|
|
128
|
+
},
|
|
129
|
+
"Children": [
|
|
130
|
+
{
|
|
131
|
+
"Title": "Category 2.1",
|
|
132
|
+
"Key": "2.1",
|
|
133
|
+
"Data": {
|
|
134
|
+
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
135
|
+
"CategoryId": "1CDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
136
|
+
"CategoryName": "Category 2.1",
|
|
137
|
+
"OpenAnswer": false,
|
|
138
|
+
"GeneralEvaluationLevel": 0,
|
|
139
|
+
"Grade": "50",
|
|
140
|
+
"Description": "This is a description",
|
|
141
|
+
"Score": "0.000",
|
|
142
|
+
"SupervisorScore": "0.000",
|
|
143
|
+
"Questions": []
|
|
144
|
+
},
|
|
145
|
+
"Children": [
|
|
146
|
+
{
|
|
147
|
+
"Title": "Category 2.1.1",
|
|
148
|
+
"Key": "2.1.1",
|
|
149
|
+
"Data": {
|
|
150
|
+
"Id": "37A06838-67F9-4726-BC36-719A0C797484",
|
|
151
|
+
"CategoryId": "3CDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
152
|
+
"CategoryName": "Category 2.1.1",
|
|
153
|
+
"OpenAnswer": false,
|
|
154
|
+
"GeneralEvaluationLevel": 0,
|
|
155
|
+
"Grade": "50",
|
|
156
|
+
"Description": "This is a description",
|
|
157
|
+
"Score": "3.4",
|
|
158
|
+
"SupervisorScore": "3.4",
|
|
159
|
+
"Questions": [
|
|
160
|
+
{
|
|
161
|
+
"Id": "365562A64-A24B-425A-A345-560238CA2468",
|
|
162
|
+
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
163
|
+
"Subject": "This is a Subject",
|
|
164
|
+
"Description": "This is a description",
|
|
165
|
+
"Grade": "50",
|
|
166
|
+
"UserAnswer": "3.4",
|
|
167
|
+
"SupervisorAnswer": "3.4",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"Id": "35562A64-A24B-425A-A345-560238CA2468",
|
|
171
|
+
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
172
|
+
"Subject": "This is a Subject",
|
|
173
|
+
"Description": "This is a description",
|
|
174
|
+
"Grade": "25",
|
|
175
|
+
"UserAnswer": "3.4",
|
|
176
|
+
"SupervisorAnswer": "3.4",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"Id": "35562A64-A24B-425A-A345-560238CA2468",
|
|
180
|
+
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
181
|
+
"Subject": "This is a Subject",
|
|
182
|
+
"Description": "This is a description",
|
|
183
|
+
"Grade": "25",
|
|
184
|
+
"UserAnswer": "3.4",
|
|
185
|
+
"SupervisorAnswer": "3.4",
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"Title": "Category 2.2",
|
|
194
|
+
"Key": "2.2",
|
|
195
|
+
"Data": {
|
|
196
|
+
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
197
|
+
"CategoryId": "PCDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
198
|
+
"CategoryName": "Category 2.2",
|
|
199
|
+
"OpenAnswer": false,
|
|
200
|
+
"GeneralEvaluationLevel": 0,
|
|
201
|
+
"Grade": "50",
|
|
202
|
+
"Description": "This is a description",
|
|
203
|
+
"Score": "3.4",
|
|
204
|
+
"SupervisorScore": "3.4",
|
|
205
|
+
"Questions": [
|
|
206
|
+
{
|
|
207
|
+
"Id": "P5562A64-A24B-425A-A345-560238CA2468",
|
|
208
|
+
"QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
209
|
+
"Subject": "This is a Subject",
|
|
210
|
+
"Description": "This is a description",
|
|
211
|
+
"Grade": "50",
|
|
212
|
+
"UserAnswer": "3.4",
|
|
213
|
+
"SupervisorAnswer": "3.4",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"Id": "P5562A64-A24B-425A-A345-560238CA2468",
|
|
217
|
+
"QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
218
|
+
"Subject": "This is a Subject",
|
|
219
|
+
"Description": "This is a description",
|
|
220
|
+
"Grade": "50",
|
|
221
|
+
"UserAnswer": "3.4",
|
|
222
|
+
"SupervisorAnswer": "3.4",
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"Children": []
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"Title": "Category 3",
|
|
232
|
+
"Key": "3",
|
|
233
|
+
"Data": {
|
|
234
|
+
"Id": "97A06838-67F9-4726-BC36-719A0C797484",
|
|
235
|
+
"CategoryId": "CATEGORYID3",
|
|
236
|
+
"CategoryName": "Category 3",
|
|
237
|
+
"OpenAnswer": true,
|
|
238
|
+
"GeneralEvaluationLevel": 0,
|
|
239
|
+
"Grade": "0",
|
|
240
|
+
"Description": "This is a description",
|
|
241
|
+
"Score": "3.4",
|
|
242
|
+
"SupervisorScore": "3.4",
|
|
243
|
+
"Questions": [
|
|
244
|
+
{
|
|
245
|
+
"Id": "95562A64-A24B-425A-A345-560238CA2468",
|
|
246
|
+
"QuestionId": "9D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
247
|
+
"Subject": "This is a Subject",
|
|
248
|
+
"Description": "This is a description",
|
|
249
|
+
"Grade": "0",
|
|
250
|
+
"UserAnswer": "3.4",
|
|
251
|
+
"SupervisorAnswer": "3.4",
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"Id": "93862A64-A24B-425A-A345-560238CA2468",
|
|
255
|
+
"QuestionId": "9D38A8A5-E299-47D3-AB49-684135DB23A3",
|
|
256
|
+
"Subject": "This is a Subject",
|
|
257
|
+
"Description": "This is a description",
|
|
258
|
+
"Grade": "0",
|
|
259
|
+
"UserAnswer": "3.4",
|
|
260
|
+
"SupervisorAnswer": "3.4",
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|