Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed household new digit component integration #576

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
1,127 changes: 1,127 additions & 0 deletions apps/health_campaign_field_worker_app/assets/animated_json/alert.json

Large diffs are not rendered by default.

728 changes: 728 additions & 0 deletions apps/health_campaign_field_worker_app/assets/animated_json/error.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions apps/health_campaign_field_worker_app/lib/pages/login.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:digit_components/digit_components.dart';
import 'package:digit_components/models/privacy_notice/privacy_notice_model.dart';
import 'package:digit_components/widgets/atoms/digit_toaster.dart';
import 'package:digit_components/widgets/privacy_notice/privacy_component.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:reactive_forms/reactive_forms.dart';
Expand All @@ -11,7 +13,7 @@ import '../router/app_router.dart';
import '../utils/environment_config.dart';
import '../utils/i18_key_constants.dart' as i18;
import '../widgets/localized.dart';
import '../widgets/privacy_notice/privacy_component.dart';


@RoutePage()
class LoginPage extends LocalizedStatefulWidget {
Expand Down Expand Up @@ -140,7 +142,7 @@ class _LoginPageState extends LocalizedState<LoginPage> {
form.control(_privacyCheck).setValidators([Validators.requiredTrue]);
form.control(_privacyCheck).updateValueAndValidity();
return PrivacyComponent(
privacyPolicy: privacyPolicyJson,
privacyPolicy: convertToPrivacyPolicyModel(privacyPolicyJson),
formControlName: _privacyCheck,
text: localizations
.translate(i18.privacyPolicy.privacyNoticeText),
Expand Down Expand Up @@ -237,3 +239,27 @@ class _LoginPageState extends LocalizedState<LoginPage> {
)
});
}


// convert to privacy notice model
PrivacyNoticeModel? convertToPrivacyPolicyModel(PrivacyPolicy? privacyPolicy) {
return PrivacyNoticeModel(
header: privacyPolicy?.header ?? '',
module: privacyPolicy?.module ?? '',
active: privacyPolicy?.active,
contents: privacyPolicy?.contents?.map((content) => ContentNoticeModel(
header: content.header,
descriptions: content.descriptions?.map((description) => DescriptionNoticeModel(
text: description.text,
type: description.type,
isBold: description.isBold,
subDescriptions: description.subDescriptions?.map((subDescription) => SubDescriptionNoticeModel(
text: subDescription.text,
type: subDescription.type,
isBold: subDescription.isBold,
isSpaceRequired: subDescription.isSpaceRequired,
)).toList(),
)).toList(),
)).toList(),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:referral_reconciliation/blocs/app_localization.dart'
as referral_reconciliation_localization;
import 'package:registration_delivery/blocs/app_localization.dart'
as registration_delivery_localization;
import 'package:digit_components/blocs/localization.dart' as component_localization;

import '../blocs/localization/app_localization.dart';
import '../data/local_store/no_sql/schema/app_configuration.dart';
Expand Down Expand Up @@ -59,6 +60,10 @@ getAppLocalizationDelegates({
digit_dss_localization.DashboardLocalization.getDelegate(
LocalizationLocalRepository().returnLocalizationFromSQL(sql) as Future,
appConfig.languages!,
)
),
component_localization.ComponentLocalization.getDelegate(
LocalizationLocalRepository().returnLocalizationFromSQL(sql) as Future,
appConfig.languages!,
),
];
}
Loading