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

ENH Include versioned status flag styling #372

Merged
merged 1 commit into from
Nov 26, 2024
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
2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/src/styles/bundle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Legacy
@import "legacy/ArchiveAdmin";
@import "legacy/badges";

// Components
@import "../components/HistoryViewer/HistoryViewer";
Expand Down
15 changes: 15 additions & 0 deletions client/src/styles/legacy/_badges.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@mixin badge-status($label, $textColor, $bgColor) {
.badge.status-#{$label} {
background-color: $bgColor;
border-color: $textColor;
}
.badge.status-#{$label} {
color: $textColor;
}
}

@include badge-status('addedtodraft', #cf3f00, #fff2ea);
@include badge-status('modified', #cf3f00, #fff2ea);
@include badge-status('archived', #455b6c, #f1f3f6);
@include badge-status('deletedonlive', #455b6c, #f1f3f6);
@include badge-status('removedfromdraft', #455b6c, #f1f3f6);
6 changes: 4 additions & 2 deletions tests/Behat/features/restore-to-draft.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ Feature: Restore to draft

Scenario: I can restore archived version to draft
When I go to "/admin/archive"
Then I should see "MyPage" in the "#Form_EditForm" element
Then I click "MyPage" in the "#Form_EditForm" element
Then I should see "MyPage" in the "#Form_EditForm .col-Title" element
# Need to use "directly" here or it will think the badge is part of the text in the element
# which results in thinking it's not a match ("MyPageArchived" !== "MyPage")
Then I click "MyPage" directly in the "#Form_EditForm .col-Title" element
Then I press the "Restore to draft" button
Then I should see "Successfully restored the page" in the "#Form_EditForm" element
When I go to "/admin/pages"
Expand Down
Loading