Non modpack wireup & Project to profile install (#90)

* Base impl

* Make project type selectable

* Update Browse.vue

* address changes

* Quick create

* Run linter

* fix merge

* Addressed changes

* Installation improvements

* Run lint

* resourcepacks

* automatic installation of dependencies

* Fix bugs with search

* Addressed changes

* Run linter

* Fixed direct install not working

* Remove back to search

* Update Index.vue

* Addressed some changes

* Shader fix

* fix resetting

* Update Browse.vue

* fixed install not working properly

* Update Index.vue

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
Adrian O.V
2023-05-08 19:27:27 -04:00
committed by GitHub
parent 65c1942037
commit b094a30677
14 changed files with 675 additions and 64 deletions

View File

@@ -9,6 +9,7 @@ export const useSearch = defineStore('searchStore', {
pageCount: 1,
offset: 0,
filter: 'Relevance',
projectType: '',
facets: [],
orFacets: [],
environments: {
@@ -18,10 +19,15 @@ export const useSearch = defineStore('searchStore', {
activeVersions: [],
openSource: false,
limit: 20,
instanceContext: null,
}),
actions: {
getQueryString() {
let andFacets = ['project_type:modpack']
let andFacets = [`project_type:${this.projectType === 'datapack' ? 'mod' : this.projectType}`]
if (this.instanceContext) {
this.activeVersions = [this.instanceContext.metadata.game_version]
}
// Iterate through possible andFacets
this.facets.forEach((facet) => {
@@ -32,7 +38,18 @@ export const useSearch = defineStore('searchStore', {
// Create andFacet string
let formattedAndFacets = ''
andFacets.forEach((f) => (formattedAndFacets += `["${f}"],`))
if (this.projectType === 'datapack') {
;[...andFacets, `categories:${encodeURIComponent('datapack')}`].forEach(
(f) => (formattedAndFacets += `["${f}"],`)
)
} else if (this.instanceContext && this.projectType === 'mod') {
;[
...andFacets,
`categories:${encodeURIComponent(this.instanceContext.metadata.loader)}`,
].forEach((f) => (formattedAndFacets += `["${f}"],`))
} else {
andFacets.forEach((f) => (formattedAndFacets += `["${f}"],`))
}
formattedAndFacets = formattedAndFacets.slice(0, formattedAndFacets.length - 1)
formattedAndFacets += ''