This makes it possible to create declarative projects via a PUT request, and also exposes the currently-configured values to GET requests.
3NGONGQ7MXUUH2RR4LQGY7FP5ALNCYYIF64RU6IM7ESO5MY6EUNQC
IQBLO5PWPC3M36DUAYL2MX54P4HQF4Y7GN2QKEU5HM7ADMCWGHKAC
2XGJ54SFMXISWLZCPCFGHJKCH4FJS7YKJSLA4D6WVILTRDLMOJFQC
LX326CB7QYUPVTX37SSK6VFSYKJIII6ARISYJBHZBVKVJ2NQTI3AC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
6WRGCITDYP7JIBYP25QIWCHWRJWFPDP2D3TJS3WO3KUHQQJAWHMQC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
7ECJWNVXNO3BKM7B7FIFIRBE77QET5PK2C3XKVQUXCYKHDP3V4UQC
X27GNHDV5KPZ5GSH6DCAJMNCEMZLCP7M43JWF2X3O5QWXMOX273AC
7RRDNLP32DSO3POUC6RXYRUAFX2OOF5RNKSKSF7YHFVVWAE77FHAC
TQVKZQUGCFYNH5P56LXMXRXZNTD56MH5T5GX2BMQ5YSRPGHAUYMAC
NIX2TKYVRRIQNW447RY2HKV6LMGWJIROXBWPMGAY744PI4OTST6AC
JY7BXXOP3EZCDT5RSMVE4Y6IECXGYL4GEBJOZHR7H3Z35XZ3NIVQC
LN3E2P4E6QRVXFKSGCD2FARP5YFGDU2CIPJYWCX5MAEPWXK6CP7QC
DeclarativeInput:
type: object
properties:
file:
description: The file in `value` which contains the declarative spec file. Relative to the root of `value`.
type: string
type:
description: The type of the declarative input.
type: string
value:
description: The value of the declarative input.
type: string
, declfile => trim($c->stash->{params}->{declfile})
, decltype => trim($c->stash->{params}->{decltype})
, declvalue => trim($c->stash->{params}->{declvalue})
, declfile => trim($c->stash->{params}->{declarative}->{file})
, decltype => trim($c->stash->{params}->{declarative}->{type})
, declvalue => trim($c->stash->{params}->{declarative}->{value})
my %hint = (
string_columns => [
"name",
"displayname",
"description",
"homepage",
"owner"
],
boolean_columns => [
"enabled",
"hidden"
],
relations => {
jobsets => "name"
}
);
sub as_json {
my $self = shift;
sub json_hint {
return \%hint;
my %json = (
# string_columns
"name" => $self->get_column("name") // "",
"displayname" => $self->get_column("displayname") // "",
"description" => $self->get_column("description") // "",
"homepage" => $self->get_column("homepage") // "",
"owner" => $self->get_column("owner") // "",
# boolean_columns
"enabled" => $self->get_column("enabled") ? JSON::true : JSON::false,
"hidden" => $self->get_column("hidden") ? JSON::true : JSON::false,
"declarative" => {
"file" => $self->get_column("declfile") // "",
"type" => $self->get_column("decltype") // "",
"value" => $self->get_column("declvalue") // ""
},
"jobsets" => [ map { $_->name } $self->jobsets ]
);
return \%json;
var formElements = $(this).parents("form").serializeArray();
var data = { 'declarative': {} };
var decl = {};
for (var i = 0; formElements.length > i; i++) {
var elem = formElements[i];
var match = elem.name.match(/^decl(file|type|value)$/);
if (match === null) {
data[elem.name] = elem.value;
} else {
var param = match[1];
decl[param] = elem.value;
}
}
data.declarative = decl;