@@ -76,7 +76,6 @@ type LocationProp = {
76
76
name : string ;
77
77
id : string ;
78
78
type : DETAIL_TYPE ;
79
- overwriteStyles ?: boolean ;
80
79
} ;
81
80
82
81
type ThemeDetailPageProps = {
@@ -99,15 +98,14 @@ type ThemeDetailPageState = {
99
98
100
99
class ThemeDetailPage extends React . Component < ThemeDetailPageProps , ThemeDetailPageState > {
101
100
themeDefault : ThemeDetail ;
102
- overwriteStyles : boolean ;
103
101
readonly id : string ;
104
102
readonly type : string ;
105
103
readonly inputRef : React . RefObject < InputRef > ;
106
104
footerRef = React . createRef < HTMLDivElement > ( ) ;
107
105
108
106
constructor ( props : ThemeDetailPageProps ) {
109
107
super ( props ) ;
110
- const { name, id, theme, type, overwriteStyles } = props . location . state || { } ;
108
+ const { name, id, theme, type } = props . location . state || { } ;
111
109
if ( ! name || ! id || ! theme || ! type ) {
112
110
history . replace ( BASE_URL ) ;
113
111
window . location . reload ( ) ;
@@ -124,7 +122,6 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
124
122
125
123
this . id = id ;
126
124
this . type = type ;
127
- this . overwriteStyles = Boolean ( overwriteStyles ) ;
128
125
this . state = {
129
126
theme,
130
127
name,
@@ -138,36 +135,6 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
138
135
this . setState ( { theme : this . themeDefault } ) ;
139
136
}
140
137
141
- handleOverwriteStyles ( overwriteStyles : boolean ) {
142
- this . props . fetchCommonSettings ( this . props . orgId , ( { themeList } ) => {
143
- let list = [ ] ;
144
- const currentTheme = {
145
- name : this . state . name ,
146
- id : this . id ,
147
- updateTime : new Date ( ) . getTime ( ) ,
148
- theme : this . themeDefault ,
149
- overwriteStyles : overwriteStyles ,
150
- } ;
151
- list = themeList ! . map ( ( theme ) => {
152
- if ( theme . id === this . id ) {
153
- return currentTheme ;
154
- } else {
155
- return theme ;
156
- }
157
- } ) ;
158
-
159
- this . props . setCommonSettings ( {
160
- orgId : this . props . orgId ,
161
- data : { key : "themeList" , value : list } ,
162
- onSuccess : ( ) => {
163
- messageInstance . success ( trans ( "theme.saveSuccessMsg" ) ) ;
164
- this . themeDefault = this . state . theme ;
165
- this . overwriteStyles = overwriteStyles ;
166
- } ,
167
- } ) ;
168
- } ) ;
169
- }
170
-
171
138
handleSave ( ) {
172
139
this . props . fetchCommonSettings ( this . props . orgId , ( { themeList } ) => {
173
140
let list = [ ] ;
@@ -376,15 +343,6 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
376
343
< ArrowIcon />
377
344
< span > { this . state . name } </ span >
378
345
</ HeaderBack >
379
- < Flex gap = { 8 } >
380
- < b style = { { margin : 0 } } >
381
- Overwrite styles
382
- </ b >
383
- < Switch defaultValue = { this . overwriteStyles } onChange = { ( ) => {
384
- console . log ( 'change' ) ;
385
- this . handleOverwriteStyles ( ! this . overwriteStyles )
386
- } } />
387
- </ Flex >
388
346
</ Header >
389
347
390
348
< DetailContent >
@@ -586,7 +544,7 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
586
544
</ Card >
587
545
</ ThemeSettingsView >
588
546
589
- { /* <ThemeSettingsView>
547
+ < ThemeSettingsView >
590
548
< StyleThemeSettingsCover >
591
549
< ChartCompIcon width = { "36px" } style = { { marginRight : "10px" } } /> < h2 style = { { color : "#ffffff" , marginTop : "8px" } } > { trans ( "theme.charts" ) } </ h2 >
592
550
</ StyleThemeSettingsCover >
@@ -618,7 +576,7 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
618
576
< PreviewApp style = { { height : "380px" , width : "100%" , margin : "0" } } theme = { this . state . theme } dsl = { chartDsl } />
619
577
</ Flex >
620
578
</ Card >
621
- </ThemeSettingsView> */ }
579
+ </ ThemeSettingsView >
622
580
623
581
</ DetailContent >
624
582
0 commit comments