Skip to content

Commit

Permalink
wip: Refactor collections based components #917
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Aug 5, 2024
1 parent 063fd58 commit eb79b57
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/client/components/collection/KCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!--
Content
-->
<div v-if="items.length > 0" class="scroll q-pr-md">
<div v-if="items.length > 0" class="scroll q-pr-md row items-center">
<!-- Infinite mode -->
<q-infinite-scroll
v-if="appendItems"
Expand Down Expand Up @@ -46,7 +46,7 @@
</template>
</q-infinite-scroll>
<!-- Paginated mode -->
<div v-else class="fit">
<div v-else class="fit row items-center">
<template v-for="item in items" :key="item._id">
<div :class="rendererClass">
<component
Expand Down Expand Up @@ -77,8 +77,9 @@
<KStamp
icon="las la-exclamation-circle"
icon-size="1.6rem"
:text="$t('KCollection.NO_ITEMS')"
:text="$t('KCollection.EMPTY_COLLECTION')"
direction="horizontal"
class="q-pa-md"
/>
</div>
</slot>
Expand Down Expand Up @@ -177,7 +178,8 @@ const itemRenderer = computed(() => {
return loadComponent(props.renderer.component)
})
const rendererClass = computed(() => {
return props.renderer.class || 'q-pa-sm col-12 col-sm-6 col-md-4 col-lg-3'
console.log(props.rendererClass)
return props.renderer.class || 'q-pa-sm col-12 col-sm-6 col-md-4'
})
// Watch
Expand Down
2 changes: 2 additions & 0 deletions core/client/components/collection/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import KCard from './KCard.vue'
import KCardSection from './KCardSection.vue'
import KCollection from './KCollection.vue'
import KGrid from './KGrid.vue'
import KItem from './KItem.vue'
import KList from './KList.vue'
Expand All @@ -10,6 +11,7 @@ import KColumn from './KColumn.vue'
export {
KCard,
KCardSection,
KCollection,
KGrid,
KItem,
KList,
Expand Down
3 changes: 3 additions & 0 deletions core/client/i18n/core_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@
"UNSUBSCRIBE_DIALOG_TITLE": "Unsubscribe from {description} ?",
"UNSUBSCRIBE_DIALOG_MESSAGE": "Are you sure you want to unsubscribe your account from <b>{description}</b> ?<br><br>You will not be able to receive notifications until you reconnect using this service."
},
"KCollection": {
"EMPTY_COLLECTION": "@:NO_ITEM"
},
"KGrid": {
"EMPTY_GRID": "@:NO_ITEM"
},
Expand Down
3 changes: 3 additions & 0 deletions core/client/i18n/core_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@
"UNSUBSCRIBE_DIALOG_TITLE": "Se désabonner de {description} ?",
"UNSUBSCRIBE_DIALOG_MESSAGE": "Etes vous sûr de vouloir désabonner votre compte de {description} ?<br><br>Vous ne pourrez plus recevoir de notifications jusqu'à une prochaine reconnexion via ce service."
},
"KCollection": {
"EMPTY_COLLECTION": "@:NO_ITEM"
},
"KGrid": {
"EMPTY_GRID": "@:NO_ITEM"
},
Expand Down

0 comments on commit eb79b57

Please sign in to comment.