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 Use getStatusFlags() instead of hardcoded statuses #351

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 uses the new getStatusFlags() method instead of building hardcoded status flags.

Ends up looking something like this (custom flag added by overriding getStatusFlags())
Screenshot from 2024-11-20 14-56-56

Issue

Comment on lines -201 to -202
color: #cf3f00;
background-color: #fff2ea;
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.

Rely on styling in admin for colours

Comment on lines +203 to +205
&:not(:last-child) {
margin-right: 5px;
}
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.

Needs a gap between badges - this value matches the right margin on the title text

Comment on lines -256 to +257
return $this->renderWith([static::class, Link::class]);
return (string) $this->renderWith([static::class, Link::class]);
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated change - my IDE was upset that the return type was string but this returns DBHtmlText - probably just because we're using strict mode here when we don't use it anywhere else.

};

const LinkPickerTitle = ({
id,
title,
description,
versionState,
statusFlags,
Copy link
Member

Choose a reason for hiding this comment

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

How is this prop being passed in? There's no corresponding PHP change in this PR?

Copy link
Member Author

@GuySartorelli GuySartorelli Nov 25, 2024

Choose a reason for hiding this comment

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

@emteknetnz emteknetnz merged commit 8f867be into silverstripe:5 Nov 26, 2024
7 of 12 checks passed
@emteknetnz emteknetnz deleted the pulls/5/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.

2 participants