Skip to content

Commit

Permalink
Merge pull request SchoolofComputerScience#103 from clizzy12/MySQLUpdate
Browse files Browse the repository at this point in the history
Updating Frontend For MySQL Data
  • Loading branch information
clizzy12 authored Aug 23, 2018
2 parents 76ad261 + ef8a012 commit 1d182c2
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 181 deletions.
22 changes: 11 additions & 11 deletions src/components/EventsItem.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<template>
<div v-if="!compact" class="card">
<div class="type" :style="{background: typeColors.get(data.type)}">{{data.type}}</div>
<router-link :to="'/events/' + data.uid">
<router-link :to="'/events/' + data.id">
<div class="pull-left date-card">
<div class="date-month">{{eventDate.month}}</div>
<div class="date-day">{{eventDate.day}}</div>
<div class="date-year">{{eventDate.year}}</div>
</div>
<div class="card-content">
<h3>{{data.title}}</h3>
<h3>{{data.name}}</h3>
<div v-if="data.speakerName" class="text-capitalize">{{data.speakerName}}</div>
<p>
{{data.building}} {{data.room}}<br>
<b>{{timeFix(data.startDate)}}</b>
{{data.building.toUpperCase() | buildingTranslate}} {{data.room}}<br>
<b>{{timeFix(data.date)}}</b>
</p>
</div>
</router-link>
</div>

