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

Hide dashboard edit mode on small screen sizes #30103

Merged
merged 1 commit into from
Feb 6, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ function getEditConfig(action) {
defaultMessage: 'Switch to edit mode',
}),
testId: 'dashboardEditMode',
// We want to hide the "edit" button on small screens, since those have a responsive
// layout, which is not tied to the grid anymore, so we cannot edit the grid on that screens.
className: 'eui-hideFor--s eui-hideFor--xs',
run: action
};
}
Expand Down
13 changes: 13 additions & 0 deletions src/ui/public/kbn_top_nav/__tests__/kbn_top_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,17 @@ describe('kbnTopNav directive', function () {
const { $scope } = build({ controller }, { config: 'controller' });
expect($scope.kbnTopNav).to.be(controller);
});

it('should allow setting CSS classes via className', () => {
const scope = {
config: [
{ key: 'foo', testId: 'foo', className: 'fooClass' },
{ key: 'test', testId: 'test', className: 'class1 class2' },
],
};
const { $el } = build(scope, { config: 'config' });
expect($el.find('[data-test-subj="foo"]').hasClass('fooClass')).to.be(true);
expect($el.find('[data-test-subj="test"]').hasClass('class1')).to.be(true);
expect($el.find('[data-test-subj="test"]').hasClass('class2')).to.be(true);
});
});
2 changes: 1 addition & 1 deletion src/ui/public/kbn_top_nav/kbn_top_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div class="kuiLocalMenu kbnTopNav__mainMenu" ng-if="kbnTopNav.menuItems.length">
<button
class="kuiLocalMenuItem"
class="kuiLocalMenuItem {{menuItem.className}}"
ng-repeat="menuItem in kbnTopNav.menuItems"
aria-label="{{::menuItem.description}}"
aria-haspopup="{{!menuItem.hasFunction}}"
Expand Down