grafana/public/app/features/browse-dashboards/fixtures/folder.fixture.ts
Ashley Harrison 9799a28fad
Nested folders: add analytics tracking for some features (#69901)
* add analytics for folder creation

* add interaction tracking for move/delete

* add tracking for item clicked in the new browse view

* review comments

* emit counts instead
2023-06-12 16:52:08 +01:00

26 lines
611 B
TypeScript

import { Chance } from 'chance';
import { FolderDTO } from 'app/types';
export function mockFolderDTO(seed = 1, partial?: Partial<FolderDTO>): FolderDTO {
const random = Chance(seed);
const uid = random.guid();
return {
canAdmin: true,
canDelete: true,
canEdit: true,
canSave: true,
created: new Date(random.timestamp()).toISOString(),
createdBy: '',
hasAcl: true,
id: 1,
title: random.sentence({ words: 3 }),
uid,
updated: new Date(random.timestamp()).toISOString(),
updatedBy: '',
url: `/dashboards/f/${uid}`,
version: 1,
...partial,
};
}