UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Platform One
P
Party Bus
Launchboard
launchboard-fe
Commits
d8056a03
Commit
d8056a03
authored
May 04, 2021
by
Keith Becker
Browse files
refactor
parent
2cf2e5b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
26 deletions
+16
-26
src/components/Dialogs/AddStudentsToCourseDialog.vue
src/components/Dialogs/AddStudentsToCourseDialog.vue
+12
-5
src/components/Training/TrainingAttendance.vue
src/components/Training/TrainingAttendance.vue
+1
-0
src/views/TrainingDetails.vue
src/views/TrainingDetails.vue
+3
-21
No files found.
src/components/Dialogs/AddStudentsToCourseDialog.vue
View file @
d8056a03
...
@@ -58,6 +58,17 @@ export default {
...
@@ -58,6 +58,17 @@ export default {
courseId
:
Number
,
courseId
:
Number
,
},
},
methods
:
{
methods
:
{
async
fetchDebounced
()
{
this
.
course
=
await
CourseService
.
getCourse
(
this
.
courseId
);
const
result
=
await
CourseService
.
getCourseRegistrationsById
(
this
.
course
.
id
);
this
.
course
.
registrations
=
result
.
registrations
;
console
.
log
(
"
updated add students to course dialog registrations is now
"
+
this
.
course
.
registrations
.
length
);
},
availableSeatsInCourse
,
availableSeatsInCourse
,
canAddStudentsToCourse
,
canAddStudentsToCourse
,
async
addSelectedUsersToSelectedCourses
()
{
async
addSelectedUsersToSelectedCourses
()
{
...
@@ -108,11 +119,7 @@ export default {
...
@@ -108,11 +119,7 @@ export default {
},
},
},
},
async
created
()
{
async
created
()
{
this
.
course
=
await
CourseService
.
getCourse
(
this
.
courseId
);
this
.
fetchDebounced
();
const
result
=
await
CourseService
.
getCourseRegistrationsById
(
this
.
course
.
id
);
this
.
course
.
registrations
=
result
.
registrations
;
},
},
};
};
</
script
>
</
script
>
src/components/Training/TrainingAttendance.vue
View file @
d8056a03
...
@@ -232,6 +232,7 @@ export default {
...
@@ -232,6 +232,7 @@ export default {
this
.
$store
.
commit
(
SET_ERROR_MESSAGE
,
errorMessage
);
this
.
$store
.
commit
(
SET_ERROR_MESSAGE
,
errorMessage
);
}
}
this
.
fetchDebounced
();
this
.
fetchDebounced
();
this
.
$emit
(
"
removed-student
"
);
},
},
sendEmailToStudents
()
{
sendEmailToStudents
()
{
const
userEmails
=
this
.
selectedUsers
.
map
((
item
)
=>
item
.
user
.
email
);
const
userEmails
=
this
.
selectedUsers
.
map
((
item
)
=>
item
.
user
.
email
);
...
...
src/views/TrainingDetails.vue
View file @
d8056a03
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
Add Student
Add Student
</v-btn>
</v-btn>
<AddStudentsToCourseDialog
<AddStudentsToCourseDialog
ref=
"addStudentsToCourseDialog"
:show-dialog=
"state.isAddingStudent"
:show-dialog=
"state.isAddingStudent"
:course-id=
"Number.parseInt($route.params.trainingId)"
:course-id=
"Number.parseInt($route.params.trainingId)"
v-on:close-dialog=
"closeAddStudentDialog"
v-on:close-dialog=
"closeAddStudentDialog"
...
@@ -306,6 +307,7 @@
...
@@ -306,6 +307,7 @@
v-if=
"trainingCourse.id"
v-if=
"trainingCourse.id"
:trainingCourse=
"trainingCourse"
:trainingCourse=
"trainingCourse"
:reload=
"trigger"
:reload=
"trigger"
v-on:removed-student=
"fetchDebounced"
/>
/>
</v-skeleton-loader>
</v-skeleton-loader>
</v-container>
</v-container>
...
@@ -493,6 +495,7 @@ export default {
...
@@ -493,6 +495,7 @@ export default {
// delay new call
// delay new call
this
.
fetchData
();
this
.
fetchData
();
this
.
$refs
.
trainingAttendance
.
fetchDebounced
();
this
.
$refs
.
trainingAttendance
.
fetchDebounced
();
this
.
$refs
.
addStudentsToCourseDialog
.
fetchDebounced
();
},
},
async
updateCourse
()
{
async
updateCourse
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -517,27 +520,6 @@ export default {
...
@@ -517,27 +520,6 @@ export default {
cancelUpdateCourse
()
{
cancelUpdateCourse
()
{
this
.
state
.
isEditingCourse
=
false
;
this
.
state
.
isEditingCourse
=
false
;
},
},
async
addStudent
(
student
)
{
if
(
!
student
)
{
student
=
this
.
studentToAdd
;
}
this
.
state
.
isAddingBusy
=
true
;
try
{
await
TrainingService
.
addStudents
(
this
.
currentTrainingCourse
.
id
,
student
);
this
.
studentToAdd
=
student
;
this
.
trigger
=
this
.
trigger
+
1
;
}
catch
(
error
)
{
console
.
error
(
"
addStudent error!!:
"
,
error
);
this
.
$store
.
commit
(
SET_ERROR_MESSAGE
,
error
);
}
finally
{
this
.
state
.
isAddingBusy
=
false
;
this
.
state
.
isAddingStudent
=
false
;
this
.
$refs
.
userSelect
&&
this
.
$refs
.
userSelect
.
clear
();
}
},
},
},
};
};
</
script
>
</
script
>
...
...
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