@campxdev/campx-web-utils 0.5.4 → 0.5.5
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/package.json
CHANGED
|
@@ -8,7 +8,6 @@ import { ChangePasswordDialog } from '../../components/ChangePassword';
|
|
|
8
8
|
import { axios } from '../../config/axios';
|
|
9
9
|
import { ErrorBoundary } from '../../context/export';
|
|
10
10
|
import HelpDocs from './components/HelpDocs';
|
|
11
|
-
import { helpDocsConfig } from './components/helpDocsConfig';
|
|
12
11
|
|
|
13
12
|
type Props = {
|
|
14
13
|
actions?: ReactNode[];
|
|
@@ -21,6 +20,10 @@ type Props = {
|
|
|
21
20
|
designation?: string;
|
|
22
21
|
clientName?: string;
|
|
23
22
|
institutionData?: any[];
|
|
23
|
+
helpDocsConfig?: Record<
|
|
24
|
+
string,
|
|
25
|
+
{ actions: { name: string; onClick: () => void }[] }
|
|
26
|
+
>;
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export const AppLayout: React.FC<Props> = ({
|
|
@@ -34,6 +37,7 @@ export const AppLayout: React.FC<Props> = ({
|
|
|
34
37
|
userName = '',
|
|
35
38
|
designation = '',
|
|
36
39
|
clientName = '',
|
|
40
|
+
helpDocsConfig,
|
|
37
41
|
}) => {
|
|
38
42
|
const [collapsed, setCollapsed] = useState(true);
|
|
39
43
|
const theme = useTheme();
|
|
@@ -57,7 +61,7 @@ export const AppLayout: React.FC<Props> = ({
|
|
|
57
61
|
const pathSegments = fullPath.split('/').filter(Boolean);
|
|
58
62
|
const actualPath = pathSegments.slice(1).join('/');
|
|
59
63
|
const normalizedPath = actualPath.replace(/\/\d+/g, '/:id');
|
|
60
|
-
const helpDocsActions = helpDocsConfig[`/${normalizedPath}`]?.actions || [];
|
|
64
|
+
const helpDocsActions = helpDocsConfig?.[`/${normalizedPath}`]?.actions || [];
|
|
61
65
|
|
|
62
66
|
return (
|
|
63
67
|
<AppLayoutContainer>
|
|
@@ -87,8 +91,11 @@ export const AppLayout: React.FC<Props> = ({
|
|
|
87
91
|
profileSx: { width: 32, height: 32, fontSize: '12px' },
|
|
88
92
|
})}
|
|
89
93
|
/>
|
|
90
|
-
{helpDocsActions.length > 0 &&
|
|
91
|
-
|
|
94
|
+
{helpDocsConfig && helpDocsActions.length > 0 && (
|
|
95
|
+
<HelpDocs actions={helpDocsActions} />
|
|
96
|
+
)}
|
|
97
|
+
|
|
98
|
+
<OutletContainer
|
|
92
99
|
sx={{
|
|
93
100
|
margin: '12px 0px 0px 0px',
|
|
94
101
|
backgroundColor: theme.palette.surface.paperBackground,
|
|
@@ -101,7 +108,7 @@ export const AppLayout: React.FC<Props> = ({
|
|
|
101
108
|
<Suspense fallback={<Spinner />}>
|
|
102
109
|
<ErrorBoundary>{children}</ErrorBoundary>
|
|
103
110
|
</Suspense>
|
|
104
|
-
</
|
|
111
|
+
</OutletContainer>
|
|
105
112
|
</motion.div>
|
|
106
113
|
</AppLayoutContainer>
|
|
107
114
|
);
|
|
@@ -114,13 +121,17 @@ const AppLayoutContainer = styled(Stack)(({ theme }: { theme?: any }) => ({
|
|
|
114
121
|
[theme.breakpoints.down('md')]: { flexWrap: 'wrap' },
|
|
115
122
|
}));
|
|
116
123
|
|
|
117
|
-
const
|
|
124
|
+
const OutletContainer = styled(Box)(({ theme }: { theme?: any }) => ({
|
|
118
125
|
borderRadius: '8px',
|
|
119
126
|
height: 'calc(100vh - 96px)',
|
|
120
127
|
overflowY: 'scroll',
|
|
121
128
|
width: '100%',
|
|
122
129
|
|
|
123
|
-
'&::-webkit-scrollbar': {
|
|
130
|
+
'&::-webkit-scrollbar': {
|
|
131
|
+
width: '0.5em',
|
|
132
|
+
height: '0.2em',
|
|
133
|
+
backgroundColor: theme.palette.surface.defaultBackground,
|
|
134
|
+
},
|
|
124
135
|
|
|
125
136
|
'&::-webkit-scrollbar-thumb': {
|
|
126
137
|
backgroundColor: theme.palette.primary.light,
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export const helpDocsConfig: Record<
|
|
2
|
-
string,
|
|
3
|
-
{ actions: { name: string; onClick: () => void }[] }
|
|
4
|
-
> = {
|
|
5
|
-
'/payments/exam-fees': {
|
|
6
|
-
actions: [
|
|
7
|
-
{
|
|
8
|
-
name: 'Know how to collect exam fee',
|
|
9
|
-
onClick: () =>
|
|
10
|
-
window.open('https://docs.campx.in/Workflows/collect_fee/', '_blank'),
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
},
|
|
14
|
-
'/payments/student-permissions': {
|
|
15
|
-
actions: [
|
|
16
|
-
{
|
|
17
|
-
name: 'Know how to manage permissions',
|
|
18
|
-
onClick: () =>
|
|
19
|
-
window.open('https://docs.campx.in/Workflows/collect_fee/', '_blank'),
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
'/exams/blocked-students': {
|
|
24
|
-
actions: [
|
|
25
|
-
{
|
|
26
|
-
name: 'Know how to block students',
|
|
27
|
-
onClick: () =>
|
|
28
|
-
window.open('https://docs.campx.in/Workflows/collect_fee/', '_blank'),
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
'/ums/settings/assessments/assessment-types': {
|
|
33
|
-
actions: [
|
|
34
|
-
{
|
|
35
|
-
name: 'Know how to setup Assessment rules',
|
|
36
|
-
onClick: () =>
|
|
37
|
-
window.open(
|
|
38
|
-
'https://docs.campx.in/Workflows/assessment_rules/',
|
|
39
|
-
'_blank',
|
|
40
|
-
),
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
'/ums/settings/assessments/assessment-templates': {
|
|
45
|
-
actions: [
|
|
46
|
-
{
|
|
47
|
-
name: 'Know how to setup Assessment rules',
|
|
48
|
-
onClick: () =>
|
|
49
|
-
window.open(
|
|
50
|
-
'https://docs.campx.in/Workflows/assessment_rules/',
|
|
51
|
-
'_blank',
|
|
52
|
-
),
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
'/ums/classrooms/:id/timetable': {
|
|
57
|
-
actions: [
|
|
58
|
-
{
|
|
59
|
-
name: 'Know how to suspend a class',
|
|
60
|
-
onClick: () =>
|
|
61
|
-
window.open(
|
|
62
|
-
'https://docs.campx.in/Workflows/suspending-a-class/',
|
|
63
|
-
'_blank',
|
|
64
|
-
),
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
'/exams/examinations/:id/bundle-subjects': {
|
|
70
|
-
actions: [
|
|
71
|
-
{
|
|
72
|
-
name: 'Learn about Scanning & Bundling',
|
|
73
|
-
onClick: () =>
|
|
74
|
-
window.open(
|
|
75
|
-
'https://docs.campx.in/Workflows/scanningbundling_booklets/',
|
|
76
|
-
'_blank',
|
|
77
|
-
),
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'Know how to upload digital booklets',
|
|
81
|
-
onClick: () =>
|
|
82
|
-
window.open(
|
|
83
|
-
'https://docs.campx.in/Workflows/digital_booklets/',
|
|
84
|
-
'_blank',
|
|
85
|
-
),
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
};
|