@omniumretail/component-library 1.2.70 → 1.2.72
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/dist/component-library.umd.js +1154 -0
- package/dist/{types/components → components}/AnalyticsBar/helpers/codeMutation.d.ts +2 -2
- package/dist/{types/components → components}/AnalyticsBar/index.d.ts +2 -1
- package/dist/{types/components → components}/Button/index.d.ts +2 -1
- package/dist/{types/components → components}/Category/index.d.ts +2 -1
- package/dist/{types/components → components}/CategoryReadOnly/index.d.ts +2 -1
- package/dist/{types/components → components}/CategoryResponse/index.d.ts +3 -2
- package/dist/{types/components → components}/DatePicker/index.d.ts +2 -1
- package/dist/{types/components → components}/DatePickerTag/index.d.ts +2 -1
- package/dist/{types/components → components}/DropdownButton/index.d.ts +3 -2
- package/dist/{types/components → components}/Footer2/index.d.ts +2 -1
- package/dist/{types/components → components}/Header/Header.data.d.ts +2 -1
- package/dist/{types/components → components}/Header/Header.types.d.ts +2 -1
- package/dist/{types/components → components}/Header/index.d.ts +2 -1
- package/dist/{types/components → components}/Input/index.d.ts +2 -1
- package/dist/{types/components → components}/InputCountryCode/index.d.ts +2 -1
- package/dist/{types/components → components}/Link/index.d.ts +2 -1
- package/dist/{types/components → components}/Menu/helpers/codeMutation.d.ts +2 -2
- package/dist/{types/components → components}/Menu/index.d.ts +2 -1
- package/dist/{types/components → components}/MobileTable/index.d.ts +2 -1
- package/dist/{types/components → components}/ModalWithTable/index.d.ts +2 -1
- package/dist/{types/components → components}/Notification/index.d.ts +2 -1
- package/dist/{types/components → components}/Radio/index.d.ts +3 -2
- package/dist/{types/components → components}/ResponsiveTable/index.d.ts +2 -1
- package/dist/{types/components → components}/Select/index.d.ts +2 -1
- package/dist/{types/components → components}/Switch/index.d.ts +2 -1
- package/dist/{types/components → components}/Table/index.d.ts +2 -1
- package/dist/{types/components → components}/Tag/index.d.ts +3 -2
- package/dist/{types/components → components}/Upload/index.d.ts +3 -2
- package/dist/{types/components → components}/WebCam/index.d.ts +2 -1
- package/{src/locales/en.json → dist/locales/en.json.d.ts} +4 -2
- package/{src/locales/es.json → dist/locales/es.json.d.ts} +4 -2
- package/{src/locales/pt.json → dist/locales/pt.json.d.ts} +4 -1
- package/package.json +98 -183
- package/NPMPUBLISH.md +0 -29
- package/bitbucket-pipelines.yml +0 -95
- package/dist/780.bundle.js +0 -1
- package/dist/838.bundle.js +0 -2
- package/dist/838.bundle.js.LICENSE.txt +0 -1
- package/dist/bundle.js +0 -2
- package/dist/bundle.js.LICENSE.txt +0 -451
- package/dist/main.css +0 -36
- package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -4
- package/dist/types/components/BellNotifications/BellNotifications.stories.d.ts +0 -4
- package/dist/types/components/Button/Button.stories.d.ts +0 -5
- package/dist/types/components/Category/Category.stories.d.ts +0 -3
- package/dist/types/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -3
- package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -3
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +0 -4
- package/dist/types/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -4
- package/dist/types/components/DropdownButton/DropdownButton.stories.d.ts +0 -4
- package/dist/types/components/ExportTableData/ExportTableData.stories.d.ts +0 -3
- package/dist/types/components/Footer/Footer.stories.d.ts +0 -4
- package/dist/types/components/Footer2/Footer.stories.d.ts +0 -5
- package/dist/types/components/Header/Header.stories.d.ts +0 -4
- package/dist/types/components/Input/Input.stories.d.ts +0 -4
- package/dist/types/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -4
- package/dist/types/components/Label/Label.stories.d.ts +0 -5
- package/dist/types/components/Link/Link.stories.d.ts +0 -6
- package/dist/types/components/Menu/Menu.stories.d.ts +0 -4
- package/dist/types/components/MobileTable/MobileTable.stories.d.ts +0 -4
- package/dist/types/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -4
- package/dist/types/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -4
- package/dist/types/components/Navigation/Navigation.stories.d.ts +0 -4
- package/dist/types/components/Notification/Notification.stories.d.ts +0 -4
- package/dist/types/components/Questions/Questions.stories.d.ts +0 -3
- package/dist/types/components/Radio/Radio.stories.d.ts +0 -4
- package/dist/types/components/ResponseType/ResponseType.stories.d.ts +0 -3
- package/dist/types/components/ResponsiveTable/ResponsiveTable.stories.d.ts +0 -8
- package/dist/types/components/Select/Select.stories.d.ts +0 -5
- package/dist/types/components/Separator/Separator.stories.d.ts +0 -5
- package/dist/types/components/Sidebar/Sidebar.stories.d.ts +0 -5
- package/dist/types/components/Switch/Switch.stories.d.ts +0 -4
- package/dist/types/components/Table/Table.stories.d.ts +0 -8
- package/dist/types/components/Tag/Tag.stories.d.ts +0 -4
- package/dist/types/components/Upload/Upload.stories.d.ts +0 -3
- package/dist/types/components/UserInfo/UserInfo.stories.d.ts +0 -3
- package/dist/types/components/WebCam/WebCam.stories.d.ts +0 -3
- package/src/assets/code-brackets.svg +0 -1
- package/src/assets/colors.svg +0 -1
- package/src/assets/comments.svg +0 -1
- package/src/assets/direction.svg +0 -1
- package/src/assets/flow.svg +0 -1
- package/src/assets/fonts/Silka-Bold.woff2 +0 -0
- package/src/assets/fonts/Silka-Regular.woff2 +0 -0
- package/src/assets/images/A2AI-logo.png +0 -0
- package/src/assets/images/omnium-retail-logo-white.png +0 -0
- package/src/assets/images/omnium-retail-logo.png +0 -0
- package/src/assets/images/omnium-retail_icon.png +0 -0
- package/src/assets/plugin.svg +0 -1
- package/src/assets/repo.svg +0 -1
- package/src/assets/scss/_combinations.scss +0 -0
- package/src/assets/scss/_global.scss +0 -89
- package/src/assets/scss/index.scss +0 -2
- package/src/assets/stackalt.svg +0 -1
- package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +0 -236
- package/src/components/AnalyticsBar/helpers/codeMutation.tsx +0 -19
- package/src/components/AnalyticsBar/index.tsx +0 -76
- package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +0 -13
- package/src/components/AnalyticsBar/styles.module.scss +0 -137
- package/src/components/BellNotifications/BellNotifications.stories.tsx +0 -200
- package/src/components/BellNotifications/index.tsx +0 -154
- package/src/components/BellNotifications/styles.module.scss +0 -239
- package/src/components/Button/Button.stories.tsx +0 -26
- package/src/components/Button/index.tsx +0 -24
- package/src/components/Button/styles.module.scss +0 -70
- package/src/components/Category/Category.stories.tsx +0 -371
- package/src/components/Category/CategoryContent/index.tsx +0 -255
- package/src/components/Category/CategoryContent/styles.module.scss +0 -69
- package/src/components/Category/CategorySidebar/index.tsx +0 -344
- package/src/components/Category/CategorySidebar/styles.module.scss +0 -28
- package/src/components/Category/index.tsx +0 -58
- package/src/components/Category/styles.module.scss +0 -13
- package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +0 -274
- package/src/components/CategoryReadOnly/evaluationOptions.tsx +0 -81
- package/src/components/CategoryReadOnly/index.tsx +0 -328
- package/src/components/CategoryReadOnly/styles.module.scss +0 -214
- package/src/components/CategoryResponse/CategoryResponse.stories.tsx +0 -312
- package/src/components/CategoryResponse/evaluationOptions.tsx +0 -81
- package/src/components/CategoryResponse/index.tsx +0 -502
- package/src/components/CategoryResponse/styles.module.scss +0 -365
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -16
- package/src/components/DatePicker/index.tsx +0 -38
- package/src/components/DatePicker/styles.module.scss +0 -3
- package/src/components/DatePickerTag/DatePickerTag.stories.tsx +0 -19
- package/src/components/DatePickerTag/index.tsx +0 -91
- package/src/components/DatePickerTag/styles.module.scss +0 -32
- package/src/components/DropdownButton/DropdownButton.stories.tsx +0 -24
- package/src/components/DropdownButton/index.tsx +0 -36
- package/src/components/DropdownButton/styles.module.scss +0 -9
- package/src/components/ExportTableData/ExportTableData.stories.tsx +0 -43
- package/src/components/ExportTableData/index.tsx +0 -37
- package/src/components/ExportTableData/styles.module.scss +0 -4
- package/src/components/Footer/Footer.stories.tsx +0 -15
- package/src/components/Footer/index.tsx +0 -45
- package/src/components/Footer/styles.module.scss +0 -38
- package/src/components/Footer2/Footer.stories.tsx +0 -184
- package/src/components/Footer2/index.tsx +0 -322
- package/src/components/Footer2/styles.module.scss +0 -292
- package/src/components/Header/Header.data.ts +0 -26
- package/src/components/Header/Header.stories.tsx +0 -236
- package/src/components/Header/Header.types.ts +0 -32
- package/src/components/Header/README.md +0 -38
- package/src/components/Header/index.tsx +0 -200
- package/src/components/Header/styles.module.scss +0 -216
- package/src/components/Input/Input.stories.tsx +0 -13
- package/src/components/Input/index.tsx +0 -31
- package/src/components/Input/styles.module.scss +0 -8
- package/src/components/InputCountryCode/index.tsx +0 -79
- package/src/components/InputCountryCode/inputCountryCode.stories.tsx +0 -55
- package/src/components/InputCountryCode/styles.module.scss +0 -3
- package/src/components/Label/Label.stories.tsx +0 -21
- package/src/components/Label/index.tsx +0 -19
- package/src/components/Label/styles.module.scss +0 -17
- package/src/components/Link/Link.stories.tsx +0 -30
- package/src/components/Link/index.tsx +0 -21
- package/src/components/Link/styles.module.scss +0 -24
- package/src/components/Menu/Menu.stories.tsx +0 -178
- package/src/components/Menu/helpers/codeMutation.tsx +0 -19
- package/src/components/Menu/index.tsx +0 -24
- package/src/components/Menu/styles.module.scss +0 -0
- package/src/components/MobileTable/MobileTable.stories.tsx +0 -27
- package/src/components/MobileTable/index.tsx +0 -102
- package/src/components/MobileTable/styles.module.scss +0 -75
- package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +0 -40
- package/src/components/ModalConfirmation/ModalStatusList.tsx +0 -5
- package/src/components/ModalConfirmation/index.tsx +0 -71
- package/src/components/ModalConfirmation/styles.module.scss +0 -62
- package/src/components/ModalWithTable/ModalWithTable.stories.tsx +0 -99
- package/src/components/ModalWithTable/index.tsx +0 -238
- package/src/components/ModalWithTable/styles.module.scss +0 -77
- package/src/components/Navigation/Navigation.stories.tsx +0 -21
- package/src/components/Navigation/index.tsx +0 -91
- package/src/components/Navigation/styles.module.scss +0 -91
- package/src/components/Notification/Notification.stories.tsx +0 -32
- package/src/components/Notification/index.tsx +0 -28
- package/src/components/Questions/Questions.stories.tsx +0 -37
- package/src/components/Questions/SingleQuestion/index.tsx +0 -337
- package/src/components/Questions/SingleQuestion/styles.module.scss +0 -142
- package/src/components/Questions/index.tsx +0 -124
- package/src/components/Questions/styles.modules.scss +0 -0
- package/src/components/Radio/Radio.stories.tsx +0 -43
- package/src/components/Radio/index.tsx +0 -26
- package/src/components/Radio/styles.module.scss +0 -24
- package/src/components/ResponseType/ResponseType.stories.tsx +0 -393
- package/src/components/ResponseType/index.tsx +0 -100
- package/src/components/ResponseType/styles.module.scss +0 -31
- package/src/components/ResponsiveTable/ResponsiveTable.stories.tsx +0 -386
- package/src/components/ResponsiveTable/index.tsx +0 -389
- package/src/components/ResponsiveTable/styles.module.scss +0 -153
- package/src/components/Select/Select.stories.tsx +0 -39
- package/src/components/Select/index.tsx +0 -27
- package/src/components/Select/styles.module.scss +0 -19
- package/src/components/Separator/Separator.stories.tsx +0 -22
- package/src/components/Separator/index.tsx +0 -27
- package/src/components/Separator/styles.module.scss +0 -25
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -85
- package/src/components/Sidebar/index.tsx +0 -127
- package/src/components/Sidebar/styles.module.scss +0 -141
- package/src/components/Switch/Switch.stories.tsx +0 -14
- package/src/components/Switch/index.tsx +0 -18
- package/src/components/Switch/styles.module.scss +0 -7
- package/src/components/Table/Table.stories.tsx +0 -337
- package/src/components/Table/index.tsx +0 -313
- package/src/components/Table/styles.module.scss +0 -97
- package/src/components/Tag/Tag.stories.tsx +0 -32
- package/src/components/Tag/index.tsx +0 -295
- package/src/components/Tag/styles.module.scss +0 -104
- package/src/components/Upload/Upload.stories.tsx +0 -45
- package/src/components/Upload/index.tsx +0 -112
- package/src/components/Upload/styles.module.scss +0 -29
- package/src/components/UserInfo/UserInfo.stories.tsx +0 -38
- package/src/components/UserInfo/index.tsx +0 -77
- package/src/components/UserInfo/styles.module.scss +0 -35
- package/src/components/WebCam/WebCam.stories.tsx +0 -24
- package/src/components/WebCam/index.tsx +0 -73
- package/src/components/WebCam/styles.module.scss +0 -37
- package/src/components/index.tsx +0 -34
- package/src/constants/i18n.ts +0 -25
- package/src/constants/logoCompanyHelper.ts +0 -52
- package/src/constants/translationHelper.ts +0 -7
- package/src/index.ts +0 -3
- package/src/types/Global.d.ts +0 -4
- package/tsconfig.json +0 -29
- package/webpack.config.js +0 -51
- /package/dist/{types/components → components}/AnalyticsBar/interfaces/analyticsBar.d.ts +0 -0
- /package/dist/{types/components → components}/BellNotifications/index.d.ts +0 -0
- /package/dist/{types/components → components}/Category/CategoryContent/index.d.ts +0 -0
- /package/dist/{types/components → components}/Category/CategorySidebar/index.d.ts +0 -0
- /package/dist/{types/components → components}/CategoryReadOnly/evaluationOptions.d.ts +0 -0
- /package/dist/{types/components → components}/CategoryResponse/evaluationOptions.d.ts +0 -0
- /package/dist/{types/components → components}/ExportTableData/index.d.ts +0 -0
- /package/dist/{types/components → components}/Footer/index.d.ts +0 -0
- /package/dist/{types/components → components}/Label/index.d.ts +0 -0
- /package/dist/{types/components → components}/ModalConfirmation/ModalStatusList.d.ts +0 -0
- /package/dist/{types/components → components}/ModalConfirmation/index.d.ts +0 -0
- /package/dist/{types/components → components}/Navigation/index.d.ts +0 -0
- /package/dist/{types/components → components}/Questions/SingleQuestion/index.d.ts +0 -0
- /package/dist/{types/components → components}/Questions/index.d.ts +0 -0
- /package/dist/{types/components → components}/ResponseType/index.d.ts +0 -0
- /package/dist/{types/components → components}/Separator/index.d.ts +0 -0
- /package/dist/{types/components → components}/Sidebar/index.d.ts +0 -0
- /package/dist/{types/components → components}/UserInfo/index.d.ts +0 -0
- /package/dist/{types/components → components}/index.d.ts +0 -0
- /package/dist/{types/constants → constants}/i18n.d.ts +0 -0
- /package/dist/{types/constants → constants}/logoCompanyHelper.d.ts +0 -0
- /package/dist/{types/constants → constants}/translationHelper.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/{public → dist}/index.ts +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react-webpack5";
|
|
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: StoryFn<any> = (args: any) => {
|
|
12
|
-
const [serverData, setServerData] = useState<any>();
|
|
13
|
-
const categoryResponseRef = useRef(null);
|
|
14
|
-
const [hasNext, setHasNext] = useState(true);
|
|
15
|
-
const [hasPrevious, setHasPrevious] = useState(false);
|
|
16
|
-
const [teste, setTeste] = useState(false);
|
|
17
|
-
|
|
18
|
-
const handleNextCategoryAvailabilityChange = (hasNext: boolean) => {
|
|
19
|
-
setHasNext(hasNext);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const handlePreviousCategoryAvailabilityChange = (hasPrevious: boolean) => {
|
|
23
|
-
setHasPrevious(hasPrevious);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const handleNextClickOutside = () => {
|
|
27
|
-
(categoryResponseRef.current as any).handleNextClick();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const handlePreviousClickOutside = () => {
|
|
31
|
-
(categoryResponseRef.current as any).handlePreviousClick();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
console.log(serverData);
|
|
36
|
-
}, [serverData])
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div style={{ height: '600px' }}>
|
|
40
|
-
<div>
|
|
41
|
-
<CategoryReadOnly
|
|
42
|
-
{...args}
|
|
43
|
-
serverReadyData={setServerData}
|
|
44
|
-
ref={categoryResponseRef}
|
|
45
|
-
onNextCategoryAvailabilityChange={handleNextCategoryAvailabilityChange}
|
|
46
|
-
onPreviousCategoryAvailabilityChange={handlePreviousCategoryAvailabilityChange}
|
|
47
|
-
exportPdf={ teste}
|
|
48
|
-
>
|
|
49
|
-
</CategoryReadOnly>
|
|
50
|
-
</div>
|
|
51
|
-
<div>
|
|
52
|
-
|
|
53
|
-
{hasPrevious && (
|
|
54
|
-
<Button onClick={handlePreviousClickOutside}>Previous on Parent</Button>
|
|
55
|
-
)}
|
|
56
|
-
|
|
57
|
-
{hasNext && (
|
|
58
|
-
<Button onClick={handleNextClickOutside}>Next on Parent</Button>
|
|
59
|
-
)}
|
|
60
|
-
|
|
61
|
-
<Button onClick={() => setTeste(true)}>teste</Button>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
)
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const Primary = Template.bind({});
|
|
68
|
-
Primary.args = {
|
|
69
|
-
data: {
|
|
70
|
-
"Id": "E985B66B-5EA4-4A6F-81B9-0B12CAA99343",
|
|
71
|
-
"EvaluationCycleId": "A3FE0C73-E771-40BB-B87D-1E40597841A6",
|
|
72
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
73
|
-
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
74
|
-
"TargetUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
75
|
-
"StartDate": 1678707055,
|
|
76
|
-
"EndDate": 1679707055,
|
|
77
|
-
"Status": "A",
|
|
78
|
-
"UserFinalScore": "4",
|
|
79
|
-
"SupervisorFinalScore": "3.6",
|
|
80
|
-
"UserColor": "#09168B",
|
|
81
|
-
"SupervisorColor": "#FF674C",
|
|
82
|
-
"CategoryAnswers": [
|
|
83
|
-
{
|
|
84
|
-
"Title": "Competências",
|
|
85
|
-
"Key": "1",
|
|
86
|
-
"Data": {
|
|
87
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
88
|
-
"CategoryId": "CATEGORYID1",
|
|
89
|
-
"CategoryName": "Competências",
|
|
90
|
-
"OpenAnswer": false,
|
|
91
|
-
"GeneralEvaluationLevel": 2,
|
|
92
|
-
"Grade": "0",
|
|
93
|
-
"Description": "Inserir resposta numa escala numérica entre 1 e 5, sendo que 1 corresponde a “Mau” e 5 corresponde a “Excelente”",
|
|
94
|
-
"Score": "3.4",
|
|
95
|
-
"SupervisorScore": "3.4",
|
|
96
|
-
"Questions": [
|
|
97
|
-
{
|
|
98
|
-
"Id": "65562A64-A24B-425A-A345-560238CA2468",
|
|
99
|
-
"QuestionId": "7D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
100
|
-
"Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
101
|
-
"Description": "This is a description",
|
|
102
|
-
"Grade": "0",
|
|
103
|
-
"UserAnswer": "3.4",
|
|
104
|
-
"SupervisorAnswer": "3.4",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"Id": "85562A64-A24B-425A-A345-560238CA2468",
|
|
108
|
-
"QuestionId": "8D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
109
|
-
"Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
110
|
-
"Description": "This is a description ",
|
|
111
|
-
"Grade": "0",
|
|
112
|
-
"UserAnswer": "3.4",
|
|
113
|
-
"SupervisorAnswer": "3.4",
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"Title": "Category 2",
|
|
120
|
-
"Key": "2",
|
|
121
|
-
"Data": {
|
|
122
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
123
|
-
"CategoryId": "CATEGORYID2",
|
|
124
|
-
"CategoryName": "Category 2",
|
|
125
|
-
"OpenAnswer": false,
|
|
126
|
-
"GeneralEvaluationLevel": 0,
|
|
127
|
-
"Grade": "100",
|
|
128
|
-
"Description": "This is a description",
|
|
129
|
-
"Score": "3.4",
|
|
130
|
-
"SupervisorScore": "3.4",
|
|
131
|
-
"Questions": []
|
|
132
|
-
},
|
|
133
|
-
"Children": [
|
|
134
|
-
{
|
|
135
|
-
"Title": "Category 2.1",
|
|
136
|
-
"Key": "2.1",
|
|
137
|
-
"Data": {
|
|
138
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
139
|
-
"CategoryId": "1CDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
140
|
-
"CategoryName": "Category 2.1",
|
|
141
|
-
"OpenAnswer": false,
|
|
142
|
-
"GeneralEvaluationLevel": 0,
|
|
143
|
-
"Grade": "50",
|
|
144
|
-
"Description": "This is a description",
|
|
145
|
-
"Score": "0.000",
|
|
146
|
-
"SupervisorScore": "0.000",
|
|
147
|
-
"Questions": []
|
|
148
|
-
},
|
|
149
|
-
"Children": [
|
|
150
|
-
{
|
|
151
|
-
"Title": "Category 2.1.1",
|
|
152
|
-
"Key": "2.1.1",
|
|
153
|
-
"Data": {
|
|
154
|
-
"Id": "37A06838-67F9-4726-BC36-719A0C797484",
|
|
155
|
-
"CategoryId": "3CDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
156
|
-
"CategoryName": "Category 2.1.1",
|
|
157
|
-
"OpenAnswer": false,
|
|
158
|
-
"GeneralEvaluationLevel": 0,
|
|
159
|
-
"Grade": "50",
|
|
160
|
-
"Description": "This is a description",
|
|
161
|
-
"Score": "3.4",
|
|
162
|
-
"SupervisorScore": "3.4",
|
|
163
|
-
"Questions": [
|
|
164
|
-
{
|
|
165
|
-
"Id": "365562A64-A24B-425A-A345-560238CA2468",
|
|
166
|
-
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
167
|
-
"Subject": "This is a Subject",
|
|
168
|
-
"Description": "This is a description",
|
|
169
|
-
"Grade": "50",
|
|
170
|
-
"UserAnswer": "3.4",
|
|
171
|
-
"SupervisorAnswer": "3.4",
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"Id": "35562A64-A24B-425A-A345-560238CA2468",
|
|
175
|
-
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
176
|
-
"Subject": "This is a Subject",
|
|
177
|
-
"Description": "This is a description",
|
|
178
|
-
"Grade": "25",
|
|
179
|
-
"UserAnswer": "3.4",
|
|
180
|
-
"SupervisorAnswer": "3.4",
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"Id": "35562A64-A24B-425A-A345-560238CA2468",
|
|
184
|
-
"QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
185
|
-
"Subject": "This is a Subject",
|
|
186
|
-
"Description": "This is a description",
|
|
187
|
-
"Grade": "25",
|
|
188
|
-
"UserAnswer": "3.4",
|
|
189
|
-
"SupervisorAnswer": "3.4",
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
]
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"Title": "Category 2.2",
|
|
198
|
-
"Key": "2.2",
|
|
199
|
-
"Data": {
|
|
200
|
-
"Id": "57A06838-67F9-4726-BC36-719A0C797484",
|
|
201
|
-
"CategoryId": "PCDED10D-0984-46D4-A9B3-7EC518D74A63",
|
|
202
|
-
"CategoryName": "Category 2.2",
|
|
203
|
-
"OpenAnswer": false,
|
|
204
|
-
"GeneralEvaluationLevel": 0,
|
|
205
|
-
"Grade": "50",
|
|
206
|
-
"Description": "This is a description",
|
|
207
|
-
"Score": "3.4",
|
|
208
|
-
"SupervisorScore": "3.4",
|
|
209
|
-
"Questions": [
|
|
210
|
-
{
|
|
211
|
-
"Id": "P5562A64-A24B-425A-A345-560238CA2468",
|
|
212
|
-
"QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
213
|
-
"Subject": "This is a Subject",
|
|
214
|
-
"Description": "This is a description",
|
|
215
|
-
"Grade": "50",
|
|
216
|
-
"UserAnswer": "3.4",
|
|
217
|
-
"SupervisorAnswer": "3.4",
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"Id": "P5562A64-A24B-425A-A345-560238CA2468",
|
|
221
|
-
"QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
222
|
-
"Subject": "This is a Subject",
|
|
223
|
-
"Description": "This is a description",
|
|
224
|
-
"Grade": "50",
|
|
225
|
-
"UserAnswer": "3.4",
|
|
226
|
-
"SupervisorAnswer": "3.4",
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
"Children": []
|
|
231
|
-
}
|
|
232
|
-
]
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"Title": "Category 3",
|
|
236
|
-
"Key": "3",
|
|
237
|
-
"Data": {
|
|
238
|
-
"Id": "97A06838-67F9-4726-BC36-719A0C797484",
|
|
239
|
-
"CategoryId": "CATEGORYID3",
|
|
240
|
-
"CategoryName": "Category 3",
|
|
241
|
-
"OpenAnswer": true,
|
|
242
|
-
"GeneralEvaluationLevel": 0,
|
|
243
|
-
"Grade": "0",
|
|
244
|
-
"Description": "This is a description",
|
|
245
|
-
"Score": "3.4",
|
|
246
|
-
"SupervisorScore": "3.4",
|
|
247
|
-
"Questions": [
|
|
248
|
-
{
|
|
249
|
-
"Id": "95562A64-A24B-425A-A345-560238CA2468",
|
|
250
|
-
"QuestionId": "9D17A8A5-E299-47D3-AB49-684135DB23A3",
|
|
251
|
-
"Subject": "This is a Subject",
|
|
252
|
-
"Description": "This is a description",
|
|
253
|
-
"Grade": "0",
|
|
254
|
-
"UserAnswer": "Adeuswddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
|
|
255
|
-
"SupervisorAnswer": "Adeus",
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"Id": "93862A64-A24B-425A-A345-560238CA2468",
|
|
259
|
-
"QuestionId": "9D38A8A5-E299-47D3-AB49-684135DB23A3",
|
|
260
|
-
"Subject": "This is a Subject",
|
|
261
|
-
"Description": "This is a description",
|
|
262
|
-
"Grade": "0",
|
|
263
|
-
"UserAnswer": "Adeus",
|
|
264
|
-
"SupervisorAnswer": "Adeuswddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
|
|
265
|
-
}
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
]
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import translate from '../../constants/translationHelper';
|
|
2
|
-
|
|
3
|
-
export type EvaluationOption = {
|
|
4
|
-
value: string;
|
|
5
|
-
label: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type EvaluationOptions = {
|
|
9
|
-
scale_0: EvaluationOption[];
|
|
10
|
-
scale_1: EvaluationOption[];
|
|
11
|
-
scale_2: EvaluationOption[];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const evaluationOptions: EvaluationOptions = {
|
|
15
|
-
scale_0: [
|
|
16
|
-
{
|
|
17
|
-
value: '1',
|
|
18
|
-
label: '1',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
value: '2',
|
|
22
|
-
label: '2',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
value: '3',
|
|
26
|
-
label: '3',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: '4',
|
|
30
|
-
label: '4',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: '5',
|
|
34
|
-
label: '5',
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
scale_1: [
|
|
38
|
-
{
|
|
39
|
-
value: '1',
|
|
40
|
-
label: '1',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: '2',
|
|
44
|
-
label: '2',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
value: '3',
|
|
48
|
-
label: '3',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
value: '4',
|
|
52
|
-
label: '4',
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
scale_2: [
|
|
56
|
-
{
|
|
57
|
-
value: '1',
|
|
58
|
-
label: '1',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
value: '2',
|
|
62
|
-
label: '2',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
value: '3',
|
|
66
|
-
label: '3',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
value: '4',
|
|
70
|
-
label: '4',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
value: '5',
|
|
74
|
-
label: '5',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
value: 'na',
|
|
78
|
-
label: translate('components.categoryResponse.notApplicable')
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import styles from './styles.module.scss';
|
|
2
|
-
import { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
3
|
-
import { useForm } from 'antd/es/form/Form';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { t } from 'i18next';
|
|
7
|
-
import TextArea from 'antd/es/input/TextArea';
|
|
8
|
-
import html2canvas from 'html2canvas';
|
|
9
|
-
import jsPDF from 'jspdf';
|
|
10
|
-
|
|
11
|
-
interface CategoryResponse {
|
|
12
|
-
data: any;
|
|
13
|
-
serverReadyData: any;
|
|
14
|
-
onNextCategoryAvailabilityChange: (hasNext: boolean) => void;
|
|
15
|
-
onPreviousCategoryAvailabilityChange: (hasPrevious: boolean) => void;
|
|
16
|
-
exportPdf?: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type Category = {
|
|
20
|
-
Title: string;
|
|
21
|
-
Key: string;
|
|
22
|
-
Data: any;
|
|
23
|
-
Children?: Category[];
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const updateCategoryAnswers = (CategoryAnswers: any[], categoryToUpdate: any, updatedQuestions: any) => {
|
|
27
|
-
CategoryAnswers.forEach((category: any) => {
|
|
28
|
-
if (category.Data.CategoryId === categoryToUpdate.CategoryId) {
|
|
29
|
-
category.Data.Questions = category.Data.Questions.map((question: any, index: any) => {
|
|
30
|
-
return {
|
|
31
|
-
...question,
|
|
32
|
-
Answer: updatedQuestions[index].Answer
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
else if (category.Children && category.Children.length > 0) {
|
|
37
|
-
updateCategoryAnswers(category.Children, categoryToUpdate, updatedQuestions);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return CategoryAnswers;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const findCategoryWithQuestions = (currentKey: string, categories: Category[], direction: 'next' | 'prev'): Category | null => {
|
|
44
|
-
let foundCurrent = false;
|
|
45
|
-
|
|
46
|
-
const searchCategories = (categoryList: Category[], direction: 'next' | 'prev'): Category | null => {
|
|
47
|
-
const iterable = direction === 'next' ? categoryList : [...categoryList].reverse();
|
|
48
|
-
|
|
49
|
-
for (const category of iterable) {
|
|
50
|
-
if (foundCurrent) {
|
|
51
|
-
if (category.Data.Questions.length > 0) {
|
|
52
|
-
return category;
|
|
53
|
-
}
|
|
54
|
-
} else if (category.Key === currentKey) {
|
|
55
|
-
foundCurrent = true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (category.Children) {
|
|
59
|
-
const result = searchCategories(category.Children, direction);
|
|
60
|
-
if (result) {
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return searchCategories(categories, direction);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const getCategoryObject = (currentKey: string, categories: Category[], direction: 'next' | 'prev'): any => {
|
|
72
|
-
const category = findCategoryWithQuestions(currentKey, categories, direction);
|
|
73
|
-
return category ? category.Data : null;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const hasCategory = (currentKey: string, categories: Category[], direction: 'next' | 'prev'): boolean => {
|
|
77
|
-
const category = findCategoryWithQuestions(currentKey, categories, direction);
|
|
78
|
-
return !!category;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const CategoryReadOnly = React.forwardRef((props: CategoryResponse, ref) => {
|
|
82
|
-
const { data } = props;
|
|
83
|
-
|
|
84
|
-
const [currentKey, setCurrentKey] = useState(data.CategoryAnswers[0].Key);
|
|
85
|
-
const [localData, setLocalData] = useState<any>(data);
|
|
86
|
-
// Setting first set of questions as default open
|
|
87
|
-
const [selectedCategory, setSelectedCategory] = useState<any>(data.CategoryAnswers[0]);
|
|
88
|
-
const [initialValues, setInitialValues] = useState<any>(data.CategoryAnswers[0].Data);
|
|
89
|
-
const [form] = useForm();
|
|
90
|
-
const pdfRef = useRef<HTMLDivElement>(null);
|
|
91
|
-
|
|
92
|
-
const updateInitialValues = (data: any) => {
|
|
93
|
-
const {
|
|
94
|
-
Questions,
|
|
95
|
-
OpenAnswer
|
|
96
|
-
} = data;
|
|
97
|
-
|
|
98
|
-
const initial = {
|
|
99
|
-
Questions: Questions.map((question: any) => ({
|
|
100
|
-
Subject: question.Subject,
|
|
101
|
-
Description: question.Description,
|
|
102
|
-
Answer: question.Answer || ""
|
|
103
|
-
})),
|
|
104
|
-
OpenAnswer: OpenAnswer
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
setInitialValues(initial);
|
|
108
|
-
form.setFieldsValue(initial);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const handleLabelClick = (category: any, index: number) => {
|
|
112
|
-
setSelectedCategory(category);
|
|
113
|
-
updateInitialValues(category.Data);
|
|
114
|
-
setCurrentKey(index);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const renderCategories = (categories: any) => {
|
|
118
|
-
return categories.map((category: any, index: number) => {
|
|
119
|
-
const labelClasses = classNames({
|
|
120
|
-
[styles.cursorPointer]: category.Data.Questions.length > 0
|
|
121
|
-
}, [styles.label]);
|
|
122
|
-
|
|
123
|
-
const indexCheck = category.Data.Questions.length > 0 && category.Key;
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<div
|
|
127
|
-
className={`${styles.labelWrapper} ${category.Data.CategoryId === selectedCategory.Data.CategoryId ? styles.active : ""}`}
|
|
128
|
-
key={index}
|
|
129
|
-
>
|
|
130
|
-
<div
|
|
131
|
-
className={labelClasses}
|
|
132
|
-
data-index={indexCheck}
|
|
133
|
-
onClick={() => category.Data.Questions.length > 0 && handleLabelClick(category, indexCheck)}
|
|
134
|
-
>
|
|
135
|
-
{category.Title}
|
|
136
|
-
</div>
|
|
137
|
-
{category.Children && (
|
|
138
|
-
<div className={styles.subCategory}>
|
|
139
|
-
{renderCategories(category.Children)}
|
|
140
|
-
</div>
|
|
141
|
-
)}
|
|
142
|
-
</div>
|
|
143
|
-
)
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const handleDownloadPDF = async () => {
|
|
148
|
-
if (pdfRef.current && data) {
|
|
149
|
-
const pdf = new jsPDF('p', 'mm', 'a4');
|
|
150
|
-
const pdfWidth = pdf.internal.pageSize.getWidth();
|
|
151
|
-
const pdfHeight = pdf.internal.pageSize.getHeight();
|
|
152
|
-
const spaceBetweenCategories = 20;
|
|
153
|
-
|
|
154
|
-
let currentY = 0;
|
|
155
|
-
|
|
156
|
-
// Função recursiva para percorrer e capturar apenas os nós mais profundos
|
|
157
|
-
const processLeafNodes = async (category: any) => {
|
|
158
|
-
if (category.Children && category.Children.length > 0) {
|
|
159
|
-
// Se houver subcategorias, processa cada uma delas recursivamente
|
|
160
|
-
for (const childCategory of category.Children) {
|
|
161
|
-
await processLeafNodes(childCategory);
|
|
162
|
-
}
|
|
163
|
-
} else {
|
|
164
|
-
// Se não houver subcategorias, processa o nó como um nó folha
|
|
165
|
-
setCurrentKey(category.Key);
|
|
166
|
-
setSelectedCategory(category);
|
|
167
|
-
|
|
168
|
-
// Aguarda a renderização da nova categoria
|
|
169
|
-
await new Promise((resolve) => {
|
|
170
|
-
setTimeout(async () => {
|
|
171
|
-
// Captura o conteúdo da referência PDF
|
|
172
|
-
const canvas = await html2canvas(pdfRef.current!, {
|
|
173
|
-
width: pdfRef.current!.scrollWidth,
|
|
174
|
-
height: pdfRef.current!.scrollHeight,
|
|
175
|
-
useCORS: true,
|
|
176
|
-
allowTaint: true,
|
|
177
|
-
scale: 1,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
const imgData = canvas.toDataURL('image/png');
|
|
181
|
-
const imgHeight = (canvas.height * pdfWidth) / canvas.width;
|
|
182
|
-
|
|
183
|
-
// Adiciona uma nova página se não houver espaço suficiente
|
|
184
|
-
if (currentY + imgHeight + spaceBetweenCategories > pdfHeight) {
|
|
185
|
-
pdf.addPage();
|
|
186
|
-
currentY = 0;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Adiciona a imagem ao PDF na posição atual
|
|
190
|
-
pdf.addImage(imgData, 'PNG', 0, currentY, pdfWidth, imgHeight);
|
|
191
|
-
currentY += imgHeight + spaceBetweenCategories;
|
|
192
|
-
|
|
193
|
-
resolve(null);
|
|
194
|
-
}, 150);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
// Percorre todas as categorias principais
|
|
200
|
-
for (const mainCategory of data.CategoryAnswers) {
|
|
201
|
-
await processLeafNodes(mainCategory);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
pdf.save('evaluation_details.pdf');
|
|
205
|
-
} else {
|
|
206
|
-
console.warn('pdfRef.current está vazio. Verifique se a referência está correta.');
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
useEffect(() => {
|
|
211
|
-
if (props.exportPdf) {
|
|
212
|
-
handleDownloadPDF();
|
|
213
|
-
}
|
|
214
|
-
}, [props.exportPdf]);
|
|
215
|
-
|
|
216
|
-
const handleNextClick = () => {
|
|
217
|
-
const nextCategory = findCategoryWithQuestions(currentKey, localData.CategoryAnswers, 'next');
|
|
218
|
-
if (nextCategory) {
|
|
219
|
-
setCurrentKey(nextCategory.Key);
|
|
220
|
-
setSelectedCategory(nextCategory);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const nextCategoryData = getCategoryObject(currentKey, localData.CategoryAnswers, 'next');
|
|
224
|
-
setSelectedCategory(nextCategoryData ? { ...nextCategory, data: nextCategoryData } : null);
|
|
225
|
-
updateInitialValues(nextCategoryData);
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const handlePreviousClick = () => {
|
|
229
|
-
const prevCategory = findCategoryWithQuestions(currentKey, localData.CategoryAnswers, 'prev');
|
|
230
|
-
if (prevCategory) {
|
|
231
|
-
setCurrentKey(prevCategory.Key);
|
|
232
|
-
setSelectedCategory(prevCategory);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const prevCategoryData = getCategoryObject(currentKey, localData.CategoryAnswers, 'prev');
|
|
236
|
-
setSelectedCategory(prevCategoryData ? { ...prevCategory, data: prevCategoryData } : null);
|
|
237
|
-
updateInitialValues(prevCategoryData);
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
useImperativeHandle(ref, () => ({
|
|
241
|
-
handleNextClick,
|
|
242
|
-
handlePreviousClick,
|
|
243
|
-
}));
|
|
244
|
-
|
|
245
|
-
useEffect(() => {
|
|
246
|
-
props.serverReadyData(localData);
|
|
247
|
-
}, [localData]);
|
|
248
|
-
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
const hasNext = hasCategory(currentKey, localData.CategoryAnswers, 'next');
|
|
251
|
-
props.onNextCategoryAvailabilityChange(hasNext);
|
|
252
|
-
|
|
253
|
-
const hasPrevious = hasCategory(currentKey, localData.CategoryAnswers, 'prev');
|
|
254
|
-
props.onPreviousCategoryAvailabilityChange(hasPrevious);
|
|
255
|
-
}, [currentKey, localData.CategoryAnswers, props]);
|
|
256
|
-
|
|
257
|
-
const questionWrapper = classNames({
|
|
258
|
-
[styles.questionWrapperOpenAnswer]: selectedCategory.Data.OpenAnswer,
|
|
259
|
-
}, [styles.questionWrapper]);
|
|
260
|
-
|
|
261
|
-
return (
|
|
262
|
-
<div ref={pdfRef} className={styles.categoryResponse}>
|
|
263
|
-
<div className={styles.sidebarWrapper}>
|
|
264
|
-
{renderCategories(localData.CategoryAnswers)}
|
|
265
|
-
</div>
|
|
266
|
-
<div className={styles.contentWrapper}>
|
|
267
|
-
|
|
268
|
-
<div className={styles.details}>
|
|
269
|
-
<div className={styles.categoryGradesWrapper}>
|
|
270
|
-
<div className={styles.categoryGradesTitle}>
|
|
271
|
-
{t('components.categoryReadOnly.categoryAverage')}
|
|
272
|
-
</div>
|
|
273
|
-
<div className={styles.categoryGrades}>
|
|
274
|
-
<div className={styles.gradeBox} style={{ backgroundColor: localData.UserColor }}>
|
|
275
|
-
{selectedCategory?.Data.Score}
|
|
276
|
-
</div>
|
|
277
|
-
<div className={styles.gradeBox} style={{ backgroundColor: localData.SupervisorColor }}>
|
|
278
|
-
{selectedCategory?.Data.SupervisorScore}
|
|
279
|
-
</div>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
|
|
284
|
-
{selectedCategory?.Data?.Questions.map((question: any, index: number) => (
|
|
285
|
-
<div className={questionWrapper} key={index}>
|
|
286
|
-
<div className={styles.question}>
|
|
287
|
-
<div className={styles.subject}>
|
|
288
|
-
{question.Subject}
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
<div className={styles.answer}>
|
|
292
|
-
{!selectedCategory.Data.OpenAnswer ? (
|
|
293
|
-
<>
|
|
294
|
-
<div className={styles.gradeBox} style={{ backgroundColor: localData.UserColor }}>
|
|
295
|
-
{question.UserAnswer}
|
|
296
|
-
</div>
|
|
297
|
-
<div className={styles.gradeBox} style={{ backgroundColor: localData.SupervisorColor }}>
|
|
298
|
-
{question.SupervisorAnswer}
|
|
299
|
-
</div>
|
|
300
|
-
</>
|
|
301
|
-
) : (
|
|
302
|
-
<div className={styles.openAnswerContainer}>
|
|
303
|
-
<div className={styles.subject}>
|
|
304
|
-
{t('components.categoryReadOnly.userResponse')}
|
|
305
|
-
</div>
|
|
306
|
-
|
|
307
|
-
<TextArea
|
|
308
|
-
value={question.UserAnswer}
|
|
309
|
-
disabled
|
|
310
|
-
/>
|
|
311
|
-
|
|
312
|
-
<div className={styles.subject}>
|
|
313
|
-
{t('components.categoryReadOnly.supervisorResponse')}
|
|
314
|
-
</div>
|
|
315
|
-
|
|
316
|
-
<TextArea
|
|
317
|
-
value={question.SupervisorAnswer}
|
|
318
|
-
disabled
|
|
319
|
-
/>
|
|
320
|
-
</div>
|
|
321
|
-
)}
|
|
322
|
-
</div>
|
|
323
|
-
</div>
|
|
324
|
-
))}
|
|
325
|
-
</div>
|
|
326
|
-
</div>
|
|
327
|
-
);
|
|
328
|
-
});
|