Commit graph

122 commits

Author SHA1 Message Date
Paul Chavard
b94bc8fd8a refactor(dossier): use champ id as champ attributes key 2022-05-03 16:14:54 +02:00
simon lehericey
ea361643be types_de_champ -> types_de_champs_public 2022-05-03 11:05:24 +02:00
simon lehericey
44f2d93277 quick fix of sections in preview 2022-03-15 10:54:39 +01:00
Paul Chavard
c60a8970f1 perf(dossier): memoize champ.sections on dossier 2022-03-11 00:15:53 +01:00
Paul Chavard
54b559364a feat(dossier): replace discarded with visible_by_administration 2022-03-10 14:29:40 +01:00
Paul Chavard
fc058f721d a11y(champs): expose ids for UI on champ 2022-01-05 12:33:40 +01:00
kara Diaby
dc35d9521f add other option to liste deroulante champ 2021-10-26 16:11:15 +02:00
Paul Chavard
d308448f02 feat(type_de_champ): add secondary label and description do linked drop downs 2021-10-26 12:18:01 +02:00
Paul Chavard
09a09d3fcf feat(revisions): add rebased_at to champs 2021-10-20 17:26:09 +02:00
simon lehericey
354735ace4 add champ value_json jsonb column 2021-10-12 14:27:20 +02:00
Paul Chavard
ac0f50b488 Improuve champ blank check 2021-07-22 10:45:25 +02:00
Paul Chavard
dfc46a8736 Enable add descriptions to cadastres 2021-05-26 11:27:09 +02:00
Paul Chavard
c20ad5ca17 Remove the link between commentaire and user 2021-04-22 15:10:47 +01:00
Paul Chavard
5e5122a436 Prevent crash in preview where there is no siblings 2021-04-06 18:15:29 +01:00
Paul Chavard
2702660d72 Update app/models/champs/header_section_champ.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-04-06 10:45:16 +01:00
Pierre de La Morinerie
3499f5af9a models: remove invalid Dossier ↔︎ Champ inverse relationship
`Dossier.champs` is not really an inverse of `Champs.dossier`: when a
Champ record is created, it should not always be added to dossier.champs
(for instance if the champ is private).

NB: this breaks the workaround we added in #3907 to fix the parent
dossier not being touched in some cases (the workaround was to add an
inverse relationship, but we now have to remove it).

The new workaround is to watch for `changed_for_autosave?` on champs.
Unlike `changed?`, `changed_for_autosave?` also detects changes to
attachments. This allows us to touch both `last_champ_updated_at` and
`updated_at` in a single pass.
2021-04-06 10:26:17 +02:00
Paul Chavard
1449fbbe67 Fix multiple_drop_down_list mandatory check 2021-03-18 15:22:28 +01:00
Paul Chavard
d24ee27cac Try to reduce the number of external data fetches
Only fetch external data if the external_id is the current one and data is not yet fetched
2021-03-11 14:56:37 +01:00
Paul Chavard
7eee14feef Add ChampFetchExternalDataJob 2021-02-17 19:10:16 +01:00
Paul Chavard
a591d5528e Add job exception log methods to champ and dossier 2021-02-05 18:56:27 +01:00
Paul Chavard
78a07ef021 Add job exception logs to dossier and champ 2021-02-04 19:27:27 +01:00
Paul Chavard
09a3cacd88 Add external_id to champs 2021-01-15 11:50:02 +01:00
Paul Chavard
a1643dad84 Add data column to champ 2021-01-14 17:31:37 +01:00
Paul Chavard
48e7822e34 Remove titres identite after a dossier is processed 2020-12-10 15:21:25 +01:00
clemkeirua
9019a8b380 ensure a dossier_id is set if possible 2020-09-30 16:50:28 +02:00
clemkeirua
61cf33e3ca remove duplicate private champ 2020-09-04 15:40:23 +02:00
Paul Chavard
6d4425885d Fix champ order joins sql error 2020-09-03 18:32:43 +02:00
Paul Chavard
ec72fdd164 Remove migration service 2020-09-02 11:26:26 +02:00
Pierre de La Morinerie
6328011f60 models: require belong_to associations on champ
- Make `champ.dossier` a requirement;
- Move the dossier_id assignation to `before_validation` (otherwise
the record is invalid, and never gets saved);
- Allow specs to only build the champ (instead of saving it to the
database), which bypasses the requirement to have a dossier.
2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
11456109c0 models: explicitly mark optional belongs_to relationship as so
This prepares making the `belongs_to` relationship required by default.
2020-08-18 15:57:36 +02:00
Pierre de La Morinerie
6d28069539 models: generate annotations 2020-08-12 11:45:53 +02:00
Paul Chavard
b628169053 Remove unsused drop_down_list model 2020-07-16 15:29:01 +02:00
Paul Chavard
97f91513c8 Store drop_down_list values as jsonb 2020-06-25 13:14:17 +02:00
Christophe Robillard
fb87a09c02 doesn't update dossier etablissement for siret controller 2020-05-26 18:13:20 +02:00
kara Diaby
db5fd9bd0f fix bug on mandatory carto champ for the new map editor 2020-05-15 13:44:50 +02:00
Paul Chavard
ef2d9e1138 Expose stable_id on champ 2020-04-30 15:49:31 +02:00
Pierre de La Morinerie
1cb18e51ac champ: return the parent dossier even when discarded
Dossier has a `default_scope { kept }`.

Because of that, when the parent dossier is discarded, `champ.dossier`
will return nil.

We should kill the default scope. But meanwhile, ensure that
`champ.dossier` returns even a discarded dossier.
2020-04-22 11:46:42 +02:00
Christophe Robillard
5b6044803b forbid to create champ with same type_de_champ and same row 2020-04-06 17:39:51 +02:00
clemkeirua
6d02e6e9e8 replaced helper has_html_label? with inheritance 2020-03-24 16:54:36 +00:00
Pierre de La Morinerie
d6a9318d05 champ: fix siblings for repetition champs
Fix a crash when requesting the `section_index` of a section header
in a repetition champ.
2020-02-17 17:11:17 +01:00
Pierre de La Morinerie
f8ed7ec051 form: display index of section in header 2020-02-13 11:18:46 +01:00
Paul Chavard
86b271997b Invite experts to linked dossiers
closes #3669
2019-10-23 13:10:09 +02:00
Paul Chavard
eb7aba18e6 Add dossier champs and annotations types 2019-09-24 10:47:21 +02:00
Paul Chavard
b97cbd3402 Serialize champ repetition for tags
closes #4272
2019-09-12 17:23:18 +02:00
Paul Chavard
b266915892 Add repetitions to api 2019-08-01 10:04:35 +02:00
Pierre de La Morinerie
51aacabf13 models: fix touch not propagating when using nested attributes
Sometimes, when using nested attributes, touch doesn’t propagate to
parent relationships. (see https://github.com/rails/rails/issues/26726)

Specifically, this happens in our app when updating a dossier with
only new attachements (but without changing the value of any fields).

To work around this, we need to define the parent relationship
explicitely. This is good practice anyway.

Fix #3906
2019-06-17 13:44:07 +02:00
Paul Chavard
91f2d7d706 Remove deprecated virus_scan model 2019-05-03 11:07:19 +02:00
Paul Chavard
8d093bd9ba Fix missing dossier_id on champs inside repetition 2019-04-18 16:55:35 +02:00
simon lehericey
2f66625f18 Manager: improve dossier view 2019-02-19 14:30:14 +01:00
Paul Chavard
071448e1d9 Champ Repetition dossier editor 2019-02-04 16:19:07 +01:00