From 6acb3c55a494eb73afd5f8cec5cd6ef0e29bbee5 Mon Sep 17 00:00:00 2001 From: Lloyd Wheeler Date: Sun, 3 Dec 2017 20:34:44 -0800 Subject: [PATCH] StudentSupportCallForm: Implementing preference table #1450 --- .../StudentSupportCallForm.html | 4 +- .../StudentSupportCallFormCtrl.js | 12 ---- .../studentComments/studentComments.html | 4 +- .../studentComments/studentComments.js | 6 +- .../studentPreferenceSelector.js | 1 - .../studentPreferenceTable.css | 5 ++ .../studentPreferenceTable.html | 43 ++++++++++++ .../studentPreferenceTable.js | 16 +++++ .../studentPreferences.html | 66 ++----------------- .../studentQualifications.html | 4 +- .../studentQualifications.js | 4 +- .../services/studentActions.js | 24 +++++++ .../services/studentReducers.js | 6 +- app/shared/css/ipaTable.css | 0 app/shared/css/ipaTile.css | 5 ++ 15 files changed, 114 insertions(+), 86 deletions(-) create mode 100644 app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.css create mode 100644 app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.html create mode 100644 app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.js create mode 100644 app/shared/css/ipaTable.css create mode 100644 app/shared/css/ipaTile.css diff --git a/app/instructionalSupport/studentSupportCallForm/StudentSupportCallForm.html b/app/instructionalSupport/studentSupportCallForm/StudentSupportCallForm.html index f64ae623d..48204b81b 100644 --- a/app/instructionalSupport/studentSupportCallForm/StudentSupportCallForm.html +++ b/app/instructionalSupport/studentSupportCallForm/StudentSupportCallForm.html @@ -11,7 +11,7 @@ -
+

You have not been invited to a support call in this term.


