feat: backups page cleanup before worlds (#5844)
* feat: card alignment + fix modals * feat: change admon title in restore alert modal * fix: lint * feat: backups queue api into api-client * feat: impl backup queue api endpoints into frontend * feat: ack fix * feat: bulk actions * feat: bulk delete impl * fix: lint * fix: align error states * fix: transition group * feat: ready for qa * fix: lint * feat: qa * feat: stacked admonitions component * fix: issues with stacking * feat: hook up admonition stacking + fix app csp for staging kyros nodes * fix: logs.vue * qa: close stack on admonitions click * fix: all problems with stacked admonitions * qa: admonition cleanup and copy overhaul draft * fix: qa issues padding * fix: padding bug * feat: qa * fix: intercom in app csp bug * fix: positioning intercom * feat: loading overlay on top of console + admon consistency changes * feat: scroll indicator fade in backup delete modal + admon timestamp fix * feat: move action bar behind modal * fix: lint + i18n * fix: server ping spam on filter (cache but clear on unmount) * fix: 1 admon fade in flicker issue * chore: temp staging undo * qa: changes * fix: lint * chore: revert staging to use staging * fix: scoping
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { Labrinth } from '@modrinth/api-client'
|
||||
import { getCategoryIcon, GlobeIcon, SERVER_CATEGORY_ICON_MAP, UserIcon } from '@modrinth/assets'
|
||||
import { sortedCategories } from '@modrinth/utils'
|
||||
import { computed, type Ref, ref, shallowRef } from 'vue'
|
||||
import { computed, type ComputedRef, type Ref, ref, shallowRef } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
import { defineMessage, LOCALES, useVIntl } from '../composables/i18n'
|
||||
@@ -128,6 +128,7 @@ export function useServerSearch(opts: {
|
||||
query: Ref<string>
|
||||
maxResults: Ref<number>
|
||||
currentPage: Ref<number>
|
||||
providedFilters?: ComputedRef<FilterValue[]>
|
||||
}) {
|
||||
const { tags, query, maxResults, currentPage } = opts
|
||||
|
||||
@@ -371,6 +372,31 @@ export function useServerSearch(opts: {
|
||||
}
|
||||
}
|
||||
|
||||
const providedProjectIds = (opts.providedFilters?.value ?? [])
|
||||
.filter((filter) => filter.type === 'project_id')
|
||||
.map((filter) => ({
|
||||
projectId: filter.option.startsWith('project_id:')
|
||||
? filter.option.slice('project_id:'.length)
|
||||
: filter.option,
|
||||
negative: !!filter.negative,
|
||||
}))
|
||||
.filter((filter) => filter.projectId.length > 0)
|
||||
const excludedProjectIds = providedProjectIds
|
||||
.filter((filter) => filter.negative)
|
||||
.map((filter) => filter.projectId)
|
||||
const includedProjectIds = providedProjectIds
|
||||
.filter((filter) => !filter.negative)
|
||||
.map((filter) => filter.projectId)
|
||||
|
||||
if (includedProjectIds.length > 0) {
|
||||
const values = includedProjectIds.map((projectId) => `"${projectId}"`).join(', ')
|
||||
parts.push(`project_id IN [${values}]`)
|
||||
}
|
||||
if (excludedProjectIds.length > 0) {
|
||||
const values = excludedProjectIds.map((projectId) => `"${projectId}"`).join(', ')
|
||||
parts.push(`project_id NOT IN [${values}]`)
|
||||
}
|
||||
|
||||
return parts.join(' AND ')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user