<div v-else class="condensed-card" :style="{ borderLeftColor: typeColors.get(data.type)}">
<router-link :to="'/events/' + data.uid">
<router-link :to="'/events/' + data.id">
<div class="condensed-type" :style="{background: typeColors.get(data.type)}">{{data.type}}</div>
<div class="pl-3 pt-1 date-card"><strong>{{dateFix(data.startDate)}} &ndash; {{timeFix(data.startDate)}}</strong></div>
<h3 class="pl-3 pr-3">{{data.title}}</h3>
<div class="pl-3 pt-1 date-card"><strong>{{dateFix(data.date)}} &ndash; {{timeFix(data.date)}}</strong></div>
<h3 class="pl-3 pr-3">{{data.name}}</h3>
<div v-if="data.speakerName" class="pl-3 text-capitalize text-right pr-3">{{data.speakerName}}</div>
<p class="text-right pr-3">
{{data.building}} {{data.room}}
{{data.building.toUpperCase() | buildingTranslate}} {{data.room}}
</p>
</router-link>
</div>
Expand All @@ -52,9 +52,9 @@
computed: {
eventDate(){
const dateObject = {
month: format(this.data.startDate, 'MMM'),
day: format(this.data.startDate, 'DD'),
year: format(this.data.startDate, 'YYYY')
month: format(this.data.date, 'MMM'),
day: format(this.data.date, 'DD'),
year: format(this.data.date, 'YYYY')
};
return dateObject;
Expand Down
4 changes: 2 additions & 2 deletions src/components/NewsItem.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="news-item">
<router-link :to="'/news/' + data.uid" class="card">
<router-link :to="'/news/' + data.id" class="card">
<figure :style="{ 'background-image': 'url(' + data.image + ')' }"></figure>
<div class="content">
<p>{{timeFix(data.date)}}</p>
<h3>{{data.title}}</h3>
<h3>{{data.headline}}</h3>
</div>
</router-link>
<div v-if="show_tags" class="tags">
Expand Down
6 changes: 5 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import programs from './modules/programs';
import researchAreas from './modules/researchAreas';
import semesterCode from './modules/semesterCode';
import navigation from './modules/navigation';
import researchAreaCourses from './modules/researchAreaCourses';
import researchAreaMembers from './modules/researchAreaMembers';

Vue.use(Vuex)

Expand All @@ -29,7 +31,9 @@ const store = new Vuex.Store({
programs,
researchAreas,
semesterCode,
navigation
navigation,
researchAreaCourses,
researchAreaMembers
}
})

Expand Down
7 changes: 1 addition & 6 deletions src/store/modules/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,19 @@ export default {
query: gql`
{
members {
_id
display_name
family_name
given_name
hr_relationship_class
positions {
title
department
primary_position
primary_position_indicator
}
scid
scs_relationship_class
scs_relationship_desc
image_url
research_areas {
area_id
title
}
email
display_email
}
Expand Down
31 changes: 11 additions & 20 deletions src/store/modules/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,15 @@ export default {
: apollo.query({
query: gql`
{
event(uid:"${fields}") {
uid
events(id:"${fields}") {
id
room
building
title
abstract
startDate
endDate
talkTitle
name
date
speakerName
speakerCompany
speakerCompanyTeam
type
tags
eventUrl
poster
description
}
}
`
Expand All @@ -77,15 +70,13 @@ export default {
query: gql`
{
events {
uid
talkTitle
type
title
speakerName
startDate
tags
id
room
building
name
date
speakerName
eventUrl
}
}
`
Expand All @@ -101,7 +92,7 @@ export default {
},
mutations: {
SET_EVENT: (state, data) => {
Vue.set(state.event, data.event[0].uid, data.event[0])
Vue.set(state.event, data.events[0].id, data.events[0])
},
SET_EVENTS_LIST: (state, data) => {
if(data.error){
Expand Down
48 changes: 19 additions & 29 deletions src/store/modules/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,23 @@ export default {
hr_relationship
hr_relationship_class
hr_relationship_desc
research_areas {
area_id
title
}
display_name
phone_full_call
phone_full
scid
scs_relationship_class
scs_relationship_desc
positions {
building
building_id
department
department_name
hr_department
performance_supervisor
primary_position
hr_department_id
performance_supervisor_scid
primary_position_indicator
room
scs_position_class
scs_position_desc
title
}
news(limit: 2){
title
date
uid
image
tags {
tag
name
}
}
events{
uid
title
startDate
}
profile{
gs_affiliation
gs_areas
Expand All @@ -79,14 +61,22 @@ export default {
gs_profile_guid
gs_profile_url
scid
pub_year_agg{
_id
}
}
publications{
_id
title
authors
description
gs_citation_count
gs_citation_guid
gs_citation_url
gs_profile_guid
journal
pages
pub_date
pub_format
pub_url
pub_year
publisher
title
}
courses{
long_title
Expand Down
38 changes: 17 additions & 21 deletions src/store/modules/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ export default {
query: gql`
{
newsBySearch(query:"${fields}") {
title
headline
date
uid
id
image
tags {
tag
name
}
image_alt
image_caption
}
}
`
Expand All @@ -51,16 +49,15 @@ export default {
: apollo.query({
query: gql`
{
newsArticle(uid:"${fields}") {
title
news(id:"${fields}") {
headline
subheading
date
uid
id
image
body
tags {
tag
name
}
image_alt
image_caption
copy
}
}
`
Expand All @@ -82,14 +79,13 @@ export default {
query: gql`
{
news {
title
headline
subheading
date
uid
id
image
tags {
tag
name
}
image_alt
image_caption
}
}
`
Expand All @@ -114,7 +110,7 @@ export default {
state.error = data.error
} else {
state.error = ''
Vue.set(state.articles, data.newsArticle[0].uid, data.newsArticle[0])
Vue.set(state.articles, data.news[0].id, data.news[0])
}
},
SET_NEWS_LIST: (state, data) => {
Expand Down
17 changes: 1 addition & 16 deletions src/store/modules/programs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,10 @@ export default {
program_name
url
description
department
departments
graduate_level
degree_level
additional_degree
learning_outcomes {
track_id
outcomes
}
goals {
track_id
goal
}
areas {
track_id
areas {
title
area_id
}
}
}
}
`
Expand Down
27 changes: 1 addition & 26 deletions src/store/modules/researchAreas.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,8 @@ export default {
researchAreas {
area_id
title
courses {
course_id
course_number
title
}
description{
text
title
contributors
sources {
title
url
}
}
description
gs_count
members {
scid
display_name
}
programs {
program_id
program_name
tracks {
track_id
track_name
}
}
}
}
`
Expand Down
Loading

0 comments on commit 1d182c2

Please sign in to comment.