Skip to content

Commit

Permalink
Fix client-side validation of sample/analysis names #1419
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Nov 6, 2023
1 parent 64adb50 commit 1ff7173
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ define([
const annotationLabelNodeid = "3e541cc6-859b-11ea-97eb-acde48001122";
const annotationPolygonIdentifierNodeid = "97c30c42-8594-11ea-97eb-acde48001122";

if (!ko.unwrap(self.selectedAnalysisAreaInstance().data[annotationLabelNodeid])) {
if (!ko.unwrap(self.selectedAnalysisAreaInstance().data[annotationLabelNodeid]?.[arches.activeLanguage]?.value)) {
params.pageVm.alert(new params.form.AlertViewModel('ep-alert-red', "Name required", "Providing a name is required"));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,9 @@ define([
var partIdentifierAssignmentLabelNodeId = '3e541cc6-859b-11ea-97eb-acde48001122';
var partIdentifierAssignmentPolygonIdentifierNodeId = "97c30c42-8594-11ea-97eb-acde48001122"
const featureCollection = ko.unwrap(self.selectedSampleLocationInstance().data[partIdentifierAssignmentPolygonIdentifierNodeId])
if (!ko.unwrap(featureCollection?.features)?.length ||
(!ko.unwrap(ko.unwrap(self.selectedSampleLocationInstance().data[partIdentifierAssignmentLabelNodeId])?.[arches.activeLanguage]?.value) && !ko.unwrap(self.selectedSampleLocationInstance().data[partIdentifierAssignmentLabelNodeId])) ) { //Sample Name Node
if (!ko.unwrap(featureCollection?.features)?.length || // Sample location
!ko.unwrap(ko.unwrap(self.selectedSampleLocationInstance().data[partIdentifierAssignmentLabelNodeId])?.[arches.activeLanguage]?.value) // Sample name
) {
params.pageVm.alert(new params.form.AlertViewModel(
"ep-alert-red",
"Missing Values",
Expand Down

0 comments on commit 1ff7173

Please sign in to comment.