Skip to content

Commit

Permalink
chore(teams): updates
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Mar 27, 2019
1 parent ac3fe81 commit b1f3452
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 160 deletions.
9 changes: 6 additions & 3 deletions src/client/components/CardList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ class CardList extends React.Component {
}

render () {
const { header, children } = this.props
const { header, headerRightComponent, children, extraClass } = this.props
return (
<div className={'md-card-list-wrapper'}>
<div className={'md-card-list-wrapper' + (extraClass ? ' ' + extraClass : '')}>
<div className={'md-card-list'}>
{header && <div className={'md-card-list-header heading_list'}>{header}</div>}
{headerRightComponent && <div className={'md-card-list-header-right'}>{headerRightComponent}</div>}
<ul className={'hierarchical_slide'} data-delay='100ms'>
{children}
</ul>
Expand All @@ -39,7 +40,9 @@ class CardList extends React.Component {

CardList.propTypes = {
header: PropTypes.string,
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
headerRightComponent: PropTypes.element,
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
extraClass: PropTypes.string
}

export default CardList
16 changes: 9 additions & 7 deletions src/client/components/Nav/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ class Sidebar extends React.Component {
{sessionUser && Helpers.canUser('teams:view') && (
<SidebarItem text='Teams' icon='wc' href='/teams' class='navTeams' active={activeItem === 'teams'} />
)}
<SidebarItem
text='Departments'
icon='domain'
href='/departments'
class='navTeams'
active={activeItem === 'departments'}
/>
{sessionUser && Helpers.canUser('departments:view') && (
<SidebarItem
text='Departments'
icon='domain'
href='/departments'
class='navTeams'
active={activeItem === 'departments'}
/>
)}
{sessionUser && Helpers.canUser('reports:view') && (
<SidebarItem
text='Reports'
Expand Down
26 changes: 18 additions & 8 deletions src/client/containers/Settings/Permissions/permissionBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ class PermissionBody extends React.Component {
@observable ticketGrants = defaultGrants()
@observable commentGrants = defaultGrants()
@observable accountGrants = defaultGrants()
@observable teamGrants = defaultGrants()
@observable groupGrants = defaultGrants()
@observable teamGrants = defaultGrants()
@observable departmentGrants = defaultGrants()
@observable reportGrants = defaultGrants()
@observable noticeGrants = defaultGrants()
Expand Down Expand Up @@ -85,9 +86,10 @@ class PermissionBody extends React.Component {
if (parsedGrants.accounts && !isEqual(parsedGrants.accounts, this.accountGrants))
this.accountGrants = parsedGrants.accounts
if (parsedGrants.teams && !isEqual(parsedGrants.teams, this.teamGrants)) this.teamGrants = parsedGrants.teams
if (parsedGrants.groups && !isEqual(parsedGrants.groups, this.groupGrants)) this.groupGrants = parsedGrants.groups
if (parsedGrants.teams && !isEqual(parsedGrants.teams, this.teamGrants)) this.teamGrants = parsedGrants.teams
if (parsedGrants.departments && !isEqual(parsedGrants.departments, this.departmentGrants))
this.departmentGrants = parsedGrants.departments
if (parsedGrants.reports && !isEqual(parsedGrants.reports, this.reportGrants))
this.reportGrants = parsedGrants.reports
Expand Down Expand Up @@ -126,8 +128,9 @@ class PermissionBody extends React.Component {
obj.tickets = PermissionBody.buildPermArray(this.ticketPermGroup)
obj.comments = PermissionBody.buildPermArray(this.commentPermGroup)
obj.accounts = PermissionBody.buildPermArray(this.accountPermGroup)
obj.teams = PermissionBody.buildPermArray(this.teamPermGroup)
obj.groups = PermissionBody.buildPermArray(this.groupPermGroup)
obj.teams = PermissionBody.buildPermArray(this.teamPermGroup)
obj.departments = PermissionBody.buildPermArray(this.departmentPermGroup)
obj.reports = PermissionBody.buildPermArray(this.reportPermGroup)
obj.notices = PermissionBody.buildPermArray(this.noticePermGroup)

Expand Down Expand Up @@ -218,6 +221,13 @@ class PermissionBody extends React.Component {
grants={this.accountGrants}
subtitle={'Account Permissions'}
/>
<PermissionGroupPartial
ref={i => (this.groupPermGroup = i)}
title={'Groups'}
role={this.props.role}
grants={this.groupGrants}
subtitle={'Group Permissions'}
/>
<PermissionGroupPartial
ref={i => (this.teamPermGroup = i)}
title={'Teams'}
Expand All @@ -226,11 +236,11 @@ class PermissionBody extends React.Component {
subtitle={'Team Permissions'}
/>
<PermissionGroupPartial
ref={i => (this.groupPermGroup = i)}
title={'Groups'}
ref={i => (this.departmentPermGroup = i)}
title={'Departments'}
role={this.props.role}
grants={this.groupGrants}
subtitle={'Group Permissions'}
grants={this.departmentGrants}
subtitle={'Department Permissions'}
/>
<PermissionGroupPartial
ref={i => (this.reportPermGroup = i)}
Expand Down
150 changes: 80 additions & 70 deletions src/client/containers/Settings/Tickets/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,83 +359,93 @@ class TicketsSettings extends React.Component {
}
footer={<ul id={'tagPagination'} className={'uk-pagination'} />}
>
<Grid extraClass={'zone uk-margin-medium-bottom'}>
<Grid extraClass={'uk-margin-medium-bottom'}>
{this.props.tagsSettings.tags.size < 1 && (
<div style={{ width: '100%', padding: '55px', textAlign: 'center' }}>
<h3 style={{ fontSize: '24px', fontWeight: '300' }}>No Tags Found</h3>
</div>
)}
<SpinLoader active={this.props.tagsSettings.loading} extraClass={'panel-bg'} />
{this.props.tagsSettings.tags.map(i => {
return (
<GridItem width={'1-2'} key={i.get('_id')} extraClass={'tag-wrapper br bb'}>
<Grid extraClass={'view-tag'}>
<GridItem width={'1-1'}>
<ZoneBox>
<Grid>
<GridItem width={'1-2'}>
<h5
style={{ fontSize: '16px', lineHeight: '31px', margin: 0, padding: 0, fontWeight: 300 }}
>
{i.get('name')}
</h5>
</GridItem>
<GridItem width={'1-2'} extraClass={'uk-text-right'}>
<ButtonGroup classNames={'mt-5'}>
<Button
text={'edit'}
flat={true}
waves={true}
small={true}
onClick={e => TicketsSettings.toggleEditTag(e)}
/>
<Button
text={'remove'}
flat={true}
waves={true}
style={'danger'}
small={true}
onClick={e => this.onRemoveTagClicked(e, i)}
/>
</ButtonGroup>
</GridItem>
</Grid>
</ZoneBox>
</GridItem>
</Grid>
<Grid extraClass={'edit-tag z-box uk-clearfix nbt hide'} style={{ paddingTop: '5px' }}>
<GridItem width={'1-1'}>
<form onSubmit={e => this.onSubmitUpdateTag(e, i.get('_id'))}>
<Grid>
<GridItem width={'2-3'}>
<input type='text' className={'md-input'} name={'name'} defaultValue={i.get('name')} />
</GridItem>
<GridItem width={'1-3'} style={{ paddingTop: '10px' }}>
<ButtonGroup classNames={'uk-float-right uk-text-right'}>
<Button
text={'cancel'}
flat={true}
waves={true}
small={true}
onClick={e => TicketsSettings.toggleEditTag(e)}
/>
<Button
type={'submit'}
text={'save'}
flat={true}
waves={true}
small={true}
style={'success'}
/>
</ButtonGroup>
</GridItem>
</Grid>
</form>
<GridItem width={'1-1'}>
<Grid extraClass={'zone ml-0'}>
{this.props.tagsSettings.tags.map(i => {
return (
<GridItem width={'1-2'} key={i.get('_id')} extraClass={'tag-wrapper br bb'}>
<Grid extraClass={'view-tag'}>
<GridItem width={'1-1'}>
<ZoneBox>
<Grid>
<GridItem width={'1-2'}>
<h5
style={{
fontSize: '16px',
lineHeight: '31px',
margin: 0,
padding: 0,
fontWeight: 300
}}
>
{i.get('name')}
</h5>
</GridItem>
<GridItem width={'1-2'} extraClass={'uk-text-right'}>
<ButtonGroup classNames={'mt-5'}>
<Button
text={'edit'}
flat={true}
waves={true}
small={true}
onClick={e => TicketsSettings.toggleEditTag(e)}
/>
<Button
text={'remove'}
flat={true}
waves={true}
style={'danger'}
small={true}
onClick={e => this.onRemoveTagClicked(e, i)}
/>
</ButtonGroup>
</GridItem>
</Grid>
</ZoneBox>
</GridItem>
</Grid>
<Grid extraClass={'edit-tag z-box uk-clearfix nbt hide'} style={{ paddingTop: '5px' }}>
<GridItem width={'1-1'}>
<form onSubmit={e => this.onSubmitUpdateTag(e, i.get('_id'))}>
<Grid>
<GridItem width={'2-3'}>
<input type='text' className={'md-input'} name={'name'} defaultValue={i.get('name')} />
</GridItem>
<GridItem width={'1-3'} style={{ paddingTop: '10px' }}>
<ButtonGroup classNames={'uk-float-right uk-text-right'}>
<Button
text={'cancel'}
flat={true}
waves={true}
small={true}
onClick={e => TicketsSettings.toggleEditTag(e)}
/>
<Button
type={'submit'}
text={'save'}
flat={true}
waves={true}
small={true}
style={'success'}
/>
</ButtonGroup>
</GridItem>
</Grid>
</form>
</GridItem>
</Grid>
</GridItem>
</Grid>
</GridItem>
)
})}
)
})}
</Grid>
</GridItem>
</Grid>
</SettingItem>
</div>
Expand Down
Loading

0 comments on commit b1f3452

Please sign in to comment.