maintenance_tasks icon indicating copy to clipboard operation
maintenance_tasks copied to clipboard

added turbo and removed the page auto refresh

Open TopRoupi opened this issue 3 years ago • 3 comments

attempt to fix #510, i wrapped the main components in the index/show view in a turbo-frame and added a update button inside, so when clicked it will just update the html inside the turbo frame.

also added data-turbo=false to all forms and data-turbo-frame="_top" to task's links, and removed the code that implemented the auto refresh every 3 seconds.

i needed to do a hack to get the system tests to work(disable csp in test environment) since i cant fix the insecure inline style inside the turbo package.

TopRoupi avatar Feb 14 '22 11:02 TopRoupi

i needed to do a hack to get the system tests to work(disable csp in test environment) since i cant fix the insecure inline style inside the turbo package.

That is an issue, we're running this gem with a very strict content security policy, so we will have to figure something out.

etiennebarrie avatar Feb 14 '22 13:02 etiennebarrie

added integrity hash in the CSP config to the turbo progress bar css

it wont be needed any more after if this gets merged: https://github.com/hotwired/turbo/pull/501

now the other CSP errors that are happening in the tests coming from this line is being triggered by the in line style in the application.html.erb that adds code highlighting, this csp error only happens in chrome when navigation between pages although the highlighting will works fine, in firefox you can navigate without any csp error.

https://github.com/Shopify/maintenance_tasks/blob/c76b2810adc3dac03bad5efc33fb0f1e217bad9f/app/views/layouts/maintenance_tasks/application.html.erb#L24 if i remove this style block the tests will pass, but then the code highlight will be gone.

TopRoupi avatar Feb 15 '22 16:02 TopRoupi

another option would be to remove the nonce attribute from the block and add its hash value to the CSP config.

TopRoupi avatar Feb 15 '22 16:02 TopRoupi

@TopRoupi are you still interested in working on this?

gmcgibbon avatar Jan 19 '24 21:01 gmcgibbon