From 0c7929cc93b4f43770c607d35074c51ea191a9d1 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Tue, 9 Jul 2019 14:54:34 -0700 Subject: [PATCH 01/11] Prettier --- .../courseHeader/courseHeader.html | 105 +++++++++--------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html index e665fc050..a0a7f4685 100644 --- a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html +++ b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html @@ -1,54 +1,57 @@
-
- {{ sectionGroup.subjectCode }} {{ sectionGroup.courseNumber }} {{ sectionGroup.sequencePattern }} {{ sectionGroup.title }} -
+
+ {{ sectionGroup.subjectCode }} {{ sectionGroup.courseNumber }} + {{ sectionGroup.sequencePattern }} {{ sectionGroup.title }} +
- - - - - - - - - - - - - - - - - - - -
-
- TAs -
-
- - -
-
- Readers -
-
- - -
- Seats - - {{ sectionGroup.plannedSeats }} -
- Units - - {{ sectionGroup.units }} -
+ + + + + + + + + + + + + + + + + + + +
+
+ TAs +
+
+ + +
+
+ Readers +
+
+ + +
+ Seats + + {{ sectionGroup.plannedSeats }} +
+ Units + + {{ sectionGroup.units }} +
From 7d64b11e047594b7c288584a009fa549b3f66784 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Tue, 9 Jul 2019 14:55:51 -0700 Subject: [PATCH 02/11] Add appointment percentage input fields --- .../courseHeader/courseHeader.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html index a0a7f4685..aaf7b67e2 100644 --- a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html +++ b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html @@ -20,6 +20,15 @@ > + +
Appt %
+ + +
+ + +
+ @@ -35,6 +44,15 @@ > + +
Appt %
+ + +
+ + +
+ From f46c8ed8aa1003990ec432b6179e2bc83f1eb848 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Thu, 11 Jul 2019 11:42:40 -0700 Subject: [PATCH 03/11] Accept and update appointment percentage input --- .../supportCoursesTab/courseHeader/courseHeader.html | 4 ++-- app/supportAssignment/services/supportActions.js | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html index aaf7b67e2..a8cafa8d6 100644 --- a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html +++ b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html @@ -25,7 +25,7 @@
- +
@@ -49,7 +49,7 @@
- +
diff --git a/app/supportAssignment/services/supportActions.js b/app/supportAssignment/services/supportActions.js index 193e4ee1b..31a2a024f 100644 --- a/app/supportAssignment/services/supportActions.js +++ b/app/supportAssignment/services/supportActions.js @@ -102,6 +102,8 @@ class SupportActions { plannedSeats: sectionGroupDTO.plannedSeats, teachingAssistantAppointments: sectionGroupDTO.teachingAssistantAppointments, readerAppointments: sectionGroupDTO.readerAppointments, + taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage) || 50, + readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage) || 25, showTheStaff: sectionGroupDTO.showTheStaff, showPlaceholderAI: sectionGroupDTO.showPlaceholderAI }; @@ -128,13 +130,12 @@ class SupportActions { plannedSeats: sectionGroupDTO.plannedSeats, teachingAssistantAppointments: sectionGroupDTO.teachingAssistantAppointments, readerAppointments: sectionGroupDTO.readerAppointments, + taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage) || 50, + readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage) || 25, showTheStaff: sectionGroupDTO.showTheStaff, showPlaceholderAI: sectionGroupDTO.showPlaceholderAI }; - - sectionGroup.teachingAssistantAppointments = sectionGroupDTO.teachingAssistantAppointments; - - + debugger; SupportService.updateSectionGroup(sectionGroup).then(function() { $rootScope.$emit('toast', { message: "Updated Teaching Assistants", type: "SUCCESS" }); SupportReducer.reduce({ From 2db8b3375fcb6113a5db3a56676384c2fbe54c01 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Thu, 11 Jul 2019 11:58:59 -0700 Subject: [PATCH 04/11] Show appointment percentages next to count --- .../budgetCosts/courseCostsRow/courseCostsRow.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html b/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html index a26f39710..040333978 100644 --- a/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html +++ b/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html @@ -61,7 +61,7 @@
- TAs + TAs (Appointment Percentage)
@@ -82,6 +82,9 @@
{{ sectionGroupCost.taCount || 0 }}
+
+  ({{ sectionGroupCost.sectionGroup.taAppointmentPercentage || '50'}}%) +
@@ -117,6 +120,9 @@
{{ sectionGroupCost.readerCount || 0 }}
+
+  ({{ sectionGroupCost.sectionGroup.readerAppointmentPercentage || '25'}}%) +
From 582debcec4efbb9ccd6d1f22c236ad5b6f80e3d8 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Fri, 12 Jul 2019 14:38:37 -0700 Subject: [PATCH 05/11] Specify cost is for default appointment percentage --- app/budget/directives/instructorList/instructorList.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/budget/directives/instructorList/instructorList.html b/app/budget/directives/instructorList/instructorList.html index 48d4829db..1d21d0350 100644 --- a/app/budget/directives/instructorList/instructorList.html +++ b/app/budget/directives/instructorList/instructorList.html @@ -89,7 +89,7 @@
- TA + TA (50% Appointment)
@@ -106,7 +106,7 @@
- Reader + Reader (25% Appointment)
From f07904a0359c7af0519e012c113906ecdb01a12b Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Fri, 12 Jul 2019 14:42:37 -0700 Subject: [PATCH 06/11] Adjust support cost calculations --- app/budget/services/actions/scheduleCostCalculations.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/budget/services/actions/scheduleCostCalculations.js b/app/budget/services/actions/scheduleCostCalculations.js index 00b4adf73..cc12de3a8 100644 --- a/app/budget/services/actions/scheduleCostCalculations.js +++ b/app/budget/services/actions/scheduleCostCalculations.js @@ -232,9 +232,12 @@ class ScheduleCostCalculations { _calculateSectionGroupFinancialCosts: function(sectionGroupCost) { var budget = BudgetReducers._state.budget; + var readerApptAdjustment = sectionGroupCost.sectionGroup.readerAppointmentPercentage ? sectionGroupCost.sectionGroup.readerAppointmentPercentage / 25 : 1; + var taApptAdjustment = sectionGroupCost.sectionGroup.taAppointmentPercentage ? sectionGroupCost.sectionGroup.taAppointmentPercentage / 50 : 1; + // Support Costs - sectionGroupCost.readerCost = sectionGroupCost.readerCount > 0 ? sectionGroupCost.readerCount * budget.readerCost : 0; - sectionGroupCost.taCost = sectionGroupCost.taCount > 0 ? sectionGroupCost.taCount * budget.taCost : 0; + sectionGroupCost.readerCost = sectionGroupCost.readerCount > 0 ? sectionGroupCost.readerCount * budget.readerCost * readerApptAdjustment : 0; + sectionGroupCost.taCost = sectionGroupCost.taCount > 0 ? sectionGroupCost.taCount * budget.taCost * taApptAdjustment : 0; sectionGroupCost.courseCostSubTotal = sectionGroupCost.taCost + sectionGroupCost.readerCost; From 2191e46abf6f01d899703bcb1b0919620cd35f81 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Mon, 15 Jul 2019 12:14:32 -0700 Subject: [PATCH 07/11] Adjust support cost by appointment percentage --- .../services/budgetComparisonReportCalculations.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/reports/budgetComparison/services/budgetComparisonReportCalculations.js b/app/reports/budgetComparison/services/budgetComparisonReportCalculations.js index 1a0977f69..02b41bff5 100644 --- a/app/reports/budgetComparison/services/budgetComparisonReportCalculations.js +++ b/app/reports/budgetComparison/services/budgetComparisonReportCalculations.js @@ -234,17 +234,21 @@ class BudgetComparisonReportCalculations { }; sectionGroupCosts.ids.forEach(function(sectionGroupCostId) { - var sectionGroupCost = sectionGroupCosts.list[sectionGroupCostId]; + var sectionGroupCost = sectionGroupCosts.list[sectionGroupCostId]; + + // TA default is 50, reader default is 25 + var taApptAdjustment = sectionGroupCost.taAppointmentPercentage ? (sectionGroupCost.taAppointmentPercentage / 50) : 1; + var readerApptAdjustment = sectionGroupCost.readerAppointmentPercentage ? (sectionGroupCost.readerAppointmentPercentage / 25) : 1; if (sectionGroupCost.budgetScenarioId != selectedScenarioId || sectionGroupCost.disabled) { return; } if (activeTerms.indexOf(sectionGroupCost.termCode.slice(-2)) == -1) { return; } supportCosts.taCount += sectionGroupCost.taCount || 0; - supportCosts.readerCount += sectionGroupCost.readerCount || 0; - }); + supportCosts.readerCount += sectionGroupCost.readerCount || 0; - supportCosts.taCost = supportCosts.taCount * budget.taCost; - supportCosts.readerCost = supportCosts.readerCount * budget.readerCost; + supportCosts.taCost += sectionGroupCost.taCount * budget.taCost * taApptAdjustment; + supportCosts.readerCost += sectionGroupCost.readerCount * budget.readerCost * readerApptAdjustment; + }); supportCosts.totalCount += supportCosts.taCount + supportCosts.readerCount; supportCosts.totalCost += supportCosts.taCost + supportCosts.readerCost; From a70d6a027837f63a2c2083b04b3b4fc9b95c633a Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Mon, 15 Jul 2019 15:46:42 -0700 Subject: [PATCH 08/11] Remove debugger; --- app/supportAssignment/services/supportActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/supportAssignment/services/supportActions.js b/app/supportAssignment/services/supportActions.js index 31a2a024f..faabab169 100644 --- a/app/supportAssignment/services/supportActions.js +++ b/app/supportAssignment/services/supportActions.js @@ -135,7 +135,7 @@ class SupportActions { showTheStaff: sectionGroupDTO.showTheStaff, showPlaceholderAI: sectionGroupDTO.showPlaceholderAI }; - debugger; + SupportService.updateSectionGroup(sectionGroup).then(function() { $rootScope.$emit('toast', { message: "Updated Teaching Assistants", type: "SUCCESS" }); SupportReducer.reduce({ From 95247787967ea9bcbef971c5ce837ef504d96413 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Mon, 15 Jul 2019 15:53:47 -0700 Subject: [PATCH 09/11] Shorten display text --- .../directives/budgetCosts/courseCostsRow/courseCostsRow.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html b/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html index 040333978..62877b8b6 100644 --- a/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html +++ b/app/budget/directives/budgetCosts/courseCostsRow/courseCostsRow.html @@ -61,7 +61,7 @@
- TAs (Appointment Percentage) + TAs (Appointment)
@@ -99,7 +99,7 @@
- Readers + Readers (Appointment)
From 0e5f2860698c6ab913b9fdb59817c9b6e65a1eca Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Mon, 15 Jul 2019 16:09:03 -0700 Subject: [PATCH 10/11] Add tooltip to show default value --- .../courseHeader/courseHeader.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html index a8cafa8d6..a28e9cc20 100644 --- a/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html +++ b/app/supportAssignment/directives/supportAssignmentTable/supportCoursesTab/courseHeader/courseHeader.html @@ -25,7 +25,13 @@
- +
@@ -49,7 +55,13 @@
- +
From f273d27d40bf31ac11989693a03ebfa7ab068cb0 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Mon, 15 Jul 2019 16:10:30 -0700 Subject: [PATCH 11/11] Don't set default value --- app/supportAssignment/services/supportActions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/supportAssignment/services/supportActions.js b/app/supportAssignment/services/supportActions.js index faabab169..1d2b64f8c 100644 --- a/app/supportAssignment/services/supportActions.js +++ b/app/supportAssignment/services/supportActions.js @@ -102,8 +102,8 @@ class SupportActions { plannedSeats: sectionGroupDTO.plannedSeats, teachingAssistantAppointments: sectionGroupDTO.teachingAssistantAppointments, readerAppointments: sectionGroupDTO.readerAppointments, - taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage) || 50, - readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage) || 25, + taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage), + readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage), showTheStaff: sectionGroupDTO.showTheStaff, showPlaceholderAI: sectionGroupDTO.showPlaceholderAI }; @@ -130,8 +130,8 @@ class SupportActions { plannedSeats: sectionGroupDTO.plannedSeats, teachingAssistantAppointments: sectionGroupDTO.teachingAssistantAppointments, readerAppointments: sectionGroupDTO.readerAppointments, - taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage) || 50, - readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage) || 25, + taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage), + readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage), showTheStaff: sectionGroupDTO.showTheStaff, showPlaceholderAI: sectionGroupDTO.showPlaceholderAI };