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

Chore: Migrate SidebarView to Typescript #3478

Merged
merged 8 commits into from
Nov 10, 2021
Merged

Conversation

reinaldonetof
Copy link
Contributor

Proposed changes

Issue(s)

How to test or reproduce

  • The sidebar should be work normally. Besides the sidebar the Button to Admin Panel must be working properly, I changed a small part of the algorithm to show this button.

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

app/containers/Status/Status.tsx Outdated Show resolved Hide resolved
app/views/SidebarView/index.tsx Show resolved Hide resolved
return result;
}, false);
// Creating a new array with booleans values, than the every check if it is a truthy array
isAdmin = allPermissions.map(permission => permission.some(r => roles.indexOf(r) !== -1)).every(Boolean);
Copy link
Contributor

Choose a reason for hiding this comment

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

when we don't have admin permissions we get this error.

Screen Shot 2021-11-02 at 00 15 15

the const allPermissions is like this: [ undefined, undefined, undefined, undefined ]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, thanks, I didn't realize this!

Copy link
Contributor

@AlexAlexandre AlexAlexandre left a comment

Choose a reason for hiding this comment

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

LGTM ;)

app/views/SidebarView/index.tsx Outdated Show resolved Hide resolved
@diegolmello diegolmello merged commit 64f7b1f into develop Nov 10, 2021
@diegolmello diegolmello deleted the chore.ts-sidebarview branch November 10, 2021 20:14
ivnxyz pushed a commit to NextiaDev/Rocket.Chat.ReactNative that referenced this pull request May 26, 2023
Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants