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 window.LiskHubExtensions module #1710

Closed
michaeltomasik opened this issue Jan 31, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@michaeltomasik
Copy link
Member

commented Jan 31, 2019

This is a subtask of #1706 epic.

Implement the window.LiskHubExtensions module with:

  • LiskHubExtensions.addModule({ identifier, reactComponent });
    Stores identifier and reactComponent in ‘extensions’ redux store
  • LiskHubExtensions.addPage({ path, reactComponent });
  • LiskHubExtensions.Components = { Button, Input, Box, ....};

As outlined in

const LiskHubExtensions = {
identifiers: {
// TODO move identifiers into constants folder and only import it here
dashboardColumn1: 'dashboard-column-1',
dashboardColumn2: 'dashboard-column-2',
dashboardColumn3: 'dashboard-column-3',
// TODO define and use further extension points
},
components: {
Box, // TODO Adjust Box to be able to set it's height and other properties
Button,
// TODO add other components, such as input, other buttons etc.
},
addModule: ({ identifier, component }) => {
const moduleId = window.crypto.getRandomValues(new Uint32Array(4)).toString('hex');
// the component is stored in _modules because Redux can store only serializable objects
LiskHubExtensions._modules[moduleId] = component;
store.dispatch(moduleAdded({ identifier, moduleId }));
},
addPage: (/* { path, component } */) => {
// TODO implement action, reducer and component for adding page
throw new Error('Not implemented yet');
},
_modules: {
},
};

@slaweet slaweet changed the title How to inject code extention to lisk-hub Implement the window.LiskHubExtensions module Feb 7, 2019

@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

@slaweet slaweet closed this in d37a82b 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.