Skip to content

Added explore button to each database table row - #3857

Closed
joshhunt wants to merge 1 commit into
rethinkdb:nextfrom
joshhunt:explore-table-button
Closed

joshhunt wants to merge 1 commit into
rethinkdb:nextfrom
joshhunt:explore-table-button

Conversation

@joshhunt

@joshhunt joshhunt commented Mar 2, 2015

Copy link
Copy Markdown

My quick attempt at completing issue #3856 and #3509.

screen shot 2015-03-02 at 2 56 20 pm

Each row gets a new 'Explore' button, visible only on row hover (to avoid the clutter of lots of repeating buttons).
Clicking the button navigates to the data explorer, profiled in with the query r.db('databaseName').table('tableName')

I wasn't sure of the best way to do this, so I went for the simplest approach:

explore_table: =>
  window.localStorage.current_query = JSON.stringify "r.db('#{@model.get('db')}').table('#{@model.get('name')}')"
  location.hash = 'dataexplorer'

Because it relies on localStorage to refill in the command, the button is only displayed in browsers that support localStorage.

Thoughts?

On database table hover, an explore button appears which launches the
data explorer, prefilled in with a query to explore that table.

The button is only displayed in browsers that support localStorage.
@joshhunt

joshhunt commented Mar 2, 2015

Copy link
Copy Markdown
Author

My main concern with my attempt is if @model.get('db') or @model.get('name') contains characters which need to be escaped. Is that possible, or is it basically only alphanumeric characters which can appear there?

@deontologician

Copy link
Copy Markdown
Contributor

Will check this out today. Thanks for the PR

@deontologician

Copy link
Copy Markdown
Contributor

I like it, the functionality is nice and clean. The buttons only showing up on hover is probably not the way to go though. We don't use that mechanism anywhere else in the ui. @mglukhovsky also mentioned we try to remove as much as we can from the table listing to keep it uncluttered.

What I think needs to happen:

  1. move the "Explore" button to the top of the table page (next to ", and leave it off the table listing page for now. We have an issue open for redesigning the table listing page in the medium-near future (Table listing redesign #3825), so we'll probably revisit whether we can make it work at that point.
  2. Instead of setting location.hash directly, use the backbone router like: main_view.router.navigate("#dataexplorer")

@danielmewes

Copy link
Copy Markdown
Member

@joshhunt Are you still interested in updating the PR? (in particular moving the "Explore" button to the top of the individual table page as @deontologician described)

We can try to use some of your code as a basis for our own modifications, but I'm not sure when we'll get to that.

Had you signed our CLA http://rethinkdb.com/community/cla/ btw?

@bsharpe

bsharpe commented Jul 1, 2016

Copy link
Copy Markdown
Contributor

This would be a great addition... hope it makes it :)

@danielmewes danielmewes added this to the backlog milestone Jul 6, 2016
@srh

srh commented Jun 10, 2017

Copy link
Copy Markdown
Contributor

Fixed merge conflicts, followed @deontologician's advice about navigation, and cherry-picked into next as of 05be59f. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants