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

# Conflicts:
#	app/blueprints/round/templates/round_details.html
  • Loading branch information
nuwan-samarasinghe committed Feb 3, 2025
1 parent c6d5c79 commit e2c691d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
6 changes: 0 additions & 6 deletions app/blueprints/round/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ class RoundForm(FlaskForm):
),
],
)
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 @@ -73,7 +75,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 @@ -167,7 +168,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 @@ -219,7 +221,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
14 changes: 0 additions & 14 deletions app/blueprints/round/templates/round_details.html
Original file line number Diff line number Diff line change
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": "Project name field ID ",
}
]
},
},
{
"key": {"text": "Expression of interest decision schema"},
"value": {"text": round.eoi_decision_schema["en"]},
Expand Down

0 comments on commit e2c691d

Please sign in to comment.