Remove the ability to add multiple jobset input alternatives
Now each jobset input has exactly one value. (Actually, adding multiple values was already broken, so all this does is clean up the UI...)
This commit is contained in:
@ -244,25 +244,20 @@ sub updateJobset {
|
||||
foreach my $name (keys %{$c->stash->{params}->{inputs}}) {
|
||||
my $inputData = $c->stash->{params}->{inputs}->{$name};
|
||||
my $type = $inputData->{type};
|
||||
my $values = $inputData->{values};
|
||||
my $value = $inputData->{value};
|
||||
my $emailresponsible = defined $inputData->{emailresponsible} ? 1 : 0;
|
||||
|
||||
error($c, "Invalid input name ‘$name’.") unless $name =~ /^[[:alpha:]][\w-]*$/;
|
||||
error($c, "Invalid input type ‘$type’.") unless defined $c->stash->{inputTypes}->{$type};
|
||||
|
||||
my $input = $jobset->jobsetinputs->create({
|
||||
name => $name,
|
||||
type => $type,
|
||||
emailresponsible => $emailresponsible
|
||||
my $input = $jobset->jobsetinputs->create(
|
||||
{ name => $name,
|
||||
type => $type,
|
||||
emailresponsible => $emailresponsible
|
||||
});
|
||||
|
||||
# Set the values for this input.
|
||||
my @values = ref($values) eq 'ARRAY' ? @{$values} : ($values);
|
||||
my $altnr = 0;
|
||||
foreach my $value (@values) {
|
||||
$value = checkInputValue($c, $name, $type, $value);
|
||||
$input->jobsetinputalts->create({altnr => $altnr++, value => $value});
|
||||
}
|
||||
$value = checkInputValue($c, $name, $type, $value);
|
||||
$input->jobsetinputalts->create({altnr => 0, value => $value});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ our @EXPORT = qw(
|
||||
sendEmail
|
||||
paramToList
|
||||
backToReferer
|
||||
$pathCompRE $relPathRE $relNameRE $projectNameRE $jobsetNameRE $jobNameRE $systemRE $userNameRE
|
||||
$pathCompRE $relPathRE $relNameRE $projectNameRE $jobsetNameRE $jobNameRE $systemRE $userNameRE $inputNameRE
|
||||
@buildListColumns
|
||||
parseJobsetName
|
||||
showJobName
|
||||
@ -235,6 +235,7 @@ Readonly our $jobsetNameRE => "(?:[A-Za-z_][A-Za-z0-9-_\.]*)";
|
||||
Readonly our $jobNameRE => "(?:$attrNameRE(?:\\.$attrNameRE)*)";
|
||||
Readonly our $systemRE => "(?:[a-z0-9_]+-[a-z0-9_]+)";
|
||||
Readonly our $userNameRE => "(?:[a-z][a-z0-9_\.]*)";
|
||||
Readonly our $inputNameRE => "(?:[A-Za-z_][A-Za-z0-9-_]*)";
|
||||
|
||||
|
||||
sub parseJobsetName {
|
||||
|
Reference in New Issue
Block a user