Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rtt 145 convert discussions and lectures #1817

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e3b32fb
confirmation modal when conversion is required
eduranperez Jan 13, 2021
a622a6b
always fetch sections
eduranperez Jan 14, 2021
246ab75
dont compare against self for uniqueness
eduranperez Jan 14, 2021
1510d9c
reset original sequence pattern
eduranperez Jan 14, 2021
15d525d
show before and after sequence pattern in confirmation modal
eduranperez Jan 14, 2021
6ed6bac
fix padding
eduranperez Jan 14, 2021
7141ab3
example text
eduranperez Jan 14, 2021
ebb146d
compare with state instead of local scope var to check for change
eduranperez Jan 14, 2021
5d1548f
linting
eduranperez Jan 15, 2021
04b640f
change seat display for example
eduranperez Jan 19, 2021
0a7373a
clear section list on course update
eduranperez Jan 19, 2021
9088e7b
update sections array on FETCH_SECTIONS
eduranperez Jan 19, 2021
709e8f8
create new course
eduranperez Jan 21, 2021
9e9fb47
creating new offering
eduranperez Jan 21, 2021
acb01ee
update state with new course and section group
eduranperez Jan 21, 2021
da58093
update state properly after new offering creation. Switch selected r…
eduranperez Jan 22, 2021
00ce9a5
fix conditional displaying of text/examples
eduranperez Jan 23, 2021
78f4933
validate sequence pattern
eduranperez Jan 25, 2021
3687b1f
linting
eduranperez Jan 25, 2021
f041b16
remove console log, revert unused changes on course details
eduranperez Jan 25, 2021
fadb9c8
remove more console logs
eduranperez Jan 25, 2021
2c81be8
add details to description of actions and hightlight input field on i…
eduranperez Jan 25, 2021
065280b
alter wording
eduranperez Jan 26, 2021
6c2020f
only remove old sectiongroup from state if request succeeded
eduranperez Jan 26, 2021
cfd582c
ensure new offering would be unique
eduranperez Jan 27, 2021
807e4eb
update modal wording
eduranperez Jan 27, 2021
8dc806b
linting
eduranperez Jan 28, 2021
0e10b71
update wording, convert user input to uppercase
eduranperez Jan 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
creating new offering
eduranperez committed Jan 21, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
idelpivnitskiy Idel Pivnitskiy
commit 9e9fb4744b196cbfd237057d50a9ad55b60095f1
Original file line number Diff line number Diff line change
@@ -16,7 +16,13 @@ let convertSectionsModal = function (CourseActionCreators) {

scope.convertCourseOffering = function () {
console.log(scope);
CourseActionCreators.convertCourseOffering(scope.workgroupId, scope.year, scope.selectedEntity, scope.sequencePattern);
var newSection = {
seats: 270,
sequenceNumber: "A01"
};
console.log(newSection);
debugger;
CourseActionCreators.convertCourseOffering(scope.workgroupId, scope.year, scope.selectedEntity, newSection);
scope.isVisible = false;
};

10 changes: 10 additions & 0 deletions app/course/services/courseActionCreators.js
Original file line number Diff line number Diff line change
@@ -620,6 +620,16 @@ class CourseActionCreators {
}

return flagsGenerated;
},
convertCourseOffering: function (workgroupId, year, sectionGroup, newSection) {
CourseService.convertCourseOffering(workgroupId, year, sectionGroup, newSection).then(function (course) {
window.ipa_analyze_event('courses', 'course offering converted');
console.log("Created new course");
console.log(course);
$rootScope.$emit('toast', { message: "Converted course offering.", type: "SUCCESS" });
}, function () {
$rootScope.$emit('toast', { message: "Could not Convert course offering.", type: "ERROR" });
});
}
};
}
9 changes: 8 additions & 1 deletion app/course/services/courseService.js
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ class CourseService {
return deferred.promise;
},
addSectionGroup: function (sectionGroup) {
console.log('creating section group');
console.log(sectionGroup);
return _self.ApiService.post("/api/courseView/sectionGroups/", sectionGroup);
},
updateSectionGroup: function (sectionGroup) {
@@ -105,6 +107,8 @@ class CourseService {
return _self.ApiService.put("/api/courseView/sections/" + section.id, section);
},
createSection: function (section) {
console.log("Create section");
console.log(section);
if (!section) { return; }

return _self.ApiService.post("/api/courseView/sectionGroups/" + section.sectionGroupId + "/sections", section);
@@ -124,7 +128,10 @@ class CourseService {
},
getAuditLogs: function (workgroupId, year) {
return _self.ApiService.get("/api/workgroups/" + workgroupId + "/years/" + year + "/modules/Courses" + "/auditLogs");
}
},
convertCourseOffering: function (workgroupId, year, sectionGroup, newSection) {
return _self.ApiService.post("/api/courseView/workgroups/" + workgroupId + "/years/" + year + "/courses/" + sectionGroup.courseId + "/sectionGroups/" + sectionGroup.id + "/convert/" + sectionGroup.termCode, newSection);
},
};
}
}
2 changes: 1 addition & 1 deletion app/course/templates/CourseCtrl.html
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
<ipa-modal
is-visible="view.state.uiState.convertSectionsModal.isVisible"
header-text="Convert Course">
<convert-sections-modal is-visible="view.state.uiState.convertSectionsModal.isVisible" selected-entity="view.selectedEntity" sequence-pattern="view.state.uiState.convertSectionsModal.sequencePattern"></convert-sections-modal>
<convert-sections-modal is-visible="view.state.uiState.convertSectionsModal.isVisible" selected-entity="view.selectedEntity" workgroup-id="workgroupId" year="year"></convert-sections-modal>
</ipa-modal>

<ipa-modal