@@ -36,31 +36,36 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
3636 '#title ' => $ this ->t ('Enable OpenFisca RaC integration ' ),
3737 '#description ' => '' ,
3838 '#default_value ' => $ openfisca_settings ->isEnabled (),
39+ '#weight ' => -100 ,
3940 ];
4041 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_debug_mode ' ] = [
4142 '#type ' => 'checkbox ' ,
4243 '#title ' => $ this ->t ('Enable debug mode ' ),
4344 '#description ' => '' ,
4445 '#default_value ' => $ openfisca_settings ->isDebugEnabled (),
46+ '#weight ' => -90 ,
4547 ];
4648 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_logging_mode ' ] = [
4749 '#type ' => 'checkbox ' ,
4850 '#title ' => $ this ->t ('Log OpenFisca calculation ' ),
4951 '#description ' => '' ,
5052 '#default_value ' => $ openfisca_settings ->isLoggingEnabled (),
53+ '#weight ' => -80 ,
5154 ];
5255 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_api_endpoint ' ] = [
5356 '#type ' => 'textfield ' ,
5457 '#title ' => $ this ->t ('OpenFisca API endpoint ' ),
5558 '#description ' => $ this ->t ('Specify the API endpoint to the Fisca Rule ' ),
5659 '#default_value ' => $ openfisca_settings ->getApiEndpoint (),
60+ '#weight ' => -70 ,
5761 ];
5862 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_api_authorization_header ' ] = [
5963 '#type ' => 'textfield ' ,
6064 '#title ' => $ this ->t ('Authorization header to connect to OpenFisca API ' ),
6165 '#description ' => $ this ->t ('Specify the Authorization header to connect to a private OpenFisca API, e.g. a Basic auth or a Bearer token. ' ),
6266 '#default_value ' => $ openfisca_settings ->getApiAuthorizationHeader (),
6367 '#field_prefix ' => $ this ->t ('Authorization: ' ),
68+ '#weight ' => -60 ,
6469 ];
6570 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_return_key ' ] = [
6671 '#type ' => 'webform_codemirror ' ,
@@ -69,6 +74,7 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
6974 '#title ' => $ this ->t ('The keys for the return value ' ),
7075 '#description ' => $ this ->t ('Specify the keys for the return value that needs to be checked. Comma separated. ' ),
7176 '#default_value ' => $ openfisca_settings ->getPlainReturnKeys (),
77+ '#weight ' => -50 ,
7278 ];
7379 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_field_mappings ' ] = [
7480 '#type ' => 'webform_codemirror ' ,
@@ -81,6 +87,7 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
8187 '#title ' => $ this ->t ('OpenFisca Field mappings ' ),
8288 '#description ' => $ this ->t ('Specify the field mappings ' ),
8389 '#default_value ' => $ openfisca_settings ->getJsonFieldMappings (),
90+ '#weight ' => -40 ,
8491 ];
8592 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_variables ' ] = [
8693 '#type ' => 'webform_codemirror ' ,
@@ -93,6 +100,7 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
93100 '#title ' => $ this ->t ('OpenFisca Variables ' ),
94101 '#description ' => $ this ->t ('Specify the variables from OpenFisca API ' ),
95102 '#default_value ' => $ openfisca_settings ->getJsonVariables (),
103+ '#weight ' => -30 ,
96104 ];
97105 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_parameter_tokens ' ] = [
98106 '#type ' => 'webform_codemirror ' ,
@@ -101,6 +109,7 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
101109 '#title ' => $ this ->t ('OpenFisca parameter tokens ' ),
102110 '#description ' => $ this ->t ('Specify the OpenFisca parameters used as tokens. Comma separated. ' ),
103111 '#default_value ' => $ openfisca_settings ->getPlainParameterTokens (),
112+ '#weight ' => -20 ,
104113 ];
105114 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_entity_roles ' ] = [
106115 '#type ' => 'webform_codemirror ' ,
@@ -113,6 +122,7 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
113122 '#title ' => $ this ->t ('OpenFisca Field Entity Roles ' ),
114123 '#description ' => $ this ->t ('Specify the field entity roles for OpenFisca API ' ),
115124 '#default_value ' => $ openfisca_settings ->getJsonEntityRoles (),
125+ '#weight ' => -10 ,
116126 ];
117127 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_immediate_response_mapping ' ] = [
118128 '#type ' => 'webform_codemirror ' ,
@@ -125,6 +135,7 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
125135 '#title ' => $ this ->t ('OpenFisca immediate response mapping ' ),
126136 '#description ' => $ this ->t ('Specify the field immediate response mapping ' ),
127137 '#default_value ' => $ openfisca_settings ->getJsonImmediateResponseMapping (),
138+ '#weight ' => 0 ,
128139 ];
129140 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_immediate_exit_mapping ' ] = [
130141 '#type ' => 'webform_codemirror ' ,
@@ -133,12 +144,14 @@ public function alterForm(array &$form, FormStateInterface $form_state): void {
133144 '#title ' => $ this ->t ('OpenFisca immediate exit mapping ' ),
134145 '#description ' => $ this ->t ('Specify the return keys of OpenFisca response to map to immediate exit. Comma separated. ' ),
135146 '#default_value ' => $ openfisca_settings ->getPlainImmediateExitKeys (),
147+ '#weight ' => 10 ,
136148 ];
137149 $ form ['third_party_settings ' ]['webform_openfisca ' ]['fisca_immediate_response_ajax_indicator ' ] = [
138150 '#type ' => 'checkbox ' ,
139151 '#title ' => $ this ->t ('Display Ajax indicator ' ),
140152 '#description ' => $ this ->t ('Whether to display an Ajax indicator when an immediate response is required. ' ),
141153 '#default_value ' => $ openfisca_settings ->hasImmediateResponseAjaxIndicator (),
154+ '#weight ' => 20 ,
142155 ];
143156 $ form ['#validate ' ][] = [$ this , 'validateForm ' ];
144157 }
0 commit comments