Skip to content

Commit 14ab1c8

Browse files
committed
cleanup
1 parent 09662ee commit 14ab1c8

24 files changed

+207
-177
lines changed

src/components/base/FetchLoader.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<template>
22
<div :class="{ skeletons: inSkeletons }" class="contents">
3-
<!-- <ul>
4-
<li v-for="mem in memory">{{ mem }}</li>
5-
</ul> -->
6-
<div v-if="loading" class="m-auto w-fit flex justify-center items-center flex-col">
3+
<div v-if="loading" class="loader">
74
<LpiLoader type="simple" />
85
<span class="loading">
96
{{ props.label ?? t('common.loading') }}
@@ -78,7 +75,7 @@ const loading = computed(() => {
7875
})
7976
8077
const inSkeletons = computed(() => {
81-
return inLoading.value && !firstLoading.value && props.skeleton
78+
return inLoading.value && (!firstLoading.value || !props.withData) && props.skeleton
8279
})
8380
8481
watch(inLoading, (newValue, oldValue) => {
@@ -95,6 +92,15 @@ watch(inLoading, (newValue, oldValue) => {
9592
padding-top: 0.5rem;
9693
}
9794
95+
.loader {
96+
margin: auto;
97+
display: flex;
98+
justify-content: center;
99+
align-items: center;
100+
flex-direction: column;
101+
width: 100%;
102+
}
103+
98104
.error {
99105
opacity: 0.8;
100106
font-style: italic;

src/components/base/navigation/PaginationButtons2.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<template>
2-
<ul v-if="!hideEmpty || canPrev || canNext" class="pagination">
2+
<ul
3+
v-if="!hideEmpty || canPrev || canNext"
4+
class="pagination"
5+
:class="{
6+
disable: disable,
7+
}"
8+
>
39
<li :class="{ hidden: !canPrev }">
410
<IconImage name="ChevronLeft" @click="pagination.prev()" />
511
</li>
@@ -28,8 +34,13 @@ import { Pagination } from '@/composables/usePagination'
2834
defineOptions({ name: 'PaginationButtons2' })
2935
3036
const props = withDefaults(
31-
defineProps<{ pagination: Pagination; showNumber?: boolean; hideEmpty?: boolean }>(),
32-
{ showNumber: true, hideEmpty: false }
37+
defineProps<{
38+
pagination: Pagination
39+
showNumber?: boolean
40+
hideEmpty?: boolean
41+
disable?: boolean
42+
}>(),
43+
{ showNumber: true, hideEmpty: false, disable: false }
3344
)
3445
3546
const { canNext, canPrev } = props.pagination
@@ -68,6 +79,12 @@ const setPage = (value) => {
6879
.pagination {
6980
display: flex;
7081
align-items: center;
82+
transition: opacity 0.2s;
83+
84+
&.disable {
85+
pointer-events: none;
86+
opacity: 0.5;
87+
}
7188
7289
li {
7390
fill: $primary-dark;

src/components/group/GroupForm/ProjectSection.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
</div>
2828
</template>
2929
</ProjectPreview>
30-
<!-- <ProjectCard
31-
:has-close-icon="true"
32-
class="selected-card"
33-
@unselect="onRemoveProject(project)"
34-
/> -->
3530
</div>
3631
<div class="show-more">
3732
<LinkButton

src/components/group/Modules/Extras/GroupSimilarDrawer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { getGroupSimilar } from '@/api/v2/group.service'
2323
import BaseDrawer from '@/components/base/BaseDrawer.vue'
2424
import FetchLoader from '@/components/base/FetchLoader.vue'
2525
import { TranslatedPeopleGroupModel } from '@/models/invitation.model'
26-
import { toPagination } from '@/skeletons/base.skeletons'
26+
import { factoryPagination } from '@/skeletons/base.skeletons'
2727
import { groupSkeleton } from '@/skeletons/group.skeletons'
2828
2929
const { t } = useNuxtI18n()
@@ -42,7 +42,7 @@ const {
4242
pagination,
4343
data: groups,
4444
} = getGroupSimilar(organizationCode, groupId, {
45-
default: () => toPagination(groupSkeleton),
45+
default: () => factoryPagination(groupSkeleton),
4646
})
4747
const { count } = pagination
4848
</script>

src/components/group/Modules/Extras/GroupSimilarsPreview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import SeeMoreArrow from '@/components/base/button/SeeMoreArrow.vue'
2929
import GroupCard from '@/components/group/GroupCard.vue'
3030
import { GroupModuleTitle, TranslatedPeopleGroupModel } from '@/models/invitation.model'
3131
import BaseGroupPreview from '@/components/group/Modules/BaseGroupPreview.vue'
32-
import { maxSkeleton, toPagination } from '@/skeletons/base.skeletons'
32+
import { maxSkeleton, factoryPagination } from '@/skeletons/base.skeletons'
3333
import { groupSkeleton } from '@/skeletons/group.skeletons'
3434
import GroupSimilarDrawer from '@/components/group/Modules/Extras/GroupSimilarDrawer.vue'
3535
@@ -45,7 +45,7 @@ const { status, data: groups } = getGroupSimilar(organizationCode, groupId, {
4545
paginationConfig: {
4646
limit: props.limit,
4747
},
48-
default: () => toPagination(groupSkeleton, limitSkeletons.value),
48+
default: () => factoryPagination(groupSkeleton, limitSkeletons.value),
4949
})
5050
5151
const showMore = ref(false)

src/components/group/Modules/GroupSub/GroupSubList.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:key="sub.id"
77
:group="sub"
88
:with-pagination="withPagination"
9+
:limit-members="limitMembers"
910
/>
1011
<PaginationButtons2 v-if="withPagination" class="m-auto" :pagination="pagination" />
1112
</div>
@@ -15,17 +16,18 @@
1516
<script setup lang="ts">
1617
import { getSubGroup } from '@/api/v2/group.service'
1718
import { TranslatedPeopleGroupModel } from '@/models/invitation.model'
18-
import { maxSkeleton, toPagination } from '@/skeletons/base.skeletons'
19+
import { maxSkeleton, factoryPagination } from '@/skeletons/base.skeletons'
1920
import { groupSkeleton } from '@/skeletons/group.skeletons'
2021
import GroupSubTeamItem from '@/components/group/Modules/GroupSub/GroupSubTeamItem.vue'
2122
2223
const props = withDefaults(
2324
defineProps<{
2425
group: TranslatedPeopleGroupModel
2526
limit?: number
27+
limitMembers?: number
2628
withPagination?: boolean
2729
}>(),
28-
{ limit: null, withPagination: true }
30+
{ limit: null, withPagination: true, limitMembers: null }
2931
)
3032
3133
const organizationCode = useOrganizationCode()
@@ -41,14 +43,14 @@ const {
4143
paginationConfig: {
4244
limit: props.limit,
4345
},
44-
default: () => toPagination(groupSkeleton, limitSkeletons.value),
46+
default: () => factoryPagination(groupSkeleton, limitSkeletons.value),
4547
})
4648
</script>
4749

4850
<style lang="scss" scoped>
4951
.subgroup-list {
5052
display: flex;
5153
flex-direction: column;
52-
gap: 1rem;
54+
gap: 2rem;
5355
}
5456
</style>

src/components/group/Modules/GroupSub/GroupSubPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<SeeMoreArrow is="button" class="see-more-btn" @click="onMore" />
1010
</template>
1111
<template #content>
12-
<GroupSubList :group="group" :limit="2" :with-pagination="false" />
12+
<GroupSubList :group="group" :limit="2" :limit-members="6" :with-pagination="false" />
1313
<GroupSubDrawer :group="selectedGroup" @close="onClose" />
1414
</template>
1515
</BaseGroupPreview>
Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
<template>
2-
<div ref="groupItem" class="subgroup-element shadow-box-transition no-transform">
3-
<NuxtLink
4-
:to="{
5-
name: 'Group',
6-
params: { groupId: group.id },
7-
}"
8-
class="subgroup-header border-primary skeletons-text"
9-
@mouseover.prevent="onMouseover"
10-
@mouseout.prevent="onMouseout"
11-
>
12-
<h4>{{ group.$t.name }}</h4>
13-
<div>
14-
<GroupRecapPreview is="span" :group="group" no-title :modules="['members', 'subgroups']" />
15-
</div>
16-
</NuxtLink>
17-
<BaseGroupMembersList
18-
v-if="group.modules.members"
19-
:group="group"
20-
class="contents"
21-
:with-pagination="withPagination"
22-
/>
23-
</div>
2+
<ToolTip :hover="true" offset-distance="5" :disabled="disableToolTip" placement="top">
3+
<template #custom-content>
4+
{{ $t('common.see-more') }}
5+
</template>
6+
<div ref="groupItem" class="subgroup-element shadow-box-transition no-transform">
7+
<NuxtLink
8+
:to="{
9+
name: 'Group',
10+
params: { groupId: group.id },
11+
}"
12+
class="subgroup-header border-primary skeletons-text"
13+
@mouseover.prevent="onMouseover"
14+
@mouseout.prevent="onMouseout"
15+
>
16+
<h4>{{ group.$t.name }}</h4>
17+
<div>
18+
<GroupRecapPreview
19+
is="span"
20+
:group="group"
21+
no-title
22+
:modules="['members', 'subgroups']"
23+
/>
24+
</div>
25+
</NuxtLink>
26+
<BaseGroupMembersList
27+
v-if="group.modules.members"
28+
:group="group"
29+
class="subgroup-members"
30+
:with-pagination="withPagination"
31+
:limit="limitMembers"
32+
/>
33+
</div>
34+
</ToolTip>
2435
</template>
2536

2637
<script setup lang="ts">
@@ -32,16 +43,20 @@ withDefaults(
3243
defineProps<{
3344
group: TranslatedPeopleGroupModel
3445
withPagination?: boolean
46+
limitMembers?: number
3547
}>(),
36-
{ withPagination: true }
48+
{ withPagination: true, limitMembers: null }
3749
)
3850
51+
const disableToolTip = ref(false)
3952
const groupItem = useTemplateRef('groupItem')
4053
const onMouseover = () => {
4154
groupItem.value?.classList.add('shadow-box-transform')
55+
disableToolTip.value = false
4256
}
4357
const onMouseout = () => {
4458
groupItem.value?.classList.remove('shadow-box-transform')
59+
disableToolTip.value = true
4560
}
4661
</script>
4762

@@ -52,36 +67,25 @@ const onMouseout = () => {
5267
5368
.subgroup-element {
5469
display: grid;
55-
grid-template-columns: 1fr 1fr;
70+
grid-template-rows: 1fr;
5671
width: 100%;
5772
gap: 1rem;
58-
height: 100%;
59-
60-
> :last-child {
61-
margin-bottom: -1rem;
62-
}
73+
min-height: pxToRem(85px);
6374
6475
.subgroup-header {
65-
grid-column: span 2;
6676
padding: 1rem 1.5rem;
6777
background-color: color-mix(in srgb, $primary, transparent 90%);
6878
display: flex;
6979
justify-content: space-between;
7080
align-items: center;
7181
}
7282
}
73-
74-
.subgroup-sub {
75-
display: flex;
76-
gap: 0.2rem;
77-
align-items: center;
78-
justify-content: flex-end;
79-
80-
svg {
81-
fill: $primary;
82-
display: inline-block;
83-
width: 1.5rem;
84-
margin: 0 0.3rem;
85-
}
83+
.subgroup-members {
84+
display: grid;
85+
grid-template-columns: 1fr 1fr;
86+
width: calc(100% - 2rem);
87+
gap: 1rem;
88+
padding: 0 1rem;
89+
min-height: pxToRem(85px);
8690
}
8791
</style>

src/components/group/Modules/Members/BaseGroupMembersList.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
/>
99
<PaginationButtons2
1010
v-if="withPagination"
11-
:show-number="false"
1211
hide-empty
13-
class="pagination"
12+
class="pagination-span"
1413
:pagination="pagination"
14+
:disable="isLoading"
1515
/>
1616
<BaseDrawer
1717
no-footer
@@ -36,7 +36,7 @@
3636
import { getGroupMember } from '@/api/v2/group.service'
3737
import GroupMemberItem from '@/components/group/Modules/Members/GroupMemberItem.vue'
3838
import { TranslatedPeopleGroupModel } from '@/models/invitation.model'
39-
import { maxSkeleton, toPagination } from '@/skeletons/base.skeletons'
39+
import { maxSkeleton, factoryPagination } from '@/skeletons/base.skeletons'
4040
import { memberSkeleton } from '@/skeletons/group.skeletons'
4141
4242
const props = withDefaults(
@@ -53,11 +53,11 @@ const limitSkeletons = computed(() => maxSkeleton(props.group?.modules?.members,
5353
5454
const groupId = computed(() => props.group?.id)
5555
56-
const { status, data, pagination } = getGroupMember(organizationCode, groupId, {
56+
const { status, data, pagination, isLoading } = getGroupMember(organizationCode, groupId, {
5757
paginationConfig: {
5858
limit: props.limit,
5959
},
60-
default: () => toPagination(memberSkeleton, limitSkeletons.value),
60+
default: () => factoryPagination(memberSkeleton, limitSkeletons.value),
6161
})
6262
6363
const userIdDrawer = ref<number | null>()
@@ -66,7 +66,7 @@ const closeProfile = () => (userIdDrawer.value = null)
6666
</script>
6767

6868
<style lang="scss" scoped>
69-
.pagination {
69+
.pagination-span {
7070
grid-column: span 2;
7171
margin: auto;
7272
}

src/components/group/Modules/Projects/BaseGroupProjectsList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import { getGroupProject } from '@/api/v2/group.service'
1313
import ProjectPreview from '@/components/project/ProjectPreview.vue'
1414
import { TranslatedPeopleGroupModel } from '@/models/invitation.model'
15-
import { maxSkeleton, toPagination } from '@/skeletons/base.skeletons'
15+
import { factoryPagination, maxSkeleton } from '@/skeletons/base.skeletons'
1616
import { projectSkeleton } from '@/skeletons/project.skeletons'
1717
1818
const props = withDefaults(
@@ -31,6 +31,6 @@ const groupId = computed(() => props.group?.id)
3131
3232
const { status, data } = getGroupProject(organizationCode, groupId, {
3333
paginationConfig: { limit: props.limit },
34-
default: () => toPagination(projectSkeleton, limitSkeletons.value),
34+
default: () => factoryPagination(projectSkeleton, limitSkeletons.value),
3535
})
3636
</script>

0 commit comments

Comments
 (0)