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

[SD-231] Moved states js pattern support to global place for all nodes. #234

Conversation

MdNadimHossain
Copy link
Contributor

@MdNadimHossain MdNadimHossain commented Sep 10, 2024

JIRA

https://digital-vic.atlassian.net/browse/SD-231

Issue

Drupal states pattern was not working for promotion and navigation card component for other content types.

Changes

Removed the JS that has been used only for landing page and moved it to tide_core to get loaded for all content types node.

Related PR

dpc-sdp/tide_core#511

Notes

Initially it was targeting only landing page as the component was only added for landing pages. Now the component is being used for publication page and it might get used for other content types in the future. So loading it for all node edit forms from tide_core.

Copy link
Contributor

@anthony-malkoun anthony-malkoun left a comment

Choose a reason for hiding this comment

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

@MdNadimHossain I might be missing the point but should this be in tide core rather than tide landing page? Our is it being added to other content types separately?

@anthony-malkoun
Copy link
Contributor

Also, should we be cleaning up the circle jobs of we're no longer using them? Would be nice to have green checks across the board.

@MdNadimHossain
Copy link
Contributor Author

@MdNadimHossain I might be missing the point but should this be in tide core rather than tide landing page? Our is it being added to other content types separately?

This js was added as a part of promotion and navigation card states pattern use and as the components belongs to landing page, the js was added here with the components, so it loads only for landing pages node. Looks like I forgot to remove the other one and that is what created the confusion.
But I think you are right, if it is going to use globally, it should be added in tide_core.

Pattern example in state -
if (isset($element['subform']['field_paragraph_summary'])) { $element['subform']['field_paragraph_summary']['widget'][0]['value']['#states'] = [ 'visible' => [ $selector => [ ['value' => ['pattern' => '^http']], ['value' => ''], ], ], ];

Let me add it in tide_core and also modify this PR.

Copy link
Contributor

@anthony-malkoun anthony-malkoun left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning up @MdNadimHossain!

@MdNadimHossain MdNadimHossain merged commit 8564497 into develop Sep 20, 2024
5 of 8 checks passed
@MdNadimHossain MdNadimHossain deleted the bug/SD-231-moved-state-pattern-js-global-place-for-all-nodes branch September 20, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants