Commit Graph
4 Commits
Author SHA1 Message Date
Adrien Dieudonne 3a886327a6 [FIX] pad: don't consider record as dirty
Before this rev., when the user opened a form view
containing a pad widget, with a pad url already configured,
a dialog directly popped asking "The record has been
modified, your changes will be discarded. Are you sure you
want to ?".

This is because of an unconventional behavior of this
widget: the field actually encodes an url, the one of the pad
to display. When the user saves, a write is forced so that
the server can retrieve the pad's content and store it in DB.
To force the write, the widget always notifies a fake change
on the url. However, we don't want this change to trigger
the confirm dialog. With this rev., this fake change doesn't
make the record 'dirty'.
2017-08-10 10:33:05 +02:00
Géry Debongnie ecdcc65a90 [FIX] pad: force writing url, even if it did not change
Before this commit, the pad widget did not force the view to save the
current value, since it did not change (pad values are just the url for
the pad).  However, this is a problem for the server, since it uses the
fact that the web client forces a save to update the description field
in the model (get the data from the pad server and add it to the
database).

This was not a big deal when looking at the pad (the pad widget fetches
its data each time), but it is a problem that the database is not
synchronized with the current data.
2017-07-27 11:34:05 +02:00
Géry Debongnie 72ed3a153a [FIX] web,pad: record is not considered dirty when pad is loaded
The pad widget does something unconventional: it creates the pad url
only when rendering in edit mode.  This was done to prevent creating pad
by default for record in readonly mode.

Because of that, if the user clicks on create, then discard, the record was
considered dirty, so a confirmation modal popped up.  In this commit, we
just make sure that the initial setValue from the rendering does not
'dirty' the record.
2017-07-27 11:34:04 +02:00
Géry Debongnie c31bf95e4e [FIX] pad: make it work with the new views
The pad widget was partially updated to the new views, but was no longer
working.  In this commit, we rewrite the widget to make it work.

Note that we did some functional changes:
- we do only one rpc to check if the server is configured. the result is
  stored on the prototype, so we do not need to do it again
- we do some rpcs with shadow: true, so we will not stop the rest of the
  ui if the server is slow to respond
- we display a loading message in readonly, when the content is not
  loaded yet.
2017-05-11 09:53:10 +02:00