forked from seanpdoyle/select-your-own-seat
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For comparison [see this commit][commit] The commit above adds `active_link_to`. A gem that adds classes to links if they share the same path with the current_url. We can use the gem too! This commit uses a different helper from the same library to achieve the same effect. [commit]: seanpdoyle@1f53ca7
- Loading branch information
Showing
12 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react' | ||
|
||
export default class extends React.Component { | ||
render() { | ||
const { | ||
floors, | ||
} = this.props | ||
|
||
return ( | ||
<nav className="syos-frame__floor-nav syos-floor-nav"> | ||
<div className="syos-floor-nav__header"> | ||
<p className="syos-u-margin-bottom-3 syos-u-font-weight-bold"> | ||
Floors | ||
</p> | ||
</div> | ||
|
||
<div className="syos-floor-nav__diagram-wrapper"> | ||
<ul className="syos-block-stack"> | ||
{ | ||
floors.map(({path, name, className}) => ( | ||
<li className="syos-block-stack__item" key={path}> | ||
<a href={path} className={className}>{name}</a> | ||
</li> | ||
)) | ||
} | ||
</ul> | ||
</div> | ||
</nav> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
json.array! venue.floors do |floor| | ||
floor_path = venue_floor_seats_path(venue, floor) | ||
|
||
json.path floor_path | ||
json.name floor.name | ||
json.class_name active_link_to_class(floor_path) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require "application_system_test_case" | ||
|
||
class VisitorChangesFloorTest < ApplicationSystemTestCase | ||
test "visiting the balcony from the orchestra" do | ||
benedum_center = create(:benedum_center) | ||
orchestra = create(:orchestra, venue: benedum_center) | ||
balcony = create(:balcony, venue: benedum_center) | ||
front = create(:section, floor: orchestra) | ||
back = create(:section, floor: balcony) | ||
orchestra_seat = create(:seat, section: front, row: "AA", number: "1") | ||
balcony_seat = create(:seat, section: back, row: "ZZ", number: "1") | ||
|
||
visit "/venues/benedum_center/floors/orchestra/seats" | ||
click_on balcony.name | ||
|
||
assert_selector seat_selector(balcony_seat) | ||
refute_selector seat_selector(orchestra_seat) | ||
end | ||
|
||
def seat_selector(seat) | ||
%{a[aria-label="#{seat.row_number}"]} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters