1
- import Api from " ./api" ;
2
- import { AxiosPromise } from " axios" ;
3
- import { ApiResponse , GenericApiResponse } from " ./apiResponses" ;
4
- import { trans } from " i18n" ;
1
+ import Api from ' ./api' ;
2
+ import { AxiosPromise } from ' axios' ;
3
+ import { ApiResponse , GenericApiResponse } from ' ./apiResponses' ;
4
+ import { trans } from ' i18n' ;
5
5
6
6
export type FetchCommonSettingPayload = {
7
7
orgId : string ;
@@ -44,50 +44,54 @@ export interface ThemeDetail {
44
44
primarySurface : string ; // comp bg-color
45
45
borderRadius : string ;
46
46
chart ?: string ;
47
- margin ?: string ;
47
+ margin ?: string ;
48
48
padding ?: string ;
49
49
gridColumns ?: string ; //Added By Aqib Mirza
50
50
textSize ?: string ;
51
+ animation ?: string ;
51
52
}
52
53
53
54
export function getThemeDetailName ( key : keyof ThemeDetail ) {
54
55
switch ( key ) {
55
- case "primary" :
56
- return trans ( "themeDetail.primary" ) ;
57
- case "textDark" :
58
- return trans ( "themeDetail.textDark" ) ;
59
- case "textLight" :
60
- return trans ( "themeDetail.textLight" ) ;
61
- case "canvas" :
62
- return trans ( "themeDetail.canvas" ) ;
63
- case "primarySurface" :
64
- return trans ( "themeDetail.primarySurface" ) ;
65
- case "borderRadius" :
66
- return trans ( "themeDetail.borderRadius" ) ;
67
- case "margin" :
68
- return trans ( "style.margin" ) ;
69
- case "padding" :
70
- return trans ( "style.padding" ) ;
56
+ case 'primary' :
57
+ return trans ( 'themeDetail.primary' ) ;
58
+ case 'textDark' :
59
+ return trans ( 'themeDetail.textDark' ) ;
60
+ case 'textLight' :
61
+ return trans ( 'themeDetail.textLight' ) ;
62
+ case 'canvas' :
63
+ return trans ( 'themeDetail.canvas' ) ;
64
+ case 'primarySurface' :
65
+ return trans ( 'themeDetail.primarySurface' ) ;
66
+ case 'borderRadius' :
67
+ return trans ( 'themeDetail.borderRadius' ) ;
68
+ case 'margin' :
69
+ return trans ( 'style.margin' ) ;
70
+ case 'animation' :
71
+ return trans ( 'style.animation' ) ;
72
+ case 'padding' :
73
+ return trans ( 'style.padding' ) ;
71
74
//Added By Aqib Mirza
72
- case " gridColumns" :
73
- return trans ( " themeDetail.gridColumns" ) ;
74
- case " textSize" :
75
- return trans ( " style.textSize" ) ;
75
+ case ' gridColumns' :
76
+ return trans ( ' themeDetail.gridColumns' ) ;
77
+ case ' textSize' :
78
+ return trans ( ' style.textSize' ) ;
76
79
}
77
- return "" ;
80
+ return '' ;
78
81
}
79
82
80
83
export function isThemeColorKey ( key : string ) {
81
84
switch ( key as keyof ThemeDetail ) {
82
- case "primary" :
83
- case "textDark" :
84
- case "textLight" :
85
- case "canvas" :
86
- case "primarySurface" :
87
- case "margin" :
88
- case "padding" :
89
- case "gridColumns" : //Added By Aqib Mirza
90
- case "textSize" :
85
+ case 'primary' :
86
+ case 'textDark' :
87
+ case 'textLight' :
88
+ case 'canvas' :
89
+ case 'primarySurface' :
90
+ case 'margin' :
91
+ case 'animation' :
92
+ case 'padding' :
93
+ case 'gridColumns' : //Added By Aqib Mirza
94
+ case 'textSize' :
91
95
return true ;
92
96
}
93
97
return false ;
@@ -98,7 +102,8 @@ export interface SetCommonSettingResponse extends ApiResponse {
98
102
}
99
103
100
104
class CommonSettingApi extends Api {
101
- static commonSettingUrl = ( orgId : string ) => `/organizations/${ orgId } /common-settings` ;
105
+ static commonSettingUrl = ( orgId : string ) =>
106
+ `/organizations/${ orgId } /common-settings` ;
102
107
103
108
static fetchCommonSetting (
104
109
request : FetchCommonSettingPayload
@@ -109,7 +114,7 @@ class CommonSettingApi extends Api {
109
114
static setCommonSetting < T > (
110
115
request : SetCommonSettingPayload < T >
111
116
) : AxiosPromise < SetCommonSettingResponse > {
112
- const { orgId, ...rest } = request ;
117
+ const { orgId, ...rest } = request ;
113
118
return Api . put ( CommonSettingApi . commonSettingUrl ( request . orgId ) , rest . data ) ;
114
119
}
115
120
}
0 commit comments