Skip to content

Commit

Permalink
FS-5006 remove project name field and give default value and fixes fo…
Browse files Browse the repository at this point in the history
…r date fields
  • Loading branch information
nuwan-samarasinghe committed Jan 31, 2025
1 parent 6d6a123 commit cd77db4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
6 changes: 0 additions & 6 deletions app/blueprints/round/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ class RoundForm(FlaskForm):
widget=GovTextInput(),
validators=[DataRequired(message="Enter the privacy notice link"), validate_flexible_url],
)
project_name_field_id = StringField(
"Project name field ID",
widget=GovTextInput(),
description="Ask a developer on the Forms team for the correct field ID",
validators=[DataRequired(message="Enter the project name field ID")],
)
eoi_decision_schema_en = TextAreaField(
"Expression of interest decision schema (optional)",
widget=GovTextArea(),
Expand Down
9 changes: 6 additions & 3 deletions app/blueprints/round/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from app.db.models.round import Round
from app.db.queries.round import add_round, update_round

PROJECT_NAME_FIELD_DEFAULT = "RoLhhf"


def convert_json_data_for_form(data) -> str:
if isinstance(data, dict):
Expand Down Expand Up @@ -72,7 +74,6 @@ def populate_form_with_round_data(round_obj, form_class):
"instructions_en": round_obj.instructions_json.get("en", "") if round_obj.instructions_json else "",
"instructions_cy": round_obj.instructions_json.get("cy", "") if round_obj.instructions_json else "",
"feedback_link": round_obj.feedback_link,
"project_name_field_id": round_obj.project_name_field_id,
"application_guidance_en": (
round_obj.application_guidance_json.get("en", "") if round_obj.application_guidance_json else ""
),
Expand Down Expand Up @@ -166,7 +167,8 @@ def update_existing_round(round_obj, form, user="dummy_user"):
round_obj.support_times = form.support_times.data
round_obj.support_days = form.support_days.data
round_obj.feedback_link = form.feedback_link.data
round_obj.project_name_field_id = form.project_name_field_id.data
# TODO this need to be revisited with a good approach FS-4904
round_obj.project_name_field_id = PROJECT_NAME_FIELD_DEFAULT
round_obj.guidance_url = form.guidance_url.data
round_obj.all_uploaded_documents_section_available = form.all_uploaded_documents_section_available.data
round_obj.application_fields_download_available = form.application_fields_download_available.data
Expand Down Expand Up @@ -217,7 +219,8 @@ def create_new_round(form, user="dummy_user"):
support_days=form.support_days.data,
instructions_json={"en": form.instructions_en.data or None, "cy": form.instructions_cy.data or None},
feedback_link=form.feedback_link.data,
project_name_field_id=form.project_name_field_id.data,
# TODO this need to be revisited with a good approach FS-4904
project_name_field_id=PROJECT_NAME_FIELD_DEFAULT,
application_guidance_json={
"en": form.application_guidance_en.data or None,
"cy": form.application_guidance_cy.data or None,
Expand Down
1 change: 0 additions & 1 deletion app/blueprints/round/templates/round.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ <h1 class="govuk-heading-l govuk-!-margin-bottom-7">{{ pageHeading }}</h1>
{{form.prospectus_link}}
{{form.privacy_notice_link}}
<div class="govuk-heading-m">Advanced settings</div>
{{form.project_name_field_id}}
{{form.eoi_decision_schema_en }}
{{form.eoi_decision_schema_cy(params={"classes": "welsh-field"}) }}
{{form.contact_us_banner_en }}
Expand Down
20 changes: 3 additions & 17 deletions app/blueprints/round/templates/round_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h2 class="govuk-heading-l govuk-!-margin-bottom-0">Apply for {{ round.fund.titl
"actions": {
"items": [
{
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.opens.id),
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.opens.id+ "-day"),
"text": "Change",
"classes": "govuk-link--no-visited-state",
"visuallyHiddenText": "application round open date",
Expand All @@ -115,7 +115,7 @@ <h2 class="govuk-heading-l govuk-!-margin-bottom-0">Apply for {{ round.fund.titl
"actions": {
"items": [
{
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.deadline.id),
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.deadline.id+ "-day"),
"text": "Change",
"classes": "govuk-link--no-visited-state",
"visuallyHiddenText": "application round close date",
Expand All @@ -129,7 +129,7 @@ <h2 class="govuk-heading-l govuk-!-margin-bottom-0">Apply for {{ round.fund.titl
"actions": {
"items": [
{
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.reminder_date.id),
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.reminder_date.id+ "-day"),
"text": "Change",
"classes": "govuk-link--no-visited-state",
"visuallyHiddenText": "applicant reminder date",
Expand Down Expand Up @@ -347,20 +347,6 @@ <h2 class="govuk-heading-l govuk-!-margin-bottom-0">Apply for {{ round.fund.titl
]
},
},
{
"key": {"text": form.project_name_field_id.label.text},
"value": {"text": round.project_name_field_id},
"actions": {
"items": [
{
"href": url_for(endpoint="round_bp.edit_round", round_id=round.round_id, _anchor=form.project_name_field_id.id),
"text": "Change",
"classes": "govuk-link--no-visited-state",
"visuallyHiddenText": "application guidance ",
}
]
},
},
{
"key": {"text": "Expression of interest decision schema"},
"value": {"text": round.eoi_decision_schema["en"]},
Expand Down

0 comments on commit cd77db4

Please sign in to comment.