Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Breadcrumbs exceeding characters limit #2862

Merged
merged 3 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/sagas/createChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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));
}
};
Expand Down
6 changes: 3 additions & 3 deletions app/sagas/createDiscussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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));
}
};
Expand Down
36 changes: 17 additions & 19 deletions app/utils/log/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ 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',
diegolmello marked this conversation as resolved.
Show resolved Hide resolved
NS_JOIN_OPEN_WORKSPACE: 'ns_join_open_workspace',

// LOGIN VIEW
LOGIN_DEFAULT_LOGIN: 'login_default_login',
Expand Down Expand Up @@ -99,20 +98,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',
Expand All @@ -122,8 +121,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',
Expand Down Expand Up @@ -297,8 +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',
NP_DESKTOPNOTIFICATIONDURATION: 'np_desktopnotificationduration',
NP_DESKTOPNOTIFICATIONDURATION_F: 'np_desktopnotificationduration_f',
NP_EMAILNOTIFICATIONS: 'np_email_notifications',
NP_EMAILNOTIFICATIONS_F: 'np_email_notifications_f',

Expand Down
10 changes: 5 additions & 5 deletions app/views/CreateChannelView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 }));
}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/views/CreateDiscussionView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

Expand Down
4 changes: 2 additions & 2 deletions app/views/NewServerView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions app/views/ProfileView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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') });
}
}
Expand Down