Skip to content

Commit

Permalink
[RCF-334] Document type dropdowns should be display in selected langu…
Browse files Browse the repository at this point in the history
…ages (#235)

* new ui changes

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* new ui changes

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* new ui changes

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* some ui changes

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* ui added

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* ui changes

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* ui changes

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* document upload screen new ui updated

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* localazation added

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* document dropdown values in selected language

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* change the method name and null handle

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* changed variable name

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

* changed variable name

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>

---------

Signed-off-by: Sachin S P <sachin.sp@cyberpwn.com>
Co-authored-by: Sachin S P <sachin.sp@cyberpwn.com>
  • Loading branch information
SachinPremkumar and Sachin S P authored Jan 10, 2024
1 parent a39dd94 commit 32aaecf
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public interface ApplicantValidDocumentDao {
@Query("select distinct doc_type_code from applicant_valid_doc where doc_cat_code=:docCategoryCode")
List<String> findAllDocTypesByDocCategory(String docCategoryCode);

@Query("select name from document_type where code=:code and lang_code=:langCode")
List<String> findAllDocTypesByLanguageCode(String code,String langCode);

@Insert(onConflict = OnConflictStrategy.REPLACE)
void insert(ApplicantValidDocument applicantValidDocument);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.json.JSONObject;

import javax.inject.Inject;

import java.util.ArrayList;
import java.util.List;

public class ApplicantValidDocRepository {
Expand All @@ -18,11 +20,23 @@ public ApplicantValidDocRepository(ApplicantValidDocumentDao applicantValidDocum
}

public List<String> getDocumentTypes(String applicantType, String categoryCode, String langCode) {
if (applicantType == null)
return this.applicantValidDocumentDao.findAllDocTypesByDocCategory(categoryCode);

return this.applicantValidDocumentDao.findAllDocTypesByDocCategoryAndApplicantType(applicantType,
categoryCode);
List<String> docTypeList;
ArrayList<String> documentList = new ArrayList<>();
if (applicantType == null) {
docTypeList = this.applicantValidDocumentDao.findAllDocTypesByDocCategory(categoryCode);
}else {
docTypeList = this.applicantValidDocumentDao.findAllDocTypesByDocCategoryAndApplicantType(applicantType,
categoryCode);
}
docTypeList.forEach((v) -> {
if(v!=null) {
List<String> docListByLang = this.applicantValidDocumentDao.findAllDocTypesByLanguageCode(v, langCode);
if (docListByLang != null && !docListByLang.isEmpty()) {
documentList.add(docListByLang.get(0));
}
}
});
return documentList;
}

public void saveApplicantValidDocument(JSONObject jsonObject, String defaultAppTypeCode) throws JSONException {
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"notificationLanguage": "{language, select, eng{Notification Languages} ara{لغات الإخطار} fra{Langues de notification} hin{अधिसूचना भाषाएँ} kan{ಅಧಿಸೂಚನೆ ಭಾಷೆಗಳು} tam{அறிவிப்பு மொழிகள்} other{Notification Languages}}",
"@notificationLanguage": {
"description": "Notification Language Label",
"placeholders": {
"placeholders": {
"language": {
"type": "String"
}
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/process_ui/widgets/document_upload_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class _DocumentUploadControlState extends State<DocumentUploadControl> {
children: [
FutureBuilder(
future: _getDocumentValues(
widget.field.subType!, "eng", null),
widget.field.subType!, lang, null),
builder: (BuildContext context,
AsyncSnapshot<List<String?>> snapshot) {
return Card(
Expand Down Expand Up @@ -468,7 +468,7 @@ class _DocumentUploadControlState extends State<DocumentUploadControl> {
Expanded(
child: FutureBuilder(
future: _getDocumentValues(
widget.field.subType!, "eng", null),
widget.field.subType!, lang, null),
builder: (BuildContext context,
AsyncSnapshot<List<String?>> snapshot) {
return Card(
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/app_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ abstract class AppStyle {
color: appWhite,
letterSpacing: 0.5,
);

static TextStyle tabletPortraitCommunityRegClientText = const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 36,
Expand Down

0 comments on commit 32aaecf

Please sign in to comment.