123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- import { DashboardSearchItemType, DashboardSection, DashboardSectionItem } from './types';
- function makeSection(sectionPartial: Partial<DashboardSection>): DashboardSection {
- return {
- title: 'Default title',
- id: Number.MAX_SAFE_INTEGER - 1,
- score: -99,
- expanded: true,
- type: DashboardSearchItemType.DashFolder,
- items: [],
- url: '/default-url',
- ...sectionPartial,
- };
- }
- const makeSectionItem = (itemPartial: Partial<DashboardSectionItem>): DashboardSectionItem => {
- return {
- id: Number.MAX_SAFE_INTEGER - 2,
- uid: 'default-uid',
- title: 'Default dashboard title',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- tags: [],
- uri: 'db/default-slug',
- url: '/d/default-uid/default-slug',
- ...itemPartial,
- };
- };
- export const generalFolder: DashboardSection = {
- id: 0,
- title: 'General',
- items: [
- {
- id: 1,
- uid: 'lBdLINUWk',
- title: 'Test 1',
- uri: 'db/test1',
- url: '/d/lBdLINUWk/test1',
- type: DashboardSearchItemType.DashDB,
- tags: [],
- isStarred: false,
- checked: true,
- },
- {
- id: 46,
- uid: '8DY63kQZk',
- title: 'Test 2',
- uri: 'db/test2',
- url: '/d/8DY63kQZk/test2',
- type: DashboardSearchItemType.DashDB,
- tags: [],
- isStarred: false,
- checked: true,
- },
- ],
- icon: 'folder-open',
- score: 1,
- expanded: true,
- checked: false,
- url: '',
- type: DashboardSearchItemType.DashFolder,
- };
- export const searchResults: DashboardSection[] = [
- {
- id: 2,
- uid: 'JB_zdOUWk',
- title: 'gdev dashboards',
- expanded: false,
- items: [],
- url: '/dashboards/f/JB_zdOUWk/gdev-dashboards',
- icon: 'folder',
- score: 0,
- checked: true,
- type: DashboardSearchItemType.DashFolder,
- },
- generalFolder,
- ];
- // Search results with more info
- export const sections: DashboardSection[] = [
- makeSection({
- title: 'Starred',
- score: -2,
- expanded: true,
- items: [
- makeSectionItem({
- id: 1,
- uid: 'lBdLINUWk',
- title: 'Prom dash',
- type: DashboardSearchItemType.DashDB,
- }),
- ],
- }),
- makeSection({
- title: 'Recent',
- icon: 'clock-o',
- score: -1,
- expanded: false,
- items: [
- makeSectionItem({
- id: 4072,
- uid: 'OzAIf_rWz',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 46,
- uid: '8DY63kQZk',
- title: 'Stocks',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 20,
- uid: '7MeksYbmk',
- title: 'Alerting with TestData',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- folderId: 2,
- }),
- makeSectionItem({
- id: 4073,
- uid: 'j9SHflrWk',
- title: 'New dashboard Copy 4',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- folderId: 2,
- }),
- ],
- }),
- makeSection({
- id: 2,
- uid: 'JB_zdOUWk',
- title: 'gdev dashboards',
- expanded: true,
- url: '/dashboards/f/JB_zdOUWk/gdev-dashboards',
- icon: 'folder',
- score: 2,
- items: [],
- }),
- makeSection({
- id: 2568,
- uid: 'search-test-data',
- title: 'Search test data folder',
- expanded: false,
- items: [],
- url: '/dashboards/f/search-test-data/search-test-data-folder',
- icon: 'folder',
- score: 3,
- }),
- makeSection({
- id: 4074,
- uid: 'iN5TFj9Zk',
- title: 'Test',
- expanded: false,
- items: [],
- url: '/dashboards/f/iN5TFj9Zk/test',
- icon: 'folder',
- score: 4,
- }),
- makeSection({
- id: 0,
- title: 'General',
- icon: 'folder-open',
- score: 5,
- expanded: true,
- items: [
- makeSectionItem({
- id: 4069,
- uid: 'LCFWfl9Zz',
- title: 'New dashboard Copy',
- uri: 'db/new-dashboard-copy',
- url: '/d/LCFWfl9Zz/new-dashboard-copy',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 4072,
- uid: 'OzAIf_rWz',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 1,
- uid: 'lBdLINUWk',
- title: 'Prom dash',
- type: DashboardSearchItemType.DashDB,
- isStarred: true,
- }),
- ],
- }),
- ];
- export const checkedGeneralFolder: DashboardSection[] = [
- makeSection({
- id: 4074,
- uid: 'other-folder-dash',
- title: 'Test',
- expanded: false,
- type: DashboardSearchItemType.DashFolder,
- items: [
- makeSectionItem({
- id: 4072,
- uid: 'other-folder-dash-abc',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 46,
- uid: 'other-folder-dash-def',
- title: 'Stocks',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- ],
- url: '/dashboards/f/iN5TFj9Zk/test',
- icon: 'folder',
- score: 4,
- }),
- makeSection({
- id: 0,
- title: 'General',
- uid: 'other-folder-abc',
- score: 5,
- expanded: true,
- checked: true,
- type: DashboardSearchItemType.DashFolder,
- items: [
- makeSectionItem({
- id: 4069,
- uid: 'general-abc',
- title: 'New dashboard Copy',
- uri: 'db/new-dashboard-copy',
- url: '/d/LCFWfl9Zz/new-dashboard-copy',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- checked: true,
- }),
- makeSectionItem({
- id: 4072,
- uid: 'general-def',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- checked: true,
- }),
- makeSectionItem({
- id: 1,
- uid: 'general-ghi',
- title: 'Prom dash',
- type: DashboardSearchItemType.DashDB,
- isStarred: true,
- checked: true,
- }),
- ],
- }),
- ];
- export const checkedOtherFolder: DashboardSection[] = [
- makeSection({
- id: 4074,
- uid: 'other-folder-abc',
- title: 'Test',
- expanded: false,
- checked: true,
- type: DashboardSearchItemType.DashFolder,
- items: [
- makeSectionItem({
- id: 4072,
- uid: 'other-folder-dash-abc',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- checked: true,
- }),
- makeSectionItem({
- id: 46,
- uid: 'other-folder-dash-def',
- title: 'Stocks',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- checked: true,
- }),
- ],
- url: '/dashboards/f/iN5TFj9Zk/test',
- icon: 'folder',
- score: 4,
- }),
- makeSection({
- id: 0,
- title: 'General',
- icon: 'folder-open',
- score: 5,
- expanded: true,
- type: DashboardSearchItemType.DashFolder,
- items: [
- makeSectionItem({
- id: 4069,
- uid: 'general-abc',
- title: 'New dashboard Copy',
- uri: 'db/new-dashboard-copy',
- url: '/d/LCFWfl9Zz/new-dashboard-copy',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 4072,
- uid: 'general-def',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- }),
- makeSectionItem({
- id: 1,
- uid: 'general-ghi',
- title: 'Prom dash',
- type: DashboardSearchItemType.DashDB,
- isStarred: true,
- }),
- ],
- }),
- ];
- export const folderViewAllChecked: DashboardSection[] = [
- makeSection({
- checked: true,
- selected: true,
- title: '',
- items: [
- makeSectionItem({
- id: 4072,
- uid: 'other-folder-dash-abc',
- title: 'New dashboard Copy 3',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- checked: true,
- }),
- makeSectionItem({
- id: 46,
- uid: 'other-folder-dash-def',
- title: 'Stocks',
- type: DashboardSearchItemType.DashDB,
- isStarred: false,
- checked: true,
- }),
- ],
- }),
- ];
|