Skip to content

Commit

Permalink
Hide tutorial if class charts exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaddeus McCleary authored and Thaddeus McCleary committed Sep 1, 2021
1 parent d034121 commit 5bb952f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 87 deletions.
28 changes: 14 additions & 14 deletions src/views/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
v-on:edit-info="setLastView(`/chart/${id}`)"
:title="classInfo.name"
/>
<RemoteAdapter
<RemoteAdapter
v-on:open-remote-panel="openRemotePanel"
v-on:set-room-id="setRemoteRoomID"
v-on:remote-connected="remoteClientConnected = true"
Expand Down Expand Up @@ -52,7 +52,7 @@
</div>
</section>
<section v-if="inverted" class="row" v-for="(row, index) in classInfo.rows" :style="rowMargins" :key="`invertedRow${index},${students.length}`">
<div v-for="(column, subIndex) in classInfo.columns" class="column" :style="cardStyle">
<div v-for="(column, subIndex) in classInfo.columns" class="column" :style="cardStyle">
<NameCard
:type="cardType"
:conserveSpace="isHuge"
Expand All @@ -67,7 +67,7 @@
v-on:absence="addAbsence"
:deselect="deselect"
:key="students[students.length - 1]._id + index"
:chosen="chosenSeat.row == index + 1 && chosenSeat.column == subIndex + 1"
:chosen="chosenSeat.row == index + 1 && chosenSeat.column == subIndex + 1"
/>
</div>
</section>
Expand Down Expand Up @@ -215,15 +215,15 @@
</Modal>
<Modal v-if="remotePanelOpen" v-on:trigger-close="closeRemotePanel" :dismissable="true" size="small">
<template slot="content">
<RemoteConfigPanel
<RemoteConfigPanel
v-if="!remoteConfigured"
v-on:trigger-modal-close="closeRemotePanel"
v-on:end-config="remoteConfigured = true"
:roomID="remoteRoomID"
:remoteClientConnected="remoteClientConnected"
:remoteConnected="remoteConnected"
/>
<RemoteStatusPanel
<RemoteStatusPanel
v-else
v-on:disconnect="closeRemoteConnection"
v-on:trigger-modal-close="closeRemotePanel"
Expand All @@ -236,13 +236,13 @@
</Modal>
<Modal v-if="activityModalOpen" v-on:trigger-close="activityModalOpen = false" :dismissable="false" size="large">
<template slot="content">
<ActivitySelector
v-if="activityChoice == null"
<ActivitySelector
v-if="activityChoice == null"
v-on:set-activity-choice="setActivityChoice"
v-on:cancel-activity="cancelActivity"
:chart="id"
/>
<ActivityAdapter
<ActivityAdapter
v-else
:allowAnonymous="false"
:chart="id"
Expand All @@ -258,7 +258,7 @@
/>
</template>
</Modal>
<TouchBar :show="!modalOpen"
<TouchBar :show="!modalOpen"
:bar="[
{type: 'button', label: '🔀', method: function() {rearrangeSeats()}},
{type: 'button', label: '🌈', method: function() {highlightStudents()}},
Expand All @@ -268,7 +268,7 @@
{type: 'button', label: '📺', method: function() {invertChart()}},
{type: 'button', label: '📝', method: function() {createBulkNote()}},
{type: 'button', label: '🌠', method: function() {deselectStudents()}}
]"
]"
/>
</div>
</template>
Expand Down Expand Up @@ -645,7 +645,7 @@ export default {
.then(() => {
db.deleteSomething('notes', {student: this.studentToEdit._id})
.then((numNotesDeleted) => {
})
for (let i=0; i<this.students.length; i++) {
Expand Down Expand Up @@ -820,7 +820,7 @@ export default {
},
mounted() {
let scope = this
if (this.$store.state.preferences.progress.indexOf('rearranged seats') === -1) {
if (this.$store.state.preferences.progress.indexOf('rearranged seats') === -1 && !this.$store.state.allClasses) {
// display tutorial info
setTimeout(function() {
scope.alert.isAlert = true
Expand Down Expand Up @@ -900,7 +900,7 @@ body {
}
#chartHeader {
}
#activityLaunchButton {
Expand All @@ -914,7 +914,7 @@ body {
}
#chartMain {
}
#chartFooter {
Expand Down
93 changes: 48 additions & 45 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{type: 'button', label: 'New Chart', method: function() {$router.push('/charts/new')}},
{type: 'spacer', size: 'flexible'},
{type: 'button', label: 'Settings', method: openModal}
]"
]"
/>
</div>
</template>
Expand Down Expand Up @@ -141,7 +141,7 @@ export default {
archiveClass(id) {
db.updateSomething('classes', {_id: id}, {
$set: {
"archived": true
"archived": true
}
}).then(() => {
this.populateClasses()
Expand All @@ -150,7 +150,7 @@ export default {
unarchiveClass(id) {
db.updateSomething('classes', {_id: id}, {
$set: {
"archived": false
"archived": false
}
}).then(() => {
this.populateClasses()
Expand Down Expand Up @@ -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)
}
}
Expand All @@ -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";
Expand Down
Loading

0 comments on commit 5bb952f

Please sign in to comment.