-
Notifications
You must be signed in to change notification settings - Fork 115
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
API Update API to reflect changes in silverstripe/framework #1271
API Update API to reflect changes in silverstripe/framework #1271
Conversation
b432c54
to
1d6e135
Compare
33e17ed
to
e73c467
Compare
b252f6d
to
157c85e
Compare
color: $state-draft; | ||
background-color: $state-modified-bg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rely on silverstripe/admin styling for colours
{this.renderStatusBadge()} | ||
{this.renderStatusFlagBadges()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're rendering potentially multiple badges now, so I've updated the logic to handle that and to pull the status flags from BaseElement
.
@@ -205,6 +205,7 @@ public function apiReadElements(HTTPRequest $request): HTTPResponse | |||
'canPublish' => $element->canPublish(), | |||
'canUnpublish' => $element->canUnpublish(), | |||
'canCreate' => $element->canCreate(), | |||
'statusFlags' => $element->getStatusFlags(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulls through status flags for use in javascript
eff93d5
to
af06aea
Compare
af06aea
to
26d094d
Compare
Replaces use of the overly-broadly named
description
configuration in favour of the newclass_description
config added in silverstripe/silverstripe-framework#11460 and usesi18n_classDescription
instead of custom i18n code.Also updates status flag rendering to render any flags in
getStatusFlags()
.Ends up looking something like this (custom flag added by overriding
getStatusFlags()
)Issue
SiteTree
inCMSMain
silverstripe-cms#2947