mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(editor): add tracking for the creation of linked-doc (#9266)
close: BS-2189
This commit is contained in:
@@ -3,6 +3,7 @@ import type {
|
||||
DatabaseBlockModel,
|
||||
RootBlockModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { TelemetryProvider } from '@blocksuite/affine-shared/services';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
|
||||
import {
|
||||
createDefaultDoc,
|
||||
@@ -78,6 +79,13 @@ export class NoteRenderer
|
||||
])
|
||||
);
|
||||
}
|
||||
// Track when a linked doc is created in database title column
|
||||
this.host.std.getOptional(TelemetryProvider)?.track('LinkedDocCreated', {
|
||||
segment: 'database',
|
||||
module: 'center peek in database',
|
||||
type: 'turn into',
|
||||
parentFlavour: 'affine:database',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@ import {
|
||||
type RichText,
|
||||
} from '@blocksuite/affine-components/rich-text';
|
||||
import type { RootBlockModel } from '@blocksuite/affine-model';
|
||||
import { ParseDocUrlProvider } from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
ParseDocUrlProvider,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
getViewportElement,
|
||||
isValidUrl,
|
||||
@@ -295,6 +298,14 @@ export class HeaderAreaTextCellEditing extends BaseTextCell {
|
||||
index: inlineRange.index + text.length,
|
||||
length: 0,
|
||||
});
|
||||
|
||||
// Track when a linked doc is created in database title column
|
||||
std?.getOptional(TelemetryProvider)?.track('LinkedDocCreated', {
|
||||
module: 'database title cell',
|
||||
type: 'paste',
|
||||
segment: 'database',
|
||||
parentFlavour: 'affine:database',
|
||||
});
|
||||
} else {
|
||||
inlineEditor?.insertText(inlineRange, text, {
|
||||
link: text,
|
||||
@@ -390,6 +401,7 @@ export class HeaderAreaTextCellEditing extends BaseTextCell {
|
||||
this.topContenteditableElement?.host
|
||||
? getViewportElement(this.topContenteditableElement.host)
|
||||
: null}"
|
||||
data-parent-flavour="affine:database"
|
||||
class="data-view-header-area-rich-text can-link-doc"
|
||||
></rich-text>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user