fix: activity tracking description (#8268)
* feat: add no_activity flag to control issue activity tracking during partial updates * refactor: rename no_activity flag to skip_activity for clarity in issue activity tracking * enhance description input handling with migration update support * feat: implement skip_activity flag to conditionally log issue updates during partial updates * refactor: skip-activity * feat: add migration description update check to conditionally log issue updates --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
This commit is contained in:
parent
f0bc2bd3bd
commit
a9e9cb2983
9 changed files with 83 additions and 54 deletions
|
|
@ -30,6 +30,7 @@ export const createIdsForView = (view: EditorView, options: UniqueIDOptions) =>
|
|||
});
|
||||
|
||||
tr.setMeta("addToHistory", false);
|
||||
tr.setMeta("uniqueIdOnlyChange", true);
|
||||
|
||||
view.dispatch(tr);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ export const useEditor = (props: TEditorHookProps) => {
|
|||
onTransaction: () => {
|
||||
onTransaction?.();
|
||||
},
|
||||
onUpdate: ({ editor }) => onChange?.(editor.getJSON(), editor.getHTML()),
|
||||
onUpdate: ({ editor, transaction }) => {
|
||||
// Check if this update is only due to migration update
|
||||
const isMigrationUpdate = transaction?.getMeta("uniqueIdOnlyChange") === true;
|
||||
onChange?.(editor.getJSON(), editor.getHTML(), { isMigrationUpdate });
|
||||
},
|
||||
onDestroy: () => handleEditorReady?.(false),
|
||||
onFocus: onEditorFocus,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ export type IEditorProps = {
|
|||
mentionHandler: TMentionHandler;
|
||||
onAssetChange?: (assets: TEditorAsset[]) => void;
|
||||
onEditorFocus?: () => void;
|
||||
onChange?: (json: object, html: string) => void;
|
||||
onChange?: (json: object, html: string, { isMigrationUpdate }?: { isMigrationUpdate?: boolean }) => void;
|
||||
onEnterKeyPress?: (e?: any) => void;
|
||||
onTransaction?: () => void;
|
||||
placeholder?: string | ((isFocused: boolean, value: string) => string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue