diff --git a/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/config/AppModule.java b/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/config/AppModule.java index f0a5014b..d82266c6 100644 --- a/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/config/AppModule.java +++ b/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/config/AppModule.java @@ -275,8 +275,8 @@ TemplateService TemplateService(MasterDataService masterDataService, IdentitySch @Provides @Singleton - PreRegistrationDataSyncService PreRegistrationDataSyncService(PreRegistrationDataSyncDao preRegistrationDao, MasterDataService masterDataService, SyncRestService syncRestService, PreRegZipHandlingService preRegZipHandlingService, PreRegistrationList preRegistration, GlobalParamRepository globalParamRepository) { - return new PreRegistrationDataSyncServiceImpl(appContext, preRegistrationDao, masterDataService, syncRestService, preRegZipHandlingService, preRegistration, globalParamRepository); + PreRegistrationDataSyncService PreRegistrationDataSyncService(PreRegistrationDataSyncDao preRegistrationDao, MasterDataService masterDataService, SyncRestService syncRestService, PreRegZipHandlingService preRegZipHandlingService, PreRegistrationList preRegistration, GlobalParamRepository globalParamRepository, RegistrationService registrationService) { + return new PreRegistrationDataSyncServiceImpl(appContext, preRegistrationDao, masterDataService, syncRestService, preRegZipHandlingService, preRegistration, globalParamRepository, registrationService); } @Provides diff --git a/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/PreRegistrationDataSyncServiceImpl.java b/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/PreRegistrationDataSyncServiceImpl.java index de660955..6a439aaf 100644 --- a/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/PreRegistrationDataSyncServiceImpl.java +++ b/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/PreRegistrationDataSyncServiceImpl.java @@ -26,6 +26,7 @@ import io.mosip.registration.clientmanager.spi.MasterDataService; import io.mosip.registration.clientmanager.spi.PreRegistrationDataSyncService; import io.mosip.registration.clientmanager.dto.registration.RegistrationDto; +import io.mosip.registration.clientmanager.spi.RegistrationService; import io.mosip.registration.clientmanager.spi.SyncRestService; import io.mosip.registration.clientmanager.util.SyncRestUtil; import io.mosip.registration.packetmanager.util.DateUtils; @@ -65,11 +66,12 @@ public class PreRegistrationDataSyncServiceImpl implements PreRegistrationDataSy SharedPreferences sharedPreferences; PreRegistrationList preRegistration; GlobalParamRepository globalParamRepository; + RegistrationService registrationService; private Context context; private String result = ""; ExecutorService executorServiceForPreReg = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); - public PreRegistrationDataSyncServiceImpl(Context context,PreRegistrationDataSyncDao preRegistrationDao,MasterDataService masterDataService,SyncRestService syncRestService,PreRegZipHandlingService preRegZipHandlingService,PreRegistrationList preRegistration,GlobalParamRepository globalParamRepository){ + public PreRegistrationDataSyncServiceImpl(Context context,PreRegistrationDataSyncDao preRegistrationDao,MasterDataService masterDataService,SyncRestService syncRestService,PreRegZipHandlingService preRegZipHandlingService,PreRegistrationList preRegistration,GlobalParamRepository globalParamRepository,RegistrationService registrationService){ this.context = context; this.preRegistrationDao = preRegistrationDao; this.masterDataService = masterDataService; @@ -77,6 +79,7 @@ public PreRegistrationDataSyncServiceImpl(Context context,PreRegistrationDataSyn this.preRegZipHandlingService = preRegZipHandlingService; this.preRegistration = preRegistration; this.globalParamRepository = globalParamRepository; + this.registrationService = registrationService; sharedPreferences = this.context.getSharedPreferences( this.context.getString(R.string.app_name), Context.MODE_PRIVATE); @@ -208,7 +211,7 @@ public Map getPreRegistration(@NonNull String preRegistrationId, return attributeData; } - private PreRegistrationList fetchPreRegistration(String preRegistrationId, String lastUpdatedTimeStamp) throws ClientCheckedException { + private PreRegistrationList fetchPreRegistration(String preRegistrationId, String lastUpdatedTimeStamp) throws Exception { Log.i(TAG,"Fetching Pre-Registration started for {}"+ preRegistrationId); // PreRegistrationList preRegistration; @@ -220,17 +223,23 @@ private PreRegistrationList fetchPreRegistration(String preRegistrationId, Strin try { preRegistration = downloadAndSavePacket(preRegistrationId, lastUpdatedTimeStamp); } catch (ExecutionException | InterruptedException e) { + this.registrationService.getRegistrationDto().getDocuments().clear(); + this.registrationService.getRegistrationDto().getDemographics().clear(); throw new RuntimeException(e); } return preRegistration; } - if(lastUpdatedTimeStamp == null /*|| - preRegistration.getLastUpdatedPreRegTimeStamp().before(lastUpdatedTimeStamp)*/) { + Timestamp updatedPreRegTimeStamp = Timestamp.valueOf(preRegistration.getLastUpdatedPreRegTimeStamp()); + Timestamp lastUpdatedTime = Timestamp.valueOf(lastUpdatedTimeStamp); + if(lastUpdatedTimeStamp == null || + updatedPreRegTimeStamp.before(lastUpdatedTime)) { Log.i(TAG,"Pre-Registration ID is not up-to-date downloading {}"+ preRegistrationId); try { - return downloadAndSavePacket(preRegistrationId, lastUpdatedTimeStamp); + preRegistration = downloadAndSavePacket(preRegistrationId, lastUpdatedTimeStamp); } catch (ExecutionException | InterruptedException e) { + this.registrationService.getRegistrationDto().getDocuments().clear(); + this.registrationService.getRegistrationDto().getDemographics().clear(); throw new RuntimeException(e); } } diff --git a/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java b/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java index 961afefd..b5bd14fe 100644 --- a/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java +++ b/android/clientmanager/src/main/java/io/mosip/registration/clientmanager/service/RegistrationServiceImpl.java @@ -221,7 +221,7 @@ public void submitRegistrationDto(String makerName) throws Exception { document.setType(entry.getValue().getType()); document.setFormat(entry.getValue().getFormat()); document.setRefNumber(entry.getValue().getRefNumber()); - document.setDocument(convertImageToPDF(entry.getValue().getContent())); + document.setDocument(("pdf".equalsIgnoreCase(entry.getValue().getFormat()))?combineByteArray(entry.getValue().getContent()):convertImageToPDF(entry.getValue().getContent())); Log.i(TAG, entry.getKey() + " >> PDF document size :" + document.getDocument().length); packetWriterService.setDocument(this.registrationDto.getRId(), entry.getKey(), document); }); @@ -306,6 +306,17 @@ private String getKey(RegistrationDto registrationDTO, String subType) throws Ex return String.join(RegistrationConstants.COMMA, key); } + private byte[] combineByteArray(List byteList) { + int totalLength = byteList.stream().mapToInt(byteArr -> byteArr.length).sum(); + byte[] result = new byte[totalLength]; + int currentPos = 0; + for (byte[] byteArr : byteList) { + System.arraycopy(byteArr, 0, result, currentPos, byteArr.length); + currentPos += byteArr.length; + } + return result; + } + private String getAdditionalInfo(Object fieldValue) { if(fieldValue == null) { return null; } diff --git a/assets/images/AuthenticationIcon.svg b/assets/images/AuthenticationIcon.svg new file mode 100644 index 00000000..75e3f32b --- /dev/null +++ b/assets/images/AuthenticationIcon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/ui/approve_packet/widget/template_bottom_sheet.dart b/lib/ui/approve_packet/widget/template_bottom_sheet.dart index 9988f4c3..63592b9a 100644 --- a/lib/ui/approve_packet/widget/template_bottom_sheet.dart +++ b/lib/ui/approve_packet/widget/template_bottom_sheet.dart @@ -27,8 +27,7 @@ class TemplateBottomSheet { } Widget bottomSheet(BuildContext context) { - bool isPortrait = true; - isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; + return ChangeNotifierProvider.value( value: context.watch(), builder: (context, _) { @@ -60,7 +59,7 @@ class TemplateBottomSheet { child: SingleChildScrollView( controller: ScrollController(), child: SizedBox( - height: isPortrait ? 1400 : 2400, + height: isMobileSize ? 1500 : 2700, child: WebViewPlus( zoomEnabled: true, onWebViewCreated: (controller) async { diff --git a/lib/ui/export_packet/widgets/client_status_dropdown.dart b/lib/ui/export_packet/widgets/client_status_dropdown.dart index 2f624dfc..14268031 100644 --- a/lib/ui/export_packet/widgets/client_status_dropdown.dart +++ b/lib/ui/export_packet/widgets/client_status_dropdown.dart @@ -33,8 +33,8 @@ class ClientStatusDropdown extends StatelessWidget { DropdownMenuItem( value: ClientStatus.REJECTED.name, child: const Text("Rejected")), - DropdownMenuItem( - value: ClientStatus.SYNCED.name, child: const Text("Synced")), + // DropdownMenuItem( + // value: ClientStatus.SYNCED.name, child: const Text("Synced")), DropdownMenuItem( value: ClientStatus.EXPORTED.name, child: const Text("Exported")), diff --git a/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart b/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart index d3e24f69..28030db1 100644 --- a/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart +++ b/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart @@ -2078,7 +2078,7 @@ class _OperatorBiometricCaptureScanBlockViewState const SizedBox( height: 40, ), - (biometricAttributeData.title != "Face" && + /* (biometricAttributeData.title != "Face" && biometricAttributeData.title != "Exception") ? Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -2233,7 +2233,7 @@ class _OperatorBiometricCaptureScanBlockViewState color: secondaryColors.elementAt(24)), ), ), - ), + ),*/ SizedBox( height: 20.h, ), diff --git a/lib/ui/process_ui/new_process.dart b/lib/ui/process_ui/new_process.dart index cf9f36fa..dea2fadf 100644 --- a/lib/ui/process_ui/new_process.dart +++ b/lib/ui/process_ui/new_process.dart @@ -11,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:registration_client/model/biometric_attribute_data.dart'; import 'package:registration_client/model/field.dart'; @@ -1086,7 +1087,7 @@ class _NewProcessState extends State with WidgetsBindingObserver { color: authIconBackground, ), child: Center( - child: Image.asset('assets/images/Registering an Individual@2x.png'), + child: SvgPicture.asset('assets/images/AuthenticationIcon.svg'), ), ); } diff --git a/lib/ui/process_ui/widgets/pre_reg_data_control.dart b/lib/ui/process_ui/widgets/pre_reg_data_control.dart index e006a23d..e9ac155e 100644 --- a/lib/ui/process_ui/widgets/pre_reg_data_control.dart +++ b/lib/ui/process_ui/widgets/pre_reg_data_control.dart @@ -284,8 +284,12 @@ class _PreRegDataControlState extends State { .fetchPreRegistrationDetail( preRegIdController.text); if (value.isNotEmpty) { + globalProvider.clearMap(); + globalProvider.clearScannedPages(); widgetValue(widget.screen, value); } else { + globalProvider.clearMap(); + globalProvider.clearScannedPages(); globalProvider.preRegControllerRefresh = false; } } @@ -335,8 +339,12 @@ class _PreRegDataControlState extends State { .fetchPreRegistrationDetail( preRegIdController.text); if (value.isNotEmpty) { + globalProvider.clearMap(); + globalProvider.clearScannedPages(); widgetValue(widget.screen, value); } else { + globalProvider.clearMap(); + globalProvider.clearScannedPages(); globalProvider.preRegControllerRefresh = false; } }