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

Implement the <ExtensionPoint> component and use it on Dashboard #1740

Closed
slaweet opened this issue Feb 7, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@slaweet
Copy link
Member

commented Feb 7, 2019

This is a subtask of #1706 epic.

The goal is to implement the component that

  • reads installed extensions from the ‘extensions’ redux store and
  • displays the ones that match the ‘identifier’
  • use in places illustrated in

As outlined in

export default class ExtensionPoint extends React.Component {
componentDidCatch(error) {
// eslint-disable-next-line no-console
console.error(new Error(`Error in extension point '${this.props.identifier}' ${error}`));
}
render() {
const modules = this.props.modules[this.props.identifier] || [];
// TODO implement a way to highlight all extension points on a page
// for easier discover by extension developers
// e.g. localStorage.setItem('highlightExtensionPoints', true)
// and this component will get a red border and title with its 'identifier'
return <React.Fragment>
{ modules.map(({ moduleId }, i) => {
const Component = LiskHubExtensions._modules[moduleId];
if (Component) {
return <Component
t={this.props.t}
identifier={this.props.identifier}
key={i} />;
}
// eslint-disable-next-line no-console
console.error(new Error(`Invalid component in extension point ${this.props.identifier}`));
return null;
})}
</React.Fragment>;
}
}

@slaweet slaweet added the type:code label Feb 7, 2019

@slaweet slaweet added this to New Issues in Version 1.12.0 via automation Feb 7, 2019

@slaweet slaweet removed this from New Issues in Version 1.12.0 Feb 22, 2019

michaeltomasik added a commit that referenced this issue Mar 22, 2019

@slaweet slaweet closed this Mar 22, 2019

@slaweet slaweet added this to the Version 1.14.0 milestone Mar 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.