mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Allow overriding theme from query params (#7591)
Allow overriding theme through query params.. to be able to override it from preview iframe in webcomponent Github issue / Community forum post (link here to close automatically):
This commit is contained in:
21
cypress/pages/demo.ts
Normal file
21
cypress/pages/demo.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
||||
export function vistDemoPage(theme?: 'dark' | 'light') {
|
||||
const query = theme ? `?theme=${theme}` : '';
|
||||
cy.visit('/workflows/demo' + query);
|
||||
cy.waitForLoad();
|
||||
cy.window().then((win) => {
|
||||
// @ts-ignore
|
||||
win.preventNodeViewBeforeUnload = true;
|
||||
});
|
||||
}
|
||||
|
||||
export function importWorkflow(workflow: object) {
|
||||
const OPEN_WORKFLOW = {command: 'openWorkflow', workflow};
|
||||
cy.window().then($window => {
|
||||
const message = JSON.stringify(OPEN_WORKFLOW);
|
||||
$window.postMessage(message, '*')
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user