#42 - set first collection images

This commit is contained in:
isUnknown 2024-12-17 16:12:51 +01:00
parent 8ea2b3caf1
commit 2909608b85
12 changed files with 83 additions and 31 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -0,0 +1,21 @@
Alt:
----
Favoriteforusers: - user://HfuumN8s
----
Description:
----
Uuid: 92lqB8nbWNlFoRq5
----
Template: inspiration
----
Tags:

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -0,0 +1,21 @@
Alt:
----
Favoriteforusers:
----
Description:
----
Uuid: jFsUewRf28XSCg5q
----
Template: inspiration
----
Tags:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

View file

@ -1,17 +0,0 @@
Description:
----
Tags:
----
Sort: 7
----
Uuid: l9DOwTKMN7y41B0v
----
Template: image

View file

@ -20,9 +20,11 @@ Description:
Moodboard:
- file://l9DOwTKMN7y41B0v
- file://X7ToEUDi5pus6MVw
- file://xixqq95N7rDEzI8s
- file://kXQln0UuNCHoZbrR
- file://92lqB8nbWNlFoRq5
- file://jFsUewRf28XSCg5q
----

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

View file

@ -0,0 +1,28 @@
Alt:
----
Favoriteforusers: - user://HfuumN8s
----
Favoriteforclients:
- page://G418qZ4ABsoWFx4i
- page://PweFYnBx27eMZ2mr
----
Description:
----
Uuid: kXQln0UuNCHoZbrR
----
Template: inspiration
----
Tags:

View file

@ -12,12 +12,7 @@ $inspirations = $page->children()->map(function ($child) {
'status' => $child->status(),
'cover' => $child->cover()->toFile()->url(),
'media' => $child->media()->toFiles()->map(function ($file) {
return [
'url' => $file->url(),
'alt' => $file->alt()->value(),
'favoriteForUsers' => $file->favoriteForUsers()->value(),
'name' => $file->filename()
];
return getFileData($file);
})->values()
];
})->values();

View file

@ -42,7 +42,7 @@
/>
</template>
</div>
<ImagesEditPanel :images="images" />
<ImagesEditPanel />
</div>
</div>
</Dialog>

View file

@ -36,7 +36,8 @@ export const useAddImagesModalStore = defineStore("add-images-modal", () => {
id: "inspirations",
component: ImagesResources,
params: false,
images: [],
collections: [],
activeCollectionImages: [],
selectedImages: [],
},
]);
@ -47,7 +48,7 @@ export const useAddImagesModalStore = defineStore("add-images-modal", () => {
return tabs.value.find((tab) => tab.id === activeTabId.value);
});
const images = ref({
const selectedImages = ref({
myImages: [],
materials: [],
inspirations: [],
@ -56,16 +57,17 @@ export const useAddImagesModalStore = defineStore("add-images-modal", () => {
const api = useApiStore();
api
.fetchData("materials")
.then((json) => (images.value = tabs.value[1].images = json.page.images));
.then((json) => (tabs.value[1].images = json.page.images));
api.fetchData("creations").then((json) => {
images.value = tabs.value[2].images = json.page.images;
tabs.value[2].images = json.page.images;
});
api.fetchData("inspirations").then((json) => {
console.log(json);
images.value = tabs.value[3].images = json.page.images;
tabs.value[3].collections = json.page.inspirations;
tabs.value[3].images = json.page.inspirations[0].media;
});
return { images, activeTabId, tabs, activeTab };
return { activeTabId, tabs, activeTab };
});