@@ -19,7 +19,7 @@
-
+
+
Comments
\ No newline at end of file diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentComments/studentComments.js b/app/instructionalSupport/studentSupportCallForm/directives/studentComments/studentComments.js index 4291d682a..e740420c8 100644 --- a/app/instructionalSupport/studentSupportCallForm/directives/studentComments/studentComments.js +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentComments/studentComments.js @@ -1,4 +1,4 @@ -instructionalSupportApp.directive("studentComments", this.studentComments = function () { +instructionalSupportApp.directive("studentComments", this.studentComments = function (studentActions) { return { restrict: 'E', templateUrl: 'studentComments.html', @@ -7,8 +7,8 @@ instructionalSupportApp.directive("studentComments", this.studentComments = func supportCallResponse: '<' }, link: function (scope, element, attrs) { - scope.updateSupportCallResponse = function() { - studentActions.updateSupportCallResponse($scope.props.state.supportCallResponse); + scope.updateStudentComments = function() { + studentActions.updateStudentComments(scope.supportCallResponse); }; } }; diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceSelector/studentPreferenceSelector.js b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceSelector/studentPreferenceSelector.js index 438649ce4..5aea2c742 100644 --- a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceSelector/studentPreferenceSelector.js +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceSelector/studentPreferenceSelector.js @@ -3,7 +3,6 @@ instructionalSupportApp.directive("studentPreferenceSelector", this.studentPrefe restrict: 'E', templateUrl: 'studentPreferenceSelector.html', replace: true, - scope: false, link: function (scope, element, attrs) { // do nothing } diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.css b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.css new file mode 100644 index 000000000..22c7563ba --- /dev/null +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.css @@ -0,0 +1,5 @@ +.student-preference-table__empty-warn { + text-align: center; + height: 100%; + background-color: white; +} \ No newline at end of file diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.html b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.html new file mode 100644 index 000000000..55ff421a7 --- /dev/null +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.html @@ -0,0 +1,43 @@ +
+
+

There are no courses available for this support call.

+
+

If you feel this is in error please contact the Academic Planner for {{ sharedState.workgroup.name }}.

+
+ +
+ + + + + + + + + + + + + + + +
PriorityCourseComments
+ {{ preference.priority }} + + {{ preference.subjectCode }} {{ preference.courseNumber }} - {{ preference.sequencePattern }} + + + +
+ + +
+
+
+
\ No newline at end of file diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.js b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.js new file mode 100644 index 000000000..378f76e72 --- /dev/null +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferenceTable/studentPreferenceTable.js @@ -0,0 +1,16 @@ +instructionalSupportApp.directive("studentPreferenceTable", this.studentPreferenceTable = function () { + return { + restrict: 'E', + templateUrl: 'studentPreferenceTable.html', + replace: true, + link: function (scope, element, attrs) { + scope.addPreference = function(preference) { + studentActions.addStudentPreference(preference); + }; + + scope.deletePreference = function(preference) { + studentActions.deleteStudentPreference(preference); + }; + } + }; +}); \ No newline at end of file diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferences.html b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferences.html index 6f7d81d84..ba610c013 100644 --- a/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferences.html +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentPreferences/studentPreferences.html @@ -1,64 +1,12 @@
-
+ + -
- -
-

There are no courses available for this support call.

-
-

If you feel this is in error please contact the Academic Planner for {{ sharedState.workgroup.name }}.

-
-
+ + - -
    -
  • -
    -
    - {{ preference.priority }} -
    - - - - -
    -
    -
    - {{ preference.subjectCode }} {{ preference.courseNumber }} - {{ preference.sequencePattern }} -
    -
    - {{ getRoleDisplayName(preference.type) }} -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - Comments... -
    -
    -
    -
    - Comments... -
    -
    -
    -
  • -
- - - -
+ +
\ No newline at end of file diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.html b/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.html index b05809cba..68f1ff493 100644 --- a/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.html +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.html @@ -1,8 +1,8 @@ -
+
Teaching Qualification
\ No newline at end of file diff --git a/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.js b/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.js index e02809682..0e2e9ceb1 100644 --- a/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.js +++ b/app/instructionalSupport/studentSupportCallForm/directives/studentQualifications/studentQualifications.js @@ -7,8 +7,8 @@ instructionalSupportApp.directive("studentQualifications", this.studentQualifica supportCallResponse: '<' }, link: function (scope, element, attrs) { - scope.updateSupportCallResponse = function() { - studentActions.updateSupportCallResponse($scope.props.state.supportCallResponse); + scope.updateStudentQualifications = function() { + studentActions.updateStudentQualifications(scope.supportCallResponse); }; } }; diff --git a/app/instructionalSupport/studentSupportCallForm/services/studentActions.js b/app/instructionalSupport/studentSupportCallForm/services/studentActions.js index cf8f7cd48..a78c7c705 100644 --- a/app/instructionalSupport/studentSupportCallForm/services/studentActions.js +++ b/app/instructionalSupport/studentSupportCallForm/services/studentActions.js @@ -24,6 +24,30 @@ instructionalSupportApp.service('studentActions', function ($rootScope, $window, $rootScope.$emit('toast', { message: "Could not add preference.", type: "ERROR" }); }); }, + updateStudentComments: function(supportCallResponse) { + studentService.updateSupportCallResponse(supportCallResponse).then(function (payload) { + $rootScope.$emit('toast', { message: "Updated comments.", type: "SUCCESS" }); + var action = { + type: UPDATE_SUPPORT_CALL_RESPONSE, + payload: payload + }; + studentReducers.reduce(action); + }, function (err) { + $rootScope.$emit('toast', { message: "Could not update comments.", type: "ERROR" }); + }); + }, + updateStudentQualifications: function(supportCallResponse) { + studentService.updateSupportCallResponse(supportCallResponse).then(function (payload) { + $rootScope.$emit('toast', { message: "Updated qualifications.", type: "SUCCESS" }); + var action = { + type: UPDATE_SUPPORT_CALL_RESPONSE, + payload: payload + }; + studentReducers.reduce(action); + }, function (err) { + $rootScope.$emit('toast', { message: "Could not update qualifications.", type: "ERROR" }); + }); + }, updateSupportCallResponse: function (supportCallResponse) { studentService.updateSupportCallResponse(supportCallResponse).then(function (payload) { $rootScope.$emit('toast', { message: "Updated preferences", type: "SUCCESS" }); diff --git a/app/instructionalSupport/studentSupportCallForm/services/studentReducers.js b/app/instructionalSupport/studentSupportCallForm/services/studentReducers.js index 81bfe04ab..3b74513c1 100644 --- a/app/instructionalSupport/studentSupportCallForm/services/studentReducers.js +++ b/app/instructionalSupport/studentSupportCallForm/services/studentReducers.js @@ -22,7 +22,7 @@ instructionalSupportApp.service('studentReducers', function ($rootScope, $log, s case INIT_STATE: courses = { ids: [], - list: [] + list: {} }; action.payload.courses.forEach( function(course) { courses.ids.push(course.id); @@ -38,7 +38,7 @@ instructionalSupportApp.service('studentReducers', function ($rootScope, $log, s case INIT_STATE: preferences = { ids: [], - list: [] + list: {} }; action.payload.studentSupportPreferences.forEach( function(preference) { preferences.ids.push(preference.id); @@ -78,7 +78,7 @@ instructionalSupportApp.service('studentReducers', function ($rootScope, $log, s case INIT_STATE: supportAssignments = { ids: [], - list: [] + list: {} }; action.payload.supportAssignments.forEach( function(supportAssignment) { supportAssignments.ids.push(supportAssignment.id); diff --git a/app/shared/css/ipaTable.css b/app/shared/css/ipaTable.css new file mode 100644 index 000000000..e69de29bb diff --git a/app/shared/css/ipaTile.css b/app/shared/css/ipaTile.css new file mode 100644 index 000000000..dd1aba408 --- /dev/null +++ b/app/shared/css/ipaTile.css @@ -0,0 +1,5 @@ +.ipa-tile { + padding: 5px 25px 10px 25px; + background-color: white; + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} \ No newline at end of file