Skip to content

Commit

Permalink
merge lint PR
Browse files Browse the repository at this point in the history
  • Loading branch information
solderq35 committed Dec 19, 2023
2 parents 3724f5d + e0f422f commit f77a641
Show file tree
Hide file tree
Showing 61 changed files with 2,073 additions and 2,073 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ module.exports = {
'vue/no-use-v-if-with-v-for': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-in-parens': [1, 'always']
'space-in-parens': [1, 'never']
}
}
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* @Last modified time: 2019-02-01T12:55:07-08:00
*/

module.exports = function ( api ) {
api.cache( true )
module.exports = function (api) {
api.cache(true)
const presets = ['@vue/app']

const plugins = []

// add babel-require hook so web-pack directives don't brick jest
if ( process.env.NODE_ENV === 'test' ) {
plugins.push( 'require-context-hook' )
if (process.env.NODE_ENV === 'test') {
plugins.push('require-context-hook')
}

return {
Expand Down
20 changes: 10 additions & 10 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default {
},
async created () {
// On load, grab building/meter/map information from the API.
await this.$store.dispatch( 'map/loadMap' )
await this.$store.dispatch('map/loadMap')
// Also check if user is logged in.
this.$store.dispatch( 'user/user' )
this.$store.dispatch('user/user')
},
data () {
return {
Expand All @@ -46,28 +46,28 @@ export default {
},
mounted () {
// This is the first-timer pop-up window
if ( !document.cookie.split( ';' ).some( cookieString => cookieString.includes( 'firstTimer' ) ) ) {
this.$msgbox( {
if (!document.cookie.split(';').some(cookieString => cookieString.includes('firstTimer'))) {
this.$msgbox({
title: 'First Timer?',
message: 'Take a look at the "FAQ" tab for some info on how to get started!',
showCancelButton: true,
confirmButtonText: 'OK',
cancelButtonText: 'Never Show This Message Again',
distinguishCancelAndClose: true,
callback: function ( action ) {
if ( action === 'cancel' ) {
callback: function (action) {
if (action === 'cancel') {
const cookieDate = new Date()
cookieDate.setFullYear( new Date().getFullYear() + 10 )
cookieDate.setFullYear(new Date().getFullYear() + 10)
document.cookie = 'firstTimer=true; expires=' + cookieDate.toUTCString() + ';'
}
}
} )
})
}
},
watch: {
$route: function ( to, from ) {
$route: function (to, from) {
// transition in
if ( to.path.length > from.path.length ) {
if (to.path.length > from.path.length) {
this.transitionName = 'pageTo'
} else {
// transition out
Expand Down
60 changes: 30 additions & 30 deletions src/components/building_list/building_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ export default {
}
},
async mounted () {
if ( this.buildingList ) {
if (this.buildingList) {
await this.$store.getters['map/promise']
if ( this.$route.params.group && this.groups[this.$route.params.group] ) {
if (this.$route.params.group && this.groups[this.$route.params.group]) {
this.openName = this.$route.params.group
} else {
this.openName = Object.keys( this.groups )[0]
this.openName = Object.keys(this.groups)[0]
}
this.loading = false
} else {
Expand All @@ -82,36 +82,36 @@ export default {
computed: {
buildingList: {
get () {
return this.$route.path.includes( 'buildings' )
return this.$route.path.includes('buildings')
}
},
groups: {
get () {
if ( this.buildingList ) {
if (this.buildingList) {
let r = {}
// await this.$store.getters['map/promise']
let buildings = this.$store.getters['map/buildings']
for ( let building of buildings ) {
if ( r['All'] ) {
r['All'].push( building )
r['All'].sort( ( a, b ) => ( a.name > b.name ? 1 : -1 ) )
for (let building of buildings) {
if (r['All']) {
r['All'].push(building)
r['All'].sort((a, b) => (a.name > b.name ? 1 : -1))
} else {
r['All'] = [building]
}
if ( r[building.group] ) {
r[building.group].push( building )
r[building.group].sort( ( a, b ) => ( a.name > b.name ? 1 : -1 ) )
if (r[building.group]) {
r[building.group].push(building)
r[building.group].sort((a, b) => (a.name > b.name ? 1 : -1))
} else {
r[building.group] = [building]
}
}
let r2 = {
All: r['All']
}
let keys = Object.keys( r ).sort()
for ( let key of keys ) {
if ( key !== 'All' ) r2[key] = r[key]
let keys = Object.keys(r).sort()
for (let key of keys) {
if (key !== 'All') r2[key] = r[key]
}
return r2
} else {
Expand All @@ -121,37 +121,37 @@ export default {
}
},
watch: {
groups: function ( value ) {
groups: function (value) {
this.search = ''
if ( this.$route.params.group && this.groups[this.$route.params.group] ) {
if (this.$route.params.group && this.groups[this.$route.params.group]) {
this.openName = this.$route.params.group
} else {
this.openName = Object.keys( this.groups )[0]
this.openName = Object.keys(this.groups)[0]
}
},
search: function ( v ) {
search: function (v) {
let groups
if ( this.buildingList ) {
groups = Object.values( this.groups ).reduce( ( a, c ) => {
for ( let d of c ) a.push( d )
if (this.buildingList) {
groups = Object.values(this.groups).reduce((a, c) => {
for (let d of c) a.push(d)
return a
}, [] )
}, [])
} else {
groups = this.groups
}
let values = groups
.filter(
( card, index, arr ) =>
(card, index, arr) =>
// Check that the item's name includes query
( card.name && card.name.toLowerCase().includes( v.toLowerCase() ) ) ||
(card.name && card.name.toLowerCase().includes(v.toLowerCase())) ||
// Check that description includes query
( card.description && card.description.toLowerCase().includes( v.toLowerCase() ) )
(card.description && card.description.toLowerCase().includes(v.toLowerCase()))
)
.map( e => {
.map(e => {
return e.id
} )
for ( let card of this.$refs.card ) {
if ( values.indexOf( card.id ) < 0 ) {
})
for (let card of this.$refs.card) {
if (values.indexOf(card.id) < 0) {
card.$el.parentNode.style.display = 'none'
} else {
card.$el.parentNode.style.display = 'block'
Expand Down
24 changes: 12 additions & 12 deletions src/components/building_list/view_card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
}
},
mounted () {
if ( this.media ) {
if (this.media) {
this.$refs.card.style.background =
'linear-gradient(to bottom right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2)),url("https://osu-energy-images.s3-us-west-2.amazonaws.com/thumbnails/' +
this.media +
Expand All @@ -27,10 +27,10 @@ export default {
computed: {
buildingOrStory: {
get () {
if ( this.building ) {
return this.$store.getters['map/building']( this.id )
if (this.building) {
return this.$store.getters['map/building'](this.id)
} else {
return this.$store.getters['user/view']( this.id )
return this.$store.getters['user/view'](this.id)
}
}
},
Expand All @@ -52,26 +52,26 @@ export default {
},
methods: {
hover: function ( enter ) {
if ( this.$refs.toolbox ) {
if ( enter ) {
hover: function (enter) {
if (this.$refs.toolbox) {
if (enter) {
this.$refs.toolbox.style.display = 'block'
} else {
this.$refs.toolbox.style.display = 'none'
}
}
},
clicked: function ( event ) {
if ( event.target.parentNode.classList.contains( 'toolbox' ) || event.target.classList.contains( 'toolbox' ) ) {
clicked: function (event) {
if (event.target.parentNode.classList.contains('toolbox') || event.target.classList.contains('toolbox')) {
return
}
this.$emit( 'click' )
this.$emit('click')
}
},
watch: {
selected: function ( value ) {
if ( value ) {
selected: function (value) {
if (value) {
this.$refs.card.style.borderColor = 'rgb(215,63,9)'
this.$refs.card.style.borderWidth = '4px'
} else {
Expand Down
Loading

0 comments on commit f77a641

Please sign in to comment.