diff --git a/web/app/assets/javascripts/application.js b/web/app/assets/javascripts/application.js index 45331077c..f35d69f14 100644 --- a/web/app/assets/javascripts/application.js +++ b/web/app/assets/javascripts/application.js @@ -76,3 +76,4 @@ //= require_directory ./wizard/gear //= require_directory ./wizard/loopback //= require everywhere/everywhere +//= require fix_home_tiles diff --git a/web/app/assets/javascripts/fix_home_tiles.js b/web/app/assets/javascripts/fix_home_tiles.js new file mode 100644 index 000000000..9dab844dd --- /dev/null +++ b/web/app/assets/javascripts/fix_home_tiles.js @@ -0,0 +1,19 @@ +(function() { + // Wait for everything to settle + setTimeout(function() { + // If we are at the client root/home and the home screen is hidden + if ((window.location.hash === '' || window.location.hash === '#/home') && + $('.screen[layout-id="home"]').is(':hidden')) { + + console.log("Fixing home screen visibility..."); + + // Force the layout engine to show the home screen + if (window.JK && window.JK.app && window.JK.app.layout) { + window.JK.app.layout.changeToScreen('home', {}); + } + + // Also ensure the curtain is gone + $('.curtain').fadeOut(); + } + }, 1000); +})(); diff --git a/web/app/assets/javascripts/react-components/TopMessageHolder.js.jsx.coffee b/web/app/assets/javascripts/react-components/TopMessageHolder.js.jsx.coffee index 8f96207a1..43c7bd35a 100644 --- a/web/app/assets/javascripts/react-components/TopMessageHolder.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/TopMessageHolder.js.jsx.coffee @@ -1,9 +1,9 @@ context = window ConfigStore = context.ConfigStore -ReactCSSTransitionGroup = React.addons.CSSTransitionGroup; +ReactCSSTransitionGroup = if React.addons then React.addons.CSSTransitionGroup else null -@TopMessageHolder = React.createClass( +context.TopMessageHolder = React.createClass( { displayName: 'Top Message Holder', minimum_time_until_sub_prompt: 1000 * 60 * 15 # 30 minutes diff --git a/web/spec/features/home_tiles_spec.rb b/web/spec/features/home_tiles_spec.rb new file mode 100644 index 000000000..ce783ee23 --- /dev/null +++ b/web/spec/features/home_tiles_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "Home Tiles", :js => true, :type => :feature do + let(:user) { FactoryBot.create(:user) } + + it "shows the home tiles" do + # Ensure we are not logged in to see the 'not-logged-in' class + # sign_in_poltergeist(user) + + visit "/client" + + # Check for the specific selector + expect(page).to have_css('.homecard.createsession.not-logged-in', visible: true, wait: 10) + end +end \ No newline at end of file