n8n icon indicating copy to clipboard operation
n8n copied to clipboard

fix(editor): Disable expression editor modal opening on readonly field

Open cstuncsik opened this issue 1 year ago • 2 comments

Expression fields appear editable when they should be in read only state

m

We need to look at expression fields across all nodes to make sure they are 'read only' when a credential on them is being used that isn't shared with the user currently editing. There are a few different scenarios to consider. One is where you're an instance owner/admin and more things look editiable than they should be. The other is that it looks like even for standard member users, expression fields/text input fields are editable when they shouldn't be

Expected behaviour

When editing the Google sheets node where the credential has not been shared with you, you should not be able to edit any of the fields on that nodes.

When opening up the expression editor in full screen mode, it should be greyed out and in read only mode

Actual behaviour

Expression/text fields on certain nodes (if not all) are still editable. You can't save them but its confusing because it looks like you can update and save them and you won't see any error messages. Any changes will just disappear once you refresh.

For certain nodes, you're unable to edit in the small expressions input but once you open up in full screen you can then edit things in there

A/C

Expressions on readonly (when credentials have not been shared) nodes should be readonly for instance owner, instance admin and member users

When you open up the expression editor in full screen mode on any node, this should also be in read only state.

We should check all nodes are handling expressions/text inputs like this consistently

Examples of where this is happening

GMAIL Node - you can't edit the message in the initial view but once you open up to full screen editor you then can image

Google Sheets node - You can edit the values to send fields when they should be read only like the fields above image

cstuncsik avatar Jan 26 '24 12:01 cstuncsik

Thanks for fixing this! Added a comment about the requirements on Linear.

ivov avatar Jan 26 '24 14:01 ivov

Thanks @ivov, sorry, I just missed it. Pushed another fix disabling editing the extended expression editor Thinking on a good way to test it (possibly not in an E2E test)

cstuncsik avatar Jan 26 '24 15:01 cstuncsik

So readonly works fine, but I'm still seeing this white instead of greyed out. Let's sync on this when you get a chance.

Capture 2024-01-29 at 12 19 11@2x Capture 2024-01-29 at 12 19 48@2x

ivov avatar Jan 29 '24 11:01 ivov

1 flaky test on run #3950 ↗︎

0 339 5 0 Flakiness 1

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 cstuncsik 🗃️ e2e/*
Project: n8n Commit: 1c39f53250
Status: Passed Duration: 03:20 💡
Started: Jan 29, 2024 3:29 PM Ended: Jan 29, 2024 3:32 PM
Flakiness  cypress/e2e/19-execution.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Execution > should test manual workflow stop Test Replay Screenshots Video

Review all test suite changes for PR #8457 ↗︎

cypress[bot] avatar Jan 29 '24 15:01 cypress[bot]

:white_check_mark: All Cypress E2E specs passed

github-actions[bot] avatar Jan 29 '24 15:01 github-actions[bot]

Got released with [email protected]

janober avatar Feb 02 '24 13:02 janober