-
Notifications
You must be signed in to change notification settings - Fork 11
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
find and apply promos #4476
base: master
Are you sure you want to change the base?
find and apply promos #4476
Conversation
Quality Gate passedIssues Measures |
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.
👍 LGTM
NB: For the link rendered as button, add a
|
class ApplyComponent < ViewComponent::Base | ||
attr_accessor :icon, :title, :text, :link | ||
|
||
def initialize(icon:, link_text: nil, link_target: nil, title: nil, text: nil, hide_on_mobile: false, hide_on_tablet: false, hide_on_desktop: false) |
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.
@martyn-w is there a way to set the default arguments here? so it makes it easier for content on the markdown file
eg. something like this? or is this the wrong place to do that? as i tried it and it didn't like it when i removed the arguments from the markdown file
def initialize(
icon: "icon-school-black",
link_text: "Apply for a course",
link_target: "https://www.gov.uk/apply-for-teacher-training",
title: "Start your application",
text: "Create an account and start your application for a teacher training course.",
hide_on_mobile: false,
hide_on_tablet: false,
hide_on_desktop: false
)
super
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.
Hi @jenhadfield-dfe i've just tested and your suggested fix for default arguments does work - you might need to restart the application to get the defaults to load. Could you try again?
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.
ah thank you! the minimum it will let me leave is just one argument in there, if i take them all out it breaks, but it's ok as long as i leave one in. Is this due to the line in the component:
def before_render
fail(ArgumentError, "a title or text/content must be present") if [title, text, content].all?(&:nil?)
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.
yep - you could remove that constraint if it isn't required
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.
thanks, I've removed. But if i just put -
calls_to_action:
find:
name: find
in the markdown it still breaks, but if i keep one argument in it seems to work ok. It's not the end of the world to have one argument in there, but would be nice to have it as simple as possible
end | ||
end | ||
end | ||
|
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.
@martyn-w is it everything below line 83 that needs removing from the spec files?
Review app deployed to https://get-into-teaching-app-review-4476.test.teacherservices.cloud |
Trello card
https://trello.com/c/vew5h4zh/7152-redesign-and-build-find-promo
Context
Changes proposed in this pull request
Guidance to review