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
2b72055b
Commit
2b72055b
authored
Aug 30, 2023
by
janithgamage1.ed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update
Desc : update project
parent
2ae4f7cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
19 deletions
+69
-19
Project/Frontend/SignConnectPlus/src/data/curriculumLevels.ts
...ect/Frontend/SignConnectPlus/src/data/curriculumLevels.ts
+15
-0
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
...ages/parameter/curriculum-management/list/types/types.tsx
+4
-4
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
...ns/parameters/curriculum-management/AddEditCurriculum.tsx
+50
-15
No files found.
Project/Frontend/SignConnectPlus/src/data/curriculumLevels.ts
0 → 100644
View file @
2b72055b
export
interface
CurriculumLevelsType
{
id
:
number
code
:
string
description
:
string
}
// ==============================|| DATA - CURRICULUM LEVELS ||============================== //
const
curriculumLevels
:
readonly
CurriculumLevelsType
[]
=
[
{
id
:
1
,
code
:
"
Level 1
"
,
description
:
"
Preliminary
"
},
{
id
:
2
,
code
:
"
Level 2
"
,
description
:
"
Intermediate
"
},
{
id
:
3
,
code
:
"
Level 3
"
,
description
:
"
Advance
"
},
];
export
default
curriculumLevels
;
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
View file @
2b72055b
...
...
@@ -3,7 +3,7 @@ import { Column } from 'react-table';
export
interface
dataProps
{
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
number
;
curriculumName
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
...
...
@@ -11,7 +11,7 @@ export interface dataProps {
createdBy
:
String
;
updatedBy
:
String
;
createdAt
:
Date
;
updatedAt
:
Date
;
updatedAt
:
Date
;
}
export
interface
ReactTableProps
{
...
...
@@ -23,7 +23,7 @@ export interface ReactTableProps {
export
interface
curriculumProps
{
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
number
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
...
...
@@ -32,7 +32,7 @@ export interface curriculumProps {
createdBy
:
String
;
updatedBy
:
String
;
createdAt
:
Date
;
updatedAt
:
Date
;
updatedAt
:
Date
;
}
export
interface
tutorialItemProps
{
...
...
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
View file @
2b72055b
...
...
@@ -2,19 +2,21 @@ import { useState } from 'react';
// material-ui
import
{
Autocomplete
,
Box
,
Button
,
DialogActions
,
DialogContent
,
DialogTitle
,
Divider
,
FormHelperText
,
Grid
,
InputLabel
,
Stack
,
TextField
,
Tooltip
}
from
'
@mui/material
'
;
//
import { useTheme } from '@mui/material/styles';
import
{
useTheme
}
from
'
@mui/material/styles
'
;
import
{
LocalizationProvider
}
from
'
@mui/x-date-pickers
'
;
import
{
AdapterDateFns
}
from
'
@mui/x-date-pickers/AdapterDateFns
'
;
...
...
@@ -30,6 +32,7 @@ import IconButton from 'components/@extended/IconButton';
// assets
import
{
DeleteFilled
}
from
'
@ant-design/icons
'
;
import
MainCard
from
'
components/MainCard
'
;
import
curriculumLevels
,
{
CurriculumLevelsType
}
from
'
data/curriculumLevels
'
;
import
AlertCurriculumDelete
from
'
./AlertCurriculumDelete
'
;
// types
...
...
@@ -40,7 +43,7 @@ const getInitialValues = (curriculum: FormikValues | null) => {
const
newCurriculum
=
{
_id
:
undefined
,
curriculumCode
:
""
,
curriculumLevel
:
""
,
curriculumLevel
:
undefined
,
curriculumTitle
:
""
,
curriculumDescription
:
""
,
curriculumImage
:
""
,
...
...
@@ -60,7 +63,7 @@ export interface Props {
curriculum
?:
{
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
number
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
...
...
@@ -75,7 +78,7 @@ export interface Props {
}
const
AddEditCurriculum
=
({
curriculum
,
onCancel
}:
Props
)
=>
{
//
const theme = useTheme();
const
theme
=
useTheme
();
const
isCreating
=
!
curriculum
;
...
...
@@ -138,14 +141,30 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
<
Grid
item
xs=
{
4
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumLevel"
>
Curriculum Level
</
InputLabel
>
<
TextField
<
Autocomplete
fullWidth
id=
"curriculumLevel"
placeholder=
"Enter Curriculum Level"
{
...
getFieldProps
('
curriculumLevel
')}
error=
{
Boolean
(
touched
.
curriculumLevel
&&
errors
.
curriculumLevel
)
}
helperText=
{
touched
.
curriculumLevel
&&
errors
.
curriculumLevel
}
value=
{
curriculumLevels
.
find
((
option
)
=>
option
.
id
===
formik
.
values
.
curriculumLevel
)
||
null
}
onChange=
{
(
event
:
any
,
newValue
:
CurriculumLevelsType
|
null
)
=>
{
formik
.
setFieldValue
(
'
curriculumLevel
'
,
newValue
?.
id
);
}
}
options=
{
curriculumLevels
}
getOptionLabel=
{
(
item
)
=>
`${item.description}`
}
renderInput=
{
(
params
)
=>
{
return
(
<
TextField
{
...
params
}
placeholder=
"Select Curriculum Level"
sx=
{
{
'
& .MuiAutocomplete-input.Mui-disabled
'
:
{
WebkitTextFillColor
:
theme
.
palette
.
text
.
primary
}
}
}
/>
)
}
}
/>
{
formik
.
touched
.
curriculumLevel
&&
formik
.
errors
.
curriculumLevel
&&
(
<
FormHelperText
error
id=
"helper-text-curriculumLevel"
>
{
formik
.
errors
.
curriculumLevel
}
</
FormHelperText
>
)
}
</
Stack
>
</
Grid
>
<
Grid
item
xs=
{
4
}
>
...
...
@@ -213,17 +232,33 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
values
.
tutorials
.
map
((
item
,
index
)
=>
{
return
(
<>
<
Grid
item
xs=
{
11
}
>
<
Grid
item
xs=
{
11
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
{
`tutorials.${index}`
}
>
Tutorial
</
InputLabel
>
<
TextField
<
Autocomplete
fullWidth
id=
{
`tutorials.${index}`
}
placeholder=
"Enter Tutorial"
{
...
getFieldProps
(`
tutorials
.
$
{
index
}`)}
// error=
{
Boolean
(
touched
.
ingredientNutritions
![
index
]
.
nutritionCategory
&&
errors
.
ingredientNutritions
![
index
]
.
nutritionCategory
)}
// helperText=
{
touched
.
ingredientNutritions
![
index
]
.
nutritionCategory
&&
errors
.
ingredientNutritions
![
index
]
.
nutritionCategory
}
// value=
{
tutorials
.
find
((
option
)
=
>
option.id === formik.values.curriculumLevel) || null}
// onChange=
{
(
event
:
any
,
newValue
:
CurriculumLevelsType
|
null
)
=>
{
// formik.setFieldValue(`tutorials.$
{
index
}
`, newValue?.id);
// }
}
options=
{
[]
}
// getOptionLabel=
{
(
item
)
=>
`${item.description}`
}
renderInput=
{
(
params
)
=>
{
return
(
<
TextField
{
...
params
}
placeholder=
"Select Tutorial"
sx=
{
{
'
& .MuiAutocomplete-input.Mui-disabled
'
:
{
WebkitTextFillColor
:
theme
.
palette
.
text
.
primary
}
}
}
/>
)
}
}
/
>
{
/* {formik.touched.curriculumLevel && formik.errors.curriculumLevel && (
<FormHelperText error id="helper-text-curriculumLevel">
{formik.errors.curriculumLevel}
</FormHelperText>
)} */
}
</
Stack
>
</
Grid
>
<
Grid
item
xs=
{
1
}
style=
{
{
marginTop
:
"
4%
"
}
}
>
...
...
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