Update workflow statuses in real time (#11653)
Statuses are maintained by an async job. Those are calculations that we would like to avoid using in both frontend and backend. Using push updates are an easier way. https://github.com/user-attachments/assets/31e44a82-08a8-4100-a38e-c965d5c73ee8
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
import { useRecordIndexContextOrThrow } from '@/object-record/record-index/contexts/RecordIndexContext';
|
||||
import { RecordValueSetterEffect } from '@/object-record/record-store/components/RecordValueSetterEffect';
|
||||
import { RecordTableCellCheckbox } from '@/object-record/record-table/record-table-cell/components/RecordTableCellCheckbox';
|
||||
import { RecordTableCellGrip } from '@/object-record/record-table/record-table-cell/components/RecordTableCellGrip';
|
||||
import { RecordTableLastEmptyCell } from '@/object-record/record-table/record-table-cell/components/RecordTableLastEmptyCell';
|
||||
import { RecordTableCells } from '@/object-record/record-table/record-table-row/components/RecordTableCells';
|
||||
import { RecordTableDraggableTr } from '@/object-record/record-table/record-table-row/components/RecordTableDraggableTr';
|
||||
import { ListenRecordUpdatesEffect } from '@/subscription/components/ListenUpdatesEffect';
|
||||
import { getDefaultRecordFieldsToListen } from '@/subscription/utils/getDefaultRecordFieldsToListen.util';
|
||||
|
||||
type RecordTableRowProps = {
|
||||
recordId: string;
|
||||
@ -16,6 +19,11 @@ export const RecordTableRow = ({
|
||||
rowIndexForFocus,
|
||||
rowIndexForDrag,
|
||||
}: RecordTableRowProps) => {
|
||||
const { objectNameSingular } = useRecordIndexContextOrThrow();
|
||||
const listenedFields = getDefaultRecordFieldsToListen({
|
||||
objectNameSingular,
|
||||
});
|
||||
|
||||
return (
|
||||
<RecordTableDraggableTr
|
||||
recordId={recordId}
|
||||
@ -27,6 +35,11 @@ export const RecordTableRow = ({
|
||||
<RecordTableCells />
|
||||
<RecordTableLastEmptyCell />
|
||||
<RecordValueSetterEffect recordId={recordId} />
|
||||
<ListenRecordUpdatesEffect
|
||||
objectNameSingular={objectNameSingular}
|
||||
recordId={recordId}
|
||||
listenedFields={listenedFields}
|
||||
/>
|
||||
</RecordTableDraggableTr>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user