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';
...
@@ -3,7 +3,7 @@ import { Column } from 'react-table';
export
interface
dataProps
{
export
interface
dataProps
{
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
number
;
curriculumName
:
String
;
curriculumName
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
tutorials
:
tutorialItemProps
[];
...
@@ -11,7 +11,7 @@ export interface dataProps {
...
@@ -11,7 +11,7 @@ export interface dataProps {
createdBy
:
String
;
createdBy
:
String
;
updatedBy
:
String
;
updatedBy
:
String
;
createdAt
:
Date
;
createdAt
:
Date
;
updatedAt
:
Date
;
updatedAt
:
Date
;
}
}
export
interface
ReactTableProps
{
export
interface
ReactTableProps
{
...
@@ -23,7 +23,7 @@ export interface ReactTableProps {
...
@@ -23,7 +23,7 @@ export interface ReactTableProps {
export
interface
curriculumProps
{
export
interface
curriculumProps
{
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
number
;
curriculumTitle
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
...
@@ -32,7 +32,7 @@ export interface curriculumProps {
...
@@ -32,7 +32,7 @@ export interface curriculumProps {
createdBy
:
String
;
createdBy
:
String
;
updatedBy
:
String
;
updatedBy
:
String
;
createdAt
:
Date
;
createdAt
:
Date
;
updatedAt
:
Date
;
updatedAt
:
Date
;
}
}
export
interface
tutorialItemProps
{
export
interface
tutorialItemProps
{
...
...
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
View file @
2b72055b
...
@@ -2,19 +2,21 @@ import { useState } from 'react';
...
@@ -2,19 +2,21 @@ import { useState } from 'react';
// material-ui
// material-ui
import
{
import
{
Autocomplete
,
Box
,
Box
,
Button
,
Button
,
DialogActions
,
DialogActions
,
DialogContent
,
DialogContent
,
DialogTitle
,
DialogTitle
,
Divider
,
Divider
,
FormHelperText
,
Grid
,
Grid
,
InputLabel
,
InputLabel
,
Stack
,
Stack
,
TextField
,
TextField
,
Tooltip
Tooltip
}
from
'
@mui/material
'
;
}
from
'
@mui/material
'
;
//
import { useTheme } from '@mui/material/styles';
import
{
useTheme
}
from
'
@mui/material/styles
'
;
import
{
LocalizationProvider
}
from
'
@mui/x-date-pickers
'
;
import
{
LocalizationProvider
}
from
'
@mui/x-date-pickers
'
;
import
{
AdapterDateFns
}
from
'
@mui/x-date-pickers/AdapterDateFns
'
;
import
{
AdapterDateFns
}
from
'
@mui/x-date-pickers/AdapterDateFns
'
;
...
@@ -30,6 +32,7 @@ import IconButton from 'components/@extended/IconButton';
...
@@ -30,6 +32,7 @@ import IconButton from 'components/@extended/IconButton';
// assets
// assets
import
{
DeleteFilled
}
from
'
@ant-design/icons
'
;
import
{
DeleteFilled
}
from
'
@ant-design/icons
'
;
import
MainCard
from
'
components/MainCard
'
;
import
MainCard
from
'
components/MainCard
'
;
import
curriculumLevels
,
{
CurriculumLevelsType
}
from
'
data/curriculumLevels
'
;
import
AlertCurriculumDelete
from
'
./AlertCurriculumDelete
'
;
import
AlertCurriculumDelete
from
'
./AlertCurriculumDelete
'
;
// types
// types
...
@@ -40,7 +43,7 @@ const getInitialValues = (curriculum: FormikValues | null) => {
...
@@ -40,7 +43,7 @@ const getInitialValues = (curriculum: FormikValues | null) => {
const
newCurriculum
=
{
const
newCurriculum
=
{
_id
:
undefined
,
_id
:
undefined
,
curriculumCode
:
""
,
curriculumCode
:
""
,
curriculumLevel
:
""
,
curriculumLevel
:
undefined
,
curriculumTitle
:
""
,
curriculumTitle
:
""
,
curriculumDescription
:
""
,
curriculumDescription
:
""
,
curriculumImage
:
""
,
curriculumImage
:
""
,
...
@@ -60,7 +63,7 @@ export interface Props {
...
@@ -60,7 +63,7 @@ export interface Props {
curriculum
?:
{
curriculum
?:
{
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
number
;
curriculumTitle
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
...
@@ -75,7 +78,7 @@ export interface Props {
...
@@ -75,7 +78,7 @@ export interface Props {
}
}
const
AddEditCurriculum
=
({
curriculum
,
onCancel
}:
Props
)
=>
{
const
AddEditCurriculum
=
({
curriculum
,
onCancel
}:
Props
)
=>
{
//
const theme = useTheme();
const
theme
=
useTheme
();
const
isCreating
=
!
curriculum
;
const
isCreating
=
!
curriculum
;
...
@@ -138,14 +141,30 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
...
@@ -138,14 +141,30 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
<
Grid
item
xs=
{
4
}
>
<
Grid
item
xs=
{
4
}
>
<
Stack
spacing=
{
1.25
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
"curriculumLevel"
>
Curriculum Level
</
InputLabel
>
<
InputLabel
htmlFor=
"curriculumLevel"
>
Curriculum Level
</
InputLabel
>
<
TextField
<
Autocomplete
fullWidth
fullWidth
id=
"curriculumLevel"
id=
"curriculumLevel"
placeholder=
"Enter Curriculum Level"
value=
{
curriculumLevels
.
find
((
option
)
=>
option
.
id
===
formik
.
values
.
curriculumLevel
)
||
null
}
{
...
getFieldProps
('
curriculumLevel
')}
onChange=
{
(
event
:
any
,
newValue
:
CurriculumLevelsType
|
null
)
=>
{
error=
{
Boolean
(
touched
.
curriculumLevel
&&
errors
.
curriculumLevel
)
}
formik
.
setFieldValue
(
'
curriculumLevel
'
,
newValue
?.
id
);
helperText=
{
touched
.
curriculumLevel
&&
errors
.
curriculumLevel
}
}
}
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
>
</
Stack
>
</
Grid
>
</
Grid
>
<
Grid
item
xs=
{
4
}
>
<
Grid
item
xs=
{
4
}
>
...
@@ -213,17 +232,33 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
...
@@ -213,17 +232,33 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
values
.
tutorials
.
map
((
item
,
index
)
=>
{
values
.
tutorials
.
map
((
item
,
index
)
=>
{
return
(
return
(
<>
<>
<
Grid
item
xs=
{
11
}
>
<
Grid
item
xs=
{
11
}
>
<
Stack
spacing=
{
1.25
}
>
<
Stack
spacing=
{
1.25
}
>
<
InputLabel
htmlFor=
{
`tutorials.${index}`
}
>
Tutorial
</
InputLabel
>
<
InputLabel
htmlFor=
{
`tutorials.${index}`
}
>
Tutorial
</
InputLabel
>
<
TextField
<
Autocomplete
fullWidth
fullWidth
id=
{
`tutorials.${index}`
}
id=
{
`tutorials.${index}`
}
placeholder=
"Enter Tutorial"
// value=
{
tutorials
.
find
((
option
)
=
>
option.id === formik.values.curriculumLevel) || null}
{
...
getFieldProps
(`
tutorials
.
$
{
index
}`)}
// onChange=
{
(
event
:
any
,
newValue
:
CurriculumLevelsType
|
null
)
=>
{
// error=
{
Boolean
(
touched
.
ingredientNutritions
![
index
]
.
nutritionCategory
&&
errors
.
ingredientNutritions
![
index
]
.
nutritionCategory
)}
// formik.setFieldValue(`tutorials.$
{
index
}
`, newValue?.id);
// helperText=
{
touched
.
ingredientNutritions
![
index
]
.
nutritionCategory
&&
errors
.
ingredientNutritions
![
index
]
.
nutritionCategory
}
// }
}
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
>
</
Stack
>
</
Grid
>
</
Grid
>
<
Grid
item
xs=
{
1
}
style=
{
{
marginTop
:
"
4%
"
}
}
>
<
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