mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
2854a0cf46
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):
22 lines
510 B
TypeScript
22 lines
510 B
TypeScript
/**
|
|
* 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, '*')
|
|
});
|
|
}
|