From 94ff47a7e76f18f2965b036381e34e99f21079ba Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Fri, 7 Jun 2019 18:07:44 -0400 Subject: [PATCH] fix(departments): issue with creating department with no teams #206 --- package.json | 2 +- src/client/containers/Departments/index.jsx | 141 +++++++++--------- .../containers/Modals/EditDepartmentModal.jsx | 12 +- 3 files changed, 78 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index 989413665..92b1a11f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trudesk", - "version": "1.0.13", + "version": "1.0.14-beta", "private": true, "engines": { "node": ">=9.10.0" diff --git a/src/client/containers/Departments/index.jsx b/src/client/containers/Departments/index.jsx index 13b159946..2444bb8b0 100644 --- a/src/client/containers/Departments/index.jsx +++ b/src/client/containers/Departments/index.jsx @@ -114,76 +114,81 @@ class DepartmentsContainer extends React.Component { - {this.props.departments.map(department => { - return ( - - {/**/} - {/* */} - {/* */} - {/**/} - -
{department.get('name')}
- - - {department.get('teams').map(team => { - return ( -
- {team.get('name')} + {this.props.departments && + this.props.departments.map(department => { + const teams = department.get('teams') + const groups = department.get('groups') + return ( + + {/**/} + {/* */} + {/* */} + {/**/} + +
{department.get('name')}
+ + + {teams && + teams.map(team => { + return ( +
+ {team.get('name')} +
+ ) + })} + + + {department.get('allGroups') === true && ( +
+
+ All Groups +
- ) - })} - - - {department.get('allGroups') === true && ( -
-
- All Groups -
-
- )} - {department.get('allGroups') !== true && - department.get('groups').map(group => { - return ( -
- {group.get('name')} -
- ) - })} - - - - {helpers.canUser('departments:update', true) && ( -