-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Accounts dashboard base UI for Feature: "Marketplace and Shop owners should be able to create custom permission groups" #2543
Merged
spencern
merged 156 commits into
marketplace
from
rowland-accounts-react-conversion-2184
Jul 22, 2017
Merged
Changes from 152 commits
Commits
Show all changes
156 commits
Select commit
Hold shift + click to select a range
01c94a3
Give all users access to shop selector.
spencern ac4494a
Set ShopId on shop selector change
spencern 8b3df17
Merge branch 'spencer-code-cleanup' into marketplace-shop-switcher
spencern 44ed9bc
Regular Shop Selector should just adjust only the route.
spencern 150514f
Remove empty line at top of navbar
spencern 8947d2c
Change Reaction.shopId to be a ReactiveVar
spencern 9cc050d
Add closeOnClick option to DropDownMenu
spencern 6af82e8
Add shop selector to admin toolbar.
spencern deae717
WIP - tons of code not committed - Init switching away from getSeller…
spencern 6db6fe1
Switches dashboard context as well as published packages based on act…
spencern 71f7073
Init group file
impactmass 0ef424b
create group
impactmass f82956b
Test update
impactmass e82fb99
Considering side effects after group change
impactmass b6b93ef
multi update on groupname
impactmass ee999a9
Updating user after group change
impactmass 1f55590
Simpleschema fix
impactmass 13430c8
Resolve update when group name changes
impactmass 9011584
add combinedroles
impactmass 8d24925
Fix error
impactmass f0cb22c
Init group/addUser
impactmass 951fb0e
Updating user group array and roles
impactmass d997f2a
more error handling on functions
impactmass 448df6f
debug group/adduser
impactmass 005d659
set field to optional
impactmass c547026
Update to remove user
impactmass 71ecdf4
Update to remove user
impactmass 63188cb
Refactoring updates on groups user belongs to
impactmass f688503
Refactoring updates on group name
impactmass 6698d8c
Quick template scaffold to test adding perms to group
impactmass d706316
Connect update method to event
impactmass c263417
Update comments
impactmass 0a54f26
Quickly scaffold component
impactmass 0d8b8fe
Updates from first review
impactmass 2714be1
Adding new values to groups
impactmass 54660d0
Add more fields and uniqueness
impactmass 028faa2
Hopefully final fixes
impactmass ff20eea
Track with id
impactmass 4300863
added accounts holder for table
rhenshaw56 77f81b7
added table styles
rhenshaw56 821654d
added deafault style layout for table items
rhenshaw56 d797c9b
added account-list-item header bar for each table
rhenshaw56 6e69bc5
created accounts table to hold table data
rhenshaw56 5a5dd45
fixed eslint style violations
rhenshaw56 5dd893a
added gravatar to accounts table
rhenshaw56 0cbd6da
Switch use of Roles to R.haspermission
impactmass 06936e5
Add tests for createGroup and addUser
impactmass c16dc33
updated added function to get user details on table
rhenshaw56 ae7b09b
created component for rendering dynamic data
rhenshaw56 e6cfdb5
restyled table component
rhenshaw56 13259bf
styles for updated table component (will be refactored)
rhenshaw56 ef8f951
styles for updated table component (will be refactored)
rhenshaw56 bcfdffd
Update tests and change _id to groupId
impactmass 14276f8
Change to object-type schema
impactmass ae56444
Update tests to match schema
impactmass 407c428
Modify and add test for updateGroup
impactmass 0b10d3c
Merge branch 'marketplace' into seun-create-groups-2184
impactmass fde269b
Remove un-needed ui stuffs
impactmass a81ddb3
Cleanup
impactmass 1e3702e
updating latest changes
rhenshaw56 3931e62
Remove done in before and add method to mock
impactmass 4b62ab6
Fixing tests
impactmass 09340b7
Update to test
impactmass 11f38bb
Merge branch 'seun-create-groups-2184' of https://github.com/reaction…
rhenshaw56 63c653c
Refactor
impactmass f9f141d
Test changes after refactor
impactmass 4d71287
Fix lint issue
impactmass 802bdf3
saving changes
rhenshaw56 418fbfd
Merge branch 'seun-create-groups-2184' of https://github.com/reaction…
rhenshaw56 8dee184
Initial switching roles to groups
impactmass 8091822
Remove comment in json
impactmass c691632
Fixes on default customer group
impactmass 5d4bb0b
Default guest grp
impactmass c13c9e4
Fixing tests and changes to groups init
impactmass 8e330ee
one group type per shop
impactmass 72dd5c9
saving changes for testing
rhenshaw56 14e42a2
one group type per shop during init
impactmass 2fe52d5
Merge branch 'seun-change-roles-group' of https://github.com/reaction…
rhenshaw56 a987763
saving updated changes after adding groups collection
rhenshaw56 e3e6e26
moved files around
rhenshaw56 1ec098c
implemented groups settings side-bar with permissions
rhenshaw56 2e61906
fixed console errors
rhenshaw56 5cb1e3d
saving changes to implement the owners tab
rhenshaw56 691b653
commented out old accounts/dashboard section
rhenshaw56 c2a8027
made ui responsive to screen-width
rhenshaw56 ab9c2cf
removed SourceSansPro font
rhenshaw56 470c653
* customized dropdown menu
rhenshaw56 5b73681
upgraded dependencies
rhenshaw56 74b49a3
updated local branch with latest marketplace
rhenshaw56 1d8f607
File name changes and indentation fixes
impactmass b97eb99
Subscribe before fetch
impactmass 5a596aa
added shop owner's details and moved getGravatar function to helpers
rhenshaw56 6097b6a
resolved conflicts after pull
rhenshaw56 d7bfcec
Modify data passed to table
impactmass 715f9c2
removed in-line styles
rhenshaw56 8366124
Show account details in cells
impactmass 3c13b69
Fix dropdown
impactmass 792aab9
added form functionality for sending invites
rhenshaw56 816a1a7
Merge branch 'rowland-accounts-react-conversion-2184' of https://gith…
rhenshaw56 c389c32
restyled table borders
rhenshaw56 29021ad
Fix dropdown actions; admin account pub
impactmass fde6334
Merge branch origin into rowland-accounts-react-conversion-2184
impactmass f7f817d
fixed proptype validation
rhenshaw56 d939e62
Button status, show existing templates
impactmass 1e68a23
Show owner group first
impactmass 15ef1d4
Avatar, Prune css
impactmass d862757
Click on group header, open actionview
impactmass 96e4ec3
Render form, move container
impactmass 75509ed
Remove written html, use rui components, init AddGroupMembers
impactmass ab02b42
Setup addGroupMember box
impactmass e0035aa
Replace list component with sortable in addAdminOwner module
impactmass 4e3feec
Init editGroup module
impactmass 312d1ae
Init packagelist comp for editgroups
impactmass 948d290
Group packages
impactmass 6c48e4e
Remove 2factor div
impactmass aa93792
Move functions; remove un-used code
impactmass 15d64a6
Fixing pkgs list switch
impactmass 40e8174
Switch on click group heading
impactmass d211fcd
Capitalize title
impactmass d2da9fa
Add selected state
impactmass de12bf8
Add togglePermission & call method on toggle
impactmass 9c01e65
Extra margin on empty table
impactmass 487b5ff
Use pencil icon for edits
impactmass aaac534
Init new group form
impactmass c0a4da2
Click fixes, stop propagation on edit
impactmass 17a34bb
Modify PermissionsList comp to save with container func
impactmass dcb4757
Fix update perm
impactmass 0acd094
Get only admin groups
impactmass 818277e
Change fetching of admins
impactmass 9c5a0ef
Once saved switch to update mode
impactmass 2d9ebf5
Fix list toggling
impactmass 48af05a
Prune un-used code
impactmass 3270980
i18n
impactmass 696db92
Use React Alert comp
impactmass 5cbe710
Replace import
impactmass 97d36c8
Resolve lint issue
impactmass c0c031a
Merge branch 'marketplace' into rowland-accounts-react-conversion-2184
impactmass 3f0b8aa
Fix alert error mesage passed to Translation
impactmass f0f46a8
Fix alert disappearing and error display
impactmass f8be4cd
Remove duplicates
impactmass 4d3748e
i18n
impactmass 5bc3f55
Update test
impactmass 57e3c2c
Pull component out of Blaze template
impactmass 5bc4010
Fix test
impactmass 32f1c66
Redo Permissions update
impactmass d6f672b
Set active group
impactmass 360f68f
Update child data
impactmass f641194
Remove console
impactmass f0ddbd3
Change accounts publication to only publish users that are not in the…
spencern f1b82e4
check for admin permissions for the shopId of the group a user is bei…
spencern 1f7f8de
Remove commented code, and update permissions check
impactmass 5ae737d
Fix linting error by removing unused lodash import
spencern 6a6f495
Refactor components and containers
impactmass c87490c
Merge branch origin into rowland-accounts-react-conversion-2184
impactmass 643b059
Add class to divs
impactmass 55fdf71
Ensure arrow-parens on all funcs
impactmass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 2 additions & 39 deletions
41
client/modules/accounts/templates/dashboard/dashboard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
91 changes: 91 additions & 0 deletions
91
imports/plugins/core/accounts/client/components/accountsDashboard.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React, { Component } from "react"; | ||
import PropTypes from "prop-types"; | ||
import AccountsTable from "./accountsTable"; | ||
import AccountsManageContainer from "../containers/accountsManageContainer"; | ||
|
||
class AccountsDashboard extends Component { | ||
static propTypes = { | ||
accounts: PropTypes.array, | ||
groups: PropTypes.array | ||
}; | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
accounts: props.accounts, | ||
groups: props.groups, | ||
showSideBar: false, | ||
selectedGroup: {} | ||
}; | ||
} | ||
|
||
componentWillReceiveProps(nextProps) { | ||
const { groups, accounts } = nextProps; | ||
const selectedGroup = groups.find(grp => grp._id === (this.state.selectedGroup || {})._id); | ||
this.setState({ groups, accounts, selectedGroup }); | ||
} | ||
|
||
handleGroupSelect = group => { | ||
this.setState({ showSideBar: true, selectedGroup: group }); | ||
}; | ||
|
||
tableClassName() { | ||
if (this.state.showSideBar) { | ||
return "col-md-9"; | ||
} | ||
return "col-md-12"; | ||
} | ||
|
||
detailDivClassName() { | ||
if (this.state.showSideBar) { | ||
return "col-md-3"; | ||
} | ||
return "hide"; | ||
} | ||
|
||
renderGroupDetail = () => { | ||
if (this.state.showSideBar) { | ||
const { groups, accounts } = this.state; | ||
return ( | ||
<AccountsManageContainer | ||
className="accounts-manage-container" | ||
group={this.state.selectedGroup} | ||
groups={groups} | ||
accounts={accounts} | ||
onChangeGroup={this.handleGroupSelect} | ||
/> | ||
); | ||
} | ||
return null; | ||
}; | ||
|
||
renderGroupsTable(groups) { | ||
if (Array.isArray(groups)) { | ||
return groups.map((group, index) => { | ||
return ( | ||
<div key={index}> | ||
<AccountsTable group={group} onGroupSelect={this.handleGroupSelect} {...this.props} /> | ||
</div> | ||
); | ||
}); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="row list-group accounts-table"> | ||
<div className={this.tableClassName()}> | ||
{this.renderGroupsTable(this.state.groups)} | ||
</div> | ||
<div className={this.detailDivClassName()}> | ||
{this.renderGroupDetail()} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default AccountsDashboard; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
<div>
necessary? you can addkey
to the<AccountsTable />
. If it necessary, put aclassName
on it likerui accounts-table-container
or something appropriate.