Skip to content

Commit e2a8d8c

Browse files
committed
Reference Trello cards from TODO comments
1 parent 4fd9752 commit e2a8d8c

File tree

12 files changed

+44
-32
lines changed

12 files changed

+44
-32
lines changed

app/components/page_list_component/error_summary/view.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def self.error_id(number)
1212

1313
def self.generate_error_message(error_name, condition:, page:)
1414
# TODO: route_number is hardcoded as 1 here because we know there can be only two conditions. It will need to change in future
15+
# https://trello.com/c/BfkZEIgM/3446-set-route-count-dynamically-instead-of-hard-coding-it
1516
route_number = condition.secondary_skip? ? I18n.t("errors.page_conditions.route_number_for_any_other_answer") : 1
1617

1718
interpolation_variables = { question_number: page.position, route_number: }

app/controllers/group_members_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def set_group
3232
end
3333

3434
def group_member_params
35-
## TODO: We are passing in host here because the admin doesn't know it's own URL to use in emails
35+
# TODO: We are passing in host here because the admin doesn't know it's own URL to use in emails
36+
# https://trello.com/c/HkT90mFt/3447-configure-rails-apps-to-know-their-own-urls
3637
params.require(:group_member_input).permit(:member_email_address).merge(role: new_member_role, group: @group, creator: current_user, host: request.host)
3738
end
3839

app/controllers/pages/conditions_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def create
3131
redirect_to new_exit_page_path(current_form.id, page.id, answer_value: condition_input.answer_value)
3232
else
3333
# TODO: Route number is hardcoded whilst we can only have one value for it
34+
# https://trello.com/c/BfkZEIgM/3446-set-route-count-dynamically-instead-of-hard-coding-it
3435
redirect_to show_routes_path(form_id: current_form.id, page_id: page.id), success: t("banner.success.route_created", route_number: 1)
3536
end
3637
else

app/controllers/pages/exit_page_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def create
1313

1414
if exit_page_input.submit
1515
# TODO: Route number is hardcoded whilst we can only have one value for it
16+
# https://trello.com/c/BfkZEIgM/3446-set-route-count-dynamically-instead-of-hard-coding-it
1617
redirect_to show_routes_path(form_id: current_form.id, page_id: page.id), success: t("banner.success.exit_page_created")
1718
else
1819
render template: "pages/exit_page/new", locals: { exit_page_input:, preview_html: preview_html(exit_page_input), check_preview_validation: true }, status: :unprocessable_content

app/input_objects/pages/question_input.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
class Pages::QuestionInput < BaseInput
22
attr_accessor :question_text, :hint_text, :is_optional, :answer_type, :draft_question, :is_repeatable, :form_id
33

4-
# TODO: We could lose these attributes once we have a Check your answers page
4+
# TODO: We could lose these attributes once we have a 'Check your question' page
5+
# https://trello.com/c/uSkzB4Sl/3-create-check-your-question-page
56
attr_accessor :answer_settings, :page_heading, :guidance_markdown
67

78
attr_reader :selection_options # only used for displaying error

app/models/form.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def update_draft_form_document
229229

230230
def task_status_service
231231
# TODO: refactor this in favour of dependency injection
232+
# https://trello.com/c/TVN9BNxQ/3448-refactor-formtaskstatusservice-to-use-dependency-injection
232233
# it can also lead to use of `allow_any_instance_of` in testing
233234
@task_status_service ||= TaskStatusService.new(form: self)
234235
end

app/models/page.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def destroy_secondary_skip_conditions
166166
# We want to delete the secondary skip for the page at the start of the route
167167
# That association isn't in the database, so we need to dig it out
168168
# TODO: what if the page owning the routes has more than two routes?
169+
# https://trello.com/c/ZPFCV1C7/3462-rewrite-destroysecondaryskipconditions-to-handle-a-routing-page-with-more-than-two-routes
169170
goto_conditions
170171
.filter { |condition| condition.check_page_id == condition.routing_page_id }
171172
.map(&:check_page)

app/validators/allowed_email_domain_validator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def validate_each(record, attribute, value)
55

