mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 14:10:04 +02:00
Merge branch 'master' of github.com:yldio/joyent-dashboard
This commit is contained in:
commit
db952ce95e
@ -14,7 +14,7 @@ const buttonStyle = {
|
|||||||
const People = (props) => {
|
const People = (props) => {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
orgUI = {},
|
UI = {},
|
||||||
handleToggle,
|
handleToggle,
|
||||||
people
|
people
|
||||||
} = props;
|
} = props;
|
||||||
@ -24,7 +24,7 @@ const People = (props) => {
|
|||||||
<Row>
|
<Row>
|
||||||
<Column smOffset={9} xs={2}>
|
<Column smOffset={9} xs={2}>
|
||||||
<Button
|
<Button
|
||||||
disabled={orgUI.invite_toggled}
|
disabled={UI.invite_toggled}
|
||||||
onClick={handleToggle}
|
onClick={handleToggle}
|
||||||
style={buttonStyle}
|
style={buttonStyle}
|
||||||
>
|
>
|
||||||
@ -33,7 +33,7 @@ const People = (props) => {
|
|||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{orgUI.invite_toggled ? <Invite {...props} /> : null}
|
{UI.invite_toggled ? <Invite {...props} /> : null}
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Column xs={12}>
|
<Column xs={12}>
|
||||||
@ -47,9 +47,9 @@ const People = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
People.propTypes = {
|
People.propTypes = {
|
||||||
|
UI: React.PropTypes.object,
|
||||||
handleToggle: React.PropTypes.func,
|
handleToggle: React.PropTypes.func,
|
||||||
orgUI: React.PropTypes.object,
|
people: React.PropTypes.array,
|
||||||
people: React.PropTypes.array
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = People;
|
module.exports = People;
|
@ -14,9 +14,9 @@ const PeopleTable = (props) => {
|
|||||||
handleStatusTooltip,
|
handleStatusTooltip,
|
||||||
handleMemberUpdate,
|
handleMemberUpdate,
|
||||||
people = [],
|
people = [],
|
||||||
orgUI = {},
|
parentIndex,
|
||||||
orgIndex,
|
removeMember,
|
||||||
removeMember
|
UI = {},
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const columns = [{
|
const columns = [{
|
||||||
@ -41,11 +41,11 @@ const PeopleTable = (props) => {
|
|||||||
<PersonStatus
|
<PersonStatus
|
||||||
handleMemberUpdate={handleMemberUpdate}
|
handleMemberUpdate={handleMemberUpdate}
|
||||||
handleStatusTooltip={handleStatusTooltip}
|
handleStatusTooltip={handleStatusTooltip}
|
||||||
membersStatusOptions={orgUI.members_status}
|
membersStatusOptions={UI.members_status}
|
||||||
orgIndex={orgIndex}
|
parentIndex={parentIndex}
|
||||||
person={person}
|
person={person}
|
||||||
personIndex={index}
|
personIndex={index}
|
||||||
toggledID={orgUI.member_status_tooltip}
|
toggledID={UI.member_status_tooltip}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -53,17 +53,17 @@ const PeopleTable = (props) => {
|
|||||||
<PersonRole
|
<PersonRole
|
||||||
handleMemberUpdate={handleMemberUpdate}
|
handleMemberUpdate={handleMemberUpdate}
|
||||||
handleRoleTooltip={handleRoleTooltip}
|
handleRoleTooltip={handleRoleTooltip}
|
||||||
membersRolesOptions={orgUI.members_roles}
|
membersRolesOptions={UI.members_roles}
|
||||||
orgIndex={orgIndex}
|
parentIndex={parentIndex}
|
||||||
person={person}
|
person={person}
|
||||||
personIndex={index}
|
personIndex={index}
|
||||||
toggledID={orgUI.member_role_tooltip}
|
toggledID={UI.member_role_tooltip}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
const remove = (person) => (
|
const remove = (person) => (
|
||||||
<PersonDelete
|
<PersonDelete
|
||||||
orgIndex={orgIndex}
|
parentIndex={parentIndex}
|
||||||
personIndex={index}
|
personIndex={index}
|
||||||
removeMember={removeMember}
|
removeMember={removeMember}
|
||||||
/>
|
/>
|
||||||
@ -87,11 +87,11 @@ const PeopleTable = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PeopleTable.propTypes = {
|
PeopleTable.propTypes = {
|
||||||
|
UI: React.PropTypes.object,
|
||||||
handleMemberUpdate: React.PropTypes.func,
|
handleMemberUpdate: React.PropTypes.func,
|
||||||
handleRoleTooltip: React.PropTypes.func,
|
handleRoleTooltip: React.PropTypes.func,
|
||||||
handleStatusTooltip: React.PropTypes.func,
|
handleStatusTooltip: React.PropTypes.func,
|
||||||
orgIndex: React.PropTypes.number,
|
parentIndex: React.PropTypes.number,
|
||||||
orgUI: React.PropTypes.object,
|
|
||||||
people: React.PropTypes.array,
|
people: React.PropTypes.array,
|
||||||
removeMember: React.PropTypes.func,
|
removeMember: React.PropTypes.func,
|
||||||
};
|
};
|
||||||
|
@ -18,13 +18,13 @@ const PersonDelete = (props) => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
personIndex,
|
personIndex,
|
||||||
orgIndex,
|
parentIndex,
|
||||||
removeMember
|
removeMember
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const _onClick = () => removeMember({
|
const _onClick = () => removeMember({
|
||||||
personIndex,
|
personIndex,
|
||||||
orgIndex
|
parentIndex
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -35,7 +35,7 @@ const PersonDelete = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PersonDelete.propTypes = {
|
PersonDelete.propTypes = {
|
||||||
orgIndex: React.PropTypes.number,
|
parentIndex: React.PropTypes.number,
|
||||||
personIndex: React.PropTypes.number,
|
personIndex: React.PropTypes.number,
|
||||||
removeMember: React.PropTypes.func,
|
removeMember: React.PropTypes.func,
|
||||||
};
|
};
|
||||||
|
@ -57,7 +57,7 @@ const PersonRole = (props) => {
|
|||||||
personIndex,
|
personIndex,
|
||||||
handleRoleTooltip,
|
handleRoleTooltip,
|
||||||
handleMemberUpdate,
|
handleMemberUpdate,
|
||||||
orgIndex
|
parentIndex
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const toggled = toggledID === person.uuid;
|
const toggled = toggledID === person.uuid;
|
||||||
@ -82,7 +82,7 @@ const PersonRole = (props) => {
|
|||||||
? <Tooltip
|
? <Tooltip
|
||||||
handleSelect={handleOptionSelect}
|
handleSelect={handleOptionSelect}
|
||||||
options={membersRolesOptions}
|
options={membersRolesOptions}
|
||||||
orgIndex={orgIndex}
|
parentIndex={parentIndex}
|
||||||
person={_person}
|
person={_person}
|
||||||
personAttr="role"
|
personAttr="role"
|
||||||
personIndex={personIndex}
|
personIndex={personIndex}
|
||||||
@ -96,7 +96,7 @@ PersonRole.propTypes = {
|
|||||||
handleMemberUpdate: React.PropTypes.func,
|
handleMemberUpdate: React.PropTypes.func,
|
||||||
handleRoleTooltip: React.PropTypes.func,
|
handleRoleTooltip: React.PropTypes.func,
|
||||||
membersRolesOptions: React.PropTypes.array,
|
membersRolesOptions: React.PropTypes.array,
|
||||||
orgIndex: React.PropTypes.number,
|
parentIndex: React.PropTypes.number,
|
||||||
person: React.PropTypes.object,
|
person: React.PropTypes.object,
|
||||||
personIndex: React.PropTypes.number,
|
personIndex: React.PropTypes.number,
|
||||||
toggledID: React.PropTypes.oneOfType([
|
toggledID: React.PropTypes.oneOfType([
|
||||||
|
@ -57,7 +57,7 @@ const PersonStatus = (props) => {
|
|||||||
personIndex,
|
personIndex,
|
||||||
handleStatusTooltip,
|
handleStatusTooltip,
|
||||||
handleMemberUpdate,
|
handleMemberUpdate,
|
||||||
orgIndex
|
parentIndex
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const toggled = toggledID === person.uuid;
|
const toggled = toggledID === person.uuid;
|
||||||
@ -82,7 +82,7 @@ const PersonStatus = (props) => {
|
|||||||
? <Tooltip
|
? <Tooltip
|
||||||
handleSelect={handleOptionSelect}
|
handleSelect={handleOptionSelect}
|
||||||
options={membersStatusOptions}
|
options={membersStatusOptions}
|
||||||
orgIndex={orgIndex}
|
parentIndex={parentIndex}
|
||||||
person={_person}
|
person={_person}
|
||||||
personAttr="status"
|
personAttr="status"
|
||||||
personIndex={personIndex}
|
personIndex={personIndex}
|
||||||
@ -96,7 +96,7 @@ PersonStatus.propTypes = {
|
|||||||
handleMemberUpdate: React.PropTypes.func,
|
handleMemberUpdate: React.PropTypes.func,
|
||||||
handleStatusTooltip: React.PropTypes.func,
|
handleStatusTooltip: React.PropTypes.func,
|
||||||
membersStatusOptions: React.PropTypes.array,
|
membersStatusOptions: React.PropTypes.array,
|
||||||
orgIndex: React.PropTypes.number,
|
parentIndex: React.PropTypes.number,
|
||||||
person: React.PropTypes.object,
|
person: React.PropTypes.object,
|
||||||
personIndex: React.PropTypes.number,
|
personIndex: React.PropTypes.number,
|
||||||
toggledID: React.PropTypes.oneOfType([
|
toggledID: React.PropTypes.oneOfType([
|
||||||
|
@ -20,7 +20,7 @@ module.exports = ({
|
|||||||
personAttr,
|
personAttr,
|
||||||
personIndex,
|
personIndex,
|
||||||
options = [],
|
options = [],
|
||||||
orgIndex,
|
parentIndex,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const _options = options.map( (option, i) => {
|
const _options = options.map( (option, i) => {
|
||||||
@ -33,7 +33,7 @@ module.exports = ({
|
|||||||
[`${personAttr}`]: option
|
[`${personAttr}`]: option
|
||||||
},
|
},
|
||||||
personIndex,
|
personIndex,
|
||||||
orgIndex,
|
parentIndex,
|
||||||
};
|
};
|
||||||
|
|
||||||
const _onClick = () => handleSelect(payload);
|
const _onClick = () => handleSelect(payload);
|
||||||
@ -64,7 +64,7 @@ module.exports = ({
|
|||||||
module.exports.propTypes = {
|
module.exports.propTypes = {
|
||||||
handleSelect: React.PropTypes.func,
|
handleSelect: React.PropTypes.func,
|
||||||
options: React.PropTypes.array,
|
options: React.PropTypes.array,
|
||||||
orgIndex: React.PropTypes.number,
|
parentIndex: React.PropTypes.number,
|
||||||
person: React.PropTypes.object,
|
person: React.PropTypes.object,
|
||||||
personAttr: React.PropTypes.string,
|
personAttr: React.PropTypes.string,
|
||||||
personIndex: React.PropTypes.number,
|
personIndex: React.PropTypes.number,
|
||||||
|
@ -37,8 +37,8 @@ const mapStateToProps = (state, {
|
|||||||
params = {}
|
params = {}
|
||||||
}) => ({
|
}) => ({
|
||||||
people: peopleByOrgIdSelector(params.org)(state),
|
people: peopleByOrgIdSelector(params.org)(state),
|
||||||
orgUI: orgUISelector(state),
|
UI: orgUISelector(state),
|
||||||
orgIndex: orgIndexSelector(params.org)(state),
|
parentIndex: orgIndexSelector(params.org)(state),
|
||||||
platformMembers: membersSelector(state)
|
platformMembers: membersSelector(state)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -50,11 +50,10 @@ module.exports = handleActions({
|
|||||||
},
|
},
|
||||||
[handleMemberUpdate.toString()]: (state, action) => {
|
[handleMemberUpdate.toString()]: (state, action) => {
|
||||||
const {
|
const {
|
||||||
orgIndex,
|
parentIndex,
|
||||||
person,
|
person,
|
||||||
personIndex,
|
personIndex,
|
||||||
} = action.payload;
|
} = action.payload;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
ui: {
|
ui: {
|
||||||
@ -63,39 +62,39 @@ module.exports = handleActions({
|
|||||||
member_role_tooltip: false
|
member_role_tooltip: false
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
...state.data.slice(0, orgIndex),
|
...state.data.slice(0, parentIndex),
|
||||||
{
|
{
|
||||||
...state.data[orgIndex],
|
...state.data[parentIndex],
|
||||||
members: [
|
members: [
|
||||||
...state.data[orgIndex].members.slice(0, personIndex),
|
...state.data[parentIndex].members.slice(0, personIndex),
|
||||||
{
|
{
|
||||||
...person,
|
...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) => {
|
[removeMember.toString()]: (state, action) => {
|
||||||
const {
|
const {
|
||||||
orgIndex,
|
parentIndex,
|
||||||
personIndex,
|
personIndex,
|
||||||
} = action.payload;
|
} = action.payload;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
data: [
|
data: [
|
||||||
...state.data.slice(0, orgIndex),
|
...state.data.slice(0, parentIndex),
|
||||||
{
|
{
|
||||||
...state.data[orgIndex],
|
...state.data[parentIndex],
|
||||||
members: [
|
members: [
|
||||||
...state.data[orgIndex].members.slice(0, personIndex),
|
...state.data[parentIndex].members.slice(0, personIndex),
|
||||||
...state.data[orgIndex].members.slice(personIndex + 1)
|
...state.data[parentIndex].members.slice(personIndex + 1)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
...state.data.slice(orgIndex + 1),
|
...state.data.slice(parentIndex + 1),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,7 @@ const React = require('react');
|
|||||||
const Avatar = require('ui/table');
|
const Avatar = require('ui/table');
|
||||||
|
|
||||||
const columns = [{
|
const columns = [{
|
||||||
title: 'Memeber',
|
title: 'Member',
|
||||||
dataID: 'member',
|
dataID: 'member',
|
||||||
dataKey: 'member',
|
dataKey: 'member',
|
||||||
width: ''
|
width: ''
|
||||||
|
Loading…
Reference in New Issue
Block a user