Skip to content

Commit 13eeafa

Browse files
committed
Revert "Merge branch 'main' into ipython-support"
This reverts commit 0898f96, reversing changes made to b9d9a14.
1 parent 0898f96 commit 13eeafa

File tree

72 files changed

+2669
-908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2669
-908
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
REACT_APP_AUTHENTICATION_CLIENT_ID='editor-dev'
2+
REACT_APP_AUTHENTICATION_URL='http://localhost:9001'
23
REACT_APP_SENTRY_DSN=''
34
REACT_APP_SENTRY_ENV='local'
45
PUBLIC_URL='http://localhost:3011'
56
ASSETS_URL='http://localhost:3011'
6-
REACT_APP_GOOGLE_TAG_MANAGER_ID=''
77
REACT_APP_API_ENDPOINT='http://localhost:3009'
8+
REACT_APP_GOOGLE_TAG_MANAGER_ID=''
89
REACT_APP_PLAUSIBLE_DATA_DOMAIN=''
910
REACT_APP_PLAUSIBLE_SOURCE=''

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: yarn run test --coverage --maxWorkers=4 --workerThreads=true --reporters=default --reporters=jest-junit --reporters=jest-github-actions-reporter
6262
env:
6363
JEST_JUNIT_OUTPUT_DIR: ./coverage/
64-
REACT_APP_API_ENDPOINT: http://localhost:3009
64+
6565
- name: Record coverage
6666
run: ./.github/workflows/record_coverage
6767
env:
@@ -95,8 +95,6 @@ jobs:
9595
yarn start
9696
wait-on: "http://localhost:3011"
9797
quiet: true
98-
config-file: cypress.config.mjs
99-
browser: chrome
10098
env:
10199
REACT_APP_API_ENDPOINT: "https://test-editor-api.raspberrypi.org"
102100
PUBLIC_URL: "http://localhost:3011"

CHANGELOG.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## Unreleased
88

