This commit is contained in:
joycitta-siqueira 2022-08-04 13:45:11 -03:00
commit e39830ea78
6 changed files with 86 additions and 77 deletions

84
package-lock.json generated
View File

@ -24724,49 +24724,6 @@
"webpack-merge": "^5.7.3", "webpack-merge": "^5.7.3",
"webpack-virtual-modules": "^0.4.2", "webpack-virtual-modules": "^0.4.2",
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz",
"integrity": "sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
} }
}, },
"@vue/cli-shared-utils": { "@vue/cli-shared-utils": {
@ -25046,6 +25003,47 @@
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz",
"integrity": "sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"@vue/vue3-jest": { "@vue/vue3-jest": {
"version": "27.0.0", "version": "27.0.0",
"resolved": "https://registry.npmjs.org/@vue/vue3-jest/-/vue3-jest-27.0.0.tgz", "resolved": "https://registry.npmjs.org/@vue/vue3-jest/-/vue3-jest-27.0.0.tgz",

View File

@ -63,12 +63,11 @@ export default defineComponent({
const thumbnailPlaceholder = computed (() => require('../../assets/placeholder_square_small.png')) const thumbnailPlaceholder = computed (() => require('../../assets/placeholder_square_small.png'))
const router = useRouter(); const router = useRouter();
const goToCollectionPage = (collection: any) => { const goToCollectionPage = (collection: any) => {
router .push({ router.push({
name: 'collection', name: 'collection',
params: { params: {
id: collection.id, id: collection.id
collection: JSON.stringify(collection) },
}
}); });
} }
return { return {

View File

@ -7,6 +7,7 @@ export const translationStrings = {
label_loading: 'Loading...', label_loading: 'Loading...',
label_items_list: 'Items list', label_items_list: 'Items list',
label_collections_list: 'Collections list', label_collections_list: 'Collections list',
label_collection_items_list: 'Collection items list',
collection: 'Collection', collection: 'Collection',
label_site_url: 'Archive site URL', label_site_url: 'Archive site URL',
placeholder_site_url: 'https://my-tainacan-archive.com', placeholder_site_url: 'https://my-tainacan-archive.com',
@ -45,6 +46,7 @@ export const translationStrings = {
label_loading: 'Carregando...', label_loading: 'Carregando...',
label_items_list: 'Lista de itens', label_items_list: 'Lista de itens',
label_collections_list: 'Lista de coleções', label_collections_list: 'Lista de coleções',
label_collection_items_list: 'Lista de itens da coleção',
collection: 'Coleção', collection: 'Coleção',
label_site_url: 'URL do Site do Acervo', label_site_url: 'URL do Site do Acervo',
placeholder_site_url: 'https://meu-acervo-tainacan.com', placeholder_site_url: 'https://meu-acervo-tainacan.com',

View File

@ -1,6 +1,6 @@
<template> <template>
<base-layout <base-layout
:page-title="(collectionObject && collectionObject.name) ? collectionObject.name : $t('collection')" :page-title="$t('label_collection_items_list')"
page-default-back-link="/collections"> page-default-back-link="/collections">
<ion-refresher slot="fixed" @ionRefresh="doRefresh($event)"> <ion-refresher slot="fixed" @ionRefresh="doRefresh($event)">
<ion-refresher-content></ion-refresher-content> <ion-refresher-content></ion-refresher-content>
@ -75,8 +75,7 @@ export default defineComponent({
IonInfiniteScrollContent IonInfiniteScrollContent
}, },
props: { props: {
id: String, id: String
collection: String
}, },
setup(props) { setup(props) {
const isLoading = ref(false); const isLoading = ref(false);
@ -133,30 +132,30 @@ export default defineComponent({
header: actionSheetLabels.value.header, header: actionSheetLabels.value.header,
cssClass: 'item-creation-action-sheet', cssClass: 'item-creation-action-sheet',
buttons: [ buttons: [
{ // {
text: actionSheetLabels.value.button1, // text: actionSheetLabels.value.button1,
icon: documentsOutline, // icon: documentsOutline,
data: 'multiple-items', // data: 'multiple-items',
handler: () => { // handler: () => {
wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + props.id + '/bulk-add'); // wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + props.id + '/bulk-add');
wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => { // wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {
if (event && // if (event &&
event.data && // event.data &&
( // (
( // (
event.data.type === 'item_updated' && // event.data.type === 'item_updated' &&
event.data.item && // event.data.item &&
event.data.item.status !== 'auto-draft' // event.data.item.status !== 'auto-draft'
) // )
|| event.data.type === 'exited_from_navigation' // || event.data.type === 'exited_from_navigation'
) // )
) { // ) {
wpStore.hideInAppBrowser(); // wpStore.hideInAppBrowser();
loadItemsByCollection({}, true); // loadItemsByCollection({}, true);
} // }
}); // });
}, // },
}, // },
{ {
text: actionSheetLabels.value.button3, text: actionSheetLabels.value.button3,
icon: documentOutline, icon: documentOutline,
@ -186,7 +185,6 @@ export default defineComponent({
const { role, data } = await actionSheet.onDidDismiss(); const { role, data } = await actionSheet.onDidDismiss();
console.log('onDidDismiss resolved with role and data', role, data); console.log('onDidDismiss resolved with role and data', role, data);
} }
const collectionObject = props.collection ? JSON.parse(props.collection + '') : false;
let tainacanStore = useTainacanStore(); let tainacanStore = useTainacanStore();
return { return {
@ -201,7 +199,6 @@ export default defineComponent({
add, add,
actionSheetLabels, actionSheetLabels,
setActionSheetLabels, setActionSheetLabels,
collectionObject,
infiniteScroll, infiniteScroll,
handleSearch, handleSearch,
} }

View File

@ -20,6 +20,10 @@
size="small" size="small"
routerLink="/collections"> routerLink="/collections">
{{ $t('label_view_all_collections', [tainacanStore.totalHomeCollections]) }} {{ $t('label_view_all_collections', [tainacanStore.totalHomeCollections]) }}
<ion-icon
slot="end"
:icon="arrowForwardOutline"
></ion-icon>
</ion-button> </ion-button>
<ion-list> <ion-list>
<ion-list-header> <ion-list-header>
@ -32,6 +36,10 @@
size="small" size="small"
routerLink="/items"> routerLink="/items">
{{ $t('label_view_all_items', [tainacanStore.totalHomeItems]) }} {{ $t('label_view_all_items', [tainacanStore.totalHomeItems]) }}
<ion-icon
slot="end"
:icon="arrowForwardOutline"
></ion-icon>
</ion-button> </ion-button>
</ion-list> </ion-list>
</base-layout> </base-layout>
@ -46,7 +54,9 @@ import { ref } from 'vue';
import CollectionsList from '@/components/lists/CollectionsList.vue'; import CollectionsList from '@/components/lists/CollectionsList.vue';
import ItemsList from '@/components/lists/ItemsList.vue'; import ItemsList from '@/components/lists/ItemsList.vue';
import BaseLayout from '@/components/base/BaseLayout.vue'; import BaseLayout from '@/components/base/BaseLayout.vue';
import { arrowForwardOutline } from "ionicons/icons";
import { import {
IonIcon,
IonButton, IonButton,
IonLoading, IonLoading,
IonList, IonList,
@ -57,6 +67,7 @@ import {
export default { export default {
components: { components: {
IonIcon,
CollectionsList, CollectionsList,
ItemsList, ItemsList,
BaseLayout, BaseLayout,
@ -83,6 +94,7 @@ export default {
let tainacanStore = useTainacanStore(); let tainacanStore = useTainacanStore();
return { return {
arrowForwardOutline,
tainacanStore, tainacanStore,
isLoading, isLoading,
setIsLoading, setIsLoading,

View File

@ -19,6 +19,7 @@ ion-card {
.searchbar-input { .searchbar-input {
border-radius: 30px !important; border-radius: 30px !important;
box-shadow: none !important; box-shadow: none !important;
--background: #efefef;
} }
.header-md::after { .header-md::after {