1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-13 06:40:06 +02:00

Merge branch 'master' of github.com:yldio/joyent-dashboard

This commit is contained in:
Tom Gallacher 2017-01-26 17:21:20 +00:00
commit db952ce95e
9 changed files with 44 additions and 45 deletions

View File

@ -14,7 +14,7 @@ const buttonStyle = {
const People = (props) => {
const {
orgUI = {},
UI = {},
handleToggle,
people
} = props;
@ -24,7 +24,7 @@ const People = (props) => {
<Row>
<Column smOffset={9} xs={2}>
<Button
disabled={orgUI.invite_toggled}
disabled={UI.invite_toggled}
onClick={handleToggle}
style={buttonStyle}
>
@ -33,7 +33,7 @@ const People = (props) => {
</Column>
</Row>
{orgUI.invite_toggled ? <Invite {...props} /> : null}
{UI.invite_toggled ? <Invite {...props} /> : null}
<Row>
<Column xs={12}>
@ -47,9 +47,9 @@ const People = (props) => {
};
People.propTypes = {
UI: React.PropTypes.object,
handleToggle: React.PropTypes.func,
orgUI: React.PropTypes.object,
people: React.PropTypes.array
people: React.PropTypes.array,
};
module.exports = People;

View File

@ -14,9 +14,9 @@ const PeopleTable = (props) => {
handleStatusTooltip,
handleMemberUpdate,
people = [],
orgUI = {},
orgIndex,
removeMember
parentIndex,
removeMember,
UI = {},
} = props;
const columns = [{
@ -41,11 +41,11 @@ const PeopleTable = (props) => {
<PersonStatus
handleMemberUpdate={handleMemberUpdate}
handleStatusTooltip={handleStatusTooltip}
membersStatusOptions={orgUI.members_status}
orgIndex={orgIndex}
membersStatusOptions={UI.members_status}
parentIndex={parentIndex}
person={person}
personIndex={index}
toggledID={orgUI.member_status_tooltip}
toggledID={UI.member_status_tooltip}
/>
);
@ -53,17 +53,17 @@ const PeopleTable = (props) => {
<PersonRole
handleMemberUpdate={handleMemberUpdate}
handleRoleTooltip={handleRoleTooltip}
membersRolesOptions={orgUI.members_roles}
orgIndex={orgIndex}
membersRolesOptions={UI.members_roles}
parentIndex={parentIndex}
person={person}
personIndex={index}
toggledID={orgUI.member_role_tooltip}
toggledID={UI.member_role_tooltip}
/>
);
const remove = (person) => (
<PersonDelete
orgIndex={orgIndex}
parentIndex={parentIndex}
personIndex={index}
removeMember={removeMember}
/>
@ -87,11 +87,11 @@ const PeopleTable = (props) => {
};
PeopleTable.propTypes = {
UI: React.PropTypes.object,
handleMemberUpdate: React.PropTypes.func,
handleRoleTooltip: React.PropTypes.func,
handleStatusTooltip: React.PropTypes.func,
orgIndex: React.PropTypes.number,
orgUI: React.PropTypes.object,
parentIndex: React.PropTypes.number,
people: React.PropTypes.array,
removeMember: React.PropTypes.func,
};

View File

@ -18,13 +18,13 @@ const PersonDelete = (props) => {
const {
personIndex,
orgIndex,
parentIndex,
removeMember
} = props;
const _onClick = () => removeMember({
personIndex,
orgIndex
parentIndex
});
return (
@ -35,7 +35,7 @@ const PersonDelete = (props) => {
};
PersonDelete.propTypes = {
orgIndex: React.PropTypes.number,
parentIndex: React.PropTypes.number,
personIndex: React.PropTypes.number,
removeMember: React.PropTypes.func,
};

View File

@ -57,7 +57,7 @@ const PersonRole = (props) => {
personIndex,
handleRoleTooltip,
handleMemberUpdate,
orgIndex
parentIndex
} = props;
const toggled = toggledID === person.uuid;
@ -82,7 +82,7 @@ const PersonRole = (props) => {
? <Tooltip
handleSelect={handleOptionSelect}
options={membersRolesOptions}
orgIndex={orgIndex}
parentIndex={parentIndex}
person={_person}
personAttr="role"
personIndex={personIndex}
@ -96,7 +96,7 @@ PersonRole.propTypes = {
handleMemberUpdate: React.PropTypes.func,
handleRoleTooltip: React.PropTypes.func,
membersRolesOptions: React.PropTypes.array,
orgIndex: React.PropTypes.number,
parentIndex: React.PropTypes.number,
person: React.PropTypes.object,
personIndex: React.PropTypes.number,
toggledID: React.PropTypes.oneOfType([

View File

@ -57,7 +57,7 @@ const PersonStatus = (props) => {
personIndex,
handleStatusTooltip,
handleMemberUpdate,
orgIndex
parentIndex
} = props;
const toggled = toggledID === person.uuid;
@ -82,7 +82,7 @@ const PersonStatus = (props) => {
? <Tooltip
handleSelect={handleOptionSelect}
options={membersStatusOptions}
orgIndex={orgIndex}
parentIndex={parentIndex}
person={_person}
personAttr="status"
personIndex={personIndex}
@ -96,7 +96,7 @@ PersonStatus.propTypes = {
handleMemberUpdate: React.PropTypes.func,
handleStatusTooltip: React.PropTypes.func,
membersStatusOptions: React.PropTypes.array,
orgIndex: React.PropTypes.number,
parentIndex: React.PropTypes.number,
person: React.PropTypes.object,
personIndex: React.PropTypes.number,
toggledID: React.PropTypes.oneOfType([

View File

@ -20,7 +20,7 @@ module.exports = ({
personAttr,
personIndex,
options = [],
orgIndex,
parentIndex,
}) => {
const _options = options.map( (option, i) => {
@ -33,7 +33,7 @@ module.exports = ({
[`${personAttr}`]: option
},
personIndex,
orgIndex,
parentIndex,
};
const _onClick = () => handleSelect(payload);
@ -64,7 +64,7 @@ module.exports = ({
module.exports.propTypes = {
handleSelect: React.PropTypes.func,
options: React.PropTypes.array,
orgIndex: React.PropTypes.number,
parentIndex: React.PropTypes.number,
person: React.PropTypes.object,
personAttr: React.PropTypes.string,
personIndex: React.PropTypes.number,

View File

@ -37,8 +37,8 @@ const mapStateToProps = (state, {
params = {}
}) => ({
people: peopleByOrgIdSelector(params.org)(state),
orgUI: orgUISelector(state),
orgIndex: orgIndexSelector(params.org)(state),
UI: orgUISelector(state),
parentIndex: orgIndexSelector(params.org)(state),
platformMembers: membersSelector(state)
});

View File

@ -50,11 +50,10 @@ module.exports = handleActions({
},
[handleMemberUpdate.toString()]: (state, action) => {
const {
orgIndex,
parentIndex,
person,
personIndex,
} = action.payload;
return {
...state,
ui: {
@ -63,39 +62,39 @@ module.exports = handleActions({
member_role_tooltip: false
},
data: [
...state.data.slice(0, orgIndex),
...state.data.slice(0, parentIndex),
{
...state.data[orgIndex],
...state.data[parentIndex],
members: [
...state.data[orgIndex].members.slice(0, personIndex),
...state.data[parentIndex].members.slice(0, personIndex),
{
...person,
},
...state.data[orgIndex].members.slice(personIndex + 1)
...state.data[parentIndex].members.slice(personIndex + 1)
]
},
...state.data.slice(orgIndex + 1),
...state.data.slice(parentIndex + 1),
]
};
},
[removeMember.toString()]: (state, action) => {
const {
orgIndex,
parentIndex,
personIndex,
} = action.payload;
return {
...state,
data: [
...state.data.slice(0, orgIndex),
...state.data.slice(0, parentIndex),
{
...state.data[orgIndex],
...state.data[parentIndex],
members: [
...state.data[orgIndex].members.slice(0, personIndex),
...state.data[orgIndex].members.slice(personIndex + 1)
...state.data[parentIndex].members.slice(0, personIndex),
...state.data[parentIndex].members.slice(personIndex + 1)
]
},
...state.data.slice(orgIndex + 1),
...state.data.slice(parentIndex + 1),
]
};
},

View File

@ -29,7 +29,7 @@ const React = require('react');
const Avatar = require('ui/table');
const columns = [{
title: 'Memeber',
title: 'Member',
dataID: 'member',
dataKey: 'member',
width: ''