Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-029
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-029
2023-029
Commits
1d1620d0
Commit
1d1620d0
authored
Aug 30, 2023
by
janithgamage1.ed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : update
Desc : update project
parent
ccd28f55
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
49 deletions
+86
-49
Project/Backend/Server_Node/models/curriculum.model.js
Project/Backend/Server_Node/models/curriculum.model.js
+7
-22
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
...ages/parameter/curriculum-management/list/types/types.tsx
+1
-1
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
...ns/parameters/curriculum-management/AddEditCurriculum.tsx
+78
-26
No files found.
Project/Backend/Server_Node/models/curriculum.model.js
View file @
1d1620d0
...
@@ -13,26 +13,11 @@ const commonFields = {
...
@@ -13,26 +13,11 @@ const commonFields = {
},
},
};
};
const
taskItemSchema
=
new
mongoose
.
Schema
({
title
:
String
,
description
:
String
,
howToDo
:
String
,
referenceImage
:
String
,
referenceVideo
:
String
,
// Additional fields for task items
});
const
tutorialSchema
=
new
mongoose
.
Schema
({
tutorialCode
:
String
,
tutorialTitle
:
String
,
tutorialDescription
:
String
,
tutorialImage
:
String
,
taskItems
:
[
taskItemSchema
],
// Embed task items as subdocuments
// Additional fields for tutorial content
});
const
curriculumSchema
=
new
mongoose
.
Schema
({
const
curriculumSchema
=
new
mongoose
.
Schema
({
curriculumCode
:
String
,
curriculumCode
:
{
type
:
String
,
unique
:
true
,
// Ensures unique values for curriculumCode
},
curriculumLevel
:
String
,
curriculumLevel
:
String
,
curriculumTitle
:
String
,
curriculumTitle
:
String
,
curriculumDescription
:
String
,
curriculumDescription
:
String
,
...
...
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
View file @
1d1620d0
...
@@ -27,7 +27,7 @@ export interface curriculumProps {
...
@@ -27,7 +27,7 @@ export interface curriculumProps {
curriculumTitle
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
tutorials
:
string
[];
status
:
Number
;
status
:
Number
;
createdBy
:
String
;
createdBy
:
String
;
updatedBy
:
String
;
updatedBy
:
String
;
...
...
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
View file @
1d1620d0
...
@@ -8,7 +8,9 @@ import {
...
@@ -8,7 +8,9 @@ import {
DialogTitle
,
DialogTitle
,
Divider
,
Divider
,
Grid
,
Grid
,
InputLabel
,
Stack
,
Stack
,
TextField
,
Tooltip
Tooltip
}
from
'
@mui/material
'
;
}
from
'
@mui/material
'
;
// import { useTheme } from '@mui/material/styles';
// import { useTheme } from '@mui/material/styles';
...
@@ -35,6 +37,12 @@ const getInitialValues = (curriculum: FormikValues | null) => {
...
@@ -35,6 +37,12 @@ const getInitialValues = (curriculum: FormikValues | null) => {
const
newCurriculum
=
{
const
newCurriculum
=
{
_id
:
undefined
,
_id
:
undefined
,
curriculumCode
:
""
,
curriculumLevel
:
""
,
curriculumTitle
:
""
,
curriculumDescription
:
""
,
curriculumImage
:
""
,
tutorials
:
[
''
],
}
}
if
(
curriculum
)
{
if
(
curriculum
)
{
...
@@ -54,7 +62,7 @@ export interface Props {
...
@@ -54,7 +62,7 @@ export interface Props {
curriculumTitle
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
tutorials
:
string
[];
status
:
Number
;
status
:
Number
;
createdBy
:
String
;
createdBy
:
String
;
updatedBy
:
String
;
updatedBy
:
String
;
...
@@ -64,29 +72,6 @@ export interface Props {
...
@@ -64,29 +72,6 @@ export interface Props {
onCancel
:
()
=>
void
;
onCancel
:
()
=>
void
;
}
}
export
interface
tutorialItemProps
{
_id
:
number
|
string
|
undefined
;
tutorialCode
:
String
;
tutorialTitle
:
String
;
tutorialDescription
:
String
;
tutorialImage
:
String
;
status
:
Number
;
createdBy
:
String
;
updatedBy
:
String
;
createdAt
:
Date
;
updatedAt
:
Date
;
taskItems
:
taskItemProps
[]
}
export
interface
taskItemProps
{
_id
:
number
|
string
|
undefined
;
title
:
String
;
description
:
String
;
howToDo
:
String
;
referenceImage
:
String
;
referenceVideo
:
String
;
}
const
AddEditCurriculum
=
({
curriculum
,
onCancel
}:
Props
)
=>
{
const
AddEditCurriculum
=
({
curriculum
,
onCancel
}:
Props
)
=>
{
// const theme = useTheme();
// const theme = useTheme();
...
@@ -121,8 +106,8 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
...
@@ -121,8 +106,8 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
}
}
});
});
//
const { errors, touched, handleSubmit, isSubmitting, getFieldProps } = formik;
const
{
errors
,
touched
,
handleSubmit
,
isSubmitting
,
getFieldProps
}
=
formik
;
const
{
handleSubmit
,
isSubmitting
}
=
formik
;
//
const { handleSubmit, isSubmitting } = formik;
return
(
return
(
<>
<>
...
@@ -135,6 +120,73 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
...
@@ -135,6 +120,73 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
<
Grid
container
spacing=
{
3
}
>
<
Grid
container
spacing=
{
3
}
>
<
Grid
item
xs=
{
12
}
md=
{
12
}
>
<
Grid
item
xs=
{
12
}
md=
{
12
}
>
<
Grid
container
spacing=
{
3
}
>
<
Grid
container
spacing=
{
3
}
>
<
Grid
item
xs=
{
4
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumCode"
>
Curriculum Code
</
InputLabel
>
<
TextField
fullWidth
id=
"curriculumCode"
placeholder=
"Enter Curriculum Code"
{
...
getFieldProps
('
curriculumCode
')}
error=
{
Boolean
(
touched
.
curriculumCode
&&
errors
.
curriculumCode
)
}
helperText=
{
touched
.
curriculumCode
&&
errors
.
curriculumCode
}
/>
</
Stack
>
</
Grid
>
<
Grid
item
xs=
{
4
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumLevel"
>
Curriculum Level
</
InputLabel
>
<
TextField
fullWidth
id=
"curriculumLevel"
placeholder=
"Enter Curriculum Level"
{
...
getFieldProps
('
curriculumLevel
')}
error=
{
Boolean
(
touched
.
curriculumLevel
&&
errors
.
curriculumLevel
)
}
helperText=
{
touched
.
curriculumLevel
&&
errors
.
curriculumLevel
}
/>
</
Stack
>
</
Grid
>
<
Grid
item
xs=
{
4
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumTitle"
>
Curriculum Title
</
InputLabel
>
<
TextField
fullWidth
id=
"curriculumTitle"
placeholder=
"Enter Curriculum Title"
{
...
getFieldProps
('
curriculumTitle
')}
error=
{
Boolean
(
touched
.
curriculumTitle
&&
errors
.
curriculumTitle
)
}
helperText=
{
touched
.
curriculumTitle
&&
errors
.
curriculumTitle
}
/>
</
Stack
>
</
Grid
>
<
Grid
item
xs=
{
12
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumImage"
>
Curriculum Image
</
InputLabel
>
<
TextField
fullWidth
id=
"curriculumImage"
placeholder=
"Enter Curriculum Image"
{
...
getFieldProps
('
curriculumImage
')}
error=
{
Boolean
(
touched
.
curriculumImage
&&
errors
.
curriculumImage
)
}
helperText=
{
touched
.
curriculumImage
&&
errors
.
curriculumImage
}
/>
</
Stack
>
</
Grid
>
<
Grid
item
xs=
{
12
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumDescription"
>
Curriculum Description
</
InputLabel
>
<
TextField
multiline
rows=
{
2
}
fullWidth
id=
"curriculumDescription"
placeholder=
"Enter Curriculum Description"
{
...
getFieldProps
('
curriculumDescription
')}
error=
{
Boolean
(
touched
.
curriculumDescription
&&
errors
.
curriculumDescription
)
}
helperText=
{
touched
.
curriculumDescription
&&
errors
.
curriculumDescription
}
/>
</
Stack
>
</
Grid
>
</
Grid
>
</
Grid
>
</
Grid
>
</
Grid
>
</
Grid
>
</
Grid
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment