Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-158
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
2
Merge Requests
2
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
2022-158
2022-158
Commits
5d4ba196
Commit
5d4ba196
authored
Nov 07, 2022
by
Weerasinghe D.N.H
Browse files
Options
Browse Files
Download
Plain Diff
BACKEND : Merge conflict fixed
parents
c20fbbe4
c0a2b07e
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1380 additions
and
210 deletions
+1380
-210
backend/.idea/.gitignore
backend/.idea/.gitignore
+0
-8
backend/.idea/backend.iml
backend/.idea/backend.iml
+0
-13
backend/.idea/inspectionProfiles/Project_Default.xml
backend/.idea/inspectionProfiles/Project_Default.xml
+0
-18
backend/.idea/inspectionProfiles/profiles_settings.xml
backend/.idea/inspectionProfiles/profiles_settings.xml
+0
-6
backend/.idea/misc.xml
backend/.idea/misc.xml
+0
-4
backend/.idea/modules.xml
backend/.idea/modules.xml
+0
-8
backend/.idea/vcs.xml
backend/.idea/vcs.xml
+0
-6
backend/app.py
backend/app.py
+0
-2
backend/database.db
backend/database.db
+0
-0
backend/services/class_diagram_class_detection_service.py
backend/services/class_diagram_class_detection_service.py
+41
-69
backend/services/class_relationship_relativity_service.py
backend/services/class_relationship_relativity_service.py
+18
-1
frontend/src/pages/DeliveryReportSubmit.js
frontend/src/pages/DeliveryReportSubmit.js
+172
-0
frontend/src/pages/ManageAllOrders.js
frontend/src/pages/ManageAllOrders.js
+83
-0
frontend/src/pages/ManageDeliveryReports.js
frontend/src/pages/ManageDeliveryReports.js
+94
-0
frontend/src/pages/ManageSites.js
frontend/src/pages/ManageSites.js
+197
-0
frontend/src/pages/OfficerDashboard.js
frontend/src/pages/OfficerDashboard.js
+232
-0
frontend/src/pages/OfficerOrders.js
frontend/src/pages/OfficerOrders.js
+178
-0
frontend/src/pages/SiteManagerDashboard.js
frontend/src/pages/SiteManagerDashboard.js
+147
-0
frontend/src/pages/StudentSubjectAssingment.js
frontend/src/pages/StudentSubjectAssingment.js
+206
-45
frontend/src/routes/Routes.js
frontend/src/routes/Routes.js
+12
-30
No files found.
backend/.idea/.gitignore
deleted
100644 → 0
View file @
c20fbbe4
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
backend/.idea/backend.iml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/backend"
isTestSource=
"false"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TemplatesService"
>
<option
name=
"TEMPLATE_CONFIGURATION"
value=
"Jinja2"
/>
</component>
</module>
\ No newline at end of file
backend/.idea/inspectionProfiles/Project_Default.xml
deleted
100644 → 0
View file @
c20fbbe4
<component
name=
"InspectionProjectProfileManager"
>
<profile
version=
"1.0"
>
<option
name=
"myName"
value=
"Project Default"
/>
<inspection_tool
class=
"DuplicatedCode"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<Languages>
<language
minSize=
"149"
name=
"Python"
/>
</Languages>
</inspection_tool>
<inspection_tool
class=
"PyPep8Inspection"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<option
name=
"ignoredErrors"
>
<list>
<option
value=
"E128"
/>
<option
value=
"E501"
/>
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
backend/.idea/inspectionProfiles/profiles_settings.xml
deleted
100644 → 0
View file @
c20fbbe4
<component
name=
"InspectionProjectProfileManager"
>
<settings>
<option
name=
"USE_PROJECT_PROFILE"
value=
"false"
/>
<version
value=
"1.0"
/>
</settings>
</component>
\ No newline at end of file
backend/.idea/misc.xml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.10"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
backend/.idea/modules.xml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/backend.iml"
filepath=
"$PROJECT_DIR$/.idea/backend.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
backend/.idea/vcs.xml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$/.."
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
backend/app.py
View file @
5d4ba196
...
...
@@ -11,7 +11,6 @@ from routes.module_routes import module
from
routes.assignment_routes
import
assignment
from
routes.diagram_routes
import
diagram
from
routes.submission_routes
import
submission
from
routes.plagiarism_routes
import
use_case_diagram_plagiarism
APP_ROOT
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
...
...
@@ -48,7 +47,6 @@ app.register_blueprint(module)
app
.
register_blueprint
(
assignment
)
app
.
register_blueprint
(
diagram
)
app
.
register_blueprint
(
submission
)
app
.
register_blueprint
(
use_case_diagram_plagiarism
)
@
app
.
before_first_request
...
...
backend/database.db
deleted
100644 → 0
View file @
c20fbbe4
File deleted
backend/services/class_diagram_class_detection_service.py
View file @
5d4ba196
...
...
@@ -5,6 +5,7 @@ import pytesseract as ts
from
PIL
import
Image
from
models.attribute_model
import
Attribute
from
object_detection.utils
import
label_map_util
import
matplotlib.pyplot
as
plt
import
app
import
tensorflow
as
tf
import
spacy
...
...
@@ -20,47 +21,41 @@ ts.pytesseract.tesseract_cmd = r'C:\Users\DELL\AppData\Local\Programs\Tesseract-
def
component_separation
(
filename
,
class_comp_id
):
"""
detect class diagram component predictions from SSD model & direct the components to correct method
:param filename: name of the submitted image file
:param class_comp_id: ID of the submission
"""
mdl1_path
=
app
.
CLASS_SAVED_MODEL_PATH
lbl1_path
=
app
.
CLASS_SAVED_LABEL_PATH
img1_path
=
app
.
SUBMISSION_PATH_CLASS
+
'/'
+
filename
image_nparray
=
np
.
array
(
Image
.
open
(
img1_path
))
# print(img1_path)
boxes
,
accurate_indexes
,
category_index
,
class_id
=
class_object_detection
(
mdl1_path
,
lbl1_path
,
image_nparray
)
for
index
in
range
(
0
,
len
(
accurate_indexes
)):
#
get the category name of the component
#
Convert the class id in their name
if
len
(
accurate_indexes
)
>
1
:
category
=
category_index
[
class_id
[
index
]][
'name'
]
elif
len
(
accurate_indexes
)
==
1
:
category
=
category_index
[
class_id
][
'name'
]
# print(category)
# select the component type and provide method to detect further details
if
category
==
'class'
:
# print(filename, 'class')
class_details_detection
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
category
)
elif
category
==
'interface'
:
# print(filename, 'interface')
class_details_detection
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
category
)
else
:
# print(filename, 'relationship')
detect_class_relationship
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
category
)
# relationship_details_detection(image_nparray, boxes, index, class_comp_id, category)
def
class_object_detection
(
model_path
,
label_path
,
image_nparray
):
"""
do predictions using trained models
:param model_path: path to the saved model
:param label_path: path to the label_map.pbtxt
:param image_nparray: numpy array for image
:return: prediction details
"""
detect_fn
=
tf
.
saved_model
.
load
(
model_path
)
category_index
=
label_map_util
.
create_category_index_from_labelmap
(
label_path
,
use_display_name
=
True
)
image_np
=
image_nparray
...
...
@@ -85,17 +80,10 @@ def class_object_detection(model_path, label_path, image_nparray):
def
class_details_detection
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
class_type
):
"""
detect class or interface details(name, methods & attributes) and save them in the database
:param image_nparray: numpy array for cropped classes or interfaces
:param boxes: coordinates of detected components
:param index: index of the loop in component_separation method
:param class_comp_id: ID of the submission
:param class_type: whether the component a class or interface
"""
methods_attributes
=
[]
_image
,
cl_ymin
,
cl_xmin
,
cl_ymax
,
cl_xmax
=
crop_image_
(
image_nparray
,
boxes
,
index
)
# cv2.imwrite('image_1.jpg', _image)
mdl2_path
=
app
.
CLASS_COMP_SAVED_MODEL_PATH
lbl2_path
=
app
.
CLASS_COMP_SAVED_LABEL_PATH
...
...
@@ -108,51 +96,52 @@ def class_details_detection(image_nparray, boxes, index, class_comp_id, class_ty
else
:
category
=
category_index
[
class_id
][
'name'
]
# print(category)
if
category
==
'class_attributes'
:
# print(category, 'line 96 - inside attributes')
class_attributes
,
y_min
,
x_min
,
y_max
,
x_max
=
crop_image_
(
_image
,
boxes_class
,
j
)
class_attributes
=
cv2
.
resize
(
class_attributes
,
None
,
fx
=
2
,
fy
=
2
)
# cv2.imwrite('image.jpg', class_attributes)
text
=
text_extraction
(
class_attributes
)
attr
=
save_attributes_methods
(
text
,
'attribute'
)
methods_attributes
.
append
(
attr
)
elif
category
==
'class_methods'
:
# print(category, 'line 103 - inside methods')
class_methods
,
y_min
,
x_min
,
y_max
,
x_max
=
crop_image_
(
_image
,
boxes_class
,
j
)
class_methods
=
cv2
.
resize
(
class_methods
,
None
,
fx
=
2
,
fy
=
2
)
text
=
text_extraction
(
class_methods
)
methods
=
save_attributes_methods
(
text
,
'method'
)
methods_attributes
.
append
(
methods
)
# print(text, '111 line')
comp_name
=
class_name_detection
(
_image
,
boxes_class
,
category_index
,
accurate_indexes
,
class_id
)
# print(comp_name, 'comp_name line 118')
comp
=
save_class_interface
(
class_type
,
comp_name
,
cl_ymin
,
cl_xmin
,
cl_ymax
,
cl_xmax
,
class_comp_id
)
# print(comp, 'component_id line 120')
alter_attributes_methods
(
methods_attributes
,
comp
.
id
)
# crop image using boxes & index
def
crop_image_
(
image
,
boxes
,
index
):
"""
crop image according to the given coordinates
:param image: numpy array for image
:param boxes: detection coordinates of predictions
:param index: index of the loop in component_separation method
:return: cropped image as numpy array
"""
height
,
width
,
c
=
image
.
shape
# crop box format: xmin, ymin, xmax, ymax
ymin
=
boxes
[
index
][
0
]
*
height
xmin
=
boxes
[
index
][
1
]
*
width
ymax
=
boxes
[
index
][
2
]
*
height
xmax
=
boxes
[
index
][
3
]
*
width
cropped_image
=
image
[
int
(
ymin
):
int
(
ymax
),
int
(
xmin
):
int
(
xmax
)]
# image = cv2.cvtColor(cropped_image, cv2.COLOR_BGR2GRAY)
# image = cv2.resize(image, (800, 500))
# returns cropped image , ymin,xmin,ymax & xmax
return
cropped_image
,
ymin
,
xmin
,
ymax
,
xmax
# extract text from provided image
def
text_extraction
(
image
):
"""
extract text of image component
:param image: numpy array of image
:return: extracted text as a list
"""
config
=
'-l eng --oem 1 --psm 4'
text
=
ts
.
image_to_string
(
image
,
config
=
config
)
text
=
text
.
splitlines
()
...
...
@@ -161,15 +150,12 @@ def text_extraction(image):
return
text
# save attributes and methods in database
def
save_attributes_methods
(
text
,
typ
):
"""
detect attribute or method component and save them inside database
:param text: list of text
:param typ: type of object(attribute or method)
:return: all saved attributes and methods
"""
saved_data
=
[]
nlp
=
spacy
.
load
(
'en_core_web_sm'
)
for
element
in
text
:
# print(element, 'line 145')
# removable = str.maketrans('', '', '()')
nlp_ner
=
spacy
.
load
(
'ner_models/model-best'
)
nlp_output
=
nlp_ner
(
element
)
...
...
@@ -199,11 +185,13 @@ def save_attributes_methods(text, typ):
method
.
return_type
=
token
.
text
if
typ
==
'attribute'
:
# print(attr, 'line 175 - attr')
db
.
session
.
add
(
attr
)
db
.
session
.
commit
()
saved_data
.
append
(
attr
)
else
:
# print(method, 'line 181 method')
db
.
session
.
add
(
method
)
db
.
session
.
commit
()
saved_data
.
append
(
method
)
...
...
@@ -211,24 +199,18 @@ def save_attributes_methods(text, typ):
return
saved_data
# update attributes and methods with relevant class id
def
alter_attributes_methods
(
element_list
,
component_id
):
"""
Update saved method and attributes with class component ID
:param element_list: attributes and method as a list
:param component_id: class ID
"""
for
j
in
element_list
:
for
element
in
j
:
# print(component_id)
# print(element_list)
element
.
class_id
=
component_id
db
.
session
.
commit
()
# convert symbol access specifier to string
def
covert_to_access_specifier
(
access
):
"""
convert access specifier symbols to strings
:param access: access specifier symbol
:return: access specifier string
"""
if
access
==
"-"
:
return
"Private"
...
...
@@ -246,23 +228,20 @@ def covert_to_access_specifier(access):
def
class_name_detection
(
image
,
boxes
,
category_index
,
accurate_indexes
,
class_id
):
"""
detect & return class or interface name
:param image: class or interface component image
:param boxes: predicted coordinates of methods and attributes
:param category_index: category index of each component
:param accurate_indexes:
:param class_id:
:return: name of the class or interface
"""
# print(category_index, 'category_index')
# print(class_id, 'class_id')
height
,
width
,
c
=
image
.
shape
for
i
in
range
(
0
,
len
(
accurate_indexes
)):
if
len
(
accurate_indexes
)
>
1
:
category
=
category_index
[
class_id
[
i
]][
'name'
]
# print(category, '225 line')
else
:
category
=
category_index
[
class_id
][
'name'
]
# print(category, '225 line')
if
category
!=
'interface_name'
or
category
!=
'class_name'
:
ymin
=
boxes
[
i
][
0
]
*
height
...
...
@@ -271,9 +250,12 @@ def class_name_detection(image, boxes, category_index, accurate_indexes, class_i
xmax
=
boxes
[
i
][
3
]
*
width
cv2
.
rectangle
(
image
,
(
int
(
xmin
),
int
(
ymin
)),
(
int
(
xmax
),
int
(
ymax
)),
(
255
,
255
,
255
),
-
1
)
# cv2.imwrite('image_2.jpg', image)
class_name
=
text_extraction
(
image
)
# print(class_name, 'line 249 class name')
if
''
.
join
(
class_name
)
is
not
None
:
# print(class_name, 'line 251 class name')
if
"interface"
in
''
.
join
(
class_name
):
name
=
''
.
join
(
class_name
)
.
replace
(
"<<interface>>"
,
""
)
else
:
...
...
@@ -283,20 +265,10 @@ def class_name_detection(image, boxes, category_index, accurate_indexes, class_i
def
save_class_interface
(
class_type
,
comp_name
,
cl_ymin
,
cl_xmin
,
cl_ymax
,
cl_xmax
,
class_comp_id
):
"""
save class component and interface components in database
:param class_type: type of component (interface or class)
:param comp_name: name of interface or class
:param cl_ymin:
:param cl_xmin:
:param cl_ymax:
:param cl_xmax:
:param class_comp_id: submission ID of diagram
:return: database saved object
"""
comp
=
Component
(
class_answer
=
class_comp_id
,
name
=
comp_name
,
type
=
class_type
,
x_min
=
cl_xmin
,
y_min
=
cl_ymin
,
x_max
=
cl_xmax
,
y_max
=
cl_ymax
)
db
.
session
.
add
(
comp
)
db
.
session
.
commit
()
# print(comp, 'line 261 comp')
return
comp
backend/services/class_relationship_relativity_service.py
View file @
5d4ba196
...
...
@@ -15,9 +15,15 @@ from models.class_relationship_muplicity import Multiplicity
def
detect_class_relationship
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
category
):
# image = cv2.imread(app.SUBMISSION_PATH + '/' + filename)
height
,
width
,
c
=
image_nparray
.
shape
class_objects
=
Component
.
query
.
filter_by
(
class_answer
=
class_comp_id
)
.
all
()
# for i in range(0, len(accurate_indexes))
# if category_index[class_id[i]]['name'] != 'class' and category_index[class_id[i]]['name'] != 'interface':
# category_name = category_index[class_id[i]]['name']
ymin
=
boxes
[
index
][
0
]
*
height
xmin
=
boxes
[
index
][
1
]
*
width
ymax
=
boxes
[
index
][
2
]
*
height
...
...
@@ -238,13 +244,20 @@ def relationship_details_detection(image_nparray, boxes, index, class_comp_id, c
if
result
is
not
None
:
relationship_text
(
_image
,
result
,
relationship
)
# print(relationship, 'relationship')
def
relationship_text
(
_image
,
result
,
relationship
):
# boxes = [res[0] for res in result]
# texts = [res[1][0] for res in result]
# scores = [res[1][1] for res in result]
for
element
in
result
:
text
=
element
[
1
][
0
]
box
=
element
[
0
]
nlp_ner
=
spacy
.
load
(
'ner_models/model-best'
)
nlp_output
=
nlp_ner
(
text
)
# print(text, 'line 290')
# box = np.array(box,dtype=float)
box
=
np
.
array
(
box
)
.
astype
(
np
.
int32
)
xmin
=
min
(
box
[:,
0
])
...
...
@@ -252,6 +265,8 @@ def relationship_text(_image, result, relationship):
xmax
=
max
(
box
[:,
0
])
ymax
=
max
(
box
[:,
1
])
for
token
in
nlp_output
.
ents
:
# print(token.text, 'line 301')
# print(token.label_, 'line 302')
if
token
.
label_
==
'MULTIPLICITY'
or
contains_number
(
text
):
multiplicity
=
Multiplicity
(
value
=
token
.
text
,
relationship_id
=
relationship
.
id
,
x_min
=
xmin
,
...
...
@@ -272,12 +287,14 @@ def contains_number(string):
# crop image using boxes & index
def
crop_image_
(
image
,
boxes
,
index
):
height
,
width
,
c
=
image
.
shape
# crop box format: xmin, ymin, xmax, ymax
ymin
=
boxes
[
index
][
0
]
*
height
xmin
=
boxes
[
index
][
1
]
*
width
ymax
=
boxes
[
index
][
2
]
*
height
xmax
=
boxes
[
index
][
3
]
*
width
cropped_image
=
image
[
int
(
ymin
):
int
(
ymax
),
int
(
xmin
):
int
(
xmax
)]
# image = cv2.cvtColor(cropped_image, cv2.COLOR_BGR2GRAY)
# image = cv2.resize(image, (800, 500))
# returns cropped image , ymin,xmin,ymax & xmax
return
cropped_image
,
ymin
,
xmin
,
ymax
,
xmax
frontend/src/pages/DeliveryReportSubmit.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
{
useParams
}
from
"
react-router-dom
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
"
../assets/css/Usercreate.css
"
;
const
DeliveryReportSubmit
=
()
=>
{
const
{
id
}
=
useParams
();
const
[
btnState
,
setBtnState
]
=
useState
(
false
);
const
[
error
,
setError
]
=
useState
(
""
);
const
[
deliveryReport
,
setDeliveryReport
]
=
useState
({});
const
saveDeliveryReport
=
async
(
e
)
=>
{
e
.
preventDefault
();
setBtnState
(
true
);
if
(
!
deliveryReport
.
description
)
{
setBtnState
(
false
);
return
setError
(
"
Please fill all the fields
"
);
}
try
{
const
res
=
await
axios
.
post
(
"
/reports/deliveryreport
"
,
deliveryReport
);
if
(
res
.
status
===
201
)
{
setDeliveryReport
({});
getOrderDetails
();
setError
(
""
);
const
res
=
await
axios
.
put
(
`orders/supplier/submitted/
${
id
}
`
);
if
(
res
.
status
===
200
)
{
window
.
alert
(
"
Delivery report registered successfully
"
);
window
.
location
.
href
=
"
/auth/supplier/deliveryreports
"
;
}
}
setBtnState
(
false
);
}
catch
(
err
)
{
setBtnState
(
false
);
console
.
log
(
err
.
response
);
}
};
const
getOrderDetails
=
async
()
=>
{
try
{
const
res
=
await
axios
.
get
(
`orders/
${
id
}
`
);
console
.
log
(
res
.
data
);
setDeliveryReport
(
res
.
data
.
order
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
useEffect
(()
=>
getOrderDetails
(),
[]);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Submit
Delivery
Report
<
/h1
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
form
className
=
"
card
"
style
=
{{
position
:
"
relative
"
}}
>
{
error
&&
(
<
div
className
=
"
error-bg
"
style
=
{{
left
:
"
3%
"
}}
>
<
p
>
{
error
}
<
/p
>
<
/div
>
)}
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Order
Item
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Delivered Item
"
value
=
{
deliveryReport
.
itemName
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Order
ID
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Order ID
"
value
=
{
deliveryReport
.
_id
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Quantity
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Quantity
"
value
=
{
deliveryReport
.
quantity
}
required
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Total
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Delivered Item
"
value
=
{
deliveryReport
.
total
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Order
Type
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Order ID
"
value
=
{
deliveryReport
.
urgentOrder
===
false
?
"
Regular Order
"
:
"
Urgent Order
"
}
required
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
div
className
=
"
row-user
"
>
<
input
type
=
"
text
"
placeholder
=
"
Description
"
value
=
{
deliveryReport
.
description
}
onChange
=
{(
e
)
=>
setDeliveryReport
({
...
deliveryReport
,
description
:
e
.
target
.
value
,
})
}
required
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row-user
"
>
<
button
type
=
"
submit
"
onClick
=
{
saveDeliveryReport
}
>
{
btnState
?
"
Saving
"
:
"
Save
"
}
<
/button
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
DeliveryReportSubmit
;
frontend/src/pages/ManageAllOrders.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
axios
from
"
axios
"
;
const
ManageAllOrders
=
()
=>
{
const
fields
=
[
"
Order ID
"
,
"
Item Name
"
,
"
Quantity
"
,
"
Total
"
,
"
Created Date
"
,
"
Status
"
,
];
const
[
orders
,
setOrders
]
=
useState
(
null
);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
new
Date
(
item
.
createdAt
).
toLocaleDateString
()}
<
/td
>
<
td
>
<
Badge
type
=
{
permissionStatus
[
item
.
isApprovedByOfficer
]}
content
=
{
item
.
isApprovedByOfficer
}
/
>
<
/td
>
<
/tr
>
);
const
getAllOrder
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
orders/getAllOrdersByManager
"
);
console
.
log
(
res
.
data
.
orders
);
setOrders
(
res
.
data
.
orders
);
};
useEffect
(()
=>
{
getAllOrder
();
},
[]);
const
permissionStatus
=
{
pending
:
"
warning
"
,
approved
:
"
success
"
,
rejected
:
"
danger
"
,
};
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
div
className
=
"
card
"
>
<
h2
>
All
Order
Details
<
/h2
>
{
orders
&&
(
<
Table
limit
=
"
10
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
orders
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
Link
to
=
{
"
/auth/manager/ApprovedOrders
"
}
>
<
div
className
=
"
row-user
"
>
<
button
>
Approved
Orders
<
/button
>
<
/div
>
<
/Link
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
ManageAllOrders
;
frontend/src/pages/ManageDeliveryReports.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
"
../components/badge/badge.css
"
;
import
"
react-calendar/dist/Calendar.css
"
;
const
ManageDeliveryReports
=
()
=>
{
const
[
suppliers
,
setSuppliers
]
=
useState
([]);
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
const
fields
=
[
""
,
"
Item
"
,
"
Quantity
"
,
"
Description
"
,
"
Total
"
,
"
Delivered Address
"
,
"
Order Type
"
,
];
const
getAllSuppliers
=
async
()
=>
{
setIsLoading
(
true
);
try
{
const
res
=
await
axios
.
get
(
`reports/deliveryreport/supplier`
);
console
.
log
(
res
);
setSuppliers
(
res
.
data
.
reports
);
setIsLoading
(
false
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
useEffect
(()
=>
getAllSuppliers
(),
[]);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
item
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
description
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
item
.
address
}
<
/td
>
<
td
>
{
item
.
urgentOrder
?
(
<
div
style
=
{{
cursor
:
"
pointer
"
}}
>
<
Badge
type
=
"
danger
"
content
=
"
Urgent
"
/>
<
/div
>
)
:
(
<
div
style
=
{{
cursor
:
"
pointer
"
}}
>
<
Badge
type
=
"
primary
"
content
=
"
Regular
"
/>
<
/div
>
)}
<
/td
>
<
/tr
>
);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Manage
Delivery
Reports
<
/h1
>
<
div
className
=
"
row
"
><
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
div
className
=
"
card
"
>
{
isLoading
?
(
<
Spinner
/>
)
:
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
suppliers
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
ManageDeliveryReports
;
frontend/src/pages/ManageSites.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
"
../assets/css/Usercreate.css
"
;
import
axios
from
"
axios
"
;
const
ManageUsers
=
()
=>
{
const
[
error
,
setError
]
=
useState
(
""
);
const
[
btnState
,
setBtnState
]
=
useState
(
false
);
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
const
[
siteManagers
,
setSiteManagers
]
=
useState
([]);
const
[
sites
,
setSites
]
=
useState
([]);
const
[
site
,
setSite
]
=
useState
({
name
:
""
,
location
:
""
,
siteManagerId
:
""
,
});
const
fields
=
[
""
,
"
Site Name
"
,
"
Location
"
,
"
Site Manager
"
,
"
Email
"
];
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
name
}
<
/td
>
<
td
>
{
item
.
location
}
<
/td
>
<
td
>
{
item
.
siteManagerId
?
item
.
siteManagerId
.
name
:
"
Not Assigned
"
}
<
/td
>
<
td
>
{
item
.
siteManagerId
?
item
.
siteManagerId
.
email
:
"
Not Assigned
"
}
<
/td
>
<
/tr
>
);
const
saveSite
=
async
(
e
)
=>
{
e
.
preventDefault
();
setBtnState
(
true
);
for
(
let
key
of
Object
.
keys
(
site
))
{
if
(
!
site
[
key
])
{
setBtnState
(
false
);
return
setError
(
"
Please fill all the fields
"
);
}
}
if
(
site
.
siteManagerId
===
"
sitemanager
"
)
{
setBtnState
(
false
);
return
setError
(
"
Please fill all the fields
"
);
}
try
{
const
res
=
await
axios
.
post
(
"
sites
"
,
site
);
setSite
({
name
:
""
,
location
:
""
,
siteManagerId
:
""
,
});
getAllSites
();
setError
(
""
);
window
.
alert
(
"
Site registered successfully
"
);
setBtnState
(
false
);
setIsLoading
(
true
);
}
catch
(
err
)
{
setBtnState
(
false
);
console
.
log
(
err
.
response
);
}
};
const
getAllSites
=
async
()
=>
{
try
{
const
res
=
await
axios
.
get
(
`sites`
);
setSites
(
res
.
data
.
sites
);
console
.
log
(
res
.
data
.
sites
);
setIsLoading
(
false
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
const
getAllSiteManagers
=
async
()
=>
{
try
{
const
res
=
await
axios
.
get
(
`sitemanagers`
);
setSiteManagers
(
res
.
data
.
sitemanagers
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
useEffect
(()
=>
{
getAllSites
();
getAllSiteManagers
();
},
[]);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Manage
Sites
<
/h1
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
form
className
=
"
card
"
style
=
{{
position
:
"
relative
"
}}
>
{
error
&&
(
<
div
className
=
"
error-bg
"
style
=
{{
left
:
"
3%
"
}}
>
<
p
>
{
error
}
<
/p
>
<
/div
>
)}
<
div
className
=
"
row
"
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row-user
"
>
<
input
type
=
"
text
"
placeholder
=
"
Site Name
"
value
=
{
site
.
name
}
onChange
=
{(
e
)
=>
setSite
({
...
site
,
name
:
e
.
target
.
value
,
})
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row-user
"
>
<
input
type
=
"
text
"
placeholder
=
"
Site Location
"
value
=
{
site
.
location
}
onChange
=
{(
e
)
=>
setSite
({
...
site
,
location
:
e
.
target
.
value
,
})
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row-user
"
>
<
select
name
=
"
site
"
id
=
"
site
"
value
=
{
site
.
siteManagerId
}
onChange
=
{(
e
)
=>
setSite
({
...
site
,
siteManagerId
:
e
.
target
.
value
,
})
}
required
>
<
option
defaultValue
value
=
"
sitemanager
"
>
SELECT
SITE
MANAGER
<
/option
>
{
siteManagers
.
length
!==
0
&&
siteManagers
.
map
((
siteManager
)
=>
(
<
option
value
=
{
siteManager
.
_id
}
>
{
siteManager
.
name
}
<
/option
>
))}
<
/select
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row-user
"
>
<
button
type
=
"
submit
"
onClick
=
{
saveSite
}
>
{
btnState
?
"
Saving
"
:
"
Save
"
}
<
/button
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
div
className
=
"
card
"
>
<
h2
>
Site
Details
<
/h2
>
{
isLoading
?
(
<
Spinner
/>
)
:
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
sites
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
ManageUsers
;
frontend/src/pages/OfficerDashboard.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
Calendar
from
"
react-calendar
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
"
react-calendar/dist/Calendar.css
"
;
import
"
../components/badge/badge.css
"
;
import
AdminGreeting
from
"
../assets/images/admin-greeting.png
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
profilePicture
from
"
../assets/images/admin-user-img.jpg
"
;
import
axios
from
"
axios
"
;
import
status
from
"
../helpers/greeting
"
;
const
OfficerDashboard
=
()
=>
{
const
[
value
,
onChange
]
=
useState
(
new
Date
());
const
[
orders
,
setOrders
]
=
useState
(
null
);
const
fields
=
[
"
Order ID
"
,
"
Item Name
"
,
"
Quantity
"
,
"
Total
"
,
"
Created Date
"
,
"
Status
"
,
];
const
rows
=
[
{
id
:
"
1
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Approved
"
,
},
{
id
:
"
2
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
{
id
:
"
3
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Declined
"
,
},
{
id
:
"
4
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
{
id
:
"
4
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
{
id
:
"
4
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
];
const
permissionStatus
=
{
pending
:
"
warning
"
,
Approved
:
"
success
"
,
Declined
:
"
danger
"
,
};
const
deleteHandler
=
(
id
)
=>
{
console
.
log
(
id
);
};
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
new
Date
(
item
.
createdAt
).
toLocaleDateString
()}
<
/td
>
<
td
>
<
Badge
type
=
{
permissionStatus
[
item
.
isApprovedByOfficer
]}
content
=
{
item
.
isApprovedByOfficer
}
/
>
<
/td
>
<
td
className
=
""
>
{
item
.
status
===
"
Pending
"
&&
(
<>
<
button
className
=
"
action-btn check
"
>
<
i
className
=
"
bx bx-check
"
><
/i
>
<
/button
>
<
button
className
=
"
action-btn x
"
>
<
i
className
=
"
bx bx-x
"
onClick
=
{()
=>
{
if
(
window
.
confirm
(
"
Are you sure to delete this request?
"
))
{
deleteHandler
(
item
.
id
);
}
}}
><
/i
>
<
/button
>
<
/
>
)}
<
/td
>
<
/tr
>
);
const
getAllOrder
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
orders/officer
"
);
setOrders
(
res
.
data
.
orders
);
console
.
log
(
res
);
};
console
.
log
(
orders
);
useEffect
(()
=>
{
getAllOrder
();
},
[]);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 full-width
"
>
<
div
className
=
"
card greeting-card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 flex-column
"
>
<
h1
className
=
"
page-header
"
>
{
`Good
${
status
}
!`
}
<
/h1
>
<
h3
>
Today
you
have
{
"
"
}
{
orders
&&
orders
.
filter
(
(
order
)
=>
order
.
isApprovedByOfficer
===
"
pending
"
).
length
}{
"
"
}
new
notifications
<
/h3
>
<
h3
>
Also
new
booking
appointments
for
approval
<
/h3
>
<
Link
className
=
"
read-more
"
>
Read
more
<
i
className
=
"
bx bx-right-arrow-alt
"
><
/i
>
<
/Link
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
img
className
=
"
admin-greeting
"
src
=
{
AdminGreeting
}
alt
=
""
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col-4 full-width
"
>
<
div
className
=
"
card
"
>
<
h2
className
=
"
request-title
"
style
=
{{
color
:
"
transparent
"
,
marginBottom
:
"
-.2rem
"
}}
>
Calender
<
/h2
>
<
Calendar
className
=
"
calender
"
onChange
=
{
onChange
}
value
=
{
value
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
flex
"
>
<
h2
className
=
"
request-title
"
>
New
Orders
<
/h2
>
<
Link
to
=
{
`/auth/officers/orderlist`
}
>
<
button
className
=
"
view-btn
"
>
View
All
<
/button
>
<
/Link
>
<
/div
>
{
orders
?
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
orders
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)
:
(
<
div
><
/div
>
)}
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4 full-width-1496
"
>
<
img
src
=
{
profilePicture
}
alt
=
""
className
=
"
profile-picture
"
/>
<
/div
>
<
div
className
=
"
col-8
"
>
<
h2
>
{
localStorage
.
getItem
(
"
name
"
)}
<
/h2
>
<
h3
className
=
"
lighter
"
>
OFFICER
<
/h3
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
OfficerDashboard
;
frontend/src/pages/OfficerOrders.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
axios
from
"
axios
"
;
import
Popup
from
"
./Popup
"
;
import
{
MdDelete
}
from
"
react-icons/md
"
;
import
{
FaCheckCircle
,
FaExclamationTriangle
,
FaCheckDouble
,
}
from
"
react-icons/fa
"
;
const
OfficerOrders
=
()
=>
{
const
fields
=
[
"
Order ID
"
,
"
Item Name
"
,
"
Quantity
"
,
"
Total
"
,
"
Created Date
"
,
"
Status
"
,
"
Actions
"
,
];
const
[
orders
,
setOrders
]
=
useState
(
null
);
const
[
trigger
,
setTrigger
]
=
useState
(
false
);
const
acceptOrder
=
async
(
id
)
=>
{
console
.
log
(
"
hi
"
);
try
{
const
res
=
await
axios
.
put
(
`orders/officer/
${
id
}
`
,
{
status
:
"
approved
"
,
});
console
.
log
(
res
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
getAllOrder
();
};
const
deleteHandler
=
async
(
id
)
=>
{
// console.log("hi");
try
{
const
res
=
await
axios
.
put
(
`orders/officer/
${
id
}
`
,
{
status
:
"
rejected
"
,
});
console
.
log
(
res
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
getAllOrder
();
};
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
new
Date
(
item
.
createdAt
).
toLocaleDateString
()}
<
/td
>
<
td
>
<
Badge
type
=
{
permissionStatus
[
item
.
isApprovedByOfficer
]}
content
=
{
item
.
isApprovedByOfficer
}
/
>
<
/td
>
<
td
>
{
item
.
isApprovedByOfficer
==
"
pending
"
?
(
<
FaCheckCircle
className
=
"
action-btn check
"
onClick
=
{()
=>
{
acceptOrder
(
item
.
_id
);
window
.
alert
(
"
order accepted successfully
"
);
window
.
location
.
reload
();
}}
/
>
)
:
item
.
isApprovedByOfficer
==
"
approved
"
?
(
<
FaCheckDouble
className
=
"
action-btn check
"
/>
)
:
(
""
)}
{
item
.
isApprovedByOfficer
==
"
pending
"
?
(
<>
<
MdDelete
className
=
"
action-btn x
"
onClick
=
{()
=>
{
// if (window.confirm("Are you sure to delete this request?")) {
deleteHandler
(
item
.
_id
);
setTrigger
(
true
);
// }
}}
/
>
<
Popup
trigger
=
{
trigger
}
setTrigger
=
{
setTrigger
}
orderId
=
{
item
.
_id
}
name
=
"
rejectReason
"
/>
<
/
>
)
:
item
.
isApprovedByOfficer
==
"
rejected
"
?
(
<
FaExclamationTriangle
className
=
"
action-btn x
"
/>
)
:
(
""
)}
{
item
.
isApprovedByOfficer
==
"
approved
"
&&
!
item
.
supplierId
?
(
<>
<
button
className
=
"
action-btn item-assign
"
onClick
=
{()
=>
{
setTrigger
(
true
);
}}
>
<
i
className
=
"
bx bxs-user-plus
"
><
/i
>
<
/button
>
<
Popup
trigger
=
{
trigger
}
setTrigger
=
{
setTrigger
}
order
=
{
item
.
itemName
}
orderId
=
{
item
.
_id
}
materialId
=
{
item
.
orderItem
}
sitemng
=
{
item
.
siteManagerId
}
total
=
{
item
.
total
}
name
=
"
Assign
"
/>
<
/
>
)
:
(
""
)}
<
/td
>
<
/tr
>
);
const
getAllOrder
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
orders/officer/orders
"
);
// console.log(res.data.orders);
setOrders
(
res
.
data
.
orders
);
};
useEffect
(()
=>
{
getAllOrder
();
},
[]);
const
permissionStatus
=
{
pending
:
"
warning
"
,
approved
:
"
success
"
,
rejected
:
"
danger
"
,
};
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
{
orders
&&
(
<
Table
limit
=
"
10
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
orders
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
OfficerOrders
;
frontend/src/pages/SiteManagerDashboard.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
AdminGreeting
from
"
../assets/images/admin-greeting.png
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
"
../components/badge/badge.css
"
;
import
Calendar
from
"
react-calendar
"
;
import
"
react-calendar/dist/Calendar.css
"
;
import
profilePicture
from
"
../assets/images/user2.jpg
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
axios
from
"
axios
"
;
const
SiteManagerDashboard
=
()
=>
{
const
[
value
,
onChange
]
=
useState
(
new
Date
());
const
fields
=
[
""
,
"
Required Date
"
,
"
Item
"
,
"
Quantity
"
,
"
Delivery Status
"
];
const
[
OrderDetail
,
setOrderDetail
]
=
useState
([])
const
[
Loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
const
FetchData
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
/orders/approved
"
);
setOrderDetail
(
res
.
data
.
orders
);
console
.
log
(
res
.
data
);
if
(
res
.
statusText
===
"
OK
"
){
setLoading
(
true
)
}
};
FetchData
();
},
[]);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
requiredDate
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
<
div
className
=
"
row-user
"
style
=
{{
paddingTop
:
"
0
"
}}
>
{
item
.
DeliveryStatus
===
"
pending
"
?
(
<
Badge
type
=
"
warning
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
preparing
"
?
(
<
Badge
type
=
"
primary
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
delivering
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
delivered
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
(
""
)}
<
/div
>
<
/td
>
<
/tr
>
);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 full-width
"
>
<
div
className
=
"
card greeting-card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 flex-column
"
>
<
h1
className
=
"
page-header
"
>
Good
Morning
!
<
/h1
>
<
h3
>
Today
you
have
9
new
notifications
<
/h3
>
<
h3
>
Also
new
booking
appointments
for
approval
<
/h3
>
<
Link
className
=
"
read-more
"
>
Read
more
<
i
className
=
"
bx bx-right-arrow-alt
"
><
/i
>
<
/Link
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
img
className
=
"
admin-greeting
"
src
=
{
AdminGreeting
}
alt
=
""
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col-4 full-width
"
>
<
div
className
=
"
card
"
>
<
h2
className
=
"
request-title
"
style
=
{{
color
:
"
transparent
"
,
marginBottom
:
"
-.2rem
"
}}
>
Calender
<
/h2
>
<
Calendar
className
=
"
calender
"
onChange
=
{
onChange
}
value
=
{
value
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
flex
"
>
<
h2
className
=
"
request-title
"
>
New
Orders
<
/h2
>
<
Link
to
=
{
`/auth/sitemanager/requisitions`
}
>
<
button
className
=
"
view-btn
"
>
View
All
<
/button
>
<
/Link
>
<
/div
>
{
Loading
?
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
OrderDetail
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/>:<Spinner/
>
}
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4 full-width-1496
"
>
<
img
src
=
{
profilePicture
}
alt
=
""
className
=
"
profile-picture
"
/>
<
/div
>
<
div
className
=
"
col-8
"
>
<
h2
>
{
localStorage
.
getItem
(
"
name
"
)}
<
/h2
>
<
h3
className
=
"
lighter
"
>
SITE
MANAGER
<
/h3
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
SiteManagerDashboard
;
frontend/src/pages/StudentSubjectAssingment.js
View file @
5d4ba196
...
...
@@ -2,61 +2,184 @@ import axios from "axios";
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
{
useParams
}
from
"
react-router-dom
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
{
MdDelete
}
from
"
react-icons/md
"
;
import
{
VscReport
}
from
"
react-icons/vsc
"
;
import
Popup
from
"
./Popup
"
;
const
StudentSubjectAssingment
=
()
=>
{
const
{
id
}
=
useParams
();
const
siteId
=
localStorage
.
getItem
(
"
site
"
);
const
[
Materials
,
setMaterials
]
=
useState
([]);
const
fields
=
[
""
,
"
Required Date
"
,
"
Item
"
,
"
Quantity
"
,
"
Order Status
"
,
"
Delivery Status
"
,
"
Action
"
,
"
Goods Receipt
"
,
];
const
[
OrderDetail
,
setOrderDetail
]
=
useState
([]);
const
[
Loading
,
setLoading
]
=
useState
(
false
);
const
[
Trigger
,
setTrigger
]
=
useState
(
false
);
const
[
assignment
,
setAssignment
]
=
useState
([]);
const
[
submission
,
setSubmission
]
=
useState
({
type
:
""
,
comment
:
""
,
id
:
2
,
file
:
{},
const
[
Name
,
setName
]
=
useState
(
""
);
const
[
Id
,
setId
]
=
useState
(
""
);
const
[
ItemName
,
setItemName
]
=
useState
(
""
);
const
[
Description
,
setDescription
]
=
useState
(
""
);
const
[
Order
,
setOrder
]
=
useState
({
item
:
{},
quantity
:
0
,
siteid
:
siteId
,
requiredDate
:
""
,
urgentOrder
:
false
,
});
console
.
log
(
Order
);
const
FetchData
=
async
()
=>
{
const
resMaterials
=
await
axios
.
get
(
`materials`
);
setMaterials
(
resMaterials
.
data
.
materials
);
const
fileHandler
=
(
e
)
=>
{
console
.
log
(
e
);
setSubmission
({
...
submission
,
file
:
e
.
target
.
files
[
0
]
});
console
.
log
(
submission
);
const
resOrders
=
await
axios
.
get
(
"
/orders
"
);
setOrderDetail
(
resOrders
.
data
.
orders
);
if
(
resOrders
.
statusText
===
"
OK
"
)
{
setLoading
(
true
);
}
};
const
FetchData
=
async
()
=>
{
useEffect
(()
=>
{
FetchData
();
},
[]);
const
deleteHandler
=
async
(
id
)
=>
{
console
.
log
(
id
);
try
{
const
res
=
await
axios
.
get
(
"
assignments/
"
+
id
);
setAssignment
(
res
.
data
.
assignment
);
setSubmission
({
...
submission
,
id
:
id
});
if
(
assignment
.
assignment_type
===
1
)
{
setSubmission
({
...
submission
,
type
:
"
use case
"
});
}
else
if
(
assignment
.
assignment_type
===
2
)
{
setSubmission
({
...
submission
,
type
:
"
class
"
});
}
else
{
setSubmission
({
...
submission
,
type
:
"
use case
"
});
const
res
=
await
axios
.
delete
(
`/orders/delete/
${
id
}
`
);
if
(
res
.
statusText
===
"
OK
"
)
{
window
.
location
.
reload
();
}
}
catch
(
erro
r
)
{
console
.
log
(
erro
r
.
response
);
}
catch
(
Er
r
)
{
console
.
log
(
Er
r
.
response
);
}
};
const
onSubmit
=
async
(
e
)
=>
{
e
.
preventDefault
();
const
orderHandler
=
async
()
=>
{
try
{
const
res
=
await
axios
.
post
(
"
submissions/upload/
"
,
submission
,
{
headers
:
{
token
:
localStorage
.
getItem
(
"
token
"
)
},
});
window
.
alert
(
"
Assignment added successfully
"
);
console
.
log
(
Order
);
const
res
=
await
axios
.
post
(
"
/orders
"
,
Order
);
if
(
res
.
statusText
===
"
OK
"
)
{
window
.
location
.
reload
();
}
catch
(
error
)
{
console
.
log
(
error
.
response
);
}
}
catch
(
Err
)
{
console
.
log
(
Err
.
response
);
}
};
useEffect
(()
=>
{
FetchData
();
},
[]);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
requiredDate
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
<
div
className
=
"
row-user
"
style
=
{{
paddingTop
:
"
0
"
}}
>
{
item
.
isApprovedByOfficer
===
"
rejected
"
?
(
<
Badge
type
=
"
danger
"
content
=
{
item
.
isApprovedByOfficer
}
/
>
)
:
item
.
isApprovedByManager
===
"
rejected
"
?
(
<
Badge
type
=
"
danger
"
content
=
{
item
.
isApprovedByManager
}
/
>
)
:
item
.
isApprovedByManager
===
"
pending
"
?
(
<
Badge
type
=
"
warning
"
content
=
{
item
.
isApprovedByManager
}
/
>
)
:
item
.
isApprovedByManager
===
"
approved
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
isApprovedByManager
}
/
>
)
:
(
""
)}
<
/div
>
<
/td
>
<
td
>
<
div
className
=
"
row-user
"
style
=
{{
paddingTop
:
"
0
"
}}
>
{
item
.
isApprovedByManager
===
"
approved
"
?
(
item
.
DeliveryStatus
===
"
pending
"
?
(
<
Badge
type
=
"
warning
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
preparing
"
?
(
<
Badge
type
=
"
primary
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
delivering
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
delivered
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
submitted
"
?
(
<
Badge
type
=
"
normal
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
(
""
)
)
:
(
""
)}
<
/div
>
<
/td
>
<
td
className
=
""
>
{
item
.
isApprovedByManager
===
"
pending
"
&&
!
(
item
.
isApprovedByOfficer
===
"
rejected
"
)
?
(
<>
<
button
className
=
"
action-btn x
"
>
<
MdDelete
onClick
=
{()
=>
{
if
(
window
.
confirm
(
"
Are you sure to delete this request?
"
))
{
deleteHandler
(
item
.
_id
);
}
}}
/
>
<
/button
>
<
/
>
)
:
item
.
isApprovedByManager
===
"
rejected
"
||
item
.
isApprovedByOfficer
===
"
rejected
"
?
(
<>
<
button
className
=
"
action-btn W
"
>
<
VscReport
onClick
=
{()
=>
{
setName
(
"
Rejection
"
);
setDescription
(
item
.
rejectMassage
);
setTrigger
(
true
);
}}
/
>
<
/button
>
<
Popup
trigger
=
{
Trigger
}
name
=
{
Name
}
description
=
{
Description
}
setTrigger
=
{
setTrigger
}
id
=
{
Id
}
item
=
{
ItemName
}
/
>
<
/
>
)
:
(
""
)}
<
/td
>
<
td
>
{
item
.
DeliveryStatus
===
"
submitted
"
?
(
<
div
onClick
=
{()
=>
{
setName
(
"
GoodsReceipt
"
);
setId
(
item
.
_id
);
setItemName
(
item
.
itemName
);
setTrigger
(
true
);
}}
>
<
Badge
type
=
"
normal
"
content
=
"
view
"
/>
<
/div
>
)
:
(
""
)}
<
/td
>
<
/tr
>
);
return
(
<
div
>
...
...
@@ -64,19 +187,57 @@ const StudentSubjectAssingment = () => {
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Assignments
<
/h1
>
<
h1
className
=
"
page-header
"
>
CTSE
Module
Assignments
<
/h1
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
flex
"
>
<
h2
className
=
"
request-title
"
>
{
assignment
.
title
}
<
/h2
>
<
h2
className
=
"
request-title
"
>
Asignment
01
<
/h2
>
<
/div
>
<
br
/>
<
h3
>
Analyze
the
case
study
given
below
and
draw
a
usecase
diagram
.
<
/h3
>
<
br
/>
<
p
>
{
assignment
.
content
}
<
/p
>
<
p
>
“
GlamourFashions
(
GF
)
”
is
a
clothing
store
situated
in
Colombo
and
it
’
s
planning
to
build
an
online
shopping
system
to
promote
their
sales
further
.
The
management
of
clothing
store
hired
you
as
a
System
Analyst
and
asked
to
come
up
with
the
design
models
for
GlamourFashions
Online
Store
(
GFOS
).
GlamourFashions
(
GF
)
Online
Clothing
Store
is
expected
to
organize
clothing
items
under
several
categories
like
office
wear
,
casual
wear
,
evening
wear
and
so
on
.
A
visitor
can
browse
on
items
without
being
registering
to
the
system
.
If
he
/
she
likes
to
order
item
,
the
system
facilitates
to
add
selected
items
into
the
shopping
cart
and
directly
move
to
checkout
option
.
If
the
user
interested
to
be
a
regular
user
,
the
system
will
provide
“
registration
”
facility
as
well
.
Without
even
registering
,
the
user
can
directly
go
for
the
“
checkout
”
.
For
a
registered
user
,
the
system
is
expected
to
send
a
promotion
code
for
users
’
mobile
every
month
which
can
be
used
only
once
.
when
the
user
logs
into
the
system
to
do
online
shopping
,
user
can
enter
this
code
which
will
give
a
5
%
discount
for
the
order
he
/
she
makes
.
If
the
user
does
not
use
the
code
within
the
month
,
automatically
the
system
must
“
discard
promotion
code
”
.
If
it
’
s
been
already
used
,
the
system
must
display
a
message
saying
“
it
’
s
already
been
used
”
.
After
adding
the
items
into
a
shopping
cart
,
user
can
select
the
checkout
button
which
gives
two
payment
options
,
Cash
on
Delivery
or
Pay
by
Card
.
Once
the
user
goes
to
the
payment
option
,
the
system
will
display
details
about
the
order
the
customer
has
made
.
It
will
display
the
order
number
,
each
item
details
with
an
image
of
clothing
item
,
total
amount
to
be
paid
.
If
any
item
needs
to
be
removed
from
the
current
order
system
will
facilitate
it
as
well
.
Finally
,
the
system
will
ask
user
to
enter
delivery
details
including
any
comments
which
is
optional
.
Based
on
the
location
to
be
delivered
it
will
indicate
the
delivery
cost
and
final
amount
to
be
paid
for
the
order
.
The
according
to
user
preferences
,
Cash
on
Delivery
or
Pay
by
Card
can
be
selected
.
If
the
user
provides
credit
or
debit
card
details
,
card
information
will
be
verified
using
a
payment
gateway
.
<
/p
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -90,15 +251,15 @@ const StudentSubjectAssingment = () => {
style
=
{{
float
:
"
right
"
}}
accept
=
"
.png, .jpg, .jpeg
"
type
=
"
file
"
onChange
=
{
fileHandler
}
onChange
=
{(
e
)
=>
setOrder
({
...
Order
,
quantity
:
e
.
target
.
value
})
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
row-user
"
>
<
button
type
=
"
submit
"
onClick
=
{
onSubmit
}
>
Submit
<
/button
>
<
button
type
=
"
submit
"
>
Submit
<
/button
>
<
/div
>
<
/div
>
<
/div
>
...
...
frontend/src/routes/Routes.js
View file @
5d4ba196
...
...
@@ -2,8 +2,11 @@ import React, { useContext } from "react";
import
{
Route
,
Switch
}
from
"
react-router-dom
"
;
import
Assign
from
"
../pages/Assign
"
;
import
DeliveryReportSubmit
from
"
../pages/DeliveryReportSubmit
"
;
import
Inventory
from
"
../pages/Inventory
"
;
import
Login
from
"
../pages/Login
"
;
import
ManageAllOrders
from
"
../pages/ManageAllOrders
"
;
import
ManageDeliveryReports
from
"
../pages/ManageDeliveryReports
"
;
import
ManageAssignments
from
"
../pages/ManageAssignments
"
;
import
SubjectsStudent
from
"
../pages/SubjectsStudent
"
;
import
ManagerApprovedOrders
from
"
../pages/ManagerApprovedOrders
"
;
...
...
@@ -11,7 +14,10 @@ import TeacherDashboard from "../pages/TeacherDashboard";
import
ManageServices
from
"
../pages/ManageServices
"
;
import
ManageStudents
from
"
../pages/ManageStudents
"
;
import
ManageModules
from
"
../pages/ManageModules
"
;
import
OfficerDashboard
from
"
../pages/OfficerDashboard
"
;
import
OfficerOrders
from
"
../pages/OfficerOrders
"
;
import
Register
from
"
../pages/Register
"
;
import
SiteManagerDashboard
from
"
../pages/SiteManagerDashboard
"
;
import
StudentSubjectAssingment
from
"
../pages/StudentSubjectAssingment
"
;
import
ViewAssignment
from
"
../pages/ViewAssignment
"
;
import
StudentDashboard
from
"
../pages/StudentDashboard
"
;
...
...
@@ -30,42 +36,18 @@ const Routes = () => {
<
Route
exact
path
=
"
/register
"
component
=
{
Register
}
/
>
<
Route
exact
path
=
"
/login
"
component
=
{
Login
}
/
>
<
Route
exact
path
=
"
/auth/teacher/dashboard
"
component
=
{
TeacherDashboard
}
/
>
<
Route
exact
path
=
"
/auth/teacher/dashboard
"
component
=
{
TeacherDashboard
}
/
>
<
Route
exact
path
=
"
/auth/teacher/students
"
component
=
{
ManageStudents
}
/
>
<
Route
exact
path
=
"
/auth/teacher/modules
"
component
=
{
ManageModules
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments
"
component
=
{
ManageAssignments
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments/:id
"
component
=
{
ViewAssignment
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments/:id/diagrams
"
component
=
{
GeneratedDiagrams
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments
"
component
=
{
ManageAssignments
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments/:id
"
component
=
{
ViewAssignment
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments/:id/diagrams
"
component
=
{
GeneratedDiagrams
}
/
>
<
Route
exact
path
=
"
/auth/student/dashboard
"
component
=
{
StudentDashboard
}
/
>
<
Route
exact
path
=
"
/auth/student/dashboard
"
component
=
{
StudentDashboard
}
/
>
<
Route
exact
path
=
"
/auth/student/modules
"
component
=
{
SubjectsStudent
}
/
>
<
Route
exact
path
=
"
/auth/student/services
"
component
=
{
ManageServices
}
/
>
<
Route
exact
path
=
"
/auth/student/assignment/:id
"
component
=
{
StudentSubjectAssingment
}
/
>
<
Route
exact
path
=
"
/auth/student/assignment
"
component
=
{
StudentSubjectAssingment
}
/
>
<
/Switch
>
);
};
...
...
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