Skip to content

fix(cms): refactor typescript and components#6037

Merged
davidruvolo51 merged 9 commits intomasterfrom
fix/cms-refactor-types
Mar 13, 2026
Merged

fix(cms): refactor typescript and components#6037
davidruvolo51 merged 9 commits intomasterfrom
fix/cms-refactor-types

Conversation

@davidruvolo51
Copy link
Contributor

@davidruvolo51 davidruvolo51 commented Mar 11, 2026

What are the main changes you did

In order to create an editable layer in the page builder, it is important to refactor the typescript files and components to make it easier to add new components. This also reduces the need to override the file produced by generateTypes which created issues with the props. Instead, I created-

  • Generated typescript interface using the generate types script (removed old way)
  • Created PageComponent which combines all interfaces with additional props (e.g., mg_tableclass, editable, etc.)
  • Updated interfaces in CMS components

This PR is part of molgenis/GCC#1143 and molgenis/GCC#2515

How to test

  • explain here what to do to test this (or point to unit tests)

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

@davidruvolo51 davidruvolo51 self-assigned this Mar 11, 2026
@sonarqubecloud
Copy link

@davidruvolo51 davidruvolo51 marked this pull request as ready for review March 13, 2026 08:50
Copy link
Contributor

@chinook25 chinook25 left a comment

Choose a reason for hiding this comment

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

Looks good, just 2 non-blocking questions

extends IHeadings,
IParagraphs,
IImages,
INavigationGroups {}
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the {} do here? (I don't know this syntax ;) )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This creates an empty interface. I needed a way to a general interface (similar to the Input component), but I defined it here so I can reuse it in the UI app. I will eventually add a few things here.

Comment on lines +31 to +32
configurablePage?: any;
block?: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

Still quite some any's in this file, should they be defined better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now produced by the generateTypes command, which doesn't have great support for inherited tables and refbacks.

@davidruvolo51 davidruvolo51 merged commit 3649d1c into master Mar 13, 2026
8 checks passed
@davidruvolo51 davidruvolo51 deleted the fix/cms-refactor-types branch March 13, 2026 10:12
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.

2 participants