Skip to content

Commit

Permalink
adds "clear" button to search column selection options
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Mar 30, 2024
1 parent 26d9826 commit e7e3abf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* warn when selecting huge page sizes
* add some query string examples
* show search query execution time
* adds "clear" button to search column selection options

## 1.0.4

Expand Down
3 changes: 3 additions & 0 deletions src/components/search/SearchResultsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<div class="flex justify-between items-center" style="flex-grow: 1">
{{ t('search.results_table.settings.columns') }}

<q-btn :label="t('shared.table_settings.clear')" flat size="sm" class="q-px-xs"
@click="clearColumns" />
<q-btn :label="t('shared.table_settings.reset')" flat size="sm" class="q-px-xs"
@click="resetColumns" />
</div>
Expand Down Expand Up @@ -119,6 +121,7 @@
acceptRowsPerPage,
tableColumns,
searchStore,
clearColumns,
resetColumns,
slicedTableColumns,
resizeStore,
Expand Down
2 changes: 2 additions & 0 deletions src/composables/components/search/SearchResultsTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const useSearchResultsTable = (props: SearchResultsTableProps, emit: any)
const slicedTableColumns = computed((): any[] => (tableColumns.value.slice(0, -1)))

const onRequest = (pagination: any) => (emit('request', pagination))
const clearColumns = () => (searchStore.visibleColumns = ['actions'])
const resetColumns = () => (searchStore.visibleColumns = tableColumns.value.map(c => c.name))
const generateDownloadData = () => (stringifyJson(props.results))

Expand All @@ -111,6 +112,7 @@ export const useSearchResultsTable = (props: SearchResultsTableProps, emit: any)
filter,
tableColumns,
searchStore,
clearColumns,
resetColumns,
slicedTableColumns,
resizeStore,
Expand Down
2 changes: 1 addition & 1 deletion src/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
},
"table_settings": {
"reset": "重置",
"uncheck": "反选"
"clear": "反选"
},
"authorization_header_hint": "你的集群使用了授权。确保你已经设置了\"http.cors.allow-headers\",否则将无法连接。",
"code_editor": {
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
},
"table_settings": {
"reset": "reset",
"uncheck": "uncheck"
"clear": "clear"
},
"authorization_header_hint": "Make sure that \"http.cors.allow-headers\" is configured",
"code_editor": {
Expand Down

0 comments on commit e7e3abf

Please sign in to comment.