From 769a4c34ea0e9531814f0406219a3ff41ebf0732 Mon Sep 17 00:00:00 2001 From: kresnaputra Date: Tue, 2 Feb 2021 22:14:11 +0800 Subject: [PATCH 1/2] [FIX] breadcrumbs exceeding --- app/utils/log/events.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/app/utils/log/events.js b/app/utils/log/events.js index 4895ad8f27..1e9fa570f4 100644 --- a/app/utils/log/events.js +++ b/app/utils/log/events.js @@ -5,9 +5,9 @@ export default { ONBOARD_CREATE_NEW_WORKSPACE_F: 'onboard_create_new_workspace_f', // NEW SERVER VIEW - NEWSERVER_CONNECT_TO_WORKSPACE: 'newserver_connect_to_workspace', - NEWSERVER_CONNECT_TO_WORKSPACE_F: 'newserver_connect_to_workspace_f', - NEWSERVER_JOIN_OPEN_WORKSPACE: 'newserver_join_open_workspace', + NS_CONNECT_TO_WORKSPACE: 'ns_connect_to_workspace', + NS_CONNECT_TO_WORKSPACE_F: 'ns_connect_to_workspace_f', + NS_JOIN_OPEN_WORKSPACE: 'ns_join_open_workspace', // LOGIN VIEW LOGIN_DEFAULT_LOGIN: 'login_default_login', @@ -99,20 +99,20 @@ export default { SELECTED_USERS_CREATE_GROUP_F: 'selected_users_create_group_f', // CREATE CHANNEL VIEW - CREATE_CHANNEL_CREATE: 'create_channel_create', - CREATE_CHANNEL_CREATE_F: 'create_channel_create_f', - CREATE_CHANNEL_TOGGLE_TYPE: 'create_channel_toggle_type', - CREATE_CHANNEL_TOGGLE_READ_ONLY: 'create_channel_toggle_read_only', - CREATE_CHANNEL_TOGGLE_BROADCAST: 'create_channel_toggle_broadcast', - CREATE_CHANNEL_TOGGLE_ENCRYPTED: 'create_channel_toggle_encrypted', - CREATE_CHANNEL_REMOVE_USER: 'create_channel_remove_user', + CR_CREATE: 'cr_create', + CR_CREATE_F: 'cr_create_f', + CR_TOGGLE_TYPE: 'cr_toggle_type', + CR_TOGGLE_READ_ONLY: 'cr_toggle_read_only', + CR_TOGGLE_BROADCAST: 'cr_toggle_broadcast', + CR_TOGGLE_ENCRYPTED: 'cr_toggle_encrypted', + CR_REMOVE_USER: 'cr_remove_user', // CREATE DISCUSSION VIEW - CREATE_DISCUSSION_CREATE: 'create_discussion_create', - CREATE_DISCUSSION_CREATE_F: 'create_discussion_create_f', - CREATE_DISCUSSION_SELECT_CHANNEL: 'create_discussion_select_channel', - CREATE_DISCUSSION_SELECT_USERS: 'create_discussion_select_users', - CREATE_DISCUSSION_TOGGLE_ENCRY: 'create_discussion_toggle_encry', + CD_CREATE: 'cd_create', + CD_CREATE_F: 'cd_create_f', + CD_SELECT_CHANNEL: 'cd_select_channel', + CD_SELECT_USERS: 'cd_select_users', + CD_TOGGLE_ENCRY: 'cd_toggle_encry', // PROFILE VIEW PROFILE_PICK_AVATAR: 'profile_pick_avatar', @@ -122,8 +122,9 @@ export default { PROFILE_SAVE_AVATAR_F: 'profile_save_avatar_f', PROFILE_SAVE_CHANGES: 'profile_save_changes', PROFILE_SAVE_CHANGES_F: 'profile_save_changes_f', - PROFILE_LOGOUT_OTHER_LOCATIONS: 'profile_logout_other_locations', - PROFILE_LOGOUT_OTHER_LOCATIONS_F: 'profile_logout_other_locations_f', + // PROFILE LOGOUT + PL_OTHER_LOCATIONS: 'pl_other_locations', + PL_OTHER_LOCATIONS_F: 'pl_other_locations_f', // SETTINGS VIEW SE_CONTACT_US: 'se_contact_us', @@ -297,8 +298,9 @@ export default { NP_AUDIONOTIFICATIONS_F: 'np_audio_notifications_f', NP_AUDIONOTIFICATIONVALUE: 'np_audio_notification_value', NP_AUDIONOTIFICATIONVALUE_F: 'np_audio_notification_value_f', - NP_DESKTOPNOTIFICATIONDURATION: 'np_desktopnotificationduration', - NP_DESKTOPNOTIFICATIONDURATION_F: 'np_desktopnotificationduration_f', + // NOTIFICATION PREFERENCES DESKTOP NOTIFICATION + NP_DN_DURATION: 'np_ds_duration', + NP_DN_DURATION_F: 'np_ds_duration_f', NP_EMAILNOTIFICATIONS: 'np_email_notifications', NP_EMAILNOTIFICATIONS_F: 'np_email_notifications_f', From aedf3997a263c7dadc9c20daf6c7f9d2625df991 Mon Sep 17 00:00:00 2001 From: kresnaputra Date: Tue, 2 Feb 2021 23:26:24 +0800 Subject: [PATCH 2/2] fix.breadcrumbs-exceeding-change-events --- app/sagas/createChannel.js | 4 ++-- app/sagas/createDiscussion.js | 6 +++--- app/utils/log/events.js | 4 ---- app/views/CreateChannelView.js | 10 +++++----- app/views/CreateDiscussionView/index.js | 6 +++--- app/views/NewServerView/index.js | 4 ++-- app/views/ProfileView/index.js | 4 ++-- 7 files changed, 17 insertions(+), 21 deletions(-) diff --git a/app/sagas/createChannel.js b/app/sagas/createChannel.js index ca4bcb9fe0..6bcedad631 100644 --- a/app/sagas/createChannel.js +++ b/app/sagas/createChannel.js @@ -42,7 +42,7 @@ const handleRequest = function* handleRequest({ data }) { broadcast, encrypted } = data; - logEvent(events.CREATE_CHANNEL_CREATE, { + logEvent(events.CR_CREATE, { type: type ? 'private' : 'public', readOnly, broadcast, @@ -66,7 +66,7 @@ const handleRequest = function* handleRequest({ data }) { yield put(createChannelSuccess(sub)); } catch (err) { - logEvent(events[data.group ? 'SELECTED_USERS_CREATE_GROUP_F' : 'CREATE_CHANNEL_CREATE_F']); + logEvent(events[data.group ? 'SELECTED_USERS_CREATE_GROUP_F' : 'CR_CREATE_F']); yield put(createChannelFailure(err)); } }; diff --git a/app/sagas/createDiscussion.js b/app/sagas/createDiscussion.js index a185e6671a..732268779e 100644 --- a/app/sagas/createDiscussion.js +++ b/app/sagas/createDiscussion.js @@ -14,7 +14,7 @@ const create = function* create(data) { }; const handleRequest = function* handleRequest({ data }) { - logEvent(events.CREATE_DISCUSSION_CREATE); + logEvent(events.CD_CREATE); try { const auth = yield select(state => state.login.isAuthenticated); if (!auth) { @@ -39,11 +39,11 @@ const handleRequest = function* handleRequest({ data }) { } yield put(createDiscussionSuccess(sub)); } else { - logEvent(events.CREATE_DISCUSSION_CREATE_F); + logEvent(events.CD_CREATE_F); yield put(createDiscussionFailure(result)); } } catch (err) { - logEvent(events.CREATE_DISCUSSION_CREATE_F); + logEvent(events.CD_CREATE_F); yield put(createDiscussionFailure(err)); } }; diff --git a/app/utils/log/events.js b/app/utils/log/events.js index 1e9fa570f4..2e1e8f9a44 100644 --- a/app/utils/log/events.js +++ b/app/utils/log/events.js @@ -6,7 +6,6 @@ export default { // NEW SERVER VIEW NS_CONNECT_TO_WORKSPACE: 'ns_connect_to_workspace', - NS_CONNECT_TO_WORKSPACE_F: 'ns_connect_to_workspace_f', NS_JOIN_OPEN_WORKSPACE: 'ns_join_open_workspace', // LOGIN VIEW @@ -298,9 +297,6 @@ export default { NP_AUDIONOTIFICATIONS_F: 'np_audio_notifications_f', NP_AUDIONOTIFICATIONVALUE: 'np_audio_notification_value', NP_AUDIONOTIFICATIONVALUE_F: 'np_audio_notification_value_f', - // NOTIFICATION PREFERENCES DESKTOP NOTIFICATION - NP_DN_DURATION: 'np_ds_duration', - NP_DN_DURATION_F: 'np_ds_duration_f', NP_EMAILNOTIFICATIONS: 'np_email_notifications', NP_EMAILNOTIFICATIONS_F: 'np_email_notifications_f', diff --git a/app/views/CreateChannelView.js b/app/views/CreateChannelView.js index 70982094de..475996f4f4 100644 --- a/app/views/CreateChannelView.js +++ b/app/views/CreateChannelView.js @@ -177,7 +177,7 @@ class CreateChannelView extends React.Component { } removeUser = (user) => { - logEvent(events.CREATE_CHANNEL_REMOVE_USER); + logEvent(events.CR_REMOVE_USER); const { removeUser } = this.props; removeUser(user); } @@ -207,7 +207,7 @@ class CreateChannelView extends React.Component { value: type, label: 'Private_Channel', onValueChange: (value) => { - logEvent(events.CREATE_CHANNEL_TOGGLE_TYPE); + logEvent(events.CR_TOGGLE_TYPE); // If we set the channel as public, encrypted status should be false this.setState(({ encrypted }) => ({ type: value, encrypted: value && encrypted })); } @@ -221,7 +221,7 @@ class CreateChannelView extends React.Component { value: readOnly, label: 'Read_Only_Channel', onValueChange: (value) => { - logEvent(events.CREATE_CHANNEL_TOGGLE_READ_ONLY); + logEvent(events.CR_TOGGLE_READ_ONLY); this.setState({ readOnly: value }); }, disabled: broadcast @@ -241,7 +241,7 @@ class CreateChannelView extends React.Component { value: encrypted, label: 'Encrypted', onValueChange: (value) => { - logEvent(events.CREATE_CHANNEL_TOGGLE_ENCRYPTED); + logEvent(events.CR_TOGGLE_ENCRYPTED); this.setState({ encrypted: value }); }, disabled: !type @@ -255,7 +255,7 @@ class CreateChannelView extends React.Component { value: broadcast, label: 'Broadcast_Channel', onValueChange: (value) => { - logEvent(events.CREATE_CHANNEL_TOGGLE_BROADCAST); + logEvent(events.CR_TOGGLE_BROADCAST); this.setState({ broadcast: value, readOnly: value ? true : readOnly diff --git a/app/views/CreateDiscussionView/index.js b/app/views/CreateDiscussionView/index.js index 43329f1020..5e14e8616d 100644 --- a/app/views/CreateDiscussionView/index.js +++ b/app/views/CreateDiscussionView/index.js @@ -136,17 +136,17 @@ class CreateChannelView extends React.Component { }; selectChannel = ({ value }) => { - logEvent(events.CREATE_DISCUSSION_SELECT_CHANNEL); + logEvent(events.CD_SELECT_CHANNEL); this.setState({ channel: value, encrypted: value?.encrypted }); } selectUsers = ({ value }) => { - logEvent(events.CREATE_DISCUSSION_SELECT_USERS); + logEvent(events.CD_SELECT_USERS); this.setState({ users: value }); } onEncryptedChange = (value) => { - logEvent(events.CREATE_DISCUSSION_TOGGLE_ENCRY); + logEvent(events.CD_TOGGLE_ENCRY); this.setState({ encrypted: value }); } diff --git a/app/views/NewServerView/index.js b/app/views/NewServerView/index.js index 192468ed33..5c005d8bca 100644 --- a/app/views/NewServerView/index.js +++ b/app/views/NewServerView/index.js @@ -174,7 +174,7 @@ class NewServerView extends React.Component { } submit = async({ fromServerHistory = false, username }) => { - logEvent(events.NEWSERVER_CONNECT_TO_WORKSPACE); + logEvent(events.NS_CONNECT_TO_WORKSPACE); const { text, certificate } = this.state; const { connectServer } = this.props; @@ -199,7 +199,7 @@ class NewServerView extends React.Component { } connectOpen = () => { - logEvent(events.NEWSERVER_JOIN_OPEN_WORKSPACE); + logEvent(events.NS_JOIN_OPEN_WORKSPACE); this.setState({ connectingOpen: true }); const { connectServer } = this.props; connectServer('https://open.rocket.chat'); diff --git a/app/views/ProfileView/index.js b/app/views/ProfileView/index.js index 62280bb126..4d775615ff 100644 --- a/app/views/ProfileView/index.js +++ b/app/views/ProfileView/index.js @@ -433,7 +433,7 @@ class ProfileView extends React.Component { } logoutOtherLocations = () => { - logEvent(events.PROFILE_LOGOUT_OTHER_LOCATIONS); + logEvent(events.PL_OTHER_LOCATIONS); showConfirmationAlert({ message: I18n.t('You_will_be_logged_out_from_other_locations'), callToAction: I18n.t('Logout'), @@ -442,7 +442,7 @@ class ProfileView extends React.Component { await RocketChat.logoutOtherLocations(); EventEmitter.emit(LISTENER, { message: I18n.t('Logged_out_of_other_clients_successfully') }); } catch { - logEvent(events.PROFILE_LOGOUT_OTHER_LOCATIONS_F); + logEvent(events.PL_OTHER_LOCATIONS_F); EventEmitter.emit(LISTENER, { message: I18n.t('Logout_failed') }); } }