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

Add "New" indicator to search result cards #523

Merged
merged 4 commits into from
Mar 19, 2020
Merged

Conversation

arkadyan
Copy link
Contributor

For buses that have logged in within the last 30 minutes.

Asana ticket: Add "New" indicator to search result cards for buses that have logged in within last 30 min

Screen Shot 2020-03-18 at 19 09 00

For buses that have logged in within the last 30 minutes.
@codecov
Copy link

codecov bot commented Mar 18, 2020

Codecov Report

Merging #523 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #523   +/-   ##
=======================================
  Coverage   97.48%   97.49%           
=======================================
  Files         170      171    +1     
  Lines        3818     3831   +13     
  Branches      523      526    +3     
=======================================
+ Hits         3722     3735   +13     
  Misses         92       92           
  Partials        4        4           
Impacted Files Coverage Δ
assets/src/components/searchResults.tsx 100.00% <100.00%> (ø)
assets/src/components/vehicleIcon.tsx 99.60% <100.00%> (ø)
assets/src/helpers/dom.ts 100.00% <100.00%> (ø)
assets/src/models/vehicle.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dc0100...76f37d4. Read the comment docs.

@ingridpierre
Copy link

Looks great, some vehicle info looked incorrect due to the data issues we're having (no trip headsigns displayed on active vehicles), but that seems separate from this pr.

One subtle detail to add. Can we change the dropshadow to the new cards to this:

.m-search-results__card--new {
box-shadow: 0 2px 4px 0 rgba(77, 182, 172, 0.3);
}

@@ -120,6 +120,72 @@ describe("SearchResults", () => {
expect(tree).toMatchSnapshot()
})

test("renders vehicles that have logged in within the past 30 minutes", () => {
Copy link
Member

Choose a reason for hiding this comment

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

A name like "shows the new badge for vehicle that have logged in within the past 30 minutes" would better indicate why we need the test.

@@ -28,5 +28,9 @@
.m-properties-list__property--last-login & {
color: $color-font-grey;
font-size: 0.75rem;

.m-search-results__card--new & {
Copy link
Member

Choose a reason for hiding this comment

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

Either _properties_list.scss needs a .m-search-results selector, or _search_results.scss needs a .m-properties-list selector. I think I'd rather this be in _search_results.scss and have the parent know the details about its child, than to have it here where the child would need to know details about its parent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I went back and forth, but I agree with you, that's better.

@arkadyan
Copy link
Contributor Author

@ingridpierre thanks, updated that box shadow.

@arkadyan arkadyan force-pushed the mss-new-indicator branch from 26cb161 to 8f4eebb Compare March 19, 2020 16:00
@arkadyan arkadyan force-pushed the mss-new-indicator branch from 8f4eebb to 76f37d4 Compare March 19, 2020 16:04
@arkadyan arkadyan merged commit 7d3a22f into master Mar 19, 2020
@arkadyan arkadyan deleted the mss-new-indicator branch March 19, 2020 16:22
@ahakuta
Copy link

ahakuta commented Mar 19, 2020

Just wanted to let you know @arkadyan I took a look and this ticket looks great!

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.

4 participants