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

DOM manipulation removal #170

Merged
merged 21 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
44 changes: 12 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/components/Confirmation.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// One prop for text // Otherwise - the same for courses and semesters // Can leave as display: none
like the 2 modals in Semester.vue until necessary? Or can itself be created from the addCourse()
method - unsure what the right move is right now

<template>
<div class="confirmation">
<div class="confirmation-left">
Expand Down
7 changes: 0 additions & 7 deletions src/components/Course.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,10 @@ export default {
};
},
computed: {
rqString() {
return 'RQ';
},

// TODO: bold requirements
requirementString() {
return this.alerts.requirement;
},

// TODO: too much DOM manipulation that vue should fix - talk to Sam
cautionString() {
return this.alerts.caution;
},
Expand All @@ -124,7 +118,6 @@ export default {
return `https://www.cureviews.org/course/${this.subject}/${this.number}`;
},

// TODO: change semester from FA18
roster() {
return `https://classes.cornell.edu/browse/roster/FA18/class/${this.subject}/${this.number}`;
},
Expand Down
13 changes: 3 additions & 10 deletions src/components/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
:isBottomBarExpanded="bottomBar.isExpanded"
:isBottomBar="bottomCourses.length > 0"
:isMobile="isMobile"
:currSemID="currSemID"

@compact-updated="compactVal = $event"
@updateBar="updateBar"
@close-bar="closeBar"
@updateRequirementsMenu="updateRequirementsMenu"
@increment-semID="incrementSemID"
/>
</div>
<tourwindow
Expand Down Expand Up @@ -376,18 +378,9 @@ export default Vue.extend({
// Return randomly generated color
return randomColor;
},

createSemester(courses: readonly AppCourse[], type: FirestoreSemesterType, year: number): AppSemester {
const semester = {
courses,
id: this.currSemID,
type,
year
};
incrementSemID(){
this.currSemID += 1;
return semester;
},

updateRequirementsMenu() {
this.requirementsKey += 1;
},
Expand Down
9 changes: 3 additions & 6 deletions src/components/Modals/DeleteSemester.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
<script lang="ts">
/* eslint-disable import/extensions */
import Vue from 'vue';
import NewCourse from '@/components/Modals/NewCourse.vue';
import NewCustomCourse from '@/components/Modals/NewCustomCourse.vue';
import NewSemester from '@/components/Modals/NewSemester.vue';
import NewCourse from '@/components/Modals/NewCourse';
import NewSemester from '@/components/Modals/NewSemester';

Vue.component('newCourse', NewCourse);
Vue.component('newCustomCourse', NewCustomCourse);
Vue.component('newSemester', NewSemester);


Expand All @@ -53,8 +51,7 @@ export default Vue.extend({
},
methods: {
closeCurrentModal() {
const modal = document.getElementById(`deleteSemesterModal-${this.deleteSemID}`)!;
modal.style.display = 'none';
this.$emit('close-delete-modal');
},
deleteSemester() {
this.$emit('delete-semester', this.deleteSemType, this.deleteSemYear);
Expand Down
16 changes: 10 additions & 6 deletions src/components/Modals/EditSemester.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
:year="deleteSemYear"
:type="deleteSemType"
@duplicateSemester="disableButton"
@updateSemProps="updateSemProps"
ref="modalBodyComponent">
</newSemester>
</div>
Expand All @@ -32,11 +33,9 @@
<script>
import Vue from 'vue';
import NewCourse from '@/components/Modals/NewCourse';
import NewCustomCourse from '@/components/Modals/NewCustomCourse';
import NewSemester from '@/components/Modals/NewSemester';

Vue.component('newCourse', NewCourse);
Vue.component('newCustomCourse', NewCustomCourse);
Vue.component('newSemester', NewSemester);

export default {
Expand All @@ -48,7 +47,9 @@ export default {
},
data() {
return {
isDisabled: false
isDisabled: false,
season: '',
year: ''
};
},
computed: {
Expand All @@ -64,17 +65,20 @@ export default {
},
methods: {
closeCurrentModal() {
const modal = document.getElementById(`editSemesterModal-${this.deleteSemID}`);
modal.style.display = 'none';
this.$emit('close-edit-modal');
},
editSemester() {
if (!this.isDisabled) {
this.$parent.editSemester(this.deleteSemID);
this.$emit('edit-semester', this.season, this.year);
this.closeCurrentModal();
}
},
disableButton(bool) {
this.isDisabled = bool;
},
updateSemProps(season, year) {
this.season = season;
this.year = year;
}
}
};
Expand Down
Loading