Projet

Général

Profil

0001-misc-include-table-fields-in-deprecation-report-6458.patch

Frédéric Péters, 29 avril 2022 09:21

Télécharger (3,12 ko)

Voir les différences:

Subject: [PATCH] misc: include table fields in deprecation report (#64581)

 tests/admin_pages/test_deprecations.py | 4 ++++
 wcs/backoffice/deprecations.py         | 9 +++++++++
 2 files changed, 13 insertions(+)
tests/admin_pages/test_deprecations.py
98 98
                {'condition': {'type': 'python', 'value': 'False'}, 'error_message': 'You shall not pass.'}
99 99
            ],
100 100
        ),
101
        fields.TableField(id='8', label='table field', type='table'),
101 102
    ]
102 103
    formdef.store()
103 104

  
......
237 238
    assert [x.text for x in resp.pyquery('.section--rtf li a')] == [
238 239
        'test / Document Creation',
239 240
    ]
241
    assert [x.text for x in resp.pyquery('.section--table-field li a')] == [
242
        'foobar / Field "table field"',
243
    ]
240 244
    # check all links are ok
241 245
    for link in resp.pyquery('.section li a'):
242 246
        resp.click(href=link.attrib['href'], index=0)
wcs/backoffice/deprecations.py
75 75
            'python-data-source': _('Python data source'),
76 76
            'rtf': _('RTF Documents'),
77 77
            'script': _('Filesystem Script'),
78
            'table-field': _('Table field'),
78 79
        }
79 80

  
80 81
    @property
......
88 89
            'python-data-source': _('Use cards.'),
89 90
            'rtf': _('Use OpenDocument format.'),
90 91
            'script': _('Use a dedicated template tags application.'),
92
            'table-field': _('Use block fields.'),
91 93
        }
92 94

  
93 95
    @property
......
101 103
            'python-data-source': 'https://doc-publik.entrouvert.com/admin-fonctionnel/elements-deprecies/',
102 104
            'rtf': 'https://doc-publik.entrouvert.com/admin-fonctionnel/elements-deprecies/',
103 105
            'script': 'https://doc-publik.entrouvert.com/admin-fonctionnel/elements-deprecies/',
106
            'table-field': 'https://doc-publik.entrouvert.com/admin-fonctionnel/elements-deprecies/',
104 107
        }
105 108

  
106 109

  
......
157 160
                            break
158 161
                if field.type in ('title', 'subtitle', 'comment'):
159 162
                    self.check_string(field.label, location_label=location_label, url=url, python_check=False)
163
                if field.type in ('table', 'table-select', 'tablerows'):
164
                    self.add_report_line(
165
                        location_label=location_label,
166
                        url=url,
167
                        category='table-field',
168
                    )
160 169

  
161 170
            self.increment_count()
162 171

  
163
-