Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public group indicator fix #178

Merged
merged 2 commits into from
Feb 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/Groups/AdminsView/AdminsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import AddSupervisor from '../AddSupervisor';
import EditGroupForm from '../../forms/EditGroupForm';
import { getLocalizedName } from '../../../helpers/getLocalizedData';

const EMPTY_OBJECT = {};

const AdminsView = ({ group, addSubgroup, formValues, intl: { locale } }) =>
<div>
<Row>
Expand Down Expand Up @@ -42,7 +44,7 @@ const AdminsView = ({ group, addSubgroup, formValues, intl: { locale } }) =>
<Col md={6}>
<EditGroupForm
onSubmit={addSubgroup}
initialValues={{ publicStats: true }}
initialValues={EMPTY_OBJECT}
createNew
collapsable
isOpen={false}
Expand Down
1 change: 1 addition & 0 deletions src/components/Groups/GroupDetail/GroupDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const GroupDetail = ({
id={id}
deletable={false}
isAdmin={isAdmin}
isPublic={isPublic}
isOpen
groups={groups}
level={1}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Groups/GroupTree/GroupTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class GroupTree extends Component {
id,
level = 0,
isOpen = false,
isPublic = true,
isPublic = false,
groups,
currentGroupId = null,
visibleGroupsMap = null,
Expand All @@ -86,7 +86,7 @@ class GroupTree extends Component {

const group = groups.get(id);
if (!group || !isReady(group)) {
return isPublic ? this.renderLoading(level) : null;
return this.renderLoading(level);
}

const {
Expand Down
6 changes: 4 additions & 2 deletions src/pages/Instance/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { isLoggedAsSuperAdmin } from '../../redux/selectors/users';

import withLinks from '../../hoc/withLinks';

const EMPTY_OBJECT = {};

class Instance extends Component {
static loadAsync = ({ instanceId }, dispatch) =>
Promise.all([
Expand Down Expand Up @@ -112,9 +114,9 @@ class Instance extends Component {
instanceId={instanceId}
createNew
collapsable={true}
isOpen={false}
isOpen={true}
formValues={formValues}
initialValues={{ publicStats: true }}
initialValues={EMPTY_OBJECT}
/>
</Col>
<Col sm={6}>
Expand Down