The UserPermissions in ui-users should be refactored as an envelope component around a new component: RenderPermissions
Description
Environment
Potential Workaround
Checklist
hideTestRail: Results
Activity

Mike TaylorApril 4, 2017 at 11:45 AM
I fixed all these Lint errors, but then it occurred to me that if Jeremy has unpushed changes in then this will create a ton of essentially unmergeable conflicts. So I have pushed the modified file into a new lint
branch, and we can sort it out after Jeremy comes online.

Mike TaylorApril 4, 2017 at 11:24 AM
Ouch. I'm on it.

Mike TaylorApril 3, 2017 at 4:00 PM
As more-or-less agree with Jeremy, I am going ahead with the linting.

Mike TaylorMarch 31, 2017 at 10:11 PM
Looks good! I accepted the PR. I like how both the components feel much simpler and more streamlined. I think this is a good direction of travel.
If you run yarn lint
, you will see a bunch of trivial errors – indentation, whitespace, unused variables and so on. Would you please fix these? (Other lint errors, like "Unexpected dangling '_' in '_id'", are not so easy to fix – don't worry about those for now.)
I'm in two minds about the location in the filesystem of the new <RenderPermissions>
component. I'd assumed it would sit alongside <UserPermissions>
but I guess you're right that this belongs in lib
since it will get used from another place within the Users module (namely settings/PermissionSets.js
). Unfortunately, that seems to leave us following John Coburn's rather cumbersome convention of putting each component in its own directory and then setting up and index.js to link to the real code. What say we move lib/RenderPermissions/RenderPermissions.js
and the CSS up a level, then delete the directory?
In order to allow the component to be reusable, UserPermissions needs to be refactored to handle all stripes connect business and the ui portion of the component needs to be moved to a new component: RenderPermissions. RenderPermissions will receive all of its data and functionality from it parent component.