Initial commit
This commit is contained in:
106
src/services/MockTaxonomyNavigationService.ts
Normal file
106
src/services/MockTaxonomyNavigationService.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import { IMenuItem } from './IMenuItem';
|
||||
import { ITaxonomyNavigationService } from './ITaxonomyNavigationService';
|
||||
import * as uuid from 'uuid';
|
||||
|
||||
export default class MockTaxonomyNavigationService implements ITaxonomyNavigationService {
|
||||
public getMenuItems(): Promise<IMenuItem[]> {
|
||||
return new Promise<IMenuItem[]>((resolve) => {
|
||||
resolve([
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Menu Item 1',
|
||||
url: 'https://www.bing.com',
|
||||
hoverText: 'Hover me!',
|
||||
pathDepth: 1,
|
||||
hasChildren: () => true,
|
||||
items: [
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 1',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 2,
|
||||
hasChildren: () => false
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 2',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 2,
|
||||
hasChildren: () => false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Menu Item 2',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 1,
|
||||
hasChildren: () => false
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Menu Item 3',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 1,
|
||||
hasChildren: () => true,
|
||||
items: [
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 1',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 2,
|
||||
hasChildren: () => false
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 2',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 2,
|
||||
hasChildren: () => true,
|
||||
items: [
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 1',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 3,
|
||||
hasChildren: () => false
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 2',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 3,
|
||||
hasChildren: () => false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 3',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 2,
|
||||
hasChildren: () => false
|
||||
},
|
||||
{
|
||||
id: uuid.v4(),
|
||||
label: 'Submenu Item 4',
|
||||
hoverText: 'Huch!',
|
||||
url: 'https://www.bing.com',
|
||||
pathDepth: 2,
|
||||
hasChildren: () => false
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user