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 Allow status flags to be used generically #1856

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Nov 20, 2024

Status flags are made generic in silverstripe/silverstripe-framework#11460

This PR generalises the styling for them across the board, and ensures LeftAndMain classes always show badges in the breadcrumbs.

Styling in CMSMain looks like this:
Screenshot from 2024-11-20 14-56-20

Custom flags look like this (but custom styling can be easily added):
Screenshot from 2024-11-20 14-57-07

Status flags in gridfields look like this:
Screenshot from 2024-11-20 14-56-03
Screenshot from 2024-11-20 14-55-48

Issue

Comment on lines +3 to +5
background-color: $color-notice;
border-color: transparent;
color: $body-color-dark;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These colours are fairly arbitrary but look nice as a default IMO. Only custom flags will use this styling, all of the versioned/fluent flags still use the colours they used to use.

Comment on lines -162 to -181
span.badge.status-modified {
color: $state-draft;
}

span.badge.status-addedtodraft {
color: $state-draft;
}

span.badge.status-deletedonlive,
span.badge.status-removedfromdraft {
color: #636363;
border: 1px solid #E49393;
background-color: #F2DADB;
}

span.badge.status-workflow-approval {
color: #56660C;
border: 1px solid #7C8816;
background-color: #DAE79A;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were moved into the relevant modules - versioned-admin and advanced-workflow.

Comment on lines +6 to +10
// Badges with no text aren't displayed
&:empty {
display: none;
}
}
Copy link
Member Author

@GuySartorelli GuySartorelli Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already gets inherited from bootstrap, but it surprised me at first. Adding it here so it's explicitly intended behaviour.
Fluent relies on this for something that probably shouldn't be using status flags but I don't want to widen the scope to unpicking that right now.

Comment on lines +122 to +124
// align back button and breadcrumbs
// but specifically do NOT override badge display
*:not(.badge) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required to respect the display:none on empty badges.

Take styling for versioned badges in their various places and centralise
it as a more generic badge, plus ensure LeftAndMain breadcrumbs include
status flags
@michalkleiner
Copy link
Contributor

Is it just me or is the text in the tag like 1 or 2 pixels too high?

@GuySartorelli
Copy link
Member Author

GuySartorelli commented Nov 22, 2024

I wondered that too at first but that's where it's always been vertically.
Can adjust it if that's the consensus, of course.

@emteknetnz
Copy link
Member

Yeah it probably needs to be adjusted

It absolutely needs to be centered in chrome, and preferably also firefox

@emteknetnz emteknetnz merged commit dbb0487 into silverstripe:3 Nov 26, 2024
11 of 12 checks passed
@emteknetnz emteknetnz deleted the pulls/3/status-flags branch November 26, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants