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: side menu icon should not be visible in mobile when there is no menu #3665

Merged
merged 8 commits into from
Dec 22, 2019
Merged

Conversation

maze-runnar
Copy link
Contributor

@maze-runnar maze-runnar commented Nov 26, 2019

fixes : #3656
Screenshot from 2019-11-26 20-18-59
visible for other pages
Screenshot from 2019-11-26 20-24-47

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)

@auto-label auto-label bot added the fix label Nov 26, 2019
</button>
{{#if isMenuOpen}}
{{public/side-menu class='toggle menu' event=model}}
{{#if (and (not-eq session.currentRouteName 'public.cfs.new-session') (not-eq session.currentRouteName 'public.cfs.new-speaker') (not-eq session.currentRouteName 'public.cfs.edit-speaker') (not-eq session.currentRouteName 'public.cfs.edit-session'))}}
Copy link
Member

Choose a reason for hiding this comment

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

Rather than using such conditionals in the templates, please use a computed property from controllers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same condition is used in side-menu.hbs file for visibility of menu .

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 really brittle

Copy link
Member

Choose a reason for hiding this comment

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

I suspected so, @maze-runnar make a computed property and use it for the above condition too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have made the computed property and it's working fine . may i make changes here ?

kushthedude
kushthedude previously approved these changes Dec 5, 2019
@maze-runnar
Copy link
Contributor Author

@kushthedude please review

@@ -11,6 +11,11 @@ export default Controller.extend({
displayEndDate: computed('model.startsAtDate', 'model.endsAtDate', function() {
return !moment(this.model.startsAtDate).isSame(this.model.endsAtDate, 'minute');
}),
displaySideMenu: computed('session.currentRouteName', function() {
if (this.get('session.currentRouteName')) {
Copy link
Member

Choose a reason for hiding this comment

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

Dont use ES5 getter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then what ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should i migrate it to ES6?

Copy link
Member

Choose a reason for hiding this comment

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

No, this.get('session') this.session

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the same file :

smallLead: computed('session.currentRouteName', function() {
    if (this.get('session.currentRouteName')) {
      return this.get('session.currentRouteName') !== 'public.index';
    }
  }),

Should i change ES5 here too ?

@maze-runnar
Copy link
Contributor Author

@kushthedude should i open a seperate PR for migrating "app/controllers/public.js" to ES6.
As you have said migrate those on whom currently working during resolving that issue.

@niranjan94
Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- app/controllers/public.js  3
         

See the complete overview on Codacy

@maze-runnar
Copy link
Contributor Author

screenshot after above change .
Screenshot from 2019-12-22 16-33-46

@kushthedude kushthedude requested review from iamareebjamal and removed request for iamareebjamal December 22, 2019 13:45
@iamareebjamal iamareebjamal merged commit c7ddd9c into fossasia:development Dec 22, 2019
@maze-runnar maze-runnar deleted the patch-12 branch December 22, 2019 14:38
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.

side menu icon button should not be there
4 participants