Skip to content

Commit

Permalink
ENH Include versioned status flag styling (#372)
Browse files Browse the repository at this point in the history
This used to be in silverstripe/admin for some reason
  • Loading branch information
GuySartorelli authored Nov 26, 2024
1 parent 33337f0 commit aac7023
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
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

0 comments on commit aac7023

Please sign in to comment.