Commit ac170882 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Correctly display friend and group names on console user details page.

parent f9d7db22
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
## [Unreleased]
### Fixed
- Correctly display counters on console status page.
- Correctly display friend names on console user details page.
- Correctly display group names on console user details page.

## [2.5.0] - 2019-04-25
### Added
+6 −6

File changed.

Preview size limit exceeded, changes collapsed.

+12 −12
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import * as userActions from '../../store/users/actions';
import {
  ExportObject,
  FriendObject,
  GroupObject,
  UserGroupObject,
  LedgerObject,
  LedgerObjectRequest,
  UserObject,
@@ -50,7 +50,7 @@ interface PropsFromState {
  data: ExportObject,
  account: ExportObject,
  friends: FriendObject[],
  groups: GroupObject[],
  groups: UserGroupObject[],
  ledgers: LedgerObject[]
}

@@ -754,16 +754,16 @@ class UsersDetails extends Component<Props, State> {
          (friends || []).map((f, key) =>
            <Table.Row
              key={this.key(`friends_${id}_${key}`)}
              onClick={this.go_to_friend.bind(this, f.user_id)}
              onClick={this.go_to_friend.bind(this, f.user.id)}
            >
              <Table.Cell>{f.user_id}</Table.Cell>
              <Table.Cell>{f.username}</Table.Cell>
              <Table.Cell>{f.user.id}</Table.Cell>
              <Table.Cell>{f.user.username}</Table.Cell>
              <Table.Cell>{f.state}</Table.Cell>
              <Table.Cell>{f.update_time}</Table.Cell>
              <Table.Cell>{f.user.update_time}</Table.Cell>
              <Table.Cell>
                <Button
                  size="small"
                  onClick={this.remove_friend.bind(this, f.user_id)}
                  onClick={this.remove_friend.bind(this, f.user.id)}
                >Delete</Button>
              </Table.Cell>
            </Table.Row>
@@ -790,16 +790,16 @@ class UsersDetails extends Component<Props, State> {
          (groups || []).map((g, key) =>
            <Table.Row
              key={this.key(`groups_${id}_${key}`)}
              onClick={this.go_to_friend.bind(this, g.id)}
              onClick={this.go_to_friend.bind(this, g.group.id)}
            >
              <Table.Cell>{g.id}</Table.Cell>
              <Table.Cell>{g.name}</Table.Cell>
              <Table.Cell>{g.group.id}</Table.Cell>
              <Table.Cell>{g.group.name}</Table.Cell>
              <Table.Cell>{g.state}</Table.Cell>
              <Table.Cell>{g.update_time}</Table.Cell>
              <Table.Cell>{g.group.update_time}</Table.Cell>
              <Table.Cell>
                <Button
                  size="small"
                  onClick={this.remove_group.bind(this, g.id)}
                  onClick={this.remove_group.bind(this, g.group.id)}
                >Delete</Button>
              </Table.Cell>
            </Table.Row>
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import {
  UsersObject,
  LedgerObject,
  FriendObject,
  GroupObject,
  UserGroupObject,
  LedgerObjectRequest
} from './types';

@@ -165,7 +165,7 @@ export const userFetchGroupRequest = (data: UserObjectRequest) => action(
  UserActionTypes.FETCH_MANY_GROUP_REQUEST,
  data
);
export const userFetchGroupSuccess = (data: GroupObject[]) => action(
export const userFetchGroupSuccess = (data: UserGroupObject[]) => action(
  UserActionTypes.FETCH_MANY_GROUP_SUCCESS,
  data
);
+1 −1
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ function* handleFetchGroup({payload: data}: AnyAction)
    }
    else
    {
      yield put(userFetchGroupSuccess(res.groups || []));
      yield put(userFetchGroupSuccess(res.user_groups || []));
    }
  }
  catch(err)
Loading