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

Add tests and styling for betterbuttons port #744

Merged
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions client/src/components/Toolbar/Toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,41 @@
.btn {
margin-bottom: 0;
}

.right {
margin-left: auto;

.btn-group:not(last-child) {
margin-right: 10px !important;
bergice marked this conversation as resolved.
Show resolved Hide resolved
}
}

.rounded {

&.btn,
>.btn {
width: 32px;
padding-left: 7px;
bergice marked this conversation as resolved.
Show resolved Hide resolved

&:last-child {
border-top-right-radius: 100px !important;
border-bottom-right-radius: 100px !important;
}

&:first-child {
border-top-left-radius: 100px !important;
border-bottom-left-radius: 100px !important;
}

}

border-radius: 100px !important;

&::before,
.btn::before {
margin-right: 0;
}
}
}

// Northern bar containing breadcrumb, tabs etc.
Expand Down
6 changes: 4 additions & 2 deletions client/src/font/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@
.font-icon-book-open:before {
content: "\6f";
}
.font-icon-plus:before {
content: "\6a";
.font-icon-plus-thin:before {
content: "\44";
transform: rotate(45deg);
display: inline-block;
}
.font-icon-tree:before {
content: "\70";
Expand Down
8 changes: 8 additions & 0 deletions client/src/legacy/LeftAndMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,14 @@ $.entwine('ss', function($) {
}
});

$('.cms button.action.discard-confirmation').entwine({
onclick: function(e) {
if (!$('.cms-container').checkCanNavigate()) {
e.preventDefault();
}
}
});

bergice marked this conversation as resolved.
Show resolved Hide resolved
/**
* Does an ajax loads of the link's 'href' attribute via ajax and displays any FormResponse messages from the CMS.
* Little helper to avoid repetition, and make it easy to trigger actions via a link,
Expand Down
6 changes: 4 additions & 2 deletions client/src/styles/_fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
content: "\6f";
}

.font-icon-plus:before {
content: "\6a";
.font-icon-plus-thin:before {
content: "\44";
transform: rotate(45deg);
display: inline-block;
bergice marked this conversation as resolved.
Show resolved Hide resolved
}

.font-icon-tree:before {
Expand Down
27 changes: 26 additions & 1 deletion tests/behat/features/manage-users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: Manage users
Given a "member" "ADMIN" belonging to "ADMIN group" with "Email"="[email protected]"
And the "member" "ADMIN" belonging to "ADMIN group2"
And a "member" "Staff" belonging to "Staff group" with "Email"="[email protected]"
And a "member" "Other Staff" belonging to "Staff group" with "Email"="[email protected]"
And the "group" "ADMIN group" has permissions "Full administrative rights"
And the "group" "ADMIN group2" has permissions "Full administrative rights"
And I am logged in with "ADMIN" permissions
Expand Down Expand Up @@ -88,8 +89,32 @@ Feature: Manage users
When I go to "admin/security/"
Then I should see "[email protected]" in the "#Root_Users" element

Scenario: I can edit an existing user and add him to an existing group
@modal
Scenario: I can navigate users from the edit form and retain my search query
When I click the "Users" CMS tab
And I press the "First Name" button

Then I should see "[email protected]" in the "#Root_Users" element
And I should see "[email protected]" in the "#Root_Users" element
And I should see "[email protected]" in the "#Root_Users" element

When I click "[email protected]" in the "#Root_Users" element
And I press the "Form_ItemEditForm_action_doNext" button
Then the "Email" field should contain "[email protected]"
When I press the "Form_ItemEditForm_action_doPrevious" button
Then the "Email" field should contain "[email protected]"

When I fill in "FirstName" with "Staff Renamed"
And I press the "Form_ItemEditForm_action_doNew" button
Then I see the text "Are you sure you want to navigate away from this page?" in the alert
And I dismiss the dialog

When I go to "admin/security/"
Then I confirm the dialog

Scenario: I can edit an existing user and add him to an existing group
When I go to "admin/security/"
And I click the "Users" CMS tab
And I click "[email protected]" in the "#Root_Users" element
And I select "ADMIN group" from "Groups"
And I press the "Apply changes" button
Expand Down