Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas saved objects for sample data #24347

Merged
merged 6 commits into from
Oct 23, 2018
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Oct 22, 2018

Adds canvas saved objects for #22893, #22892, and #22891
cc @alexfrancoeur

@nreese nreese added v7.0.0 v6.5.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Oct 22, 2018
@alexfrancoeur
Copy link

@nreese - all looks good to me here with one small exception. Not sure how this happened and it could have gotten lost in transition but OS and RAM are meant to be on two lines

screen shot 2018-10-22 at 1 19 23 pm

Any chance you could tweak the expression for that object so that the results looks like this?

screen shot 2018-10-22 at 1 21 52 pm

Expression can be copy and pasted below:

filters
| esdocs index="kibana_sample_data_logs" sort="timestamp, desc" fields="machine.os, machine.ram" count=1
| markdown "**OS:** " {getCell "machine.os"} "\
 **RAM:** " {getCell "machine.ram" | formatNumber "00.0b"}
font={font family="'Open Sans', Helvetica, Arial, sans-serif" size=20 align="left" color="#FFFFFF" weight="lighter" underline=false italic=false}
| render containerStyle={containerStyle padding="5px"}

@alexfrancoeur
Copy link

Works fine with Spaces (with the exception of known issues for Canvas/Spaces). I did run into an issue removing it from a Space though. After removing it, and loading up Canvas I saw the below error. Refreshing Canvas showed me an empty landing page.

screen shot 2018-10-22 at 1 33 06 pm

I was able to reproduce this multiple times.

  1. Add web logs sample data
  2. load up canvas workpad
  3. leave canvas and remove web logs
  4. return to canvas
  5. see error
  6. refresh
  7. no more error

@nreese
Copy link
Contributor Author

nreese commented Oct 22, 2018

jenkins, test this

@nreese
Copy link
Contributor Author

nreese commented Oct 22, 2018

jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese nreese requested a review from cqliu1 October 23, 2018 00:13
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese
Copy link
Contributor Author

nreese commented Oct 23, 2018

jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese
Copy link
Contributor Author

nreese commented Oct 23, 2018

jenkins, test this

Copy link
Contributor

@cqliu1 cqliu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

screen shot 2018-10-23 at 10 30 50 am

I noticed that the "Updated" date keeps the original date in the saved object JSON instead of setting it to the current datetime. I'd expect to see the sample workpads at the top, but that's not necessarily the case if you already have existing workpads. That's a change we'll make on the Canvas side. No changes required from you.

@nreese
Copy link
Contributor Author

nreese commented Oct 23, 2018

@cqliu1 Should I just remove the updated_at field from the saved object so its give a new value anytime it is installed?

@cqliu1
Copy link
Contributor

cqliu1 commented Oct 23, 2018

No that's not necessary. We just need to override that date on upload on the Canvas side. It doesn't matter if you remove or not.

@cqliu1
Copy link
Contributor

cqliu1 commented Oct 23, 2018

@nreese Actually I was wrong... Would it possible for you to update the date on that saved object before you store it? Since you're hitting the saved objects API directly, it won't go through our upload handler and that "Updated" date should be set to the new date before it's stored.

@cqliu1 cqliu1 closed this Oct 23, 2018
@cqliu1 cqliu1 reopened this Oct 23, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cqliu1 cqliu1 self-requested a review October 23, 2018 19:28
Copy link
Contributor

@cqliu1 cqliu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks for updating the timestamps.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alexfrancoeur
Copy link

alexfrancoeur commented Oct 23, 2018 via email

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese nreese merged commit 60bb498 into elastic:master Oct 23, 2018
nreese added a commit to nreese/kibana that referenced this pull request Oct 23, 2018
* Canvas saved objects for sample data

* fix line break in MACHINE element

* store canvas saved objects in json files instead of js files to avoid build problems

* remove logging statement

* set canvas-workpad timestamps to current time so they are displayed at top of list when sorted by date
@alexfrancoeur
Copy link

yessss @nreese!!! Thank you so much, I really appreciate you adding this in last minute. I really feel like it will help with Canvas adoption. Appreciate you and @cqliu1 for the last minute PR for 6.5

nreese added a commit that referenced this pull request Oct 24, 2018
* Canvas saved objects for sample data

* fix line break in MACHINE element

* store canvas saved objects in json files instead of js files to avoid build problems

* remove logging statement

* set canvas-workpad timestamps to current time so they are displayed at top of list when sorted by date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.5.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants