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

Implement details view for BiG CZ #2150

Merged
merged 1 commit into from
Aug 18, 2017

Conversation

caseycesari
Copy link
Member

@caseycesari caseycesari commented Aug 15, 2017

Overview

Clicking on a search result in the BiG CZ results pane will open a pane with the details for that result. Only the fields that were common between all three APIs were added.

Connects to #1934

Demo

bigcz3

Notes

I tried various approaches to wiring up the events, and unfortunately, the only one I could get working was propagating the event manually. Triggering a collection event didn't work nor did using childViewEvents.

Testing Instructions

  • Visit the BiGCZ site.
  • Draw an AoI and make a search.
  • For each API, click a few results, and verify the details view is displayed.

Copy link

@arottersman arottersman left a comment

Choose a reason for hiding this comment

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

Tested on Chrome, FF, Safari and IE11. Working well! I think this is good to merge, just a few comments:

  • I think the triggerMethods are fine, and even fairly easy to follow in this case. If we do want to stay clear of events though, I was thinking we could add a method onto the ResultsCollection like setActiveResult that sets a given result to have an attribute isActive=true (and all other results to isActive=false). Then the DataCatalogWindow could listen for change:isActive on the active catalog's ResultCollection. Not sure that this is any simpler — just a thought.

  • We could potentially add date to the view, as that seems to be a common feature

  • Should this at some point make the corresponding result's shape active on the map?

  • When the title wraps, the "x" renders below it. Not sure if now is a good time to address
    screen shot 2017-08-15 at 1 50 16 pm

</p>
{% endif %}
<p>
{{ description }}

Choose a reason for hiding this comment

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

Should we also include the date as part of this card?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't implement this originally because the APIs handle dates in different ways. But after rereading the card, I'm going to take a shot at it.

@@ -71,18 +72,25 @@ var DataCatalogWindow = Marionette.LayoutView.extend({

ui: {
introText: '.intro-text',
tabs: '.output-tabs-wrapper'
tabs: '.output-tabs-wrapper',
closeDetails: '.close'
Copy link

@arottersman arottersman Aug 15, 2017

Choose a reason for hiding this comment

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

This was a little unexpected; I didn't know you could query ui elements in child views. Consider putting this on the view that renders the template this button is in, and hooking it back up to DataCatalogWindow via childEvents (like you did for the show action).

While the childEvents aren't ideal, I think not having this ui tag on the view rendering it could trip us up down the line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call. Will do.

@caseycesari
Copy link
Member Author

Thanks for the thorough review.

Should this at some point make the corresponding result's shape active on the map?

Yeah, though that will be handled in a follow up card. The original description of this issue says not to do it as part of this issue. I'll make a follow up card.

When the title wraps, the "x" renders below it. Not sure if now is a good time to address

I'll see if I can fix this.

@caseycesari
Copy link
Member Author

@arottersman I made the requested changes. Ready for another look!

@arottersman
Copy link

I left a review but then deleted its only comment to move it somewhere else. Now the whole review is gone....

Copy link

@arottersman arottersman left a comment

Choose a reason for hiding this comment

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

+1, looks good. Can approve this is as soon as the build passes:

The linter is failing because options is defined but never used in data_catalog/views.js

<i class="fa fa-user"></i>{{ author }}
</p>
{% endif %}
{% if activeCatalog != 'cuahsi' %}

Choose a reason for hiding this comment

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

We could also check if there's begin_date instead of checking on the active catalog.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried something similar, but there is a bit of an overlap in fields between the two catalogs, so I wanted to be more explicit. We may end up having to change this in the future too depending on how much the detail panes diverge between the catalogs.

Copy link

@arottersman arottersman left a comment

Choose a reason for hiding this comment

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

Nice! "Friendly reminder" to squash fixups

@caseycesari
Copy link
Member Author

Thanks for the thorough review!

Clicking on a search result in the BiG CZ results pane will open
a pane with the details for that result. Only the fields that were
common between all three APIs were added.

Refs #1934
@caseycesari caseycesari force-pushed the cpc/bigcz-search-result-details-view branch from 7f47418 to 4f3b515 Compare August 18, 2017 14:11
@caseycesari caseycesari merged commit 7f7a542 into develop Aug 18, 2017
@caseycesari caseycesari deleted the cpc/bigcz-search-result-details-view branch August 18, 2017 14:14
@rajadain rajadain mentioned this pull request Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants