Skip to content

Commit 3004c9c

Browse files
Merge pull request #65 from platforma-open/khizhnyak/MILAB-478
MILAB-478: show loader when calculating
2 parents e12d4fb + 4e72e01 commit 3004c9c

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

.changeset/five-flies-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@platforma-open/milaboratories.mixcr-shm-trees.ui': patch
3+
---
4+
5+
Show loader when calculating

ui/src/pages/MainPage.vue

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
2-
import { ColDef, GridOptions } from 'ag-grid-enterprise';
2+
import { type ColDef, type GridOptions } from 'ag-grid-enterprise';
33
import { AgGridVue } from 'ag-grid-vue3';
44
import { AgGridTheme, PlAgOverlayLoading, PlAgOverlayNoRows, PlBlockPage, PlBtnGhost, PlMaskIcon24, PlSlideModal } from '@platforma-sdk/ui-vue';
55
import { refDebounced } from '@vueuse/core';
6-
import { reactive, } from 'vue';
6+
import { reactive, watch, ref } from 'vue';
77
import { useApp } from '../app';
88
import { TreeResult, TreeResultsFull } from '../results';
99
import ProgressCell from './components/ProgressCell.vue';
@@ -69,10 +69,6 @@ const columnDefs: ColDef<TreeResult>[] = [
6969
}
7070
];
7171
72-
// watch(result, rd => {
73-
// console.dir(rd, { depth: 5 })
74-
// }, { immediate: true })
75-
7672
const gridOptions: GridOptions<TreeResult> = {
7773
getRowId: (row) => String(row.data.donor),
7874
onRowDoubleClicked: (e) => {
@@ -84,6 +80,13 @@ const gridOptions: GridOptions<TreeResult> = {
8480
}
8581
};
8682
83+
const reloadKey = ref(0);
84+
watch(
85+
() => model.outputs.calculating,
86+
() => {
87+
++reloadKey.value;
88+
},
89+
{ immediate: true });
8790
</script>
8891

8992
<template>
@@ -98,10 +101,19 @@ const gridOptions: GridOptions<TreeResult> = {
98101
</template>
99102

100103
<div :style="{ flex: 1 }">
101-
<AgGridVue :theme="AgGridTheme" :style="{ height: '100%' }" :rowData="result" :defaultColDef="defaultColDef"
102-
:columnDefs="columnDefs" :grid-options="gridOptions" :loadingOverlayComponentParams="{ notReady: true, message: `Configure the settings and click
103-
'Run' to see the data` }"
104-
:loadingOverlayComponent=PlAgOverlayLoading :noRowsOverlayComponent=PlAgOverlayNoRows />
104+
<AgGridVue
105+
:theme="AgGridTheme"
106+
:style="{ height: '100%' }"
107+
:rowData="result"
108+
:defaultColDef="defaultColDef"
109+
:columnDefs="columnDefs"
110+
:grid-options="gridOptions"
111+
:loadingOverlayComponentParams="{ notReady: !model.outputs.calculating, message: `Configure the settings and click
112+
'Run' to see the data` }"
113+
:loadingOverlayComponent=PlAgOverlayLoading
114+
:noRowsOverlayComponent=PlAgOverlayNoRows
115+
:key="reloadKey"
116+
/>
105117
</div>
106118

107119
<PlSlideModal v-model="data.settingsOpen">

0 commit comments

Comments
 (0)