66
# TODO: we might not want to check against current user domain
77
# when we have a proper allow list?
8+
# https://trello.com/c/NQj6zljA/3449-make-email-domain-validation-check-against-allowed-domains-rather-than-just-govuk-and-the-users-current-domain
89
if record.respond_to?(:current_user) && record.current_user.present?
910
user_domain_with_at = record.current_user.email
1011
.then { |email| email[email.rindex("@")..] }

app/views/layouts/base.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<link rel="apple-touch-icon" href="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-icon-180.png"%>">
1616
<%# This manifest file and the icons it references are currently being served from the `public` folder. %>
1717
<%# TODO: update the build to either generate the manifest with references to fingerprinted assets, or automatically copy the manifest and its dependencies to `public`. %>
18+
<%# https://trello.com/c/zXttaPrR/3450-update-frontend-build-to-handle-manifestjson-automatically %>
1819
<link rel="manifest" href="/manifest.json">
1920
<meta property="og:image" content="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-opengraph-image.png" %>">
2021

app/views/pages/conditions/edit.html.erb

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<%# TODO: route_number is hardcoded as 1 here because we know there can be only two conditions. It will need to change in the future %>
2+
<%# https://trello.com/c/BfkZEIgM/3446-set-route-count-dynamically-instead-of-hard-coding-it %>
23
<% set_page_title(title_with_error_prefix(t('page_titles.routing_page_edit', question_number: condition_input.page.position, route_number: 1), condition_input.errors&.any?)) %>
34
<% content_for :back_link, govuk_back_link_to(show_routes_path(condition_input.form.id, page_id: condition_input.page.id), t(".back_link", question_number: condition_input.page.position)) %>
45

@@ -30,31 +31,31 @@
3031
<option value=<%= option.id %> <% if condition_input.record.goto_page_id == option.id || (condition_input.record.skip_to_end? && option.id == "check_your_answers") %>selected<% end %>>
3132
<%= option.question_text %>
3233
</option>
33-
<% end %>
34-
<% unless condition_input.secondary_skip? %>
35-
<optgroup label="<%= I18n.t("page_conditions.exit_page_label") %>">
36-
<% if condition_input.record.exit_page? %>
37-
<option value="exit_page" <% if condition_input.record.exit_page? %>selected<% end %>>
34+
<% end %>
35+
<% unless condition_input.secondary_skip? %>
36+
<optgroup label="<%= I18n.t("page_conditions.exit_page_label") %>">
37+
<% if condition_input.record.exit_page? %>
38+
<option value="exit_page" <% if condition_input.record.exit_page? %>selected<% end %>>
3839
<%= condition_input.record.exit_page_heading %>
3940
</option>
40-
<% else %>
41-
<option value="create_exit_page">
42-
<%= I18n.t("page_conditions.exit_page") %>
43-
</option>
41+
<% else %>
42+
<option value="create_exit_page">
43+
<%= I18n.t("page_conditions.exit_page") %>
44+
</option>
45+
<% end %>
46+
</optgroup>
4447
<% end %>
45-
</optgroup>
46-
<% end %>
47-
<% end %>
48+
<% end %>
4849

49-
<% if condition_input.record.exit_page? %>
50-
<p class="govuk-body">
51-
<%= govuk_link_to t("page_conditions.edit_exit_page", exit_page_heading: condition_input.record.exit_page_heading), edit_exit_page_path(condition_input.form.id, condition_input.page.id, condition_input.record.id) %>
52-
</p>
53-
<% end %>
50+
<% if condition_input.record.exit_page? %>
51+
<p class="govuk-body">
52+
<%= govuk_link_to t("page_conditions.edit_exit_page", exit_page_heading: condition_input.record.exit_page_heading), edit_exit_page_path(condition_input.form.id, condition_input.page.id, condition_input.record.id) %>
53+
</p>
54+
<% end %>
5455

55-
<%= f.govuk_submit t("save_and_continue") do
56+
<%= f.govuk_submit t("save_and_continue") do
5657
govuk_button_link_to "Delete route", delete_condition_path(condition_input.form.id, condition_input.page.id, condition_input.record.id), warning: true
5758
end %>
58-
<% end %>
59-
</div>
60-
</div>
59+
<% end %>
60+
</div>
61+
</div>

0 commit comments

Comments
 (0)