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] remove accountBox from admin menu #8358

Merged
merged 4 commits into from
Sep 30, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions packages/rocketchat-authorization/client/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Meteor.subscribe('roles');
RocketChat.AdminBox.addOption({
href: 'admin-permissions',
i18nLabel: 'Permissions',
icon: 'lock',
permissionGranted() {
return RocketChat.authz.hasAllPermission('access-permissions');
}
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-custom-sounds/client/admin/startup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
RocketChat.AdminBox.addOption({
href: 'custom-sounds',
i18nLabel: 'Custom_Sounds',
icon: 'volume',
permissionGranted() {
return RocketChat.authz.hasAtLeastOnePermission(['manage-sounds']);
}
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-emoji-custom/admin/startup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
RocketChat.AdminBox.addOption({
href: 'emoji-custom',
i18nLabel: 'Custom_Emoji',
icon: 'emoji',
permissionGranted() {
return RocketChat.authz.hasAtLeastOnePermission(['manage-emoji']);
}
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-integrations/client/startup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RocketChat.AdminBox.addOption({
href: 'admin-integrations',
i18nLabel: 'Integrations',
icon: 'code',
permissionGranted: () => RocketChat.authz.hasAtLeastOnePermission(['manage-integrations', 'manage-own-integrations'])
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<template name="livechatFlex">
<aside class="sidebar-light" role="navigation">
{{#unless embeddedVersion}}
<header class="sidebar__header">
{{> accountBox lighten=true modifier="--livechat"}}
<button class="sidebar-flex__back-button" data-action="back">
{{> icon block="sidebar-flex__back-icon" icon="back"}}
<span>{{_ "Back_to_chat"}}</span>
<header class="sidebar-flex__header">
<h1 class="sidebar-flex__title">{{_ "Livechat"}}</h1>
{{#unless embeddedVersion}}
<button class="sidebar-flex__close-button" data-action="close">
{{> icon block="sidebar-flex__close-icon" icon="cross"}}
</button>
</header>
{{/unless}}
{{/unless}}
</header>
<div class="rooms-list {{#if embeddedVersion}}rooms-list--embedded{{/if}}">
<ul class="rooms-list__list">
{{> sidebarItem menuItem "Current_Chats" false "livechat-current-chats" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Template.livechatFlex.helpers({
});

Template.livechatFlex.events({
'click [data-action="back"]'() {
'click [data-action="close"]'() {
SideNav.closeFlex();
}
});
3 changes: 2 additions & 1 deletion packages/rocketchat-logger/client/viewLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
this.stdout = new Mongo.Collection('stdout');

Meteor.startup(function() {
return RocketChat.AdminBox.addOption({
RocketChat.AdminBox.addOption({
href: 'admin-view-logs',
i18nLabel: 'View_Logs',
icon: 'post',
permissionGranted() {
return RocketChat.authz.hasAllPermission('view-logs');
}
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-mailer/client/startup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
RocketChat.AdminBox.addOption({
href: 'mailer',
i18nLabel: 'Mailer',
icon: 'mail',
permissionGranted() {
return RocketChat.authz.hasAllPermission('access-mailer');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
RocketChat.AdminBox.addOption({
href: 'admin-oauth-apps',
i18nLabel: 'OAuth Apps',
icon: 'discover',
permissionGranted() {
return RocketChat.authz.hasAllPermission('manage-oauth-apps');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
.sidebar-flex {
&__back-button {
margin-left: 0.25rem;
&__header {
padding: var(--sidebar-default-padding);

padding: 1rem var(--sidebar-default-padding) 1.5rem;

color: var(--sidebar-flex-back-button-color);
display: flex;
}

&__title {
font-size: 1rem;
font-weight: 400;

flex: 1;
}

&__back-icon {
font-size: 1.25rem;
&__close-button {
font-size: 18px;
}

&__search {
Expand Down
15 changes: 7 additions & 8 deletions packages/rocketchat-ui-account/client/accountFlex.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<template name="accountFlex">
<aside class="sidebar-light" role="navigation">
{{#unless embeddedVersion}}
<header class="sidebar__header">
{{> accountBox lighten=true modifier="--account" }}
<button class="sidebar-flex__back-button" data-action="back">
{{> icon block="sidebar-flex__back-icon" icon="back"}}
<span>{{_ "Back_to_chat"}}</span>
<header class="sidebar-flex__header">
<h1 class="sidebar-flex__title">{{_ "My_Account"}}</h1>
{{#unless embeddedVersion}}
<button class="sidebar-flex__close-button" data-action="close">
{{> icon block="sidebar-flex__close-icon" icon="cross"}}
</button>
</header>
{{/unless}}
{{/unless}}
</header>
<div class="rooms-list {{#if embeddedVersion}}rooms-list--embedded{{/if}}">
<ul class="rooms-list__list">
{{> sidebarItem menuItem "Preferences" "customize" "account" "preferences" }}
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui-account/client/accountFlex.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Template.accountFlex.events({
'click [data-action="back"]'() {
'click [data-action="close"]'() {
SideNav.closeFlex();
}
});
Expand Down
26 changes: 12 additions & 14 deletions packages/rocketchat-ui-admin/client/adminFlex.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<template name="adminFlex">
<aside class="sidebar-light" role="navigation">
{{#unless embeddedVersion}}
<header class="sidebar__header">
{{> accountBox lighten=true modifier="--admin"}}
<button class="sidebar-flex__back-button" data-action="back">
{{> icon block="sidebar-flex__back-icon" icon="back"}}
<span>{{_ "Back_to_chat"}}</span>
<header class="sidebar-flex__header">
<h1 class="sidebar-flex__title">{{_ "Administration"}}</h1>
{{#unless embeddedVersion}}
<button class="sidebar-flex__close-button" data-action="close">
{{> icon block="sidebar-flex__close-icon" icon="cross"}}
</button>
</header>
{{/unless}}
{{/unless}}
</header>
<div class="rooms-list {{#if embeddedVersion}}rooms-list--embedded{{/if}}" aria-label="{{_ "Administration"}}">
<h3 class="rooms-list__type">{{_ "Administration"}}</h3>
<ul class="rooms-list__list">
{{> sidebarItem menuItem "Info" false "admin-info" "" }}
{{> sidebarItem menuItem "Info" "info-circled" "admin-info" "" }}

{{#if hasPermission 'run-import'}}
{{> sidebarItem menuItem "Import" false "admin-import" "" }}
{{> sidebarItem menuItem "Import" "import" "admin-import" "" }}
{{/if}}

{{#if hasPermission 'view-room-administration'}}
{{> sidebarItem menuItem "Rooms" false "admin-rooms" "" }}
{{> sidebarItem menuItem "Rooms" "hashtag" "admin-rooms" "" }}
{{/if}}

{{#if hasPermission 'view-user-administration'}}
{{> sidebarItem menuItem "Users" false "admin-users" "" }}
{{> sidebarItem menuItem "Users" "team" "admin-users" "" }}
{{/if}}

{{#each adminBoxOptions}}
{{#if permissionGranted}}
{{> sidebarItem menuItem label false href "" }}
{{> sidebarItem menuItem label icon href "" }}
{{/if}}
{{/each}}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui-admin/client/adminFlex.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Template.adminFlex.helpers({
});

Template.adminFlex.events({
'click [data-action="back"]'() {
'click [data-action="close"]'() {
SideNav.closeFlex();
},
'keyup [name=settings-search]'(e, t) {
Expand Down
6 changes: 5 additions & 1 deletion packages/rocketchat-ui-master/public/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions packages/rocketchat-ui-sidenav/client/sidebarItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
<div class="sidebar-item__user-status sidebar-item__user-status--{{statusClass}}"></div>
{{/if}}
<a class="sidebar-item__link" href="{{#if route}}{{route}}{{else}}{{pathFor pathSection group=pathGroup}}{{/if}}" title="{{name}}">
<div class="sidebar-item__picture">
{{#if icon}}
{{#if icon}}
<div class="sidebar-item__picture">
{{> icon block="sidebar-item__icon" icon=icon}}
{{else}}
{{#if avatar}}
</div>
{{else}}
{{#if avatar}}
<div class="sidebar-item__picture">
<div class="sidebar-item__user-thumb">
{{> avatar username=username}}
</div>
{{/if}}
</div>
{{/if}}
</div>
{{/if}}
<div class='sidebar-item__name {{archivedClass}}'>{{name}}</div>
{{#if userMentions}}
<span class="badge badge--mention">@</span>
Expand Down
2 changes: 1 addition & 1 deletion tests/pageobjects/side-nav.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SideNav extends Page {
get preferences() { return browser.element('[href="/account/preferences"]'); }
get profile() { return browser.element('[href="/account/profile"]'); }
get avatar() { return browser.element('[href="/changeavatar"]'); }
get preferencesClose() { return browser.element('.sidebar-flex__back-button[data-action="back"]'); }
get preferencesClose() { return browser.element('.sidebar-flex__close-button[data-action="close"]'); }

get burgerBtn() { return browser.element('.burger'); }

Expand Down