Skip to content

Commit

Permalink
added important guidelines to the template (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
GSPrakash2662 authored Oct 10, 2024
1 parent 8536582 commit 0d56643
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ UserOnboardService provideUserOnboardService(ObjectMapper objectMapper, AuditMan

@Provides
@Singleton
TemplateService TemplateService(MasterDataService masterDataService, IdentitySchemaRepository identitySchemaRepository) {
return new TemplateService(appContext, masterDataService, identitySchemaRepository);
TemplateService TemplateService(MasterDataService masterDataService, IdentitySchemaRepository identitySchemaRepository, GlobalParamRepository globalParamRepository) {
return new TemplateService(appContext, masterDataService, identitySchemaRepository, globalParamRepository);
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ public class RegistrationConstants {
public static final String UI_SCHEMA_SUBTYPE_FULL_NAME = "name";
public static final String UI_SCHEMA_SUBTYPE_EMAIL = "Email";
public static final String UI_SCHEMA_SUBTYPE_PHONE = "Phone";
public static final List<String> SELECTED_HANDLES = Arrays.asList("mosip.registration.default-selected-handle-fields".split(","));
public static final String SELECTED_HANDLES = "mosip.registration.default-selected-handle-fields";
public static final String TEMPLATE_IMPORTANT_GUIDELINES = "mosip.registration.important_guidelines";
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@

import io.mosip.registration.clientmanager.R;
import io.mosip.registration.clientmanager.constant.Modality;
import io.mosip.registration.clientmanager.constant.RegistrationConstants;
import io.mosip.registration.clientmanager.dto.CenterMachineDto;
import io.mosip.registration.clientmanager.dto.registration.BiometricsDto;
import io.mosip.registration.clientmanager.dto.registration.RegistrationDto;
import io.mosip.registration.clientmanager.dto.uispec.FieldSpecDto;
import io.mosip.registration.clientmanager.repository.GlobalParamRepository;
import io.mosip.registration.clientmanager.repository.IdentitySchemaRepository;
import io.mosip.registration.clientmanager.spi.MasterDataService;
import io.mosip.registration.clientmanager.util.UserInterfaceHelperService;
Expand All @@ -61,10 +63,12 @@ public class TemplateService {
MasterDataService masterDataService;

IdentitySchemaRepository identitySchemaRepository;
GlobalParamRepository globalParamRepository;

public TemplateService(Context appContext, MasterDataService masterDataService, IdentitySchemaRepository identitySchemaRepository) {
public TemplateService(Context appContext, MasterDataService masterDataService, IdentitySchemaRepository identitySchemaRepository, GlobalParamRepository globalParamRepository) {
this.appContext = appContext;
this.masterDataService = masterDataService;
this.globalParamRepository = globalParamRepository;
this.identitySchemaRepository = identitySchemaRepository;
sharedPreferences = this.appContext.getSharedPreferences(
this.appContext.getString(R.string.app_name),
Expand Down Expand Up @@ -396,7 +400,11 @@ private void setBasicDetails(boolean isPreview, RegistrationDto registrationDto,
CenterMachineDto centerMachineDto = new CenterMachineDto();
centerMachineDto = masterDataService.getRegistrationCenterMachineDetails();

String imp_guidelines = globalParamRepository.getCachedStringGlobalParam(RegistrationConstants.TEMPLATE_IMPORTANT_GUIDELINES
+"_"+registrationDto.getSelectedLanguages().get(0));

velocityContext.put("isPreview", isPreview);
velocityContext.put("ImportantGuidelines", imp_guidelines);
velocityContext.put("ApplicationIDLabel", appContext.getString(R.string.app_id));
velocityContext.put("ApplicationID", registrationDto.getRId());
velocityContext.put("UINLabel", appContext.getString(R.string.uin));
Expand All @@ -416,7 +424,6 @@ private void setBasicDetails(boolean isPreview, RegistrationDto registrationDto,
velocityContext.put("ROName", sharedPreferences.getString(USER_NAME, ""));
velocityContext.put("RegCenterLabel", appContext.getString(R.string.reg_center));
velocityContext.put("RegCenter", centerMachineDto.getCenterId());
velocityContext.put("ImportantGuidelines", appContext.getString(R.string.imp_guidelines));

velocityContext.put("LeftEyeLabel", appContext.getString(R.string.left_iris));
velocityContext.put("RightEyeLabel", appContext.getString(R.string.right_iris));
Expand Down

0 comments on commit 0d56643

Please sign in to comment.