Skip to content

Commit 372cdee

Browse files
authored
Merge pull request #3210 from uw-it-aca/qa
Qa
2 parents 873ec60 + 99e3525 commit 372cdee

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

myuw_vue/components/_common/future-quarter.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default {
112112
},
113113
},
114114
created() {
115-
this.fetch();
115+
if (this.student) this.fetch();
116116
},
117117
methods: {
118118
...mapActions('oquarter', ['fetch']),

myuw_vue/components/home/events/events.vue

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<uw-card v-if="!isReady || (shownEvents.length > 0 || futureCalCount > 0)"
2+
<uw-card v-if="showCard"
33
:loaded="isReady"
44
:errored="isErrored"
55
:errored-show="showError"
@@ -152,6 +152,8 @@ export default {
152152
},
153153
computed: {
154154
...mapState({
155+
employee: (state) => state.user.affiliations.all_employee,
156+
student: (state) => state.user.affiliations.student,
155157
shownEvents: (state) => state.events.value.shownEvents || [],
156158
hiddenEvents: (state) => state.events.value.hiddenEvents || [],
157159
futureCalCount: (state) => state.events.value.futureCalCount,
@@ -163,12 +165,18 @@ export default {
163165
isErrored: 'isErrored',
164166
statusCode: 'statusCode',
165167
}),
168+
showCard() {
169+
return (
170+
(this.employee || this.student) &&
171+
(!this.isReady || this.shownEvents.length > 0 || this.futureCalCount > 0)
172+
);
173+
},
166174
showError() {
167175
return this.statusCode !== 404;
168176
},
169177
},
170178
created() {
171-
this.fetch();
179+
if (this.employee || this.student) this.fetch();
172180
},
173181
methods: {
174182
...mapActions('events', ['fetch']),

myuw_vue/tests/events-card.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ describe('Event Store and Card', () => {
2222
modules: {
2323
'events': events,
2424
},
25+
state: {
26+
user: {
27+
affiliations: {
28+
student: true,
29+
}
30+
}
31+
}
2532
});
2633
});
2734

0 commit comments

Comments
 (0)