File tree 2 files changed +25
-17
lines changed
client/packages/lowcoder/src
comps/comps/tableComp/column/columnTypeComps
2 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,13 @@ const childrenMap = {
69
69
70
70
const getBaseValue : ColumnTypeViewFn < typeof childrenMap , boolean , boolean > = ( props ) => props . switchState ;
71
71
72
+ let onEvent : ( eventName : string ) => Promise < unknown [ ] > ;
73
+
72
74
export const SwitchComp = ( function ( ) {
73
75
return new ColumnTypeCompBuilder (
74
76
childrenMap ,
75
77
( props , dispatch ) => {
78
+ onEvent = props . onEvent ;
76
79
const value = props . changeValue ?? getBaseValue ( props , dispatch ) ;
77
80
const CheckBoxComp = ( ) => {
78
81
return (
@@ -106,6 +109,8 @@ export const SwitchComp = (function () {
106
109
disabled = { false }
107
110
onChange = { ( checked , e ) => {
108
111
props . onChange ( checked ) ;
112
+ onEvent ?.( "change" ) ;
113
+ onEvent ?.( checked ? "true" : "false" ) ;
109
114
} }
110
115
/>
111
116
</ Wrapper >
Original file line number Diff line number Diff line change @@ -95,25 +95,28 @@ function UserRegister() {
95
95
setSigninEnabled ( LOWCODER_EMAIL_AUTH_ENABLED === 'true' ) ;
96
96
} , [ serverSettings ] ) ;
97
97
98
+ const fetchOrgsByEmail = ( ) => {
99
+ fetchOrgPaginationByEmail ( {
100
+ email : ' ' ,
101
+ pageNum : 1 ,
102
+ pageSize : 10 ,
103
+ } )
104
+ . then ( ( resp ) => {
105
+ if ( resp . success ) {
106
+ const orgList = resp . data || [ ] ;
107
+ if ( orgList . length ) {
108
+ // in Enterprise mode, we will get org data in different format
109
+ const selectedOrgId = orgList [ 0 ] ?. id || orgList [ 0 ] ?. orgId ;
110
+ setDefaultOrgId ( selectedOrgId ) ;
111
+ dispatch ( fetchConfigAction ( selectedOrgId ) ) ;
112
+ }
113
+ }
114
+ } )
115
+ }
116
+
98
117
useEffect ( ( ) => {
99
118
if ( isEnterpriseMode ) {
100
- // dispatch(fetchConfigAction());
101
- fetchOrgPaginationByEmail ( {
102
- email : ' ' ,
103
- pageNum : 1 ,
104
- pageSize : 10 ,
105
- } )
106
- . then ( ( resp ) => {
107
- if ( resp . success ) {
108
- const orgList = resp . data || [ ] ;
109
- if ( orgList . length ) {
110
- // in Enterprise mode, we will get org data in different format
111
- const selectedOrgId = orgList [ 0 ] ?. id || orgList [ 0 ] ?. orgId ;
112
- setDefaultOrgId ( selectedOrgId ) ;
113
- dispatch ( fetchConfigAction ( selectedOrgId ) ) ;
114
- }
115
- }
116
- } )
119
+ fetchOrgsByEmail ( ) ;
117
120
}
118
121
} , [ isEnterpriseMode ] ) ;
119
122
You can’t perform that action at this time.
0 commit comments