Closed simon-leech closed 6 days ago
@dbauszus-glx Yeah i didn't think this was the best way to handle it.
My use case is a third-party API call to a drivetime that then updates a separate field. The drivetime is not shown on the map (it has no style). When the drivetime call is finished the field should be updated as it is a dependent of the geometry drivetime field.
@simon-leech This will have to be done with the blocking capability. The geometry field entry will be ahead of the dependent field entry.
The geometry entry has the blocking and display flag. If the entry has no value it will be generated. The location view is disabled with the blocking flag. After the geometry has been created and stored the location view will re-render. Dependent fields should be synced.
@simon-leech What you are trying to do must be controlled in the plugin.
The syncFields should be added to the finally condition of the call which requests the geometry. Whether a geometry is stored or not should not matter.
Screencast from 25-06-24 09:54:25.webm
.finally(async () => {
if (entry.dependents) {
await entry.location.syncFields(entry.dependents)
}
entry.blocking && entry.location.view.dispatchEvent(new Event('render'))
})
Pull Request Template
Description
update()
so that anydependents
are also updated.entry.edit.modify_label
andentry.edit.delete_label
that can be configured.Type of Change
Please delete options that are not relevant, and select all options that apply.
How have you tested this?
Tested locally.
Testing Checklist
Please delete options that are not relevant, and select all options that apply.
Code Quality Checklist
Please delete options that are not relevant, and select all options that apply.