File tree 2 files changed +15
-8
lines changed
components/dash-core-components/tests/integration/location
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def _insert_cookie(rep):
42
42
43
43
with pytest .warns (
44
44
DeprecationWarning ,
45
- match = "LogoutButton is deprecated, use a different component type instead " ,
45
+ match = "The Logout Button is no longer used with Dash Enterprise and can be replaced with a html.Button or html.A. " ,
46
46
):
47
47
dash_dcc .start_server (app )
48
48
time .sleep (1 )
Original file line number Diff line number Diff line change 1
1
import sys
2
+ from collections import defaultdict
2
3
from collections .abc import MutableSequence
3
4
import re
4
5
import warnings
@@ -424,13 +425,19 @@ def validate_layout(layout, layout_value):
424
425
425
426
def _validate (value ):
426
427
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
- )
428
+ deprecated_components = defaultdict (lambda : defaultdict (dict ))
429
+ deprecated_components ["dash_core_components" ][
430
+ "LogoutButton"
431
+ ] = """
432
+ The Logout Button is no longer used with Dash Enterprise and can be replaced with a html.Button or html.A.
433
+ eg: html.A(href=os.getenv('DASH_LOGOUT_URL'))
434
+ """
435
+
436
+ _type = getattr (comp , "_type" , "" )
437
+ _ns = getattr (comp , "_namespace" , "" )
438
+ deprecation_message = deprecated_components [_ns ][_type ]
439
+ if deprecation_message :
440
+ warnings .warn (dedent (deprecation_message ), DeprecationWarning )
434
441
435
442
def _validate_id (comp ):
436
443
component_id = stringify_id (getattr (comp , "id" , None ))
You can’t perform that action at this time.
0 commit comments