-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adapt to changes in rmnd_headless_solr and update eslint config
- Loading branch information
Showing
15 changed files
with
7,412 additions
and
6,829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{ | ||
"extends": ["@remindgmbh/eslint-config-nuxt"], | ||
"settings": { | ||
"import/ignore": ["vee-validate"] | ||
} | ||
"extends": ["@remindgmbh/eslint-config-nuxt"] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,27 @@ | ||
export default defineNuxtConfig({ | ||
components: [ | ||
{ | ||
global: true, | ||
path: '@/components', | ||
}, | ||
], | ||
imports: { | ||
autoImport: false, | ||
}, | ||
modules: ['@remindgmbh/nuxt-typo3', '@remindgmbh/nuxt-typo3-solr'], | ||
runtimeConfig: { | ||
public: { | ||
typo3: { | ||
baseUrl: '', | ||
api: { | ||
baseUrl: '', | ||
}, | ||
baseUrl: '', | ||
cookiebotUid: '', | ||
}, | ||
}, | ||
}, | ||
components: [ | ||
{ | ||
path: '@/components', | ||
global: true, | ||
}, | ||
], | ||
typescript: { | ||
shim: false, | ||
strict: true, | ||
}, | ||
modules: ['@remindgmbh/nuxt-typo3', '@remindgmbh/nuxt-typo3-solr'], | ||
vite: { | ||
server: { | ||
hmr: { | ||
protocol: 'wss', | ||
clientPort: 443, | ||
path: 'hmr/', | ||
}, | ||
}, | ||
}, | ||
imports: { | ||
autoImport: false, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,14 @@ | ||
import { type Ref, computed } from 'vue' | ||
import { useLogger } from '#imports' | ||
import { Typo3 } from '../models' | ||
import { | ||
useRuntimeConfig, | ||
useState, | ||
useT3Api, | ||
useT3Data, | ||
useRoute, | ||
} from '#imports' | ||
import { type T3SolrModel, useT3Data } from '#imports' | ||
import { computed } from 'vue' | ||
|
||
export function useT3SolrData() { | ||
const api = useT3Api() | ||
const config = useRuntimeConfig() | ||
const logger = useLogger() | ||
const { getLocalizedRootPath } = useT3Data() | ||
const { currentInitialData } = useT3Data() | ||
|
||
const searchForm: Ref<{ | ||
[path: string]: Typo3.SearchForm | undefined | ||
}> = useState('t3-solr-searchForm', () => ({})) | ||
|
||
const currentRootPath = computed(() => | ||
getLocalizedRootPath(useRoute().fullPath), | ||
const searchForm = computed<T3SolrModel.Typo3.SearchForm | undefined>(() => | ||
currentInitialData.value?.solr | ||
? (currentInitialData.value?.solr as T3SolrModel.Typo3.SearchForm) | ||
: undefined, | ||
) | ||
|
||
const currentSearchForm = computed<Typo3.SearchForm | undefined>({ | ||
get() { | ||
return searchForm.value[currentRootPath.value] | ||
}, | ||
set(value) { | ||
searchForm.value[currentRootPath.value] = value | ||
}, | ||
}) | ||
|
||
async function loadSearchForm( | ||
path: string, | ||
): Promise<Typo3.SearchForm | undefined> { | ||
const rootPath = getLocalizedRootPath(path) | ||
|
||
if (!searchForm.value[rootPath]) { | ||
try { | ||
const result = await api.get<Typo3.SearchForm>(rootPath, { | ||
params: { | ||
type: config.public.typo3Solr.api.searchType, | ||
}, | ||
}) | ||
searchForm.value[rootPath] = result | ||
return result | ||
} catch (error) { | ||
// log error and do nothing so undefined is returned | ||
logger.error(error) | ||
} | ||
} | ||
return searchForm.value[rootPath] | ||
} | ||
|
||
return { | ||
currentSearchForm, | ||
searchForm, | ||
loadSearchForm, | ||
} | ||
return { searchForm } | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Typo3 } from '@remindgmbh/nuxt-typo3/dist/runtime/models' | ||
import type { T3Model } from '#imports' | ||
|
||
export interface Document { | ||
title: string | ||
content: string | ||
link: string | ||
image?: Typo3.Asset | ||
image?: T3Model.Typo3.Asset | ||
[key: string]: any | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import type { Typo3 } from '@remindgmbh/nuxt-typo3/dist/runtime/models' | ||
import type { SearchForm } from '.' | ||
import type { T3Model } from '#imports' | ||
|
||
export interface SolrPiSearch extends Typo3.Content.Data.Header { | ||
export interface SolrPiSearch extends T3Model.Typo3.Content.Data.Header { | ||
data: SearchForm | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.