Skip to content

Commit

Permalink
pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfyWin committed May 13, 2024
1 parent 37790e0 commit 5c943d7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const CourseCreationComponent = (props) =>
path={[{
type: LINK_BUTTON,
label: trans('catalog', {}, 'cursus'),
target: props.path + '/catalog'
target: props.path,
displayed: 'desktop' === props.contextType
}, {
type: LINK_BUTTON,
label: trans('new_course', {}, 'cursus'),
Expand All @@ -30,13 +31,13 @@ const CourseCreationComponent = (props) =>
type: LINK_BUTTON,
icon: 'fa fa-fw fa-plus',
label: trans('add_course', {}, 'cursus'),
target: `${props.path}/catalog/new`,
target: props.path,
group: trans('management'),
primary: true
}]}
>
<CourseForm
path={props.path + '/catalog'}
path={props.path}
name={selectors.FORM_NAME}
/>
</ToolPage>
Expand All @@ -48,7 +49,8 @@ CourseCreationComponent.propTypes = {
const CourseCreation = connect(
(state) => ({
path: toolSelectors.path(state),
course: formSelectors.data(formSelectors.form(state, selectors.FORM_NAME))
course: formSelectors.data(formSelectors.form(state, selectors.FORM_NAME)),
contextType: toolSelectors.contextType(state)
})
)(CourseCreationComponent)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const CourseEditComponent = (props) =>
course={props.course}
>
<CourseForm
path={props.path + '/catalog'}
path={props.path}
name={selectors.FORM_NAME}
/>
</CoursePage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Course = (props) => {
{
type: LINK_BUTTON,
label: trans('catalog', {}, 'cursus'),
target: props.path + '/catalog',
target: props.path,
displayed: 'desktop' === props.contextType
}, {
type: LINK_BUTTON,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const reducer = combineReducers({
}),
course: makeReducer(null, {
[LOAD_COURSE]: (state, action) => action.course
}),
courseForm: makeFormReducer(courseSelectors.FORM_NAME)
})
})

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {createSelector} from 'reselect'

const STORE_NAME = 'trainingCatalog'
const LIST_NAME = STORE_NAME + '.courses'
const FORM_NAME = STORE_NAME + '.courseForm'

const catalog = (state) => state[STORE_NAME] || {}

Expand All @@ -14,7 +13,6 @@ const course = createSelector(
export const selectors = {
STORE_NAME,
LIST_NAME,
FORM_NAME,

course
}

0 comments on commit 5c943d7

Please sign in to comment.