glexchange 4.18.1 → 4.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/glexchange.rb +37 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f1bc70a6bd32c406bb7d2d0ac0a67c7fe6953be
|
4
|
+
data.tar.gz: 301c369520979c3afbd211b5d50fdc59e154faf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b6cd39236411aa868b8feec61c480745f3a8aa5d11d20f2b4c9e63537a6377de8f6ad72132b1bac30e26a258367c6eeee37e27bf4d4ec0a7e1a5aec9d829f0
|
7
|
+
data.tar.gz: afdf91f95912d7afac4684fee66761f526a783174b3f78f6e3ad87625926093e7b0f104b221250c1fba026e44af0a0c487c32d4f50a3f5b25b3d4e3fa466f728
|
data/lib/glexchange.rb
CHANGED
@@ -509,13 +509,13 @@ private
|
|
509
509
|
end
|
510
510
|
end
|
511
511
|
|
512
|
-
if submission.project.customAttributes != nil
|
512
|
+
if submission.project.customAttributes != nil && submission.project.customAttributes.length > 0
|
513
513
|
for projectCustomAttribute in submission.project.customAttributes
|
514
514
|
if projectCustomAttribute.mandatory
|
515
515
|
isSet = false
|
516
516
|
if submission.customAttributes !=nil
|
517
|
-
for
|
518
|
-
if
|
517
|
+
for key in submission.customAttributes.keys
|
518
|
+
if key == projectCustomAttribute.name
|
519
519
|
isSet = true
|
520
520
|
break
|
521
521
|
end
|
@@ -526,6 +526,36 @@ private
|
|
526
526
|
end
|
527
527
|
end
|
528
528
|
end
|
529
|
+
if submission.customAttributes !=nil && submission.customAttributes.length > 0
|
530
|
+
for key in submission.customAttributes.keys
|
531
|
+
isExists = false
|
532
|
+
for projectCustomAttribute in submission.project.customAttributes
|
533
|
+
if key == projectCustomAttribute.name
|
534
|
+
isExists = true
|
535
|
+
if projectCustomAttribute.type=="COMBO" && projectCustomAttribute.values != nil
|
536
|
+
comboValueCorrect = false
|
537
|
+
va = projectCustomAttribute.values.split(',')
|
538
|
+
for option in va
|
539
|
+
if option == submission.customAttributes[key]
|
540
|
+
comboValueCorrect = true
|
541
|
+
break
|
542
|
+
end
|
543
|
+
end
|
544
|
+
if comboValueCorrect == false
|
545
|
+
raise "Value '#{submission.customAttributes[key]}' for custom field '#{key}' is not allowed. Allowed values:#{projectCustomAttribute.values}"
|
546
|
+
end
|
547
|
+
end
|
548
|
+
end
|
549
|
+
end
|
550
|
+
if isExists == false
|
551
|
+
raise "Custom field '#{key}' is not allowed in project"
|
552
|
+
end
|
553
|
+
end
|
554
|
+
end
|
555
|
+
else
|
556
|
+
if submission.customAttributes !=nil && submission.customAttributes.length > 0
|
557
|
+
raise "Project doesn't have custom attributes"
|
558
|
+
end
|
529
559
|
end
|
530
560
|
end
|
531
561
|
|
@@ -562,7 +592,10 @@ private
|
|
562
592
|
@workflowService = addHeaders(Glexchange::Pdws::WorkflowServicePortType.new(@connectionConfig.url + "/services/WorkflowService_4180"))
|
563
593
|
|
564
594
|
begin
|
565
|
-
@projectService.getUserProjects(Glexchange::Pdws::GetUserProjects.new(true))
|
595
|
+
projects = @projectService.getUserProjects(Glexchange::Pdws::GetUserProjects.new(true))
|
596
|
+
if projects!=nil and projects.length==1 and projects[0]==nil
|
597
|
+
raise "Projects is nil"
|
598
|
+
end
|
566
599
|
rescue Exception
|
567
600
|
throw "Invalid config. " + $!.to_s
|
568
601
|
end
|