Skip to content

Specify code output panel(s) in web component #909

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

Conversation

create-issue-branch[bot]
Copy link
Contributor

closes #906

@create-issue-branch create-issue-branch bot temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 29, 2024 09:57 Inactive
Copy link

Copy link

@loiswells97 loiswells97 changed the base branch from main to output-only-wc January 29, 2024 12:24
@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 29, 2024 12:25 — with GitHub Actions Inactive
Copy link

@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 29, 2024 17:56 — with GitHub Actions Inactive
Copy link

@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 30, 2024 17:40 — with GitHub Actions Inactive
Copy link

@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 31, 2024 11:03 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 31, 2024 12:08 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 31, 2024 12:34 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 31, 2024 13:05 — with GitHub Actions Inactive
Copy link

@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component January 31, 2024 13:11 — with GitHub Actions Inactive
@loiswells97 loiswells97 marked this pull request as ready for review January 31, 2024 13:12
Copy link

Copy link
Contributor

@danhalson danhalson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just the one suggestion that I think help make things easier to read / more manageable?

<div className="output-panel output-panel--visual">
{hasVisualOutput && showVisualOutput && (
<div
className={`output-panel output-panel--visual${
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the classnames package (which we're using elsewhere) offers a nice and easy to read interface for doing this, might be worth taking a look :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, okay, I'll take a look - thanks Dan 👍

@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component February 1, 2024 16:58 — with GitHub Actions Inactive
Copy link

github-actions bot commented Feb 1, 2024

@loiswells97 loiswells97 temporarily deployed to previews/issues/906-Specify_code_output_panel_s_in_web_component February 1, 2024 17:00 — with GitHub Actions Inactive
Copy link

github-actions bot commented Feb 1, 2024

Comment on lines 450 to 452
{!hasVisualOutput && !isEmbedded && isMobile ? (
<RunnerControls skinny />
) : null}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ I'm sure I've tried this before but it might not work... can we get rid of this null?

Suggested change
{!hasVisualOutput && !isEmbedded && isMobile ? (
<RunnerControls skinny />
) : null}
{!hasVisualOutput && !isEmbedded && isMobile && (
<RunnerControls skinny />
)}

Copy link

github-actions bot commented Feb 1, 2024

Copy link
Contributor

@sra405 sra405 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm

@loiswells97 loiswells97 merged commit c6d568b into output-only-wc Feb 2, 2024
@loiswells97 loiswells97 deleted the issues/906-Specify_code_output_panel_s_in_web_component branch February 2, 2024 09:14
floehopper pushed a commit that referenced this pull request May 20, 2024
floehopper pushed a commit that referenced this pull request May 20, 2024
floehopper pushed a commit that referenced this pull request May 20, 2024
floehopper pushed a commit that referenced this pull request May 20, 2024
floehopper pushed a commit that referenced this pull request May 22, 2024
floehopper pushed a commit that referenced this pull request May 22, 2024
floehopper pushed a commit that referenced this pull request May 28, 2024
floehopper pushed a commit that referenced this pull request May 29, 2024
floehopper pushed a commit that referenced this pull request May 30, 2024
floehopper pushed a commit that referenced this pull request May 30, 2024
floehopper pushed a commit that referenced this pull request May 30, 2024
floehopper pushed a commit that referenced this pull request May 30, 2024
floehopper pushed a commit that referenced this pull request May 31, 2024
Based on #909. The new `output_panels` attribute on the web component
allows specific panels to be selected when the `output-only` web
component attribute is set to `true`. Currently there are two panels:
the "text" panel and the "visual" panel. You can select either or both.
Note that this functionality has only currently been implemented for the
`PythonRunner` and not the `PyodideRunner` or the `HtmlRunner`.

The motivation for this change is to support the Block-to-Text app [1].
The exercise in the alpha version of this app displays just the "visual"
panel [2].

I've added a couple of unit tests in `PythonRunner.test.js` to test the
new behaviour. And I plan to add an e2e spec in a subsequent commit
which will test all the new attributes on the web component.

[1]: https://github.com/RaspberryPiFoundation/block-to-text-alpha/
[2]: https://github.com/RaspberryPiFoundation/block-to-text-alpha/blob/d16a8ecc1d3da202363fb16db31f4bf93f46aa04/src/components/Editor.js#L19
@floehopper floehopper mentioned this pull request Jun 3, 2024
floehopper added a commit that referenced this pull request Jun 4, 2024
### Added

- Add `project_name_editable` attribute to web component (#1009)
- Fires custom event when the theme changes (#1015)
- Add `output_only` attribute to web component (#1019 & originally #782)
- Add `assets_identifier` attribute to web component (#1019 & originally
#901)
- Enhance `code` attribute on web component to override project main
component content (#1019 & originally #901)
- Add `runCode`, `stopCode` & `rerunCode` methods to web component
(#1019 & originally #899)
- Send error details in "editor-runCompleted" event (#1019 & originally
#915)
- Return error details to web component (#1019 & originally #915)
- Add `output_panels` attribute to web component (#1019 & originally
#909)

### Changed

- Remove unused `/embedded/projects/:identifier` route (#1013)

### Fixed

- Remove unused `REACT_APP_LOGIN_ENABLED` env var (#1006)
- Fix infinite remix loop when `BYPASS_AUTH` set in `editor-api` (#1007)
- Fixes for docker-compose.yml (#1008)
- Fix deprecation warnings in GitHub Actions (#1011)
- Removed unused `isEmbedded` param from `useProject` call in
`EmbeddedViewer` (#1016)
- Improvements to Cypress specs in CI (#1017)
- Fix warnings and verbose output when starting Webpack Dev Server
(#1018)
- Add e2e spec for project remix behaviour in web component (#1020)
- Fix initial value of `user` in `WebComponentLoader` (#1021)
- Make `authKey` in e2e web component spec more realistic (#1022)
- Remove unused `ComponentStore` (#1023)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify code output panel(s) in web component
3 participants