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

OEL-1915: Support date in card pattern. #291

Merged
merged 10 commits into from
Jan 12, 2023
Merged

OEL-1915: Support date in card pattern. #291

merged 10 commits into from
Jan 12, 2023

Conversation

drishu
Copy link
Contributor

@drishu drishu commented Dec 19, 2022

No description provided.

$day_month = $expected['day'] . ' ' . $expected['month'];

if (isset($expected['end_day']) && isset($expected['end_month'])) {
$day_month .= ' - ' . $expected['end_day'] . ' ' . $expected['end_month'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to do extra processing here nor patch the template just for this strange looking extra space

Copy link
Contributor

Choose a reason for hiding this comment

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

But it's too risky like this unfortunately, we need to clean it up.

*/
protected function assertCardImage($expected_image, string $variant, Crawler $crawler): void {
if ($variant === 'search') {
$image_div = $crawler->filter('.row .col-md-3 img.card-img-top');
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the assertions are the same, can we just determine the selector in the if() ?

* The DomCrawler where to check the element.
*/
protected function assertDate(array $expected, Crawler $crawler): void {
// @todo Use dedicated pattern assert once we re-work date_plock pattern.
Copy link
Contributor

Choose a reason for hiding this comment

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

date_block

$day_month = $expected['day'] . ' ' . $expected['month'];

if (isset($expected['end_day']) && isset($expected['end_month'])) {
$day_month .= ' - ' . $expected['end_day'] . ' ' . $expected['end_month'];
Copy link
Contributor

Choose a reason for hiding this comment

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

But it's too risky like this unfortunately, we need to clean it up.

* @return string
* The base selector for the variant.
*/
protected function getBaseItemClass(string $variant): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this separate? It's only used once.

Copy link
Contributor

@brummbar brummbar left a comment

Choose a reason for hiding this comment

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

All good, just this documentation change.

date:
type: array
label: 'Date object'
description: 'Date for card. Optional.'
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't remember the ticket and it took me a while to remember how to use this. It's not really an object, it's an associative array, let's put some info in here. At least let's write that it uses the same parameters of the bcl date-block template.

@brummbar brummbar merged commit af0e771 into 1.x Jan 12, 2023
@brummbar brummbar deleted the OEL-1915 branch January 12, 2023 16:49
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.

None yet

2 participants