Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/js/card.js

Large diffs are not rendered by default.

44 changes: 20 additions & 24 deletions resources/js/components/Base/BasePartitionMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@

<HelpTextTooltip :text="helpText" :width="helpWidth" />

<div class="min-h-[90px]">
<div class="overflow-hidden overflow-y-auto max-h-[90px]">
<div class="flex min-h-[90px]">
<div
class="flex-1 overflow-hidden overflow-y-auto"
:class="{
'max-h-[90px]': legendsHeight === 'fixed',
}"
>
<ul>
<li
v-for="item in formattedItems"
Expand All @@ -45,9 +50,8 @@

<div
ref="chart"
class="right-[20px]"
:class="chartClasses"
style="width: 90px; height: 90px; bottom: 30px; top: calc(50% + 15px)"
class="flex-none rounded-b-lg ct-chart mr-4 w-[90px] h-[90px]"
:class="{ invisible: this.currentTotal <= 0 }"
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove 'this.' prefix when referencing computed properties or data in templates. Vue templates automatically bind to the component context.

Suggested change
:class="{ invisible: this.currentTotal <= 0 }"
:class="{ invisible: currentTotal <= 0 }"

Copilot uses AI. Check for mistakes.
/>
</div>
</LoadingCard>
Expand Down Expand Up @@ -83,6 +87,7 @@ export default {
helpText: {},
helpWidth: {},
chartData: Array,
legendsHeight: { type: String, default: 'fixed' },
url: '',
},

Expand All @@ -108,22 +113,19 @@ export default {
},

mounted() {
this.chartist = new Chartist.Pie(
this.$refs.chart,
this.formattedChartData,
{
donut: true,
donutWidth: 10,
donutSolid: true,
startAngle: 270,
showLabel: false,
}
)
let donutWidth = 10

this.chartist = new Chartist.Pie(this.$refs.chart, this.formattedChartData, {
donut: true,
donutWidth: 10,
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The donutWidth variable is declared but then a hardcoded value of 10 is used in the configuration object. Either use the variable consistently or remove the unused variable declaration.

Suggested change
donutWidth: 10,
donutWidth: donutWidth,

Copilot uses AI. Check for mistakes.
startAngle: 270,
showLabel: false,
})

this.chartist.on('draw', context => {
if (context.type === 'slice') {
context.element.attr({
style: `fill: ${context.meta.color} !important`,
style: `stroke-width: ${donutWidth}px; stroke: ${context.meta.color} !important;`,
})
}
})
Expand Down Expand Up @@ -151,13 +153,7 @@ export default {

computed: {
chartClasses() {
return [
'vertical-center',
'rounded-b-lg',
'ct-chart',
'mr-4',
this.currentTotal <= 0 ? 'invisible' : '',
]
return []
},

formattedChartData() {
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/LinkablePartitionMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:help-width="card.helpWidth"
:chart-data="chartData"
:loading="loading"
:legends-height="card.height"
:url="card.url"
/>
</template>
Expand Down