File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
2
from collections .abc import MutableSequence
3
3
import re
4
+ import warnings
4
5
from textwrap import dedent
5
6
from keyword import iskeyword
6
7
import flask
@@ -422,6 +423,15 @@ def validate_layout(layout, layout_value):
422
423
component_ids = set ()
423
424
424
425
def _validate (value ):
426
+ def _validate_type (comp ):
427
+ deprecated_types = ["LogoutButton" ]
428
+ component_type = getattr (comp , "_type" , None )
429
+ if component_type and component_type in deprecated_types :
430
+ warnings .warn (
431
+ f"{ component_type } is deprecated, use a different component type instead" ,
432
+ DeprecationWarning ,
433
+ )
434
+
425
435
def _validate_id (comp ):
426
436
component_id = stringify_id (getattr (comp , "id" , None ))
427
437
if component_id and component_id in component_ids :
@@ -432,9 +442,11 @@ def _validate_id(comp):
432
442
)
433
443
component_ids .add (component_id )
434
444
445
+ _validate_type (value )
435
446
_validate_id (value )
436
447
437
448
for component in value ._traverse (): # pylint: disable=protected-access
449
+ _validate_type (component )
438
450
_validate_id (component )
439
451
440
452
if isinstance (layout_value , (list , tuple )):
You can’t perform that action at this time.
0 commit comments