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

[NEW] New sidebar layout #9608

Merged
merged 37 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d782ce6
new sidebar header
karlprieb Jan 30, 2018
ab5a59b
fix sidebarHeader template
karlprieb Jan 30, 2018
ac43d75
fix set state
karlprieb Jan 30, 2018
b5e9c9c
Fix saveUserPreferences method
karlprieb Jan 31, 2018
b52402d
sort ;ist
ggazzo Feb 1, 2018
07226e2
sidenav viewmode
karlprieb Feb 1, 2018
5d879e5
migration sort sidenav
ggazzo Feb 5, 2018
2be7a45
Merge branch 'new-sidebar' of github.com:RocketChat/Rocket.Chat into …
ggazzo Feb 5, 2018
fd36bc1
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into new-…
karlprieb Feb 5, 2018
5f605af
Merge branch 'new-sidebar' of github.com:RocketChat/Rocket.Chat into …
karlprieb Feb 5, 2018
3680fa8
sidebar views
karlprieb Feb 5, 2018
66790b3
new icons
karlprieb Feb 5, 2018
b3b3ac3
change sidenav preferences to sidebar preferences
karlprieb Feb 6, 2018
0b80897
translations and big emoji
ggazzo Feb 6, 2018
d6c5381
Merge branch 'new-sidebar' of github.com:RocketChat/Rocket.Chat into …
ggazzo Feb 6, 2018
831634e
search
karlprieb Feb 6, 2018
92858c9
Merge branch 'new-sidebar' of github.com:RocketChat/Rocket.Chat into …
karlprieb Feb 6, 2018
2863e58
star icon
karlprieb Feb 6, 2018
f87af93
fix tests
karlprieb Feb 7, 2018
8239f0c
fix tests
karlprieb Feb 7, 2018
905219c
fix user preferences/admin sidebar item icons
karlprieb Feb 7, 2018
ab11cd2
remove tooltip on click sidebarheader
ggazzo Feb 7, 2018
1b7e3bb
Merge branch 'develop' into new-sidebar
engelgabriel Feb 8, 2018
77698da
Merge branch 'develop' into new-sidebar
karlprieb Feb 16, 2018
1ca598a
new merged icon
karlprieb Feb 16, 2018
a520e90
remove comments and logs
karlprieb Feb 19, 2018
4a69d6e
try to fix isRtl
karlprieb Feb 19, 2018
ea6c7a1
Merge branch 'develop' into new-sidebar
karlprieb Feb 19, 2018
8fdb51e
Merge branch 'develop' into new-sidebar
engelgabriel Feb 20, 2018
6c35a9f
fix icon sizes
engelgabriel Feb 20, 2018
94efe9a
Merge branch 'new-sidebar' of github.com:RocketChat/Rocket.Chat into …
engelgabriel Feb 20, 2018
66e5626
Fix typo
engelgabriel Feb 20, 2018
01a9123
reverting @engelgabriel commits
karlprieb Feb 20, 2018
3fa23bb
Merge branch 'develop' into new-sidebar
karlprieb Feb 20, 2018
643ba1d
fix all diego's problems
karlprieb Feb 20, 2018
8de37ff
Fix icon sizes
engelgabriel Feb 20, 2018
7afb66e
update Merge_Channels name
karlprieb Feb 20, 2018
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
6 changes: 5 additions & 1 deletion packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
"All_users_in_the_channel_can_write_new_messages": "All users in the channel can write new messages",
"Allow_Invalid_SelfSigned_Certs": "Allow Invalid Self-Signed Certs",
"Allow_Invalid_SelfSigned_Certs_Description": "Allow invalid and self-signed SSL certificate's for link validation and previews.",
"Alphabetical": "Alphabetical",
"Allow_switching_departments": "Allow Visitor to Switch Departments",
"Always_open_in_new_window": "Always Open in New Window",
"Analytics_features_enabled": "Features Enabled",
Expand Down Expand Up @@ -701,6 +702,7 @@
"Facebook_Page": "Facebook Page",
"False": "False",
"Favorite_Rooms": "Enable Favorite Rooms",
"Favorite": "Favorite",
"Favorites": "Favorites",
"Features_Enabled": "Features Enabled",
"Field": "Field",
Expand Down Expand Up @@ -798,6 +800,7 @@
"GoogleVision_Type_Properties": "Properties (Color) Detection",
"GoogleVision_Type_SafeSearch": "SafeSearch Detection",
"GoogleVision_Type_Similar": "Search Similar Images",
"Group_by_categories": "Group by categories",
"Group_mentions_only": "Group mentions only",
"Guest_Pool": "Guest Pool",
"Hash": "Hash",
Expand Down Expand Up @@ -1694,6 +1697,7 @@
"Should_exists_a_user_with_this_username": "The user must already exist.",
"Show_agent_email": "Show agent email",
"Show_all": "Show All",
"Show_Avatars": "Show Avatars",
"Show_counter": "Show counter",
"Show_room_counter_on_sidebar": "Show room counter on sidebar",
"Show_more": "Show more",
Expand Down Expand Up @@ -1756,7 +1760,6 @@
"Sort_by_activity": "Sort by Activity",
"Sound": "Sound",
"Sound_File_mp3": "Sound File (mp3)",
"Split_by_categories": "Split by categories",
"SSL": "SSL",
"Star_Message": "Star Message",
"Starred_Messages": "Starred Messages",
Expand Down Expand Up @@ -1947,6 +1950,7 @@
"Unmute_user": "Unmute user",
"Unnamed": "Unnamed",
"Unpin_Message": "Unpin Message",
"Unread" : "Unread",
"Unread_Count": "Unread Count",
"Unread_Count_DM": "Unread Count for Direct Messages",
"Unread_Messages": "Unread Messages",
Expand Down
18 changes: 0 additions & 18 deletions packages/rocketchat-lib/lib/roomTypes/channels.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/rocketchat-lib/lib/roomTypes/conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { RoomTypeConfig } from '../RoomTypeConfig';
export class ConversationRoomType extends RoomTypeConfig {
constructor() {
super({
identifier: 'activity',
identifier: 'merged',
order: 30,
label: 'Conversations'
});
}

condition() {
const user = Meteor.user();
return RocketChat.getUserPreference(user, 'roomsListExhibitionMode') === 'activity';
return RocketChat.getUserPreference(user, 'mergeChannels');
}
}
4 changes: 2 additions & 2 deletions packages/rocketchat-lib/lib/roomTypes/direct.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export class DirectMessageRoomType extends RoomTypeConfig {

condition() {
const user = Meteor.user();
const roomsListExhibitionMode = RocketChat.getUserPreference(user, 'roomsListExhibitionMode');
return !roomsListExhibitionMode || ['unread', 'category'].includes(roomsListExhibitionMode) && RocketChat.authz.hasAtLeastOnePermission(['view-d-room', 'view-joined-room']);
const mergeChannels = RocketChat.getUserPreference(user, 'mergeChannels');
return !mergeChannels && RocketChat.authz.hasAtLeastOnePermission(['view-d-room', 'view-joined-room']);
}

getUserStatus(roomId) {
Expand Down
4 changes: 4 additions & 0 deletions packages/rocketchat-lib/lib/roomTypes/favorite.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ export class FavoriteRoomType extends RoomTypeConfig {
label: 'Favorites'
});
}
condition() {
const user = Meteor.user();
return RocketChat.settings.get('Favorite_Rooms') && RocketChat.getUserPreference(user, 'sidebarShowFavorites');
}
}
2 changes: 0 additions & 2 deletions packages/rocketchat-lib/lib/roomTypes/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ChannelsRoomType } from './channels';
import { ConversationRoomType } from './conversation';
import { DirectMessageRoomType } from './direct';
import { FavoriteRoomType } from './favorite';
Expand All @@ -7,7 +6,6 @@ import { PublicRoomType } from './public';
import { UnreadRoomType } from './unread';

