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: fixed selected component #14315

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JamalAlabdullah
Copy link
Contributor

Description

  • Added selected component id to be selected and presented in selector for column in subform.
  • Added test

Related Issue(s)

Solution After:

Screen.Recording.2024-12-19.at.10.55.01.mov

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@JamalAlabdullah JamalAlabdullah linked an issue Dec 19, 2024 that may be closed by this pull request
@github-actions github-actions bot added area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution. frontend labels Dec 19, 2024
@JamalAlabdullah JamalAlabdullah changed the title fixed selected component fix: fixed selected component Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.57%. Comparing base (1aa8bb1) to head (3dd663e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14315   +/-   ##
=======================================
  Coverage   95.57%   95.57%           
=======================================
  Files        1841     1841           
  Lines       23880    23882    +2     
  Branches     2755     2756    +1     
=======================================
+ Hits        22823    22825    +2     
  Misses        800      800           
  Partials      257      257           

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

Comment on lines 58 to 60
const getSelectedComponentId = components.find(
(comp) => comp.textResourceBindings?.title === tableColumn.headerContent,
)?.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

I was initially thinking along the same lines as you to identify the component. However, as @mlqn pointed out for me earlier, using the title has some potential flaws—for example, if multiple components share the same title. Additionally, the new feature from #13980, which allows users to customize the table column title (tableColumn.headerContent), will break this logic since it separates the column title from the component's title. Given this, we might need a different approach to ensure correct component identification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used id instead of title , what do you think?

Copy link
Contributor

@lassopicasso lassopicasso Jan 3, 2025

Choose a reason for hiding this comment

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

That is a better approach I think, however I don't think componentId is supported in the app. As you can see in the preview below. If there are not other approaches or props to be used here to identify, perhaps you could contact team apps in altinn-studio-channel and describe them this problem for studio whereas if they can allow a prop such as componentId to be set in the tableColumns.

image

image

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. frontend solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The selected component does not remain selected
2 participants