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

Migrate '/download/iot/intel-iot#get-in-touch' form to c.com #1489

Merged
merged 18 commits into from
Jan 14, 2025

Conversation

petesfrench
Copy link
Contributor

@petesfrench petesfrench commented Jan 8, 2025

Done

  • Migrated the form from '/download/iot/intel-iot' form to c.com using the form builder.

Fly-by

  • Refactored set_form_rules function to look for individual files found in the same folder as the page they serve (as opposed to one giant file). This will also allow for the use of 'generic' form templates, where you only need to add the URL of the page to re-use a form.
  • Add a fallback within form-fields.html, where if an id or value is not passed it will be constructed from the label (except with textarea as this does not use a label). This allows quicker production of forms as less data is needed to be added, but the option is still there if really needed.
  • A similar thing is also done with 'inputName'.
  • Allow passing an array of strings to 'introText' with each string being on a new line.

QA

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-17902

@webteam-app
Copy link

@petesfrench petesfrench requested a review from britneywwc January 8, 2025 18:16
@petesfrench petesfrench changed the title Migrate '/download/iot/intel-iot' form to c.com Migrate '/download/iot/intel-iot#get-in-touch' form to c.com Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (partners-intel-feature-branch@6ee26ca). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                        @@
##             partners-intel-feature-branch    #1489   +/-   ##
================================================================
  Coverage                                 ?   72.30%           
================================================================
  Files                                    ?       17           
  Lines                                    ?     1437           
  Branches                                 ?        0           
================================================================
  Hits                                     ?     1039           
  Misses                                   ?      398           
  Partials                                 ?        0           
Flag Coverage Δ
python 72.30% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@britneywwc britneywwc left a comment

Choose a reason for hiding this comment

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

There is a bug where the form modals' close button do not work. It closes when Esc is pressed though.

webapp/app.py Outdated Show resolved Hide resolved
webapp/app.py Outdated Show resolved Hide resolved
webapp/app.py Outdated Show resolved Hide resolved
templates/shared/forms/form-fields.html Show resolved Hide resolved
/**
* Initializes 'other' inputs textareas, so that when they are updated the value is passed to the input and attached to the payload.
*/
function setupOtherInputs() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The text input can still be accessed and passes through the payload even when "Other" is not selected. Should the text input show only when "Other" is selected?

@britneywwc
Copy link
Contributor

Has the close button bug been addressed? It still isn't working for the forms using the form builder

Copy link
Contributor

@britneywwc britneywwc left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes, looks good! Left a comment on the old forms-data.json file

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file supposed to be removed before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Good catch

Copy link
Contributor

@britneywwc britneywwc left a comment

Choose a reason for hiding this comment

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

One more super minor thing, everything else LGTM!

"Canonical partners with silicon companies, board manufacturers and ODMs to help the industry bring smart device and software capabilities to market faster.",
"Tell us about your project so we can bring the right Canonical team members to the conversation to help you."
],
"formId": "5477",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"formId": "5477",
"formId": "4205",

To match the formID on https://ubuntu.com/download/iot/intel-iot

@petesfrench petesfrench merged commit 1f60db9 into partners-intel-feature-branch Jan 14, 2025
9 checks passed
@petesfrench petesfrench deleted the wd-17902 branch January 14, 2025 08:52
petesfrench added a commit that referenced this pull request Jan 14, 2025
* feat(/partners/silicon/intel): Build page (#1484)

* feat(/partners/intel): Build page

* chore(sitemap.xml): Add /partners/silicon/intel

* chore(test_routes.py): Add /partners/silicon/intel

* refactor: Use flask directory nesting to define url paths and remove unused python

* feat(_breadcrumbs.html): Allow breadcrumbs jinja module to consume any number of breadcrumbs

* refactor(/partners/silicon/intel): Remove partners footer

* fix(/partners/silicon/intel): Add absolute path for urls pointing to ubuntu.com

* Migrate '/download/iot/intel-iot#get-in-touch' form to c.com (#1489)

* refactor(set_form_rules): use indervidual form-data files per form instead of one large file

* refactor: Moce /silicon/intel into it's own folder

* feat: build form-data.json file for /partners/silicon/intel

* feat: Add fallbacks for missing fields in form-data file

* feat: Add optional textarea field to radio boxes

* refactor(app.py): Format python

* fix(form-template.html): Unbreak the form generator

* feat: Improve the appearnace and function of the other textarea

* refactor: Format-prettier

* refactor: Remove rogue print statments

* refactor(set_form_rules): clean up path finding logic by leveraging 'pathlib'

* feat: Update return URL to use full path

* refactor: Revert context processor changes

* feat: Show and hide other input textarea when selecting the associated input

* style: Format-js

* fix: Close button was not working

* refactor: Remove old forms-data.json

* fix: Update form is for intel form

* fix: Add 'noCommentsFromLead' to cyber-resilience-act form-data
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