From 3607bc6f9ca750136d75b077519e9c28ec1112f1 Mon Sep 17 00:00:00 2001 From: Catherine Liu Date: Fri, 12 Oct 2018 01:46:57 +0100 Subject: [PATCH] Added sample templates --- .../workpad_templates/templates/index.js | 15 +++++++++++++-- .../workpad_templates/workpad_templates.js | 10 +++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/canvas/public/components/workpad_templates/templates/index.js b/x-pack/plugins/canvas/public/components/workpad_templates/templates/index.js index 1f189b41e8f35..a4ecc8aab67c6 100644 --- a/x-pack/plugins/canvas/public/components/workpad_templates/templates/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_templates/templates/index.js @@ -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), +]; diff --git a/x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js b/x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js index 84ebc7098df43..7420967e05898 100644 --- a/x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js +++ b/x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js @@ -46,8 +46,8 @@ export class WorkpadTemplates extends React.PureComponent { }; state = { - sortField: '@timestamp', - sortDirection: 'desc', + sortField: 'name', + sortDirection: 'asc', pageSize: 10, searchTerm: '', filterTags: [], @@ -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