Updated GroupCategory functionality with Groups
• Updated: - GroupCategory functionality with Groups
This commit is contained in:
@@ -62,7 +62,7 @@ const create = (options, routerHistory) => (dispatch, getState) => {
|
||||
formData.append('title', options.title)
|
||||
formData.append('description', options.description)
|
||||
formData.append('tags', options.tags)
|
||||
formData.append('group_categories_id', options.category)
|
||||
formData.append('group_category_id', options.category)
|
||||
formData.append('is_private', options.isPrivate)
|
||||
formData.append('is_visible', options.isVisible)
|
||||
|
||||
@@ -105,7 +105,7 @@ const update = (groupId, options, routerHistory) => (dispatch, getState) => {
|
||||
formData.append('title', options.title)
|
||||
formData.append('description', options.description)
|
||||
formData.append('tags', options.tags)
|
||||
formData.append('group_categories_id', options.category)
|
||||
formData.append('group_category_id', options.category)
|
||||
formData.append('is_private', options.isPrivate)
|
||||
formData.append('is_visible', options.isVisible)
|
||||
formData.append('slug', options.slug)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import moment from 'moment-mini'
|
||||
import { shortNumberFormat } from '../../utils/numbers'
|
||||
import slugify from '../../utils/slugify'
|
||||
import PanelLayout from './panel_layout'
|
||||
import Button from '../button'
|
||||
import Divider from '../divider'
|
||||
@@ -39,6 +41,7 @@ class GroupInfoPanel extends ImmutablePureComponent {
|
||||
const isPrivate = !!group ? group.get('is_private') : false
|
||||
const isVisible = !!group ? group.get('is_visible') : false
|
||||
const tags = !!group ? group.get('tags') : []
|
||||
const groupCategory = !!group ? group.getIn(['group_category', 'text'], null) : null
|
||||
const descriptionHTML = !!group ? { __html: group.get('description_html') } : {}
|
||||
|
||||
if (noPanel) {
|
||||
@@ -143,11 +146,26 @@ class GroupInfoPanel extends ImmutablePureComponent {
|
||||
</Button>
|
||||
</GroupInfoPanelRow>
|
||||
|
||||
<Divider isSmall />
|
||||
{
|
||||
!!groupCategory &&
|
||||
<React.Fragment>
|
||||
<Divider isSmall />
|
||||
|
||||
<GroupInfoPanelRow title={intl.formatMessage(messages.category)} icon='apps'>
|
||||
<Text>General</Text>
|
||||
</GroupInfoPanelRow>
|
||||
<GroupInfoPanelRow title={intl.formatMessage(messages.category)} icon='apps'>
|
||||
<Button
|
||||
isText
|
||||
color='brand'
|
||||
backgroundColor='none'
|
||||
className={_s.mlAuto}
|
||||
to={`/groups/browse/categories/${slugify(groupCategory)}`}
|
||||
>
|
||||
<Text color='inherit' weight='medium' size='normal' className={_s.underline_onHover}>
|
||||
{groupCategory}
|
||||
</Text>
|
||||
</Button>
|
||||
</GroupInfoPanelRow>
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
<Divider isSmall />
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ class GroupCreate extends ImmutablePureComponent {
|
||||
|
||||
const memberCount = group ? group.get('member_count') : 0
|
||||
const hasGroupSlug = group ? !!group.get('slug') : false
|
||||
let categoriesOptions = []
|
||||
let categoriesOptions = [{'title':'',value:''}]
|
||||
if (categories) {
|
||||
for (let i = 0; i < categories.count(); i++) {
|
||||
const c = categories.get(i)
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function groupEditorReducer(state = initialState, action) {
|
||||
map.set('isPrivate', action.group.get('is_private'))
|
||||
map.set('isVisible', action.group.get('is_visible'))
|
||||
map.set('id', action.group.get('slug'))
|
||||
map.set('category', action.group.get('category'))
|
||||
map.set('category', action.group.getIn(['group_category', 'id'], null))
|
||||
map.set('isSubmitting', false)
|
||||
})
|
||||
case GROUP_EDITOR_TITLE_CHANGE:
|
||||
|
||||
Reference in New Issue
Block a user