feat(editor): Add fullscreen view to code editor (#8084)

## Summary

<img width="1240" alt="image"
src="https://github.com/n8n-io/n8n/assets/8850410/2819f4ce-c343-431a-8a88-a1bc9c4b572a">
<img width="2649" alt="image"
src="https://github.com/n8n-io/n8n/assets/8850410/36862aaf-cc4c-4668-bdc8-cf5a6f00babe">

1. Add code node and open it
3. Click the fullscreen button in the bottom right
4. A fullscreen dialog should appear and allow editing the code
5. Changes made in the fullscreen dialog should be applied to the
original code editor when closed

It should work the same way for HTML/SQL/JSON editors

⚠️ Modal layout was updated so that modals/dialogs are centered, try to
test some modals

## Related tickets and issues
https://linear.app/n8n/issue/NODE-1009/add-fullscreen-view-to-code-node



## Review / Merge checklist
- [ ] PR title and summary are descriptive. **Remember, the title
automatically goes into the changelog. Use `(no-changelog)` otherwise.**
([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up
ticket created.
- [ ] Tests included.
> A bug is not considered fixed, unless a test is added to prevent it
from happening again.
   > A feature is not complete without tests.

---------

Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
Elias Meire
2024-01-04 17:23:24 +01:00
committed by GitHub
parent 8f22a265d6
commit 071e6d6b6e
28 changed files with 617 additions and 376 deletions

View File

@@ -7,7 +7,6 @@ const commonDescription: INodeProperties = {
typeOptions: {
editor: 'codeNodeEditor',
editorLanguage: 'javaScript',
rows: 5,
},
default: '',
description:

View File

@@ -7,7 +7,6 @@ const commonDescription: INodeProperties = {
typeOptions: {
editor: 'codeNodeEditor',
editorLanguage: 'python',
rows: 5,
},
default: '',
description:

View File

@@ -20,7 +20,6 @@ const properties: INodeProperties[] = [
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
},
displayOptions: {
hide: {
@@ -39,7 +38,6 @@ const properties: INodeProperties[] = [
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
},
displayOptions: {
show: {

View File

@@ -88,7 +88,6 @@ export class MicrosoftSql implements INodeType {
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'MSSQL',
},
displayOptions: {

View File

@@ -79,7 +79,6 @@ const versionDescription: INodeTypeDescription = {
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'MySQL',
},
displayOptions: {

View File

@@ -26,7 +26,6 @@ const properties: INodeProperties[] = [
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'MySQL',
},
hint: 'Consider using query parameters to prevent SQL injection attacks. Add them in the options below',

View File

@@ -77,7 +77,6 @@ const versionDescription: INodeTypeDescription = {
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'PostgreSQL',
},
displayOptions: {

View File

@@ -26,7 +26,6 @@ const properties: INodeProperties[] = [
"The SQL query to execute. You can use n8n expressions and $1, $2, $3, etc to refer to the 'Query Parameters' set in options below.",
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'PostgreSQL',
},
hint: 'Consider using query parameters to prevent SQL injection attacks. Add them in the options below',

View File

@@ -63,7 +63,6 @@ export class QuestDb implements INodeType {
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'PostgreSQL',
},
displayOptions: {

View File

@@ -19,7 +19,7 @@ const properties: INodeProperties[] = [
typeOptions: {
rows: 5,
},
default: '{\n "my_field_1": "value",\n "my_field_2": 1\n}',
default: '{\n "my_field_1": "value",\n "my_field_2": 1\n}\n',
validateType: 'object',
ignoreValidationDuringExecution: true,
},

View File

@@ -69,7 +69,6 @@ export class Snowflake implements INodeType {
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
},
displayOptions: {
show: {

View File

@@ -67,7 +67,6 @@ export class TimescaleDb implements INodeType {
noDataExpression: true,
typeOptions: {
editor: 'sqlEditor',
rows: 5,
sqlDialect: 'PostgreSQL',
},
displayOptions: {