diff --git a/packages/nc-gui/composables/useViewAggregate.ts b/packages/nc-gui/composables/useViewAggregate.ts index ea0cd364e0..d8746e4252 100644 --- a/packages/nc-gui/composables/useViewAggregate.ts +++ b/packages/nc-gui/composables/useViewAggregate.ts @@ -25,18 +25,18 @@ const [useProvideViewAggregate, useViewAggregate] = useInjectionState( const { nestedFilters } = useSmartsheetStoreOrThrow() + const { isUIAllowed } = useRoles() + const { fetchAggregatedData } = useSharedView() const aggregations = ref({}) as Ref> - const { isUIAllowed } = useRoles() - const reloadAggregate = inject(ReloadAggregateHookInj) const visibleFieldsComputed = computed(() => { - const fie = fields.value.map((field, index) => ({ field, index })).filter((f) => f.index !== 0) + const field = fields.value.map((field, index) => ({ field, index })).filter((f) => f.index !== 0) - return fie.map((f) => { + return field.map((f) => { const gridField = gridViewCols.value[f.field.id!] if (!gridField) { @@ -44,7 +44,7 @@ const [useProvideViewAggregate, useViewAggregate] = useInjectionState( } return { - value: aggregations.value[f.field.title] ?? null, + value: aggregations.value[f.field.title!] ?? null, field: gridField, column: f.field, index: f.index, @@ -82,8 +82,8 @@ const [useProvideViewAggregate, useViewAggregate] = useInjectionState( }>, ) => { // Wait for meta to be defined https://vueuse.org/shared/until/ - await until(meta) - .toBeTruthy((c) => !!c, { + await until(() => !!meta.value) + .toBeTruthy({ timeout: 10000, }) .then(async () => { diff --git a/packages/nc-gui/composables/useViewGroupBy.ts b/packages/nc-gui/composables/useViewGroupBy.ts index e045072f96..873ff8488e 100644 --- a/packages/nc-gui/composables/useViewGroupBy.ts +++ b/packages/nc-gui/composables/useViewGroupBy.ts @@ -395,7 +395,7 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState( const aggregation = Object.values(gridViewCols.value) .map((f) => ({ - field: f.fk_column_id, + field: f.fk_column_id!, type: f.aggregation ?? CommonAggregations.None, })) .filter((f) => f.type !== CommonAggregations.None) @@ -630,7 +630,7 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState( let filteredFields = fields if (!fields) { filteredFields = Object.values(gridViewCols.value).map((f) => ({ - field: f.fk_column_id, + field: f.fk_column_id!, type: f.aggregation ?? CommonAggregations.None, })) }