File tree Expand file tree Collapse file tree
resources/js/processes-catalogue/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,10 @@ export default {
166166 },
167167 mounted () {
168168 this .verifyDescription ();
169+ // Initialize chart data from process.counts
170+ this .inProgress = this .process .counts ? .in_progress || 0 ;
171+ this .completed = this .process .counts ? .completed || 0 ;
172+ this .total = this .process .counts ? .total || 0 ;
169173 ProcessMaker .EventBus .$on (" reloadByNewScreen" , () => {
170174 window .location .reload ();
171175 });
@@ -177,7 +181,6 @@ export default {
177181 }
178182 });
179183 this .getStartEvents ();
180- this .fetchChartData ();
181184 },
182185 beforeDestroy () {
183186 ProcessMaker .EventBus .$off (" chartDataUpdated" );
@@ -242,24 +245,6 @@ export default {
242245 ProcessMaker .alert (err, " danger" );
243246 });
244247 },
245- /**
246- * Fetch chart data for mini pie charts
247- */
248- fetchChartData () {
249- ProcessMaker .apiClient
250- .get (` requests/${ this .process .id } /default-chart` )
251- .then ((response ) => {
252- const { data: { datasets: { data: [completedCount , inProgressCount ] } } } = response .data ;
253- this .completed = completedCount;
254- this .inProgress = inProgressCount;
255- this .total = this .completed + this .inProgress ;
256- })
257- .catch (() => {
258- this .inProgress = 0 ;
259- this .completed = 0 ;
260- this .total = 0 ;
261- });
262- },
263248 },
264249};
265250< / script>
You can’t perform that action at this time.
0 commit comments