Skip to content

Commit

Permalink
Only render WCA ID on userColumn if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
big213 committed Apr 13, 2021
1 parent b628d52 commit 1fbd09d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
17 changes: 13 additions & 4 deletions frontend/components/dialog/searchDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
<v-dialog v-model="dialog" width="500">
<template v-slot:activator="{ on, attrs }">
<v-btn icon v-bind="attrs" v-on="on">
<v-icon>mdi-magnify</v-icon>
<slot name="icon">
<v-icon>mdi-magnify</v-icon>
</slot>
</v-btn>
</template>
<v-card>
<v-card-text class="pb-0 pt-5">
<v-text-field
ref="search"
v-model="searchInput"
:value="value"
prepend-icon="mdi-magnify"
outlined
label="Search query (Enter to submit)"
clearable
@input="$emit('input', $event)"
@keyup.enter="submit()"
></v-text-field>
</v-card-text>
Expand All @@ -23,9 +26,15 @@

<script>
export default {
props: {
value: {
type: String,
default: () => null,
},
},
data() {
return {
searchInput: null,
dialog: false,
}
},
Expand All @@ -42,7 +51,7 @@ export default {
methods: {
submit() {
this.$emit('handleSubmit', this.searchInput)
this.$emit('handleSubmit', this.value)
this.dialog = false
},
},
Expand Down
12 changes: 11 additions & 1 deletion frontend/components/interface/crud/crudRecordInterface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@
inset
vertical
></v-divider>

<SearchDialog
v-if="recordInfo.paginationOptions.hasSearch"
v-model="searchInput"
@handleSubmit="handleSearchDialogSubmit"
></SearchDialog>
>
<template slot="icon">
<v-badge :value="!!search" dot color="secondary">
<v-icon>mdi-magnify</v-icon>
</v-badge>
</template>
</SearchDialog>
<v-spacer></v-spacer>
<v-btn
v-if="hasFilters"
Expand Down Expand Up @@ -491,6 +499,8 @@
import crudMixin from '~/mixins/crud'
export default {
name: 'CrudRecordInterface',
mixins: [crudMixin],
}
</script>
Expand Down
4 changes: 3 additions & 1 deletion frontend/components/table/common/userColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
<template v-else-if="currentUser">
<v-list-item-subtitle
>WCA ID:
<a @click="openWCAProfile(currentUser.wcaId)"
<a
v-if="currentUser.wcaId"
@click="openWCAProfile(currentUser.wcaId)"
>{{ currentUser.wcaId }}
<v-icon small>mdi-open-in-new</v-icon>
</a></v-list-item-subtitle
Expand Down

0 comments on commit 1fbd09d

Please sign in to comment.