From 5bb952f4f5aedb7eb740cb4abf7e4b101eacbc3b Mon Sep 17 00:00:00 2001 From: Thaddeus McCleary Date: Wed, 1 Sep 2021 11:14:18 -0500 Subject: [PATCH] Hide tutorial if class charts exist --- src/views/Chart.vue | 28 +++++------ src/views/Home.vue | 93 ++++++++++++++++++----------------- src/views/SessionExplorer.vue | 54 ++++++++++---------- 3 files changed, 88 insertions(+), 87 deletions(-) diff --git a/src/views/Chart.vue b/src/views/Chart.vue index ba3d78e..f12c917 100644 --- a/src/views/Chart.vue +++ b/src/views/Chart.vue @@ -9,7 +9,7 @@ v-on:edit-info="setLastView(`/chart/${id}`)" :title="classInfo.name" /> -
-
+
@@ -215,7 +215,7 @@ @@ -645,7 +645,7 @@ export default { .then(() => { db.deleteSomething('notes', {student: this.studentToEdit._id}) .then((numNotesDeleted) => { - + }) for (let i=0; i @@ -141,7 +141,7 @@ export default { archiveClass(id) { db.updateSomething('classes', {_id: id}, { $set: { - "archived": true + "archived": true } }).then(() => { this.populateClasses() @@ -150,7 +150,7 @@ export default { unarchiveClass(id) { db.updateSomething('classes', {_id: id}, { $set: { - "archived": false + "archived": false } }).then(() => { this.populateClasses() @@ -310,49 +310,52 @@ export default { setTimeout(function() { let progress = scope.$store.state.preferences.progress + let classes = scope.$store.state.allClasses + + if (!classes) { + if (progress.indexOf('created class') == -1) { + scope.modalOpen = true + } else if (progress.indexOf('read remote features info') == -1) { + scope.modalOpen = true + + // update onboarding progress + scope.$store.dispatch('setPreferences', { + progress: ['created class', 'rearranged seats', 'viewed class chart', 'viewed a student page', 'read remote features info'] + }) + } + + // check to ensure behaviorToTally is set + if (!scope.$store.state.preferences.hasOwnProperty('behaviorToTally')) { + scope.$store.dispatch('setPreferences', { + behaviorToTally: '(-) Absent' + }) + + scope.$store.dispatch('getPreferences') + } + + // check to ensure calculationInterval is set + if (!scope.$store.state.preferences.hasOwnProperty('calculationInterval')) { + scope.$store.dispatch('setPreferences', { + calculationInterval: 'weekly' + }) + + scope.$store.dispatch('getPreferences') + } + + // check to ensure weightValues is set + if (!scope.$store.state.preferences.hasOwnProperty('weightValues')) { + scope.$store.dispatch('setPreferences', { + weightValues: { + low: 2, + medium: 4, + strong: 8 + } + }) + + scope.$store.dispatch('getPreferences') + } - if (progress.indexOf('created class') == -1) { - scope.modalOpen = true - } else if (progress.indexOf('read remote features info') == -1) { - scope.modalOpen = true - - // update onboarding progress - scope.$store.dispatch('setPreferences', { - progress: ['created class', 'rearranged seats', 'viewed class chart', 'viewed a student page', 'read remote features info'] - }) } - - // check to ensure behaviorToTally is set - if (!scope.$store.state.preferences.hasOwnProperty('behaviorToTally')) { - scope.$store.dispatch('setPreferences', { - behaviorToTally: '(-) Absent' - }) - - scope.$store.dispatch('getPreferences') - } - - // check to ensure calculationInterval is set - if (!scope.$store.state.preferences.hasOwnProperty('calculationInterval')) { - scope.$store.dispatch('setPreferences', { - calculationInterval: 'weekly' - }) - - scope.$store.dispatch('getPreferences') - } - - // check to ensure weightValues is set - if (!scope.$store.state.preferences.hasOwnProperty('weightValues')) { - scope.$store.dispatch('setPreferences', { - weightValues: { - low: 2, - medium: 4, - strong: 8 - } - }) - - scope.$store.dispatch('getPreferences') - } - }, 3000, scope) } } @@ -371,7 +374,7 @@ header { display: grid; grid-template-rows: 20% 20% 1fr; grid-template-columns: 5% 18% 1fr 18% 5%; - grid-template-areas: + grid-template-areas: ". . . . ." ". activities . search ." "logo logo logo logo logo"; diff --git a/src/views/SessionExplorer.vue b/src/views/SessionExplorer.vue index dec0f20..b0e9b9e 100644 --- a/src/views/SessionExplorer.vue +++ b/src/views/SessionExplorer.vue @@ -18,24 +18,24 @@
{{ filteredResponses.length }} responses
- - -