lightnet 3.10.4 → 3.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/__e2e__/admin.spec.ts +93 -53
- package/__e2e__/{test-utils.ts → basics-fixture.ts} +20 -23
- package/__e2e__/fixtures/basics/node_modules/.bin/astro +2 -2
- package/__e2e__/fixtures/basics/package.json +2 -2
- package/__e2e__/fixtures/basics/src/content/media/faithful-freestyle--en.json +1 -1
- package/__e2e__/fixtures/basics/src/content/media/skate-sounds--en.json +1 -1
- package/__e2e__/global.teardown.ts +5 -0
- package/__e2e__/homepage.spec.ts +17 -19
- package/__e2e__/search.spec.ts +3 -5
- package/package.json +6 -6
- package/playwright.config.ts +1 -0
- package/src/admin/components/form/DynamicArray.tsx +74 -0
- package/src/admin/components/form/Input.tsx +8 -5
- package/src/admin/components/form/LazyLoadedMarkdownEditor.tsx +78 -0
- package/src/admin/components/form/MarkdownEditor.tsx +52 -0
- package/src/admin/components/form/Select.tsx +11 -10
- package/src/admin/components/form/SubmitButton.tsx +9 -12
- package/src/admin/components/form/atoms/ErrorMessage.tsx +7 -28
- package/src/admin/components/form/atoms/Hint.tsx +2 -2
- package/src/admin/components/form/atoms/Label.tsx +5 -1
- package/src/admin/components/form/atoms/Legend.tsx +12 -2
- package/src/admin/components/form/hooks/use-field-error.tsx +3 -11
- package/src/admin/i18n/translations/en.yml +16 -5
- package/src/admin/pages/media/EditForm.tsx +48 -6
- package/src/admin/pages/media/EditRoute.astro +29 -10
- package/src/admin/pages/media/fields/Authors.tsx +51 -51
- package/src/admin/pages/media/fields/Categories.tsx +70 -0
- package/src/admin/pages/media/fields/Collections.tsx +117 -0
- package/src/admin/pages/media/media-item-store.ts +6 -1
- package/src/admin/types/media-item.ts +35 -2
- package/src/components/CategoriesSection.astro +2 -2
- package/src/components/MediaGallerySection.astro +3 -3
- package/src/components/MediaList.astro +2 -2
- package/src/content/get-categories.ts +18 -3
- package/src/i18n/resolve-language.ts +1 -1
- package/src/layouts/Page.astro +3 -2
- package/src/layouts/components/LanguagePicker.astro +1 -1
- package/src/pages/details-page/components/more-details/Languages.astro +2 -2
- package/src/pages/search-page/components/SearchFilter.astro +7 -7
- package/src/pages/search-page/components/SearchFilter.tsx +4 -4
- package/src/pages/search-page/components/SearchList.astro +4 -4
- package/src/pages/search-page/components/SearchListItem.tsx +4 -4
- package/src/pages/search-page/components/Select.tsx +3 -3
- package/src/pages/search-page/hooks/use-search.ts +4 -4
|
@@ -2,7 +2,7 @@ type Props = {
|
|
|
2
2
|
label: string
|
|
3
3
|
initialValue: string | undefined
|
|
4
4
|
valueChange: (value: string) => void
|
|
5
|
-
options: { id: string;
|
|
5
|
+
options: { id: string; labelText: string }[]
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export default function Select({
|
|
@@ -21,9 +21,9 @@ export default function Select({
|
|
|
21
21
|
value={initialValue}
|
|
22
22
|
onChange={(e) => valueChange(e.currentTarget.value)}
|
|
23
23
|
>
|
|
24
|
-
{options.map(({ id,
|
|
24
|
+
{options.map(({ id, labelText }) => (
|
|
25
25
|
<option key={id} value={id}>
|
|
26
|
-
{
|
|
26
|
+
{labelText}
|
|
27
27
|
</option>
|
|
28
28
|
))}
|
|
29
29
|
</select>
|
|
@@ -6,8 +6,8 @@ import { observeSearchQuery, type SearchQuery } from "../utils/search-query"
|
|
|
6
6
|
|
|
7
7
|
interface Context {
|
|
8
8
|
categories: Record<string, string>
|
|
9
|
-
mediaTypes: Record<string, {
|
|
10
|
-
languages: Record<string, {
|
|
9
|
+
mediaTypes: Record<string, { labelText: string }>
|
|
10
|
+
languages: Record<string, { labelText: string }>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function useSearch({ categories, mediaTypes, languages }: Context) {
|
|
@@ -39,8 +39,8 @@ export function useSearch({ categories, mediaTypes, languages }: Context) {
|
|
|
39
39
|
const translatedCategories =
|
|
40
40
|
item.categories &&
|
|
41
41
|
item.categories.map((categoryId) => categories[categoryId])
|
|
42
|
-
const translatedType = mediaTypes[item.type].
|
|
43
|
-
const translatedLanguage = languages[item.language].
|
|
42
|
+
const translatedType = mediaTypes[item.type].labelText
|
|
43
|
+
const translatedLanguage = languages[item.language].labelText
|
|
44
44
|
|
|
45
45
|
return {
|
|
46
46
|
...item,
|