Skip to content

Commit

Permalink
more improvements for older versions of elasticvue
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Nov 23, 2023
1 parent 01f2b01 commit 5a6c826
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* link rest api docs to current version docs, fixes [#163][f163]
* sort shards by health, fixes [#161][i161]
* fixes index table filter
* replaces `ace` editor with `codemirror-6`
* replaces `ace` editor with `codemirror 6`
* more improvements for older versions of elasticvue
* dependency updates

[f153]: https://github.com/cars10/elasticvue/issues/153
Expand Down
4 changes: 3 additions & 1 deletion src/components/search/EditDocument.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<q-dialog v-model="ownValue">
<q-dialog v-model="ownValue" @show="triggerResize">
<q-card style="width: 1000px; max-width: 1000px;">
<q-card-section class="flex justify-between">
<div class="flex">
Expand Down Expand Up @@ -50,6 +50,8 @@
const resizeStore = useResizeStore()
const t = useTranslation()
const triggerResize = () => (window.dispatchEvent(new Event('resize')))
const {
document,
ownValue,
Expand Down
5 changes: 3 additions & 2 deletions src/composables/components/search/SearchDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type EsSearchResult = {
}

type EsSearchResultHits = {
total: EsSearchResultsHitsValues,
total: EsSearchResultsHitsValues | number,
hits?: any
}

Expand Down Expand Up @@ -39,7 +39,8 @@ export const useSearchDocuments = () => {

try {
searchResults.value = await callElasticsearch('search', query, searchStore.indices)
searchStore.pagination.rowsNumber = searchResults.value.hits?.total?.value
const total = searchResults.value.hits?.total
searchStore.pagination.rowsNumber = typeof total === 'number' ? total : total.value
} catch (e) {
console.error(e)
searchResults.value = { hits: { total: { value: 0 } } }
Expand Down

0 comments on commit 5a6c826

Please sign in to comment.