Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-mobile
Commits
f0314d47
Commit
f0314d47
authored
2 years ago
by
devendra
Browse files
Options
Download
Patches
Plain Diff
Fix: assessor form validation changes
parent
fa3579b7
master
add-assessor-location
two-lead-assessor
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/l10n/app_en.arb
+2
-1
lib/l10n/app_en.arb
lib/pages/application_details_page.dart
+18
-1
lib/pages/application_details_page.dart
lib/widgets/lead_inspector_application_field.dart
+4
-4
lib/widgets/lead_inspector_application_field.dart
with
24 additions
and
6 deletions
+24
-6
lib/l10n/app_en.arb
+
2
−
1
View file @
f0314d47
...
...
@@ -67,5 +67,6 @@
"preview"
:
"Preview"
,
"remove"
:
"Remove"
,
"attachment"
:
"Attachment"
,
"version"
:
"Version"
"version"
:
"Version"
,
"canNotSubmitEmptyForm"
:
"Empty assessment can't be submitted"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/pages/application_details_page.dart
+
18
−
1
View file @
f0314d47
...
...
@@ -164,7 +164,7 @@ class _ApplicationDetailsPageState extends State<ApplicationDetailsPage>
updatedFields
=
{},
value
.
forEach
((
childKey
,
childValue
)
=
>
{
updatedFields
[
childKey
]
=
{
childValue:
{
'value'
:
'
Correct
'
,
'comments'
:
''
}
childValue:
{
'value'
:
''
,
'comments'
:
''
}
}
}),
_data
[
key
]
=
updatedFields
...
...
@@ -266,6 +266,7 @@ class _ApplicationDetailsPageState extends State<ApplicationDetailsPage>
if
(
isInternetConnected
)
{
_validateUser
();
}
if
(
_isleadInspector
)
{
Map
data
=
{
'applicationId'
:
widget
.
application
.
applicationId
,
...
...
@@ -273,6 +274,22 @@ class _ApplicationDetailsPageState extends State<ApplicationDetailsPage>
'dataObject'
:
_data
};
//Validate assessment form to make sure some inputs are given by the assessor
int
fieldsLength
=
_data
.
keys
.
length
;
bool
isValidForm
=
false
;
for
(
int
i
=
0
;
i
<
fieldsLength
;
i
++
)
{
_data
[
_data
.
keys
.
elementAt
(
i
)]
.
forEach
((
key
,
value
)
{
if
(
value
[
value
.
keys
.
elementAt
(
0
)][
"value"
]
.
isNotEmpty
)
{
isValidForm
=
true
;
}
});
}
if
(
!
isValidForm
)
{
Helper
.
toastMessage
(
"Empty assessment can't be submitted"
);
return
;
}
Navigator
.
of
(
context
)
.
pushReplacement
(
MaterialPageRoute
(
builder:
(
context
)
=
>
InspectionSummaryPage
(
// formId: widget.formId,
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/lead_inspector_application_field.dart
+
4
−
4
View file @
f0314d47
...
...
@@ -543,14 +543,14 @@ class _LeadInspectorApplicationFieldState
if
(
widget
.
applicationStatus
!=
InspectionStatus
.
inspectionCompleted
&&
_radioValue
.
toLowerCase
()
!
=
FieldValue
.
c
orrect
_radioValue
.
toLowerCase
()
=
=
FieldValue
.
inC
orrect
.
toLowerCase
())
{
_displayCommentDialog
();
}
},
icon:
_radioValue
.
toLowerCase
()
!
=
FieldValue
.
c
orrect
icon:
_radioValue
.
toLowerCase
()
=
=
FieldValue
.
inC
orrect
.
toLowerCase
()
&&
widget
.
applicationStatus
!=
InspectionStatus
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets