diff --git a/jam-ui/cypress/e2e/sessions/browse-sessions-page.cy.js b/jam-ui/cypress/e2e/sessions/browse-sessions-page.cy.js index eb48a2b03..7cae42b8c 100644 --- a/jam-ui/cypress/e2e/sessions/browse-sessions-page.cy.js +++ b/jam-ui/cypress/e2e/sessions/browse-sessions-page.cy.js @@ -19,7 +19,9 @@ describe('Browse sessions', () => { }); it('alerts when there is no records', () => { - cy.contains('No Records!'); + cy.contains('There are no public, open sessions currently available for you to join'); + cy.contains('create a session').click(); + cy.url().should('include', '/sessions/new'); }); }); diff --git a/jam-ui/cypress/support/e2e.js b/jam-ui/cypress/support/e2e.js index 3a28a93ed..b9173a41b 100644 --- a/jam-ui/cypress/support/e2e.js +++ b/jam-ui/cypress/support/e2e.js @@ -27,6 +27,26 @@ beforeEach(() => { statusCode: 200, body: [], }).as('getAppFeatures'); + + cy.intercept('GET', /\S+\/users\/\S+\/profile/, { + statusCode: 200, + body: { + id: 1, + name: 'Jane Doe', + email: 'jane@example.com', + }, + }).as('getUserProfile'); + + cy.intercept('GET', /\S+\/users\/\S+\/my_notifications/, { + statusCode: 200, + body: [], + }).as('getMyNotifications'); + + cy.intercept('GET', /\S+\/users\/\S+\/friends/, { + statusCode: 200, + body: [], + }).as('getMyFriends'); + }); diff --git a/jam-ui/src/components/page/JKMusicSessions.js b/jam-ui/src/components/page/JKMusicSessions.js index fe018781c..e2d14bc91 100644 --- a/jam-ui/src/components/page/JKMusicSessions.js +++ b/jam-ui/src/components/page/JKMusicSessions.js @@ -1,5 +1,6 @@ import React, { useEffect } from 'react'; -import { Alert, Col, Row, Card, CardBody } from 'reactstrap'; +import { Col, Row, Card, CardBody } from 'reactstrap'; +import { Link } from 'react-router-dom'; import FalconCardHeader from '../common/FalconCardHeader'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; @@ -53,9 +54,9 @@ function JKMusicSessions() { ) : ( - - {t('no_records', { ns: 'common' })} - + {t('list.no_records_1', { ns: 'sessions' })} + {t('list.create_session', { ns: 'sessions' })} + {t('list.no_records_2', { ns: 'sessions' })} )} diff --git a/jam-ui/src/i18n/locales/en/sessions.json b/jam-ui/src/i18n/locales/en/sessions.json index e26188e3c..8ef477b49 100644 --- a/jam-ui/src/i18n/locales/en/sessions.json +++ b/jam-ui/src/i18n/locales/en/sessions.json @@ -37,7 +37,10 @@ "notes": { "invited": "YOU WERE INVITED TO THIS SESSION", "has_friend": "YOU HAVE A FRIEND IN THIS SESSION" - } + }, + "no_records_1": "There are no public, open sessions currently available for you to join. We suggest you ", + "create_session": "create a session", + "no_records_2": " that others can join now, or wait a bit and then refresh this page in your browser to see if new public sessions have been started." }, "lobby": { "page_title": "Lobby", diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index 6ac36c43b..51bec94a8 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -545,7 +545,7 @@ class ApiUsersController < ApiController limit = 20 if limit <= 0 offset = params[:offset].to_i offset = 0 if offset < 0 - query = @notifications = @user.notifications.joins(:source_user) + query = @user.notifications.joins(:source_user) @unread_total = query.unread.size @notifications = query.offset(offset).limit(limit) @next = @notifications.size > 0 ? offset + limit : nil