export {
ChannelsRoomType,
ConversationRoomType,
DirectMessageRoomType,
FavoriteRoomType,
Expand Down
3 changes: 1 addition & 2 deletions packages/rocketchat-lib/lib/roomTypes/private.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ export class PrivateRoomType extends RoomTypeConfig {

condition() {
const user = Meteor.user();
const roomsListExhibitionMode = RocketChat.getUserPreference(user, 'roomsListExhibitionMode');
const mergeChannels = RocketChat.getUserPreference(user, 'mergeChannels');
return !roomsListExhibitionMode || ['unread', 'category'].includes(roomsListExhibitionMode) && !mergeChannels && RocketChat.authz.hasAllPermission('view-p-room');
return !mergeChannels && RocketChat.authz.hasAllPermission('view-p-room');
}

isGroupChat() {
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-lib/lib/roomTypes/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export class PublicRoomType extends RoomTypeConfig {

condition() {
const user = Meteor.user();
const roomsListExhibitionMode = RocketChat.getUserPreference(user, 'roomsListExhibitionMode');
// const roomsListExhibitionMode = RocketChat.getUserPreference(user, 'roomsListExhibitionMode');
const mergeChannels = RocketChat.getUserPreference(user, 'mergeChannels');
return !roomsListExhibitionMode || ['unread', 'category'].includes(roomsListExhibitionMode) && !mergeChannels && (RocketChat.authz.hasAtLeastOnePermission(['view-c-room', 'view-joined-room']) || RocketChat.settings.get('Accounts_AllowAnonymousRead') === true);
return !mergeChannels && (RocketChat.authz.hasAtLeastOnePermission(['view-c-room', 'view-joined-room']) || RocketChat.settings.get('Accounts_AllowAnonymousRead') === true);
}

showJoinLink(roomId) {
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/lib/roomTypes/unread.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export class UnreadRoomType extends RoomTypeConfig {

condition() {
const user = Meteor.user();
return RocketChat.getUserPreference(user, 'roomsListExhibitionMode') === 'unread';
return RocketChat.getUserPreference(user, 'sidebarShowUnread');
}
}
1 change: 0 additions & 1 deletion packages/rocketchat-lib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Package.onUse(function(api) {
// ROOM TYPES
api.addFiles('lib/RoomTypeConfig.js');
api.addFiles([
'lib/roomTypes/channels.js',
'lib/roomTypes/conversation.js',
'lib/roomTypes/direct.js',
'lib/roomTypes/favorite.js',
Expand Down
11 changes: 8 additions & 3 deletions packages/rocketchat-lib/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,15 @@ class ModelUsers extends RocketChat.models._Base {
}

setPreferences(_id, preferences) {
const settings = Object.assign(
{},
...Object.keys(preferences).map(key => {
return {[`settings.preferences.${ key }`]: preferences[key]};
})
);

const update = {
$set: {
'settings.preferences': preferences
}
$set: settings
};

return this.update(_id, update);
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-lib/startup/defaultRoomTypes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
ChannelsRoomType,
ConversationRoomType,
DirectMessageRoomType,
FavoriteRoomType,
Expand All @@ -11,7 +10,6 @@ import {
RocketChat.roomTypes.add(new UnreadRoomType());
RocketChat.roomTypes.add(new FavoriteRoomType());
RocketChat.roomTypes.add(new ConversationRoomType());
RocketChat.roomTypes.add(new ChannelsRoomType());
RocketChat.roomTypes.add(new PublicRoomType());
RocketChat.roomTypes.add(new PrivateRoomType());
RocketChat.roomTypes.add(new DirectMessageRoomType());
2 changes: 1 addition & 1 deletion packages/rocketchat-livechat/.app/client/lib/tapi18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ this.tr = function(key, options, ...replaces) {
};

this.isRtl = (lang) => {
const language = lang ? lang : localStorage.getItem('userLanguage');
const language = lang ? lang : localStorage.getItem('userLanguage') ? localStorage.getItem('userLanguage') : 'en-US';
return ['ar', 'dv', 'fa', 'he', 'ku', 'ps', 'sd', 'ug', 'ur', 'yi'].includes(language.split('-').shift().toLowerCase());
};
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
}

.livechat-section {
margin-bottom: 32px;
margin-bottom: 22px;
}

.livechat-status {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ <h3 class="rooms-list__type {{isActive}}">
<ul class="rooms-list__list inquiries">
{{#each room in inquiries}}
{{> chatRoomItem room }}
{{else}}
<p class="rooms-list__empty-room">{{_ "No_livechats" }}</p>
{{/each}}
</ul>
{{/if}}
Expand All @@ -32,8 +30,6 @@ <h3 class="rooms-list__type {{isActive}}">
{{/if}}
{{#each room in rooms}}
{{> chatRoomItem room }}
{{else}}
<p class="rooms-list__empty-room">{{_ "No_livechats" }}</p>
{{/each}}
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@
}

& .rc-input__icon-svg--plus {
transition: transform 0.2s linear;
transition: transform 0.1s linear;
}
}

&__action-menu {
position: relative;

&.active .rc-input__icon-svg--plus {
transform: rotate(135deg);
transform: rotate(45deg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
font-size: var(--popover-item-text-size);
align-items: center;

transition: all 0.3s;
width: 100%;

&--alert {
color: var(--rc-color-error);

Expand All @@ -101,6 +104,10 @@
}
}

&--bold {
font-weight: 900;
}

&--star-filled .rc-icon {
fill: currentColor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
}

&__list:not(:last-child) {
margin-bottom: 32px;
margin-bottom: 22px;
}

&__type {
display: flex;

flex-direction: row;

padding: 0 var(--sidebar-default-padding) 0.5rem var(--sidebar-default-padding);
padding: 0 var(--sidebar-default-padding) 1rem var(--sidebar-default-padding);

color: var(--rooms-list-title-color);

Expand All @@ -48,13 +48,10 @@
position: absolute;
z-index: 1;

bottom: var(--sidebar-footer-height);
left: 0;
left: 10px;

overflow-y: scroll;

width: 100%;

background-color: var(--sidebar-background);
}
}
Expand All @@ -67,11 +64,5 @@
&__empty-room {
padding: 0 calc(var(--sidebar-small-default-padding) - 4px) 0.5rem calc(var(--sidebar-small-default-padding) - 4px);
}

&__toolbar-search {
bottom: 0;

padding: 0 var(--sidebar-small-default-padding) var(--sidebar-small-default-padding) var(--sidebar-small-default-padding);
}
}
}
Loading