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

[SDPAP-7077] Related link mandatory and help text. #365

Conversation

edyuenyw
Copy link
Contributor

@edyuenyw edyuenyw commented Jan 24, 2023

Jira

https://digital-vic.atlassian.net/browse/SDPAP-7077

Problem/Motivation

In this component, the URL field is mandatory. But the Link text field is currently not mandatory. The Link text field needs to be mandatory in order for the link to display.
If a CMS user fills the URL field but not the Link text field, they are able to save the node/page OK but on the front end, if there is no content in the Link text field, no link will display.

Fix

  1. Made 'Related link' mandatory and added help text.

Related PRs

BE: https://github.com/dpc-sdp/content-reference-sdp-vic-gov-au/pull/202 | https://nginx-php.pr-202.content-reference-sdp-vic-gov-au.sdp4.sdp.vic.gov.au/

Screenshots

Before:
image

After:
Screenshot 2023-01-30 at 11 19 30 am

TODO

Copy link
Contributor

@MdNadimHossain MdNadimHossain left a comment

Choose a reason for hiding this comment

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

looks straight forward to me

$link_config->set('description', $link_description);
$link_config->set('settings.title', $systems);
$link_config->save();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @edyuenyw
The above looks too complicated. you probably just want to load the active field.field.paragraph.related_links.field_paragraph_link and change the description and title directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @vincent-gao,
Change made. Less is more 😄

…xt-field-to-mandatory' of github.com:dpc-sdp/tide_core into feature/SDPAP-7077-core-be-related-links-change-link-text-field-to-mandatory
@edyuenyw edyuenyw merged commit e791175 into develop Feb 1, 2023
@edyuenyw edyuenyw deleted the feature/SDPAP-7077-core-be-related-links-change-link-text-field-to-mandatory branch February 1, 2023 04:51
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.

3 participants