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

Drop usage of component-helper #323

Merged
merged 4 commits into from
Oct 20, 2023
Merged

Conversation

elpoelma
Copy link
Collaborator

@elpoelma elpoelma commented Oct 12, 2023

Overview

This PR drops all usages of the dynamic component helper in this package in preparation for embroider-compatibility.

This removal also causes a change in the variable-plugin insert-component API, the insert-components now need to be passed directly (instead of their path).

Before:

get variableTypes(): VariableConfig[] {
  return [
    {
      label: 'text',
      component: {
        path: 'variable-plugin/text/insert',
      },
    },
    {
      label: 'location',
      component: {
        path: 'variable-plugin/location/insert',
        options: {
          endpoint: 'https://dev.roadsigns.lblod.info/sparql',
        },
      },
    },
  ];
}

After:

import TextVariableInsertComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/text/insert';
import LocationInsertComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/location/insert';
...
get variableTypes() {
  return [
    {
      label: 'text',
      component: TextVariableInsertComponent,
    },
    {
      label: 'location',
      component: LocationInsertComponent,
      options: {
        endpoint: 'https://dev.roadsigns.lblod.info/sparql',
      },
    },
  ];
}

How to test/reproduce

  • Start the dummy app
  • Visit the regulatory statements page
  • Check if inserting variables still works as expected

Checks PR readiness

  • UI: works on smaller screen sizes
  • UI: feedback for any loading/error states
  • Check if dummy app is correctly updated
  • Check cancel/go-back flows
  • changelog
  • npm lint

@elpoelma
Copy link
Collaborator Author

I replaced the usage of ComponentLike by typeof Component in order to remove the requirement for casting (as unknown as ComponentLike) of the components.

@piemonkey piemonkey mentioned this pull request Oct 19, 2023
4 tasks
@elpoelma elpoelma merged commit c83f2ea into master Oct 20, 2023
3 checks passed
@elpoelma elpoelma deleted the breaking/component-helper-removal branch October 20, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants