As we are building the project submission form in react, we need to integrate it with Drupal.

The idea is to create a block plugin which will provide the container element to react.

In the theme, create a build of the application and update the simplytest].libraries.yml.

Attach the library in the block plugin.

Note: This issue depends on https://www.drupal.org/project/simplytest/issues/3063304.

Comments

sumitmadan created an issue. See original summary.

sumitmadan’s picture

Assigned: Unassigned » sumitmadan
sumitmadan’s picture

Assigned: sumitmadan » Unassigned
Status: Active » Needs review
StatusFileSize
new0 bytes

Update npm build command in react's package.json, which will generate the build. Rename the theme name as it is conflicting with a profile name and creates issues while accessing libraries.

Created a custom block plugin, id attribute can be set while configuring block.

It's not a perfect solution, but it should resolve dependencies on upcoming tasks.

sumitmadan’s picture

StatusFileSize
new409.38 KB

Just noticed that patch is empty. Adding new patch file.

nerdstein’s picture

This looks like a reasonable approach to start with. I am curious how to deploy it. Also, is there a missing config schema?

sumitmadan’s picture

I don't think we need any config schema here.

To deploy, we need to install the simplytest profile and run npm build inside "simplytest_theme/react" directory.

nerdstein’s picture

Status: Needs review » Patch (to be ported)

Perfect, thanks. I've reviewed once again and there is a ton of front-end changes. At this phase, it's expected. It's nice to see this coming together.

  • nerdstein committed 112165e on 8.x-4.x authored by sumitmadan
    Issue #3066613 by sumitmadan, nerdstein: Integrate react component in a...
  • nerdstein committed ccd57c9 on 8.x-4.x authored by sumitmadan
    Issue #3066613 by sumitmadan, nerdstein: Integrate react component in a...
nerdstein’s picture

Status: Patch (to be ported) » Fixed

Merged, thanks again!!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.