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

Expression Editing Crash Triggered by Deletion of Linked Components #12564

Closed
lassopicasso opened this issue Mar 21, 2024 · 2 comments · Fixed by #12746
Closed

Expression Editing Crash Triggered by Deletion of Linked Components #12564

lassopicasso opened this issue Mar 21, 2024 · 2 comments · Fixed by #12746
Assignees
Labels
area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. kind/bug Used when there is a defect / something is not working as it should. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design.

Comments

@lassopicasso
Copy link
Contributor

Description of the bug

If a component's logical expression is linked to another component that gets deleted subsequently, attempting to edit the logical expression will cause the site to crash with the error message: Cannot read properties of undefined (reading 'value').

See the video below:

Altinn.Studio.-.Google.Chrome.2024-03-21.10-41-55.mp4

Steps To Reproduce

  1. In lage page - Add two components.
  2. Add an expression in one of the components and establish a link to the other component.
  3. Delete the other component.
  4. Attempt to edit the logical expression - the site will crash.

Additional Information

No response

@lassopicasso lassopicasso added kind/bug Used when there is a defect / something is not working as it should. area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. labels Mar 21, 2024
@framitdavid
Copy link
Collaborator

The expression editor should not crash Studio when the expression is invalid. We should give the user feedback on what went wrong.

@framitdavid framitdavid moved this to 📈 Todo in Team Studio Mar 22, 2024
@lassopicasso lassopicasso self-assigned this Apr 30, 2024
@lassopicasso lassopicasso moved this from 📈 Todo to 👷 In Progress in Team Studio Apr 30, 2024
@lassopicasso lassopicasso linked a pull request May 6, 2024 that will close this issue
4 tasks
@lassopicasso lassopicasso moved this from 👷 In Progress to 🔎 Review in Team Studio May 6, 2024
@lassopicasso lassopicasso removed their assignment May 6, 2024
@github-project-automation github-project-automation bot moved this from 🔎 Review to 🧪 Test in Team Studio May 14, 2024
@lassopicasso lassopicasso removed their assignment May 14, 2024
@nkylstad nkylstad self-assigned this May 16, 2024
@nkylstad
Copy link
Member

Tested OK in dev:

  • Added 2 components to an empty form page
  • Connected components to data model
  • Added an expression to the second component, that depended on the value from the first component (i.e. used "Component" comparison)
  • Tested the expression in preview, and saw that it worked as expected.
  • Deleted the component referenced in the expression
  • Saw that the form looked/behaved as expected
  • Opened expression editor, and saw that the expression was marked with red outline
  • Opened the expression, and saw error message informing about invalid component id

@nkylstad nkylstad moved this from 🧪 Test to ✅ Done in Team Studio May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. kind/bug Used when there is a defect / something is not working as it should. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants