silverstripe / silverstripe-elemental

Create pages in Silverstripe CMS using content blocks
http://dna.co.nz
BSD 3-Clause "New" or "Revised" License
110 stars 115 forks source link

Improve Individual Save & Publish #470

Open NightJar opened 6 years ago

NightJar commented 6 years ago

Following on from #312 , there are several performance improvements that could be made to the process which is currently launching 4 requests to publish a page, and assumes that a save is necessary prior to publishing too frequently (that is, often deems it necessary when it is not).

The first issue can hopefully be addressed by @ScopeyNZ 's work in #457 - by knowing what type of element we're trying to save, we can correctly supply the fields required to be saved with the GraphQL query.

The second issue may be able to be resolved by an update to react-form, as it seems isDirty isn't quite doing as it seems it is intended (details at https://github.com/dnadesign/silverstripe-elemental/issues/312#issuecomment-433227789). Otherwise it seems a custom reducer to evaluate the form state in comparing values to initial would be the answer - although less desirable to using what the library provides us.

robbieaverill commented 5 years ago

Note from #517 - check when we do this that "save and publish" as well as "save" actions both take the model's validation rules into account before saving.