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

fix: simply nav bar on public page #5454

Merged
merged 5 commits into from
Nov 3, 2020
Merged

fix: simply nav bar on public page #5454

merged 5 commits into from
Nov 3, 2020

Conversation

maze-runnar
Copy link
Contributor

Fixes #5448

Screenshot from 2020-11-02 18-41-17

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Nov 2, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/605godrex
✅ Preview: https://open-event-frontend-git-simply-public-page.eventyay.vercel.app

@codecov
Copy link

codecov bot commented Nov 2, 2020

Codecov Report

Merging #5454 into development will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #5454      +/-   ##
===============================================
+ Coverage        23.23%   23.24%   +0.01%     
===============================================
  Files              493      493              
  Lines             5169     5170       +1     
  Branches            38       38              
===============================================
+ Hits              1201     1202       +1     
  Misses            3963     3963              
  Partials             5        5              
Impacted Files Coverage Δ
app/components/nav-bar.js 33.33% <100.00%> (+33.33%) ⬆️

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 9ea3a5f...32e292f. Read the comment docs.

@mariobehling
Copy link
Member

Very nice. I missed this: For not-logged in users we also need to take out "pricing", please on the event pages only.

Screenshot from 2020-11-02 14-34-36

import Component from '@ember/component';

@classic
export default class NavBar extends Component {
@computed('session.currentRouteName')
get currentRoute() {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't return the current route, it returns if it is public route. Change to isEventPageRoute

@@ -10,9 +10,11 @@
@route="pricing" class="item"
@activeClass="">{{t 'Pricing'}}</LinkTo>
{{/if}}
{{#if currentRoute}}
Copy link
Member

Choose a reason for hiding this comment

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

this. is missing

Will throw a warning

@@ -5,14 +5,16 @@
<h3>{{this.settings.appName}}</h3>
</LinkTo>
<div class="right menu nav-bar">
{{#if (not this.session.isAuthenticated)}}
{{#if (and (not this.session.isAuthenticated) this.isEventPageRoute)}}
Copy link
Member

Choose a reason for hiding this comment

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

This means show Pricing if user is not logged in and the page is event page

import Component from '@ember/component';

@classic
export default class NavBar extends Component {
@computed('session.currentRouteName')
get isEventPageRoute() {
Copy link
Member

Choose a reason for hiding this comment

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

This returns true if the page is not event page. It should either be named isNotEventPageRoute or return opposite of what it does. Please check the function names make sense. Change the name

@iamareebjamal iamareebjamal merged commit 0bc01a0 into fossasia:development Nov 3, 2020
@maze-runnar maze-runnar deleted the simply-public-page branch November 3, 2020 16:18
akash2408 pushed a commit to akash2408/open-event-frontend that referenced this pull request Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public Event Pages: Do not show "Browse Events" and "Create Event"
3 participants