Skip to content

Commit

Permalink
#473 no account ids in edit app form
Browse files Browse the repository at this point in the history
  • Loading branch information
prayerslayer committed Jun 17, 2016
1 parent c5fc5d5 commit 36045f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions client/lib/application/src/router.react.jsx
Expand Up @@ -206,10 +206,9 @@ class EditAppFormHandler extends React.Component {

render() {
const {applicationId} = this.props.params,
userAccounts = this.props.userStore.getUserCloudAccounts().map(a => a.name),
userTeams = this.props.userStore.getUserTeams().map(t => t.id),
accountsAndTeams = new Set(userAccounts.concat(userTeams)),
application = this.props.kioStore.getApplication(applicationId),
teamsAndPreviousValue = new Set([...userTeams, application.team_id]),
applicationIds = this.props.kioStore.getApplications().map(a => a.id);

return <ApplicationForm
Expand All @@ -219,7 +218,7 @@ class EditAppFormHandler extends React.Component {
kioActions={KIO_ACTIONS}
application={application}
applicationIds={applicationIds}
userTeams={[...accountsAndTeams]} />
userTeams={[...teamsAndPreviousValue].sort()} />
}
}
EditAppFormHandler.isAllowed = function(routerState, state, [hasAuth]) {
Expand All @@ -239,8 +238,7 @@ EditAppFormHandler.fetchData = function(routerState, state) {
return KIO_ACTIONS.fetchApplication(routerState.params.applicationId)
.then(app => Promise.all([
requireAuth(state, app.team_id, MAGNIFICENT_ACTIONS),
requireTeams(state, USER_ACTIONS),
requireAccounts(state, USER_ACTIONS)
requireTeams(state, USER_ACTIONS)
]));
};
var ConnectedEditAppFormHandler =
Expand Down
2 changes: 1 addition & 1 deletion server/mocks/5000-kio.js
Expand Up @@ -16,7 +16,7 @@ var applications = {
subtitle: 'STUPS application registry',
name: 'Kio',
active: true,
team_id: 'stups',
team_id: 'stups-test',
id: 'kio',
required_approvers: 2,
criticality_level: 3,
Expand Down

0 comments on commit 36045f8

Please sign in to comment.