[FIX] Breadcrumbs exceeding characters limit (#2862)

* [FIX] breadcrumbs exceeding

* fix.breadcrumbs-exceeding-change-events

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Gung Wah 2021-02-12 05:44:50 +08:00 committed by GitHub
parent 491bc70c67
commit 3264746400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 36 deletions

View File

@ -42,7 +42,7 @@ const handleRequest = function* handleRequest({ data }) {
broadcast, broadcast,
encrypted encrypted
} = data; } = data;
logEvent(events.CREATE_CHANNEL_CREATE, { logEvent(events.CR_CREATE, {
type: type ? 'private' : 'public', type: type ? 'private' : 'public',
readOnly, readOnly,
broadcast, broadcast,
@ -66,7 +66,7 @@ const handleRequest = function* handleRequest({ data }) {
yield put(createChannelSuccess(sub)); yield put(createChannelSuccess(sub));
} catch (err) { } 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)); yield put(createChannelFailure(err));
} }
}; };

View File

@ -14,7 +14,7 @@ const create = function* create(data) {
}; };
const handleRequest = function* handleRequest({ data }) { const handleRequest = function* handleRequest({ data }) {
logEvent(events.CREATE_DISCUSSION_CREATE); logEvent(events.CD_CREATE);
try { try {
const auth = yield select(state => state.login.isAuthenticated); const auth = yield select(state => state.login.isAuthenticated);
if (!auth) { if (!auth) {
@ -39,11 +39,11 @@ const handleRequest = function* handleRequest({ data }) {
} }
yield put(createDiscussionSuccess(sub)); yield put(createDiscussionSuccess(sub));
} else { } else {
logEvent(events.CREATE_DISCUSSION_CREATE_F); logEvent(events.CD_CREATE_F);
yield put(createDiscussionFailure(result)); yield put(createDiscussionFailure(result));
} }
} catch (err) { } catch (err) {
logEvent(events.CREATE_DISCUSSION_CREATE_F); logEvent(events.CD_CREATE_F);
yield put(createDiscussionFailure(err)); yield put(createDiscussionFailure(err));
} }
}; };

View File

