Skip to content

Commit 6db8b83

Browse files
fix: resource search (#864)
1 parent 4a1bc01 commit 6db8b83

File tree

16 files changed

+41
-32
lines changed

16 files changed

+41
-32
lines changed

components/CommunityResources/AdminCommunityResourcesPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const sortedBy = ref<CommunityResourceSortedBy>('created_at_internal')
7373
const direction = ref<SortDirection>('desc')
7474
const sortDirection = computed(() => `${direction.value === 'asc' ? '' : '-'}${sortedBy.value}`)
7575
const q = ref('')
76-
const qDebounced = refDebounced(q, 500) // TODO add 500 in config
76+
const qDebounced = refDebounced(q, config.public.searchDebounce)
7777
7878
function sort(column: CommunityResourceSortedBy, newDirection: SortDirection) {
7979
sortedBy.value = column

components/Dataservices/AdminDataservicesPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const sortedBy = ref<DataserviceSortedBy>('title')
113113
const direction = ref<SortDirection>('desc')
114114
const sortDirection = computed(() => `${direction.value === 'asc' ? '' : '-'}${sortedBy.value}`)
115115
const q = ref('')
116-
const qDebounced = refDebounced(q, 500) // TODO add 500 in config
116+
const qDebounced = refDebounced(q, config.public.searchDebounce)
117117
const dataserviceActivities = ref<Record<Dataservice['id'], Activity>>({})
118118
119119
const props = defineProps<{

components/Dataservices/SearchPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ watchEffect(() => {
224224
queryString.value = route.query.q
225225
})
226226
227-
const deboucedQuery = debouncedRef(queryString, config.public.searchAutocompleteDebounce)
227+
const deboucedQuery = debouncedRef(queryString, config.public.searchDebounce)
228228
229229
/**
230230
* Query sort

components/Datasets/AdminDatasetsPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const sortedBy = ref<DatasetSortedBy>('created')
142142
const direction = ref<SortDirection>('desc')
143143
const sortDirection = computed(() => `${direction.value === 'asc' ? '' : '-'}${sortedBy.value}`)
144144
const q = ref('')
145-
const qDebounced = refDebounced(q, 500) // TODO add 500 in config
145+
const qDebounced = refDebounced(q, config.public.searchDebounce)
146146
const datasetsStatus = ref<{ label: string, id: string } | null>(null)
147147
const datasetActivities = ref<Record<DatasetV2['id'], Activity>>({})
148148

components/Datasets/SearchPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ watchEffect(() => {
378378
queryString.value = route.query.q
379379
})
380380
381-
const deboucedQuery = debouncedRef(queryString, config.public.searchAutocompleteDebounce)
381+
const deboucedQuery = debouncedRef(queryString, config.public.searchDebounce)
382382
383383
/**
384384
* Query sort

components/Discussions/DiscussionsList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const sortedBy = ref<DiscussionSortedBy>('created')
180180
const direction = ref<SortDirection>('desc')
181181
const sortDirection = computed(() => `${direction.value === 'asc' ? '' : '-'}${sortedBy.value}`)
182182
const q = ref('')
183-
const qDebounced = refDebounced(q, 500) // TODO add 500 in config
183+
const qDebounced = refDebounced(q, config.public.searchDebounce)
184184
185185
const me = useMaybeMe()
186186

components/Harvesters/AdminHarvestersPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const { $api } = useNuxtApp()
199199
const page = ref(1)
200200
const pageSize = ref(20)
201201
const q = ref('')
202-
const qDebounced = refDebounced(q, 500) // TODO add 500 in config
202+
const qDebounced = refDebounced(q, config.public.searchDebounce)
203203
204204
const url = computed(() => {
205205
const url = new URL(`/api/1/harvest/sources/`, config.public.apiBase)

components/Organization/ListPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ watchEffect(() => {
131131
q.value = props.initialQ
132132
})
133133
134-
const qDebounced = debouncedRef(q, config.public.searchAutocompleteDebounce)
134+
const qDebounced = debouncedRef(q, config.public.searchDebounce)
135135
const sort = ref(props.sort ?? '')
136136
const sortParam = computed(() => sort.value ? sort.value : undefined)
137137

components/Reuses/AdminReusesPage.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ const props = defineProps<{
102102
}>()
103103
104104
const { $api } = useNuxtApp()
105+
const config = useRuntimeConfig()
105106
106107
const page = ref(1)
107108
const pageSize = ref(20)
108109
const sortedBy = ref<ReuseSortedBy>('created')
109110
const direction = ref<SortDirection>('desc')
110111
const sortDirection = computed(() => `${direction.value === 'asc' ? '' : '-'}${sortedBy.value}`)
111112
const q = ref('')
112-
const qDebounced = refDebounced(q, 500) // TODO add 500 in config
113+
const qDebounced = refDebounced(q, config.public.searchDebounce)
113114
const reuseActivities = ref({})
114115
115116
function sort(column: ReuseSortedBy, newDirection: SortDirection) {

components/Reuses/ListPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ watchEffect(() => {
170170
q.value = props.initialQ
171171
})
172172
173-
const qDebounced = debouncedRef(q, config.public.searchAutocompleteDebounce)
173+
const qDebounced = debouncedRef(q, config.public.searchDebounce)
174174
const sort = ref(props.sort ?? '')
175175
const sortParam = computed(() => sort.value ? sort.value : undefined)
176176
const topic = ref(props.topic)

0 commit comments

Comments
 (0)