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

Embed CAL-web in an example application #92

Closed
6 tasks done
Tracked by #41 ...
Gelio opened this issue Nov 23, 2021 · 0 comments · Fixed by #104
Closed
6 tasks done
Tracked by #41 ...

Embed CAL-web in an example application #92

Gelio opened this issue Nov 23, 2021 · 0 comments · Fixed by #104
Labels
complexity: high P2 Medium priority scope: BalticLSC integration Issues related to integrating with the BalticLSC system thesis-required Issue must be closed to complete the thesis
Milestone

Comments

@Gelio
Copy link
Owner

Gelio commented Nov 23, 2021

As part of #41 and #34 we will have to embed the CAL-web frontend in the main BalticLSC's frontend, which is written in Vue. Let's try to recreate that scenario by creating a simple application that embeds Sirius Web as part of it.

The application could be a standalone HTML file that displays a few elements and embeds Sirius Web into one of them. The code for embedding Sirius Web could look like so:

calWeb.render({
  container: document.querySelector('.main'),
  authenticationToken: '1234', // BalticLSC authentication token
  projectId: '1234', // the ID of the project created in Sirius Web backend
});

The render call would then call ReactDOM.render and pass the authenticationToken and projectId as props to the rest of the application.

To do

  • Extract the workbench UI and the hooks for fetching the representation into a separate component. It should show the Workbench component and set the authentication token in zustand

  • Make sure the change authentication token button (Make it easy to change the BalticLSC authentication token #43) is only shown in the main application (use a prop to toggle its visibility)

  • Create this calWeb.render function that calls ReactDOM and renders the application in some HTML element

  • Adjust the build options to build one or more JS bundles that could be embedded in another application.

    This could also be done by another build tool, not webpack from Create React App.

  • Create an example HTML page that renders CAL-web in one of its HTML elements

Depends on

@Gelio Gelio added P2 Medium priority scope: BalticLSC integration Issues related to integrating with the BalticLSC system complexity: high thesis-required Issue must be closed to complete the thesis labels Nov 23, 2021
@Gelio Gelio added this to the Iteration 2 milestone Nov 23, 2021
Gelio added a commit that referenced this issue Nov 24, 2021
The BalticLSC authentication token is stored in `localStorage` and
retrieved during application load.

This happens at the `EditProjectView` page level. It means that when the
`Workbench` is embedded in #92, the authentication token can be
alternatively passed directly, without any effects from `localStorage`.
In other words, this functionality only applies when CAL-web is working
as a standalone application.

This commit also refactors how the toolbox authentication token controls
(the edit icon and the error icon) are injected into the toolbox. This
now happens via a prop on `Workbench`, which again allows for skipping
that part when using the `Workbench` directly in #92.

Closes #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: high P2 Medium priority scope: BalticLSC integration Issues related to integrating with the BalticLSC system thesis-required Issue must be closed to complete the thesis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant