Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 25f3ceb

Browse files
committed
DEV: fixes
1 parent 8b0cdcb commit 25f3ceb

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

assets/javascripts/discourse/components/admin-report-sentiment-analysis.gjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { clipboardCopy } from "discourse/lib/utilities";
2020
import Post from "discourse/models/post";
2121
import closeOnClickOutside from "discourse/modifiers/close-on-click-outside";
2222
import { i18n } from "discourse-i18n";
23-
import DoughnutChart from "discourse/plugins/discourse-ai/discourse/components/doughnut-chart";
2423
import DTooltip from "float-kit/components/d-tooltip";
24+
import DoughnutChart from "discourse/plugins/discourse-ai/discourse/components/doughnut-chart";
2525

2626
export default class AdminReportSentimentAnalysis extends Component {
2727
@service router;
@@ -326,12 +326,6 @@ export default class AdminReportSentimentAnalysis extends Component {
326326
@action={{this.backToAllCharts}}
327327
/>
328328

329-
{{!-- <DButton
330-
@title="discourse_ai.sentiments.sentiment_analysis.share_chart"
331-
@icon={{this.shareIcon}}
332-
@action={{this.shareChart}}
333-
class="share btn-flat"
334-
/> --}}
335329
<DTooltip
336330
class="share btn-flat"
337331
@icon={{this.shareIcon}}
@@ -348,6 +342,8 @@ export default class AdminReportSentimentAnalysis extends Component {
348342
@data={{this.selectedChart.scores}}
349343
@totalScore={{this.selectedChart.total_score}}
350344
@doughnutTitle={{this.selectedChart.title}}
345+
@skipCanvasResize={{true}}
346+
@displayLegend={{true}}
351347
@radius={{100}}
352348
/>
353349

assets/javascripts/discourse/components/doughnut-chart.gjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default class DoughnutChart extends Component {
3333

3434
get config() {
3535
const totalScore = this.args.totalScore || "";
36+
const skipCanvasResize = this.args.skipCanvasResize || false;
3637
const radius = this.getRadius();
3738

3839
const paddingTop = 30;
@@ -66,7 +67,8 @@ export default class DoughnutChart extends Component {
6667
},
6768
plugins: {
6869
legend: {
69-
display: false,
70+
display: this.args.displayLegend || false,
71+
position: "bottom",
7072
},
7173
},
7274
},
@@ -104,6 +106,9 @@ export default class DoughnutChart extends Component {
104106
{
105107
id: "resizeCanvas",
106108
afterDraw: function (chart) {
109+
if (skipCanvasResize) {
110+
return;
111+
}
107112
const size = `${canvasSize}px`;
108113
chart.canvas.style.width = size;
109114
chart.canvas.style.height = size;

assets/stylesheets/modules/sentiment/common/dashboard.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@
102102
text-align: center;
103103
margin-top: 0.3rem;
104104
padding-top: 2rem;
105-
border-top: 1px solid var(--primary-low);
106105
}
107106
}
108107

109108
&__selected-chart-actions {
110109
display: flex;
111110
align-items: center;
111+
padding-bottom: 0.35rem;
112+
border-bottom: 1px solid var(--primary-low);
113+
112114
.share {
113115
margin-left: auto;
114116

0 commit comments

Comments
 (0)