From fc4f45f02b293be2b292951fcc4b633d0ace88bd Mon Sep 17 00:00:00 2001 From: Govind Dixit Date: Thu, 26 Mar 2020 20:15:20 +0530 Subject: [PATCH 1/3] fix: change default directory listing to Users --- app/views/DirectoryView/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/DirectoryView/index.js b/app/views/DirectoryView/index.js index 51c7b4f2b8c..e402f111ddf 100644 --- a/app/views/DirectoryView/index.js +++ b/app/views/DirectoryView/index.js @@ -57,7 +57,7 @@ class DirectoryView extends React.Component { total: -1, showOptionsDropdown: false, globalUsers: true, - type: 'channels' + type: 'users' }; } From 647756c7bf982d0a0099e7496346da4dcf832d73 Mon Sep 17 00:00:00 2001 From: GOVINDDIXIT Date: Fri, 27 Mar 2020 19:00:33 +0530 Subject: [PATCH 2/3] follow server settings --- app/constants/settings.js | 3 +++ app/views/DirectoryView/index.js | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/constants/settings.js b/app/constants/settings.js index 513ff5f3457..2b26af3208b 100644 --- a/app/constants/settings.js +++ b/app/constants/settings.js @@ -47,6 +47,9 @@ export default { CROWD_Enable: { type: 'valueAsBoolean' }, + Accounts_Directory_DefaultView: { + type: 'valueAsString' + }, FEDERATION_Enabled: { type: 'valueAsBoolean' }, diff --git a/app/views/DirectoryView/index.js b/app/views/DirectoryView/index.js index e402f111ddf..c46380bb116 100644 --- a/app/views/DirectoryView/index.js +++ b/app/views/DirectoryView/index.js @@ -45,7 +45,8 @@ class DirectoryView extends React.Component { id: PropTypes.string, token: PropTypes.string }), - theme: PropTypes.string + theme: PropTypes.string, + directoryDefaultView: PropTypes.string }; constructor(props) { @@ -57,7 +58,7 @@ class DirectoryView extends React.Component { total: -1, showOptionsDropdown: false, globalUsers: true, - type: 'users' + type: this.directoryDefaultView }; } @@ -256,7 +257,8 @@ class DirectoryView extends React.Component { const mapStateToProps = state => ({ baseUrl: state.server.server, user: getUserSelector(state), - isFederationEnabled: state.settings.FEDERATION_Enabled + isFederationEnabled: state.settings.FEDERATION_Enabled, + directoryDefaultView: state.settings.Accounts_Directory_DefaultView }); export default connect(mapStateToProps)(withTheme(DirectoryView)); From 25e65cf3dffcc260e8829ab6cb46ae0b54822860 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 30 Mar 2020 11:20:05 -0300 Subject: [PATCH 3/3] Fix state to props --- app/views/DirectoryView/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/DirectoryView/index.js b/app/views/DirectoryView/index.js index c46380bb116..e54f966c9df 100644 --- a/app/views/DirectoryView/index.js +++ b/app/views/DirectoryView/index.js @@ -58,7 +58,7 @@ class DirectoryView extends React.Component { total: -1, showOptionsDropdown: false, globalUsers: true, - type: this.directoryDefaultView + type: props.directoryDefaultView }; }