Skip to content

Commit

Permalink
Added sample templates
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Oct 12, 2018
1 parent acb8071 commit 3607bc6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
*/

import { cloneDeep } from 'lodash';
const elasticTemplate = require('./elastic_template.json');
const canvasWeather = require('./canvas_weather.json');
const conditionalAssets = require('./conditional_assets.json');
const elasticTemplate = require('./elastic_template.json');
const markdownStyles = require('./markdown_styles.json');
const operationalMonitoring = require('./sample_data_operational_monitoring.json');
const randomizedTour2018 = require('./randomized_tour_2018.json');

export const templates = [cloneDeep(elasticTemplate), cloneDeep(conditionalAssets)];
export const templates = [
cloneDeep(canvasWeather),
cloneDeep(conditionalAssets),
cloneDeep(elasticTemplate),
cloneDeep(markdownStyles),
cloneDeep(operationalMonitoring),
cloneDeep(randomizedTour2018),
];
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export class WorkpadTemplates extends React.PureComponent {
};

state = {
sortField: '@timestamp',
sortDirection: 'desc',
sortField: 'name',
sortDirection: 'asc',
pageSize: 10,
searchTerm: '',
filterTags: [],
Expand Down Expand Up @@ -231,11 +231,7 @@ export class WorkpadTemplates extends React.PureComponent {
render() {
const { sortField, sortDirection, searchTerm, filterTags } = this.state;

const sortedTemplates = sortByOrder(
templates,
[sortField, '@timestamp'],
[sortDirection, 'desc']
);
const sortedTemplates = sortByOrder(templates, [sortField, 'name'], [sortDirection, 'asc']);

const filteredTemplates = sortedTemplates.filter(({ name, description, tags }) => {
const tagMatch = filterTags.length
Expand Down

0 comments on commit 3607bc6

Please sign in to comment.