Skip to content

Commit 36ff322

Browse files
authored
fix: display of software value on collections (#315)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 18928c6 commit 36ff322

File tree

2 files changed

+53
-36
lines changed

2 files changed

+53
-36
lines changed

frontend/app/components/modules/collection/components/details/header.vue

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,39 @@ SPDX-License-Identifier: MIT
119119
{{ pluralize('project', props.collection.projectCount) }}
120120
</p>
121121
</article>
122-
<article
122+
<lfx-tooltip
123123
v-if="props.collection.softwareValue"
124-
class="flex items-center gap-2 h-min"
124+
:content="
125+
`Aggregated software value of $${
126+
formatNumberShort(props.collection.softwareValue)
127+
} according to COCOMO`"
125128
>
126-
<div class="h-6 w-6 md:h-8 md:w-8 rounded-full flex items-center justify-center bg-positive-50">
127-
<lfx-icon
128-
name="dollar-circle"
129-
class="text-positive-600 md:!text-base !text-sm"
130-
/>
131-
</div>
132-
<lfx-skeleton
133-
v-if="loading"
134-
height="1.25rem"
135-
width="5rem"
136-
class="rounded-sm"
137-
/>
138-
<p
139-
v-else
140-
class="leading-6 transition-all whitespace-nowrap"
141-
:class="scrollTop > 50 ? 'text-xs md:text-sm' : 'text-xs md:text-base'"
129+
<article
130+
131+
class="flex items-center gap-2 h-min"
142132
>
143-
<span class="text-neutral-500">Software value:</span>
144-
${{ formatNumberShort(props.collection.softwareValue) }}
145-
</p>
146-
</article>
133+
<div class="h-6 w-6 md:h-8 md:w-8 rounded-full flex items-center justify-center bg-positive-50">
134+
<lfx-icon
135+
name="dollar-circle"
136+
class="text-positive-600 md:!text-base !text-sm"
137+
/>
138+
</div>
139+
<lfx-skeleton
140+
v-if="loading"
141+
height="1.25rem"
142+
width="5rem"
143+
class="rounded-sm"
144+
/>
145+
146+
<p
147+
v-else
148+
class="leading-6 transition-all whitespace-nowrap"
149+
:class="scrollTop > 50 ? 'text-xs md:text-sm' : 'text-xs md:text-base'"
150+
>
151+
${{ formatNumberShort(props.collection.softwareValue) }}
152+
</p>
153+
</article>
154+
</lfx-tooltip>
147155
</div>
148156
</div>
149157
</div>
@@ -162,6 +170,7 @@ import useScroll from "~/components/shared/utils/scroll";
162170
import LfxSkeleton from "~/components/uikit/skeleton/skeleton.vue";
163171
import {LfxRoutes} from "~/components/shared/types/routes";
164172
import LfxButton from "~/components/uikit/button/button.vue";
173+
import LfxTooltip from "~/components/uikit/tooltip/tooltip.vue";
165174
166175
const props = defineProps<{
167176
collection?: Collection,

frontend/app/components/modules/collection/components/list/collection-list-item.vue

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,29 @@ SPDX-License-Identifier: MIT
2929
{{ pluralize('project', props.collection.projectCount) }}
3030
</p>
3131
</article>
32-
<article
32+
<lfx-tooltip
3333
v-if="props.collection.softwareValue"
34-
class="flex items-center gap-2"
34+
:content="
35+
`Aggregated software value of $${
36+
formatNumberShort(props.collection.softwareValue)
37+
} according to COCOMO`"
3538
>
36-
<div class="h-8 w-8 rounded-full flex items-center justify-center bg-positive-50">
37-
<lfx-icon
38-
name="dollar-circle"
39-
:size="16"
40-
class="text-positive-600"
41-
/>
42-
</div>
43-
<p class="leading-6 transition-all text-sm whitespace-nowrap">
44-
<span class="text-neutral-500">Software value:</span>
45-
${{ formatNumberShort(props.collection.softwareValue) }}
46-
</p>
47-
</article>
39+
<article
40+
v-if="props.collection.softwareValue"
41+
class="flex items-center gap-2"
42+
>
43+
<div class="h-8 w-8 rounded-full flex items-center justify-center bg-positive-50">
44+
<lfx-icon
45+
name="dollar-circle"
46+
:size="16"
47+
class="text-positive-600"
48+
/>
49+
</div>
50+
<p class="leading-6 transition-all text-sm whitespace-nowrap">
51+
${{ formatNumberShort(props.collection.softwareValue) }}
52+
</p>
53+
</article>
54+
</lfx-tooltip>
4855
</div>
4956
</div>
5057

@@ -88,6 +95,7 @@ import LfxAvatar from "~/components/uikit/avatar/avatar.vue";
8895
import LfxIcon from "~/components/uikit/icon/icon.vue";
8996
import {LfxRoutes} from "~/components/shared/types/routes";
9097
import {formatNumberShort} from "~/components/shared/utils/formatter";
98+
import LfxTooltip from "~/components/uikit/tooltip/tooltip.vue";
9199
92100
const props = defineProps<{
93101
collection: Collection;

0 commit comments

Comments
 (0)