Skip to content

Commit

Permalink
Merge pull request edp963#413 from shanmengm/master
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
RichardShan committed Sep 10, 2018
2 parents 5176fcb + 13d1923 commit 3430eef
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Davinci面向业务人员/数据工程师/数据分析师/数据科学家,致
注: 默认的日志文件是以日期命名的,如不符合日期要求,可自行修改`config/logback.xml`中的日志模板

```
tail -200f logs/davinci.XXXX.log
tail -200f logs/davinci.XXXX.log
```

* **输入http://localhost:8080,进入davinci登录界面(super@davinci.com/123456)**
Expand Down
25 changes: 15 additions & 10 deletions webapp/app/containers/Projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import saga from './sagas'
import reducer from './reducer'
import reducerOrganization from '../Organizations/reducer'
import sagaOrganization from '../Organizations/sagas'
// import reducerApp from '../App/reducer'
// import sagaApp from '../App/sagas'
import reducerApp from '../App/reducer'
import sagaApp from '../App/sagas'
import {loadOrganizations} from '../Organizations/actions'
import {makeSelectOrganizations} from '../Organizations/selectors'
import {checkNameUniqueAction} from '../App/actions'
Expand Down Expand Up @@ -195,9 +195,14 @@ export class Projects extends React.PureComponent<IProjectsProps, IProjectsState
pic: `${Math.ceil(Math.random() * 19)}`,
config: '{}'
}, () => {
this.hideProjectForm() })
this.props.onLoadProjects()
this.hideProjectForm()
})
} else {
this.props.onEditProject({...values, ...{visibility: !!Number(values.visibility)}, ...{orgId: Number(values.orgId)}}, () => { this.hideProjectForm() })
this.props.onEditProject({...values, ...{visibility: !!Number(values.visibility)}, ...{orgId: Number(values.orgId)}}, () => {
this.props.onLoadProjects()
this.hideProjectForm()
})
}
}
})
Expand Down Expand Up @@ -394,7 +399,7 @@ export class Projects extends React.PureComponent<IProjectsProps, IProjectsState
</Col>
)
}
if (loginUser && loginUser.id !== d.createBy.id) {
if (loginUser && d.createBy && loginUser.id !== d.createBy.id) {
return []
}
if (organizations) {
Expand Down Expand Up @@ -485,7 +490,7 @@ export class Projects extends React.PureComponent<IProjectsProps, IProjectsState
if (d.type && d.type === 'add') {
return []
}
if (loginUser && loginUser.id === d.createBy.id) {
if (loginUser && d.createBy && loginUser.id === d.createBy.id) {
return []
}
if (organizations) {
Expand Down Expand Up @@ -852,14 +857,14 @@ const withSaga = injectSaga({ key: 'project', saga })
const withOrganizationReducer = injectReducer({ key: 'organization', reducer: reducerOrganization })
const withOrganizationSaga = injectSaga({ key: 'organization', saga: sagaOrganization })

// const withAppReducer = injectReducer({key: 'global', reducer: reducerApp})
// const withAppSaga = injectSaga({key: 'global', saga: sagaApp})
const withAppReducer = injectReducer({key: 'global', reducer: reducerApp})
const withAppSaga = injectSaga({key: 'global', saga: sagaApp})

export default compose(
withReducer,
withOrganizationReducer,
// withAppReducer,
// withAppSaga,
withAppReducer,
withAppSaga,
withSaga,
withOrganizationSaga,
withConnect
Expand Down
6 changes: 3 additions & 3 deletions webapp/app/containers/Projects/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ function projectReducer (state = initialState, action) {
case ADD_PROJECT_FAILURE:
return state

case EDIT_PROJECT_SUCCESS:
projects.splice(projects.findIndex((d) => d.id === payload.result.id), 1, payload.result)
return state.set('projects', projects.slice())
// case EDIT_PROJECT_SUCCESS:
// projects.splice(projects.findIndex((d) => d.id === payload.result.id), 1, payload.result)
// return state.set('projects', projects.slice())

case DELETE_PROJECT_SUCCESS:
if (projects) {
Expand Down

0 comments on commit 3430eef

Please sign in to comment.