Skip to content

Commit

Permalink
Changed the attribute datatype from string to bool in digit data mode…
Browse files Browse the repository at this point in the history
…l package
  • Loading branch information
Shashwat12-egov committed Nov 22, 2024
1 parent acf5c79 commit 2fc780e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Attributes extends Table {
TextColumn get tenantId => text().nullable()();
TextColumn get code => text().nullable()();
TextColumn get values => text().nullable()();
TextColumn get isActive => text().nullable()();
BoolColumn get isActive => boolean().nullable()();
BoolColumn get required => boolean().nullable()();
TextColumn get regex => text().nullable()();
IntColumn get order => integer().nullable()();
Expand Down
4 changes: 2 additions & 2 deletions packages/digit_data_model/lib/models/entities/attributes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AttributesSearchModel extends EntitySearchModel
final String? referenceId;
final String? tenantId;
final String? code;
final String? isActive;
final bool? isActive;
final bool? required;
final String? regex;
final int? order;
Expand Down Expand Up @@ -62,7 +62,7 @@ class AttributesModel extends EntityModel with AttributesModelMappable {
final String? tenantId;
final String? code;
final List<String>? values;
final String? isActive;
final bool? isActive;
final bool? required;
final String? regex;
final int? order;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class AttributesSearchModelMapper
static String? _$code(AttributesSearchModel v) => v.code;
static const Field<AttributesSearchModel, String> _f$code =
Field('code', _$code, opt: true);
static String? _$isActive(AttributesSearchModel v) => v.isActive;
static const Field<AttributesSearchModel, String> _f$isActive =
static bool? _$isActive(AttributesSearchModel v) => v.isActive;
static const Field<AttributesSearchModel, bool> _f$isActive =
Field('isActive', _$isActive, opt: true);
static bool? _$required(AttributesSearchModel v) => v.required;
static const Field<AttributesSearchModel, bool> _f$required =
Expand Down Expand Up @@ -167,7 +167,7 @@ abstract class AttributesSearchModelCopyWith<
String? referenceId,
String? tenantId,
String? code,
String? isActive,
bool? isActive,
bool? required,
String? regex,
int? order,
Expand Down Expand Up @@ -270,8 +270,8 @@ class AttributesModelMapper extends SubClassMapperBase<AttributesModel> {
static List<String>? _$values(AttributesModel v) => v.values;
static const Field<AttributesModel, List<String>> _f$values =
Field('values', _$values, opt: true);
static String? _$isActive(AttributesModel v) => v.isActive;
static const Field<AttributesModel, String> _f$isActive =
static bool? _$isActive(AttributesModel v) => v.isActive;
static const Field<AttributesModel, bool> _f$isActive =
Field('isActive', _$isActive, opt: true);
static bool? _$required(AttributesModel v) => v.required;
static const Field<AttributesModel, bool> _f$required =
Expand Down Expand Up @@ -429,7 +429,7 @@ abstract class AttributesModelCopyWith<$R, $In extends AttributesModel, $Out>
String? tenantId,
String? code,
List<String>? values,
String? isActive,
bool? isActive,
bool? required,
String? regex,
int? order,
Expand Down
2 changes: 1 addition & 1 deletion packages/survey_form/lib/pages/survey_form_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class SurveyFormViewPageState extends LocalizedState<SurveyFormViewPage> {
textAlign: TextAlign.left,
),
),
...initialAttributes!.where((att) => att.isActive.toString() == 'true').map((
...initialAttributes!.where((att) => att.isActive == true).map((
e,
) {
int index = (initialAttributes ?? []).indexOf(e);
Expand Down
4 changes: 2 additions & 2 deletions packages/survey_form/test/constants/test_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ServiceTestConstants {
dataType: testDataType,
values: null,
required: true,
isActive: 'true',
isActive: true,
regex: null,
order: 1,
);
Expand All @@ -57,7 +57,7 @@ class ServiceTestConstants {
dataType: testDataType,
values: null,
required: true,
isActive: 'true',
isActive: true,
regex: null,
order: 1,
);
Expand Down

0 comments on commit 2fc780e

Please sign in to comment.