fix(ui): repair reactivity on search fieds in moderation views when on first page

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2304>
environments/review-docs-1664-292dbg/deployments/16508
wvffle 2022-12-27 12:39:41 +00:00 zatwierdzone przez Marge
rodzic 1b6de47a4f
commit fb87d3141a
5 zmienionych plików z 51 dodań i 32 usunięć

Wyświetl plik

@ -100,10 +100,16 @@ const fetchData = async () => {
}
}
watchDebounced(query, () => (page.value = 1), { debounce: 300 })
const forceFetchFirstPage = async () => {
page.value = 1
return fetchData()
}
watchDebounced(query, forceFetchFirstPage, { debounce: 300 })
onOrderingUpdate(forceFetchFirstPage)
watch(allowed, forceFetchFirstPage)
watch(page, fetchData)
watch(allowed, fetchData)
onOrderingUpdate(fetchData)
fetchData()
const sharedLabels = useSharedLabels()

Wyświetl plik

@ -31,6 +31,7 @@ const submit = async () => {
try {
const response = await axios.post('manage/users/invitations/', { code: code.value })
invitations.unshift(response.data)
code.value = ''
} catch (error) {
errors.value = (error as BackendError).backendErrors
}

Wyświetl plik

@ -81,10 +81,16 @@ const fetchData = async () => {
}
}
watchDebounced(query, () => (page.value = 1), { debounce: 300 })
watch(isOpen, () => (page.value = 1))
const forceFetchFirstPage = async () => {
page.value = 1
return fetchData()
}
watchDebounced(query, forceFetchFirstPage, { debounce: 300 })
onOrderingUpdate(forceFetchFirstPage)
watch(isOpen, forceFetchFirstPage)
watch(page, fetchData)
onOrderingUpdate(fetchData)
fetchData()
const sharedLabels = useSharedLabels()
@ -182,7 +188,7 @@ const labels = computed(() => ({
#row-cells="scope"
>
<td>
<router-link :to="{name: 'manage.users.users.detail', params: {id: scope.obj.id }}">
<router-link :to="{name: 'manage.moderation.accounts.detail', params: {id: scope.obj.id }}">
{{ scope.obj.owner.username }}
</router-link>
</td>

Wyświetl plik

@ -84,9 +84,15 @@ const fetchData = async () => {
}
}
watchDebounced(query, () => (page.value = 1), { debounce: 300 })
const forceFetchFirstPage = async () => {
page.value = 1
return fetchData()
}
watchDebounced(query, forceFetchFirstPage, { debounce: 300 })
onOrderingUpdate(forceFetchFirstPage)
watch(page, fetchData)
onOrderingUpdate(fetchData)
fetchData()
const sharedLabels = useSharedLabels()

Wyświetl plik

@ -3033,29 +3033,29 @@
"filters": {
"creationDate": "Creation date",
"releaseDate": "Release date",
"accessedDate": "'Accessed date",
"appliedDate": "'Applied date",
"handledDate": "'Handled date",
"firstSeen": "'First seen date",
"lastSeen": "'Last seen date",
"modificationDate": "'Modification date",
"expirationDate": "'Expiration date",
"trackTitle": "'Track name",
"albumTitle": "'Album name",
"artistName": "'Artist name",
"name": "'Name",
"itemsCount": "'Items",
"size": "'Size",
"bitrate": "'Bitrate",
"duration": "'Duration",
"dateJoined": "'Sign-up date",
"lastActivity": "'Last activity",
"username": "'Username",
"domain": "'Domaimn",
"users": "'Users",
"receivedMessages": "'Received messages",
"uploads": "'Uploads",
"followers": "'Followers"
"accessedDate": "Accessed date",
"appliedDate": "Applied date",
"handledDate": "Handled date",
"firstSeen": "First seen date",
"lastSeen": "Last seen date",
"modificationDate": "Modification date",
"expirationDate": "Expiration date",
"trackTitle": "Track name",
"albumTitle": "Album name",
"artistName": "Artist name",
"name": "Name",
"itemsCount": "Items",
"size": "Size",
"bitrate": "Bitrate",
"duration": "Duration",
"dateJoined": "Sign-up date",
"lastActivity": "Last activity",
"username": "Username",
"domain": "Domaimn",
"users": "Users",
"receivedMessages": "Received messages",
"uploads": "Uploads",
"followers": "Followers"
},
"scopes": {
"profile": {