@ -5,9 +5,8 @@ export default {
ONBOARD_CREATE_NEW_WORKSPACE_F: 'onboard_create_new_workspace_f', ONBOARD_CREATE_NEW_WORKSPACE_F: 'onboard_create_new_workspace_f',
// NEW SERVER VIEW // NEW SERVER VIEW
NEWSERVER_CONNECT_TO_WORKSPACE: 'newserver_connect_to_workspace', NS_CONNECT_TO_WORKSPACE: 'ns_connect_to_workspace',
NEWSERVER_CONNECT_TO_WORKSPACE_F: 'newserver_connect_to_workspace_f', NS_JOIN_OPEN_WORKSPACE: 'ns_join_open_workspace',
NEWSERVER_JOIN_OPEN_WORKSPACE: 'newserver_join_open_workspace',
// LOGIN VIEW // LOGIN VIEW
LOGIN_DEFAULT_LOGIN: 'login_default_login', LOGIN_DEFAULT_LOGIN: 'login_default_login',
@ -99,20 +98,20 @@ export default {
SELECTED_USERS_CREATE_GROUP_F: 'selected_users_create_group_f', SELECTED_USERS_CREATE_GROUP_F: 'selected_users_create_group_f',
// CREATE CHANNEL VIEW // CREATE CHANNEL VIEW
CREATE_CHANNEL_CREATE: 'create_channel_create', CR_CREATE: 'cr_create',
CREATE_CHANNEL_CREATE_F: 'create_channel_create_f', CR_CREATE_F: 'cr_create_f',
CREATE_CHANNEL_TOGGLE_TYPE: 'create_channel_toggle_type', CR_TOGGLE_TYPE: 'cr_toggle_type',
CREATE_CHANNEL_TOGGLE_READ_ONLY: 'create_channel_toggle_read_only', CR_TOGGLE_READ_ONLY: 'cr_toggle_read_only',
CREATE_CHANNEL_TOGGLE_BROADCAST: 'create_channel_toggle_broadcast', CR_TOGGLE_BROADCAST: 'cr_toggle_broadcast',
CREATE_CHANNEL_TOGGLE_ENCRYPTED: 'create_channel_toggle_encrypted', CR_TOGGLE_ENCRYPTED: 'cr_toggle_encrypted',
CREATE_CHANNEL_REMOVE_USER: 'create_channel_remove_user', CR_REMOVE_USER: 'cr_remove_user',
// CREATE DISCUSSION VIEW // CREATE DISCUSSION VIEW
CREATE_DISCUSSION_CREATE: 'create_discussion_create', CD_CREATE: 'cd_create',
CREATE_DISCUSSION_CREATE_F: 'create_discussion_create_f', CD_CREATE_F: 'cd_create_f',
CREATE_DISCUSSION_SELECT_CHANNEL: 'create_discussion_select_channel', CD_SELECT_CHANNEL: 'cd_select_channel',
CREATE_DISCUSSION_SELECT_USERS: 'create_discussion_select_users', CD_SELECT_USERS: 'cd_select_users',
CREATE_DISCUSSION_TOGGLE_ENCRY: 'create_discussion_toggle_encry', CD_TOGGLE_ENCRY: 'cd_toggle_encry',
// PROFILE VIEW // PROFILE VIEW
PROFILE_PICK_AVATAR: 'profile_pick_avatar', PROFILE_PICK_AVATAR: 'profile_pick_avatar',
@ -122,8 +121,9 @@ export default {
PROFILE_SAVE_AVATAR_F: 'profile_save_avatar_f', PROFILE_SAVE_AVATAR_F: 'profile_save_avatar_f',
PROFILE_SAVE_CHANGES: 'profile_save_changes', PROFILE_SAVE_CHANGES: 'profile_save_changes',
PROFILE_SAVE_CHANGES_F: 'profile_save_changes_f', PROFILE_SAVE_CHANGES_F: 'profile_save_changes_f',
PROFILE_LOGOUT_OTHER_LOCATIONS: 'profile_logout_other_locations', // PROFILE LOGOUT
PROFILE_LOGOUT_OTHER_LOCATIONS_F: 'profile_logout_other_locations_f', PL_OTHER_LOCATIONS: 'pl_other_locations',
PL_OTHER_LOCATIONS_F: 'pl_other_locations_f',
// SETTINGS VIEW // SETTINGS VIEW
SE_CONTACT_US: 'se_contact_us', SE_CONTACT_US: 'se_contact_us',
@ -297,8 +297,6 @@ export default {
NP_AUDIONOTIFICATIONS_F: 'np_audio_notifications_f', NP_AUDIONOTIFICATIONS_F: 'np_audio_notifications_f',
NP_AUDIONOTIFICATIONVALUE: 'np_audio_notification_value', NP_AUDIONOTIFICATIONVALUE: 'np_audio_notification_value',
NP_AUDIONOTIFICATIONVALUE_F: 'np_audio_notification_value_f', NP_AUDIONOTIFICATIONVALUE_F: 'np_audio_notification_value_f',
NP_DESKTOPNOTIFICATIONDURATION: 'np_desktopnotificationduration',
NP_DESKTOPNOTIFICATIONDURATION_F: 'np_desktopnotificationduration_f',
NP_EMAILNOTIFICATIONS: 'np_email_notifications', NP_EMAILNOTIFICATIONS: 'np_email_notifications',
NP_EMAILNOTIFICATIONS_F: 'np_email_notifications_f', NP_EMAILNOTIFICATIONS_F: 'np_email_notifications_f',

View File

@ -177,7 +177,7 @@ class CreateChannelView extends React.Component {
} }
removeUser = (user) => { removeUser = (user) => {
logEvent(events.CREATE_CHANNEL_REMOVE_USER); logEvent(events.CR_REMOVE_USER);
const { removeUser } = this.props; const { removeUser } = this.props;
removeUser(user); removeUser(user);
} }
@ -207,7 +207,7 @@ class CreateChannelView extends React.Component {
value: type, value: type,
label: 'Private_Channel', label: 'Private_Channel',
onValueChange: (value) => { 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 // If we set the channel as public, encrypted status should be false
this.setState(({ encrypted }) => ({ type: value, encrypted: value && encrypted })); this.setState(({ encrypted }) => ({ type: value, encrypted: value && encrypted }));
} }
@ -221,7 +221,7 @@ class CreateChannelView extends React.Component {
value: readOnly, value: readOnly,
label: 'Read_Only_Channel', label: 'Read_Only_Channel',
onValueChange: (value) => { onValueChange: (value) => {
logEvent(events.CREATE_CHANNEL_TOGGLE_READ_ONLY); logEvent(events.CR_TOGGLE_READ_ONLY);
this.setState({ readOnly: value }); this.setState({ readOnly: value });
}, },
disabled: broadcast disabled: broadcast
@ -241,7 +241,7 @@ class CreateChannelView extends React.Component {
value: encrypted, value: encrypted,
label: 'Encrypted', label: 'Encrypted',
onValueChange: (value) => { onValueChange: (value) => {
logEvent(events.CREATE_CHANNEL_TOGGLE_ENCRYPTED); logEvent(events.CR_TOGGLE_ENCRYPTED);
this.setState({ encrypted: value }); this.setState({ encrypted: value });
}, },
disabled: !type disabled: !type
@ -255,7 +255,7 @@ class CreateChannelView extends React.Component {
value: broadcast, value: broadcast,
label: 'Broadcast_Channel', label: 'Broadcast_Channel',
onValueChange: (value) => { onValueChange: (value) => {
logEvent(events.CREATE_CHANNEL_TOGGLE_BROADCAST); logEvent(events.CR_TOGGLE_BROADCAST);
this.setState({ this.setState({
broadcast: value, broadcast: value,
readOnly: value ? true : readOnly readOnly: value ? true : readOnly

View File

@ -136,17 +136,17 @@ class CreateChannelView extends React.Component {
}; };
selectChannel = ({ value }) => { selectChannel = ({ value }) => {
logEvent(events.CREATE_DISCUSSION_SELECT_CHANNEL); logEvent(events.CD_SELECT_CHANNEL);
this.setState({ channel: value, encrypted: value?.encrypted }); this.setState({ channel: value, encrypted: value?.encrypted });
} }
selectUsers = ({ value }) => { selectUsers = ({ value }) => {
logEvent(events.CREATE_DISCUSSION_SELECT_USERS); logEvent(events.CD_SELECT_USERS);
this.setState({ users: value }); this.setState({ users: value });
} }
onEncryptedChange = (value) => { onEncryptedChange = (value) => {
logEvent(events.CREATE_DISCUSSION_TOGGLE_ENCRY); logEvent(events.CD_TOGGLE_ENCRY);
this.setState({ encrypted: value }); this.setState({ encrypted: value });
} }

View File

@ -174,7 +174,7 @@ class NewServerView extends React.Component {
} }
submit = async({ fromServerHistory = false, username }) => { submit = async({ fromServerHistory = false, username }) => {
logEvent(events.NEWSERVER_CONNECT_TO_WORKSPACE); logEvent(events.NS_CONNECT_TO_WORKSPACE);
const { text, certificate } = this.state; const { text, certificate } = this.state;
const { connectServer } = this.props; const { connectServer } = this.props;
@ -199,7 +199,7 @@ class NewServerView extends React.Component {
} }
connectOpen = () => { connectOpen = () => {
logEvent(events.NEWSERVER_JOIN_OPEN_WORKSPACE); logEvent(events.NS_JOIN_OPEN_WORKSPACE);
this.setState({ connectingOpen: true }); this.setState({ connectingOpen: true });
const { connectServer } = this.props; const { connectServer } = this.props;
connectServer('https://open.rocket.chat'); connectServer('https://open.rocket.chat');

View File

@ -434,7 +434,7 @@ class ProfileView extends React.Component {
} }
logoutOtherLocations = () => { logoutOtherLocations = () => {
logEvent(events.PROFILE_LOGOUT_OTHER_LOCATIONS); logEvent(events.PL_OTHER_LOCATIONS);
showConfirmationAlert({ showConfirmationAlert({
message: I18n.t('You_will_be_logged_out_from_other_locations'), message: I18n.t('You_will_be_logged_out_from_other_locations'),
confirmationText: I18n.t('Logout'), confirmationText: I18n.t('Logout'),
@ -443,7 +443,7 @@ class ProfileView extends React.Component {
await RocketChat.logoutOtherLocations(); await RocketChat.logoutOtherLocations();
EventEmitter.emit(LISTENER, { message: I18n.t('Logged_out_of_other_clients_successfully') }); EventEmitter.emit(LISTENER, { message: I18n.t('Logged_out_of_other_clients_successfully') });
} catch { } catch {
logEvent(events.PROFILE_LOGOUT_OTHER_LOCATIONS_F); logEvent(events.PL_OTHER_LOCATIONS_F);
EventEmitter.emit(LISTENER, { message: I18n.t('Logout_failed') }); EventEmitter.emit(LISTENER, { message: I18n.t('Logout_failed') });
} }
} }