9-
## [0.28.7] - 2024-11-08
10-
11-
### Fixed
12-
13-
- Bug causing py-enigma code to disable stop button
14-
15-
## [0.28.6] - 2024-11-08
16-
17-
### Fixed
18-
19-
- Bug with saving remix caused by not passing prop
20-
- stopped autoscrolling to top on project content change (#1132)
21-
- Hight of the sidebar for mobile (#1117)
22-
23-
### Changed
24-
25-
- REACT_APP_API_ENDPOINT env var is now only a default for the editor-wc prop, which can be overridden (#1124)
26-
- added "Help" link to the information panel in the sidebar as the first link
27-
28-
### Removed
29-
30-
- REACT_APP_AUTHENTICATION_URL env var no longer used and is instead a editor-wc prop (#1124)
31-
329
## [0.28.5] - 2024-10-25
3310

3411
### Fixed
3512

36-
- Fixed pyodide input test and cypress config to enable further pyodide tests (#1125)
3713
- Image sizing and wrapping in the sidebar (#1126)
3814

3915
## [0.28.4] - 2024-10-23
@@ -972,9 +948,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
972948

973949
- Events in Web Component indicating whether Mission Zero criteria have been met (#113)
974950

975-
[unreleased]: https://github.com/RaspberryPiFoundation/editor-ui/compare/v0.28.7...HEAD
976-
[0.28.7]: https://github.com/RaspberryPiFoundation/editor-ui/releases/tag/v0.28.7
977-
[0.28.6]: https://github.com/RaspberryPiFoundation/editor-ui/releases/tag/v0.28.6
951+
[unreleased]: https://github.com/RaspberryPiFoundation/editor-ui/compare/v0.28.5...HEAD
978952
[0.28.5]: https://github.com/RaspberryPiFoundation/editor-ui/releases/tag/v0.28.5
979953
[0.28.4]: https://github.com/RaspberryPiFoundation/editor-ui/releases/tag/v0.28.4
980954
[0.28.3]: https://github.com/RaspberryPiFoundation/editor-ui/releases/tag/v0.28.3

cypress.config.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ export default defineConfig({
1717
return null;
1818
},
1919
});
20-
on("before:browser:launch", (browser = {}, launchOptions) => {
21-
if (browser.name === "chrome") {
22-
console.log("Applying Chrome launch options");
23-
launchOptions.args.push("--enable-features=SharedArrayBuffer");
24-
launchOptions.args.push("--disable-site-isolation-trials");
25-
}
26-
return launchOptions;
27-
});
2820
},
2921
retries: {
3022
runMode: 3,

cypress/e2e/missionZero-wc.cy.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,20 @@ it("picks up calls to input()", () => {
137137
cy.get("editor-wc")
138138
.shadow()
139139
.find("div[class=cm-content]")
140-
.invoke("text", "name = input('What is your name?')\nprint('Hello', name)");
140+
.invoke("text", "input()");
141141
cy.get("editor-wc").shadow().find(".btn--run").click();
142-
cy.get("editor-wc").shadow().find(".btn--stop").should("be.visible");
143142
cy.get("editor-wc")
144143
.shadow()
145-
.find("div.pythonrunner-container.skulptrunner.skulptrunner--active")
146-
.contains(".react-tabs__tab-text", "Text output")
144+
.find(
145+
"div[class='pythonrunner-container skulptrunner skulptrunner--active']",
146+
)
147+
.contains("Text output")
147148
.click();
148149
cy.get("editor-wc")
149150
.shadow()
150151
.find("span[contenteditable=true]")
151-
.type("Scott{enter}");
152+
.type("{enter}");
152153
cy.get("#results").should("contain", '"noInputEvents":false');
153-
cy.get("editor-wc")
154-
.shadow()
155-
.find(".pythonrunner-console-output-line")
156-
.should("contain", "Hello Scott");
157154
});
158155

159156
it("picks up calls to wait for motion", () => {
@@ -211,12 +208,7 @@ it("returns duration of null if focus is lost", () => {
211208
"text",
212209
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")',
213210
);
214-
cy.get("editor-wc")
215-
.shadow()
216-
.find(".btn--run")
217-
.should("not.be.disabled")
218-
.click();
219-
cy.get("editor-wc").shadow().find(".btn--stop").should("be.visible");
211+
cy.get("editor-wc").shadow().find(".btn--run").click();
220212
cy.window().blur();
221213
cy.window().focus();
222214
cy.get("#results").should("contain", '"duration":null');

cypress/e2e/spec-wc-pyodide.cy.js

Lines changed: 7 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const origin = "http://localhost:3011/web-component.html";
33
beforeEach(() => {
44
cy.intercept("*", (req) => {
55
req.headers["Origin"] = origin;
6+
req.continue();
67
});
78
});
89

@@ -12,22 +13,12 @@ const runCode = (code) => {
1213
.shadow()
1314
.find("div[class=cm-content]")
1415
.invoke("text", `${code}\n`);
15-
cy.get("editor-wc")
16-
.shadow()
17-
.find(".btn--run")
18-
.should("not.be.disabled")
19-
.click();
16+
cy.get("editor-wc").shadow().find(".btn--run").click();
2017
};
2118

2219
describe("Running the code with pyodide", () => {
2320
beforeEach(() => {
24-
cy.visit({
25-
url: origin,
26-
headers: {
27-
"Cross-Origin-Opener-Policy": "same-origin",
28-
"Cross-Origin-Embedder-Policy": "require-corp",
29-
},
30-
});
21+
cy.visit(origin);
3122
cy.window().then((win) => {
3223
Object.defineProperty(win, "crossOriginIsolated", {
3324
value: true,
@@ -38,16 +29,6 @@ describe("Running the code with pyodide", () => {
3829

3930
it("runs a simple program", () => {
4031
runCode('print("Hello world")');
41-
cy.get("editor-wc")
42-
.shadow()
43-
.find(".pyodiderunner")
44-
.contains(".react-tabs__tab", "Visual output")
45-
.should("not.exist");
46-
cy.get("editor-wc")
47-
.shadow()
48-
.find(".pyodiderunner")
49-
.find(".react-tabs__tab--selected")
50-
.should("contain", "Text output");
5132
cy.get("editor-wc")
5233
.shadow()
5334
.find(".pythonrunner-console-output-line")
@@ -58,33 +39,21 @@ describe("Running the code with pyodide", () => {
5839
runCode(
5940
"from time import sleep\nfor i in range(100):\n\tprint(i)\n\tsleep(1)",
6041
);
61-
cy.get("editor-wc")
62-
.shadow()
63-
.find(".pythonrunner-console-output-line")
64-
.should("contain", "3");
65-
cy.get("editor-wc")
66-
.shadow()
67-
.find(".btn--stop")
68-
.should("be.visible")
69-
.click();
42+
cy.get("editor-wc").shadow().find(".btn--stop").click();
7043
cy.get("editor-wc")
7144
.shadow()
7245
.find(".error-message__content")
7346
.should("contain", "Execution interrupted");
7447
});
7548

76-
it("runs a simple program with an input", () => {
49+
// skip this test for now until we get the headers set up
50+
it.skip("runs a simple program with an input", () => {
7751
runCode('name = input("What is your name?")\nprint("Hello", name)');
78-
cy.get("editor-wc").shadow().find(".btn--stop").should("be.visible");
7952
cy.get("editor-wc")
8053
.shadow()
8154
.find(".pythonrunner-console-output-line")
8255
.should("contain", "What is your name?");
83-
cy.get("editor-wc")
84-
.shadow()
85-
.find("#input")
86-
.should("be.visible")
87-
.type("Lois{enter}");
56+
cy.get("editor-wc").shadow().find("#input").invoke("text", "Lois{enter}");
8857
cy.get("editor-wc")
8958
.shadow()
9059
.find(".pythonrunner-console-output-line")
@@ -164,34 +133,6 @@ describe("Running the code with pyodide", () => {
164133
.should("contain", "4");
165134
});
166135

167-
it("runs a simple program with the py-enigma library", () => {
168-
runCode(
169-
`
170-
from enigma.machine import EnigmaMachine
171-
# Sheet settings
172-
ROTORS = "IV I V"
173-
RINGS = "20 5 10"
174-
PLUGBOARD = "KT AJ IV US NY HL GD XF PB CQ"
175-
def use_enigma_machine(msg, rotor_start):
176-
# Set up the Enigma machine
177-
machine = EnigmaMachine.from_key_sheet(rotors=ROTORS, reflector="B", ring_settings=RINGS, plugboard_settings=PLUGBOARD)
178-
# Set the initial position of the rotors
179-
machine.set_display(rotor_start)
180-
# Encrypt or decrypt the message
181-
transformed_msg = machine.process_text(msg)
182-
return(transformed_msg)
183-
text_in = "This is a test message"
184-
rotor_start = "FNZ"
185-
text_out = use_enigma_machine(text_in, rotor_start)
186-
print(text_out)
187-
`,
188-
);
189-
cy.get("editor-wc")
190-
.shadow()
191-
.find(".pythonrunner-console-output-line")
192-
.should("contain", "ULRYQJMVHLFQKBEFUGEOFL");
193-
});
194-
195136
it("errors when importing a non-existent module", () => {
196137
runCode("import i_do_not_exist");
197138
cy.get("editor-wc")

cypress/e2e/spec-wc-skulpt.cy.js

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ const runCode = (code) => {
1414
.find("div[class=cm-content]")
1515
.invoke("text", `${code}\n`);
1616
cy.wait(200);
17-
cy.get("editor-wc")
18-
.shadow()
19-
.find(".btn--run")
20-
.should("not.be.disabled")
21-
.click();
17+
cy.get("editor-wc").shadow().find(".btn--run").click();
2218
};
2319

2420
describe("Running the code with skulpt", () => {
@@ -32,38 +28,10 @@ describe("Running the code with skulpt", () => {
3228
});
3329
});
3430

35-
it("runs a simple program", () => {
36-
runCode("print('Hello world')");
37-
cy.get("editor-wc")
38-
.shadow()
39-
.find(".skulptrunner")
40-
.contains(".react-tabs__tab", "Visual output")
41-
.should("not.exist");
42-
cy.get("editor-wc")
43-
.shadow()
44-
.find(".skulptrunner")
45-
.find(".react-tabs__tab--selected")
46-
.should("contain", "Text output");
47-
cy.get("editor-wc")
48-
.shadow()
49-
.find(".pythonrunner-console-output-line")
50-
.should("contain", "Hello world");
51-
});
52-
5331
it("runs a simple p5 program", () => {
5432
runCode(
5533
"from p5 import *\n\ndef setup():\n\tsize(400, 400)\ndef draw():\n\tfill('cyan')\n\trect(0, 0, 400, 250)\nrun(frame_rate=2)",
5634
);
57-
cy.get("editor-wc")
58-
.shadow()
59-
.find(".skulptrunner")
60-
.contains(".react-tabs__tab", "Text output")
61-
.should("exist");
62-
cy.get("editor-wc")
63-
.shadow()
64-
.find(".skulptrunner")
65-
.find(".react-tabs__tab--selected")
66-
.should("contain", "Visual output");
6735
cy.get("editor-wc").shadow().find(".p5Canvas").should("exist");
6836
});
6937

cypress/e2e/spec-wc.cy.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,11 @@ describe("when embedded, output_only & output_split_view are true", () => {
113113

114114
// Check text output panel is visible and has a run button
115115
// Important to wait for this before making the negative assertions that follow
116-
const runnerContainer = cy
117-
.get("editor-wc")
118-
.shadow()
119-
.find(".proj-runner-container");
120-
runnerContainer
121-
.find(".react-tabs__tab--selected")
122-
.should("contain", "Text output");
116+
cy.get("editor-wc").shadow().contains("Text output").should("be.visible");
123117
cy.get("editor-wc")
124118
.shadow()
125119
.find("button")
126120
.contains("Run")
127-
.should("not.be.disabled")
128121
.should("be.visible");
129122

130123
// Check that the side bar is not displayed
@@ -167,7 +160,6 @@ describe("when embedded, output_only & output_split_view are true", () => {
167160
.shadow()
168161
.find("button")
169162
.contains("Run")
170-
.should("not.be.disabled")
171163
.should("be.visible");
172164

173165
// Check that the code has automatically run i.e. the HTML has been rendered

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@raspberrypifoundation/editor-ui",
3-
"version": "0.28.7",
3+
"version": "0.28.5",
44
"private": true,
55
"dependencies": {
66
"@apollo/client": "^3.7.8",

public/index.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)