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

Fix Save button stop working issue #1269

Merged
merged 5 commits into from
Feb 12, 2024
Merged

Fix Save button stop working issue #1269

merged 5 commits into from
Feb 12, 2024

Conversation

usingtechnology
Copy link
Collaborator

Description

Fix the intended logic when adding a component with the API Key of form. Errors in that logic prevented the notification from displaying and prompting the form designer to remove that component.

See FORMS-982.
The issue reported was save button stops working.

CHEFs did (intend to) have a prompt to notify the designer that they cannot save a component with API key = form. That's where the button gets disabled. Without the prompt the designer doesn't know how much work or how many components would be lost to reset the button by clicking Undo.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have run the npm script lint on the frontend and backend
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have approval from the product owner for the contribution in this pull request

Further comments

Steps to reproduce (on existing code - use the dev instance)

  1. Using Chrome, so you can open the Developer Tools | Javascript console.
  2. Go to our dev instance and login with your IDIR - CHEFS Dev
  3. Create a new Form, the setup information doesn’t matter, I did Public, no API Key.
  4. In design, click Save, make sure it works.
  5. Add a Panel, just save the component, no need to rename it.
  6. Save Form again, ensure button works.
  7. Drag on a component, could be a panel, checkbox, text… doesn’t really matter. Set the API property name = form, save the component to close the dialog.
  8. You should see an error stack in the Javascript console.
  9. The Form Designer Save button should be grey and not respond to clicks.
  10. Drag another component out, don’t bother renaming anything, save it to close the dialog
  11. Save button still disabled.

On this PR, at step 7 you should see an error notification indicating you cannot have a component named form. The component is in the form, so remove it or click Undo. You should then see the save button enabled and carry on adding/editing as before.

usingtechnology and others added 3 commits February 5, 2024 15:32
Fix the intended logic when adding a component with the API Key of `form`.
Errors in that logic prevented the notification from displaying and prompting the form designer to remove that component.

Signed-off-by: Jason Sherman <tools@usingtechnolo.gy>
Copy link

github-actions bot commented Feb 6, 2024

Coverage Report (Application)

Totals Coverage
Statements: 45.24% ( 2944 / 6507 )
Methods: 41.81% ( 378 / 904 )
Lines: 51.03% ( 1954 / 3829 )
Branches: 34.5% ( 612 / 1774 )

Copy link

github-actions bot commented Feb 6, 2024

Coverage Report (Frontend)

Totals Coverage
Statements: 74.45% ( 16934 / 22745 )
Methods: 34.35% ( 270 / 786 )
Lines: 75.64% ( 16159 / 21363 )
Branches: 84.73% ( 505 / 596 )

Signed-off-by: Jason Sherman <tools@usingtechnolo.gy>
Copy link
Collaborator

@WalterMoar WalterMoar left a comment

Choose a reason for hiding this comment

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

Looks great!

@usingtechnology usingtechnology merged commit 7f2b547 into main Feb 12, 2024
12 checks passed
@usingtechnology usingtechnology deleted the fix/forms-982 branch February 12, 2024 23:45
nimya-aot added a commit to nimya-aot/common-hosted-form-service that referenced this pull request May 27, 2024
nimya-aot added a commit that referenced this pull request Jun 3, 2024
* #FORMS-974

* #974 updates

* #980 modification to cypress config

* FORMS-980

* #992

* #992 Fix cypress scripts

* #1011 Form design page

* #1011 test scripts

* #1023 cypress scripts

* #1023 advanced data components

* #1023 Updated scripts

* #1023 updation

* Updated json file

* Test/forms (#1011)(#1023) (#1307)

* #FORMS-974

* #974 updates

* #980 modification to cypress config

* FORMS-980

* #992

* #992 Fix cypress scripts

* #1011 Form design page

* #1011 test scripts

* #1023 cypress scripts

* #1023 advanced data components

* #1023 Updated scripts

* #1023 updation

* Updated json file

* #1059 workflow file for cypress

* #1059 updated the base url

* #1059 updated workflow

* Updated node version

* updated

* updated

* Updation

* updated file

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* updated package file

* Update cypress-ci.yaml

* Updated config file

* Update cypress-ci.yaml

* #1059 updated package

* #1060 scripts for Advanced fields and BC Gov components

* Fixing review comments

* Updated changes

* # Updated with PR comments

* updated

* Update form-design-basicfields.cy.js

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Modifies test scripts

* Updated files

* Fixed errors during CI/CD Run

* Updated browser type

* Updated Simple BC address component

* Updated

* Fields updated

* Test script changed

* Updated

* Updated fields

* Updated env variable

* Update form-design-basicfields.cy.js

* Updated

* Update cypress-ci.yaml

* Updated email input

* screenshots

* Updated path

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Updated version on workflow

* Fix to failed tests

* Fix to BC address component

* Updated the  component

* Changed button element

* Fixed BC components

* Modified submission

* Modified components

* Updated attribute

* Updated

* Changed simpleBC address component

* cleared

* Removed package

* screenshot folder updated

* Updated id for email notification

* Updated email input id

* Updated scripts according to PR review

* #1269 updated PR env variable

* updated

* updated

* Updated home page content visibility

* reverted changes

* changed

* Updated scripts

* updated

* null pr number

* changed pr env

* updated

* changed

* updated

* updated

* changed url

* updated url

* log added

* updated

* updated

* updated

* Updated scripts

* updated

* Updated with PR review comments

* updated

* updated

---------

Co-authored-by: jasonchung1871 <101672465+jasonchung1871@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants