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

feat: remove summary from componentlist and rename summary2 #14557

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

Conversation

lassopicasso
Copy link
Contributor

@lassopicasso lassopicasso commented Jan 31, 2025

Description

  • Removed summary from the component list in both old and new design.
  • Added summary2 to the new design.
  • Renamed summary2 to display as "Summary" and applied summary's help text.

🚨 Do not merge to main before summary2 is released.

Removed summary-component from component list in current design and new design.
Added summary2 in new design for component list.

Renamed summary2 to display as summary, and use summary's help text in summary2

Don't merge to main before summary2 is released.

Related Issue(s)

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)

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Updated deletion confirmation messages to display a revised component name for clarity.
    • Introduced conditional display logic for a redesigned summary component when a feature flag is enabled.
  • Refactor
    • Streamlined component configuration to align with the updated naming conventions.
  • Bug Fixes
    • Excluded the Summary component from visibility in relevant lists, ensuring accurate component availability.

@lassopicasso lassopicasso linked an issue Jan 31, 2025 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 Jan 31, 2025
Copy link
Contributor

coderabbitai bot commented Jan 31, 2025

Warning

Rate limit exceeded

@lassopicasso has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5327577 and 598c79b.

📒 Files selected for processing (1)
  • frontend/language/src/nb.json (4 hunks)
📝 Walkthrough

Walkthrough

This PR modifies the handling of summary components within the application. Specifically, it updates the Norwegian language file to change references from "Summary2" to "Summary" in deletion prompts. Additionally, the component configuration has been adjusted to remove "Summary" from the schema and conditionally include "Summary2" based on a feature flag. The test suite is also updated to exclude "Summary" from the available components list.

Changes

File(s) Change Summary
frontend/language/.../nb.json Updated deletion prompt texts by replacing “Summary2” with “Summary”.
frontend/packages/ux-editor/.../formItemConfig.{ts, test.ts} Modified component configuration and tests: removed ComponentType.Summary from schemaComponents, conditionally added ComponentType.Summary2 based on a feature flag, and updated the test exclusion list to filter out ComponentType.Summary.

Possibly related PRs

  • chore: reorganize summary2 translation keys #14406 – The changes in the main PR, which involve renaming "Summary2" to "Summary" in deletion prompts, are related to the retrieved PR that reorganizes translation keys for "Summary2" components, as both involve modifications to the frontend/language/src/nb.json file concerning the handling of summary components.
  • feat: Update JSON schema for Summary2 #14529 – The changes in the main PR, which involve renaming references from "Summary2" to "Summary" in deletion prompts, are related to the modifications in the retrieved PR that update the JSON schema for "Summary2," as both PRs deal with the handling and naming of the "Summary" and "Summary2" components.
  • fix: rely on component type instead of its ID when display override config #14545 – The changes in the main PR, which involve renaming "Summary2" to "Summary" in deletion prompts, are related to the modifications in the retrieved PR that also focus on the handling of "Summary2" and its display logic, indicating a direct connection in the context of component management.

Suggested labels

text/content, team/studio-domain2, skip-manual-testing

Suggested reviewers

  • mlqn
  • Jondyr

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lassopicasso lassopicasso changed the title Remove summary from componentlist and rename summary2 feat:remove summary from componentlist and rename summary2 Jan 31, 2025
@lassopicasso lassopicasso changed the title feat:remove summary from componentlist and rename summary2 feat: remove summary from componentlist and rename summary2 Jan 31, 2025
@lassopicasso lassopicasso added the skip-manual-testing PRs that do not need to be tested manually label Feb 3, 2025
@lassopicasso lassopicasso marked this pull request as ready for review February 3, 2025 09:42
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
frontend/packages/ux-editor/src/data/formItemConfig.ts (1)

461-469: Remove unused Summary component definition.

The Summary component definition is no longer used as it's been removed from schemaComponents and isn't referenced elsewhere in the codebase.

🧹 Nitpick comments (1)
frontend/packages/ux-editor/src/data/formItemConfig.test.ts (1)

25-25: Update test comment to include Summary component.

The comment should be updated to reflect that Summary is now also excluded:

-  /**  Test that all components, except Custom, Payment, Subform and Summary2 (since behind featureFlag), are available in one of the visible lists */
+  /**  Test that all components, except Custom, Payment, Subform, Summary, and Summary2 (since behind featureFlag), are available in one of the visible lists */
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0ee774 and 4da5ce6.

📒 Files selected for processing (3)
  • frontend/language/src/nb.json (3 hunks)
  • frontend/packages/ux-editor/src/data/formItemConfig.test.ts (1 hunks)
  • frontend/packages/ux-editor/src/data/formItemConfig.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • frontend/language/src/nb.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build environment and run e2e test
  • GitHub Check: CodeQL
  • GitHub Check: Testing
🔇 Additional comments (1)
frontend/packages/ux-editor/src/data/formItemConfig.ts (1)

592-592: Verify feature flag usage across the codebase.

The Summary2 component is conditionally included based on the FeatureFlag.Summary2 feature flag. Let's verify its usage across the codebase.

✅ Verification successful

Review Verification: Consistent Feature Flag Usage in Summary2
The shell script output confirms that the only production usage of the Summary2 feature flag is in the configuration file (frontend/packages/ux-editor/src/data/formItemConfig.ts), where the Summary2 component is conditionally added using the feature flag. Other appearances of ComponentType.Summary2 are in tests, mocks, or rendering paths where explicit flag guards aren’t required. This is expected behavior since the controlled inclusion is handled centrally in the configuration.

  • Summary2 inclusion in formItemConfig.ts is properly guarded using shouldDisplayFeature(FeatureFlag.Summary2).
  • All other references (tests, component renders, mocks) are acceptable and rely on the configuration for conditional inclusion.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent usage of Summary2 feature flag
# Expected: All Summary2 component usage should be guarded by the feature flag

# Search for Summary2 component usage
echo "Searching for Summary2 component usage..."
rg "ComponentType\.Summary2" -A 3

# Search for Summary2 feature flag usage
echo "Searching for Summary2 feature flag usage..."
rg "FeatureFlag\.Summary2" -A 3

Length of output: 9299

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.73%. Comparing base (36f9914) to head (598c79b).

Files with missing lines Patch % Lines
...tend/packages/ux-editor/src/data/formItemConfig.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14557      +/-   ##
==========================================
- Coverage   95.73%   95.73%   -0.01%     
==========================================
  Files        1908     1908              
  Lines       24876    24877       +1     
  Branches     2846     2847       +1     
==========================================
  Hits        23816    23816              
  Misses        799      799              
- Partials      261      262       +1     

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

@lassopicasso lassopicasso removed the skip-manual-testing PRs that do not need to be tested manually label Feb 3, 2025
@lassopicasso
Copy link
Contributor Author

NB! Move to blocked after reviewed, this PR shouldn't be merged before the feature flag is removed

Copy link
Contributor

@mlqn mlqn left a comment

Choose a reason for hiding this comment

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

🚀

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.

Remove summary1 from component list and rename summary2
2 participants