Skip to content

Commit

Permalink
Various minor frontend bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
big213 committed Mar 1, 2021
1 parent 23ddded commit 6b5881d
Show file tree
Hide file tree
Showing 24 changed files with 58 additions and 46 deletions.
2 changes: 0 additions & 2 deletions frontend/components/interface/crud/deleteRecordInterface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export default {
})
this.$emit('handleSubmit', data)
this.close()
} catch (err) {
sharedService.handleError(err, this.$root)
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@
<v-spacer></v-spacer>
<v-icon
small
class="pr-2"
class="mr-2"
@click="openLink('https://discord.gg/zg3GafZF')"
>mdi-discord</v-icon
>
<v-icon
small
class="pr-2"
class="mr-2"
@click="openLink('https://github.com/cubing/CubePB')"
>mdi-github</v-icon
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/models/event.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RecordInfo } from '~/types'
import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'

export default <RecordInfo<'event'>>{
export const Event = <RecordInfo<'event'>>{
type: 'event',
name: 'Event',
pluralName: 'Events',
Expand Down
5 changes: 5 additions & 0 deletions frontend/models/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { Event } from './event'
export { PersonalBest } from './personalBest'
export { PersonalBestClass } from './personalBestClass'
export { Product } from './product'
export { User } from './user'
7 changes: 3 additions & 4 deletions frontend/models/personalBest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import TimeElapsedColumn from '~/components/table/common/timeElapsedColumn.vue'
import CreatedByColumn from '~/components/table/common/createdByColumn.vue'
import { serializeTime } from '~/services/common'

export default <RecordInfo<'personalBest'>>{
export const PersonalBest = <RecordInfo<'personalBest'>>{
type: 'personalBest',
name: 'Personal Best',
pluralName: 'Personal Bests',
// viewRecordRoute: '/pb',
icon: 'mdi-timer',
renderItem: (item) => item.name,
options: {
Expand Down Expand Up @@ -189,9 +190,7 @@ export default <RecordInfo<'personalBest'>>{
],
},
deleteOptions: {},
shareOptions: {
route: '/pb',
},
shareOptions: {},
headers: [
{
field: 'event.name',
Expand Down
2 changes: 1 addition & 1 deletion frontend/models/personalBestClass.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RecordInfo } from '~/types'
import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'

export default <RecordInfo<'personalBestClass'>>{
export const PersonalBestClass = <RecordInfo<'personalBestClass'>>{
type: 'personalBestClass',
name: 'Personal Best Type',
pluralName: 'Personal Best Types',
Expand Down
2 changes: 1 addition & 1 deletion frontend/models/product.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RecordInfo } from '~/types'
import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'

export default <RecordInfo<'product'>>{
export const Product = <RecordInfo<'product'>>{
type: 'product',
name: 'Product',
pluralName: 'Products',
Expand Down
6 changes: 0 additions & 6 deletions frontend/models/special/allPbs.ts

This file was deleted.

3 changes: 3 additions & 0 deletions frontend/models/special/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { MyPbs } from './myPbs'
export { PbPublic } from './pbPublic'
export { UserPublic } from './userPublic'
6 changes: 6 additions & 0 deletions frontend/models/special/myPbs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { PersonalBest } from '..'

export const MyPbs = {
...PersonalBest,
viewRecordRoute: '/pb',
}
8 changes: 8 additions & 0 deletions frontend/models/special/pbPublic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { PersonalBest } from '..'

export const PbPublic = {
...PersonalBest,
viewRecordRoute: '/pb',
deleteOptions: undefined,
addOptions: undefined,
}
9 changes: 4 additions & 5 deletions frontend/models/special/userPublic.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import userRecordInfo from '../user'
import personalBestRecordInfo from '../personalBest'
import { User, PersonalBest } from '..'

export default {
...userRecordInfo,
export const UserPublic = {
...User,
viewRecordRoute: '/user',
filters: [],
editOptions: undefined,
Expand All @@ -28,7 +27,7 @@ export default {
],
expandTypes: [
{
recordInfo: personalBestRecordInfo,
recordInfo: PersonalBest,
name: 'PBs',
excludeFilters: ['created_by.id'],
excludeHeaders: ['created_by.name+created_by.avatar'],
Expand Down
6 changes: 3 additions & 3 deletions frontend/models/user.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import personalBestRecordInfo from './personalBest'
import { PersonalBest } from '.'
import type { RecordInfo } from '~/types'
import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'
import UserColumn from '~/components/table/common/userColumn.vue'
import { getBooleanOptions, getUserRoles } from '~/services/dropdown'

export default <RecordInfo<'user'>>{
export const User = <RecordInfo<'user'>>{
type: 'user',
name: 'User',
pluralName: 'Users',
Expand Down Expand Up @@ -127,7 +127,7 @@ export default <RecordInfo<'user'>>{
],
expandTypes: [
{
recordInfo: personalBestRecordInfo,
recordInfo: PersonalBest,
name: 'PBs',
excludeFilters: ['created_by.id'],
excludeHeaders: ['created_by.name+created_by.avatar'],
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/admin/events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import eventRecordInfo from '~/models/event'
import { Event } from '~/models'
export default {
components: {
Expand All @@ -13,7 +13,7 @@ export default {
data() {
return {
recordInfo: eventRecordInfo,
recordInfo: Event,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/admin/personalBestClasses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import personalBestClassRecordInfo from '~/models/personalBestClass'
import { PersonalBestClass } from '~/models'
export default {
components: {
Expand All @@ -13,7 +13,7 @@ export default {
data() {
return {
recordInfo: personalBestClassRecordInfo,
recordInfo: PersonalBestClass,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/admin/personalBests.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import personalBestRecordInfo from '~/models/personalBest'
import { PersonalBest } from '~/models'
export default {
components: {
Expand All @@ -13,7 +13,7 @@ export default {
data() {
return {
recordInfo: personalBestRecordInfo,
recordInfo: PersonalBest,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/admin/products.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import productRecordInfo from '~/models/product'
import { Product } from '~/models'
export default {
components: {
Expand All @@ -13,7 +13,7 @@ export default {
data() {
return {
recordInfo: productRecordInfo,
recordInfo: Product,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/admin/users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import userRecordInfo from '~/models/user'
import { User } from '~/models'
export default {
components: {
Expand All @@ -13,7 +13,7 @@ export default {
data() {
return {
recordInfo: userRecordInfo,
recordInfo: User,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/my-pbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import personalBestRecordInfo from '~/models/personalBest'
import { MyPbs } from '~/models/special'
export default {
components: {
Expand All @@ -20,7 +20,7 @@ export default {
data() {
return {
recordInfo: personalBestRecordInfo,
recordInfo: MyPbs,
head: {
title: 'My PBs',
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/pb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<script>
import ViewRecordPage from '~/components/page/viewRecordPage.vue'
import personalBestRecordInfo from '~/models/personalBest'
import { PbPublic } from '~/models/special'
export default {
components: {
ViewRecordPage,
},
data() {
return {
recordInfo: personalBestRecordInfo,
recordInfo: PbPublic,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/public-pbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import allPbsRecordInfo from '~/models/special/allPbs'
import { PbPublic } from '~/models/special'
export default {
components: {
Expand All @@ -19,7 +19,7 @@ export default {
data() {
return {
recordInfo: allPbsRecordInfo,
recordInfo: PbPublic,
head: {
title: 'Public PBs',
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/public-users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script>
import CrudRecordPage from '~/components/page/crudRecordPage.vue'
import userPublicRecordInfo from '~/models/special/userPublic'
import { UserPublic } from '~/models/special'
export default {
components: {
Expand All @@ -18,7 +18,7 @@ export default {
data() {
return {
recordInfo: userPublicRecordInfo,
recordInfo: UserPublic,
lockedFilters: [
{
field: 'is_public',
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/user.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<script>
import ViewRecordPage from '~/components/page/viewRecordPage.vue'
import userPublicRecordInfo from '~/models/special/userPublic'
import { UserPublic } from '~/models/special'
export default {
components: {
ViewRecordPage,
},
data() {
return {
recordInfo: userPublicRecordInfo,
recordInfo: UserPublic,
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type RecordInfo<T extends keyof MainTypes> = {
name: string
pluralName: string
// route that shareUrl and enterItem should be based off
viewItemRoute?: string
viewRecordRoute?: string
icon?: string
// how to render the item as a string
renderItem?: (item) => string
Expand Down

0 comments on commit 6b5881d

Please sign in to comment.