Improve - environment settings on project creation
This commit is contained in:
parent
1cef8260e9
commit
657b98063d
|
@ -266,6 +266,7 @@ class ProjectController extends PHPCensor\Controller
|
|||
'allow_public_status' => $this->getParam('allow_public_status', 0),
|
||||
'branch' => $this->getParam('branch', null),
|
||||
'group' => $this->getParam('group_id', null),
|
||||
'environments' => $this->getParam('environments', null),
|
||||
];
|
||||
|
||||
$project = $this->projectService->createProject($title, $type, $reference, $options);
|
||||
|
@ -406,12 +407,10 @@ class ProjectController extends PHPCensor\Controller
|
|||
$field->setClass('form-control')->setContainerClass('form-group')->setValue('master');
|
||||
$form->addField($field);
|
||||
|
||||
if ($type != 'add') {
|
||||
$field = Form\Element\TextArea::create('environments', Lang::get('environments_label'), false);
|
||||
$field->setClass('form-control')->setContainerClass('form-group');
|
||||
$field->setRows(6);
|
||||
$form->addField($field);
|
||||
}
|
||||
$field = Form\Element\TextArea::create('environments', Lang::get('environments_label'), false);
|
||||
$field->setClass('form-control')->setContainerClass('form-group');
|
||||
$field->setRows(6);
|
||||
$form->addField($field);
|
||||
|
||||
$field = Form\Element\Select::create('group_id', Lang::get('project_group'), true);
|
||||
$field->setClass('form-control')->setContainerClass('form-group')->setValue(1);
|
||||
|
|
|
@ -84,15 +84,18 @@ class ProjectService
|
|||
$project->setGroup($options['group']);
|
||||
}
|
||||
|
||||
if (array_key_exists('environments', $options)) {
|
||||
$project->setEnvironments($options['environments']);
|
||||
}
|
||||
|
||||
// Allow certain project types to set access information:
|
||||
$this->processAccessInformation($project);
|
||||
|
||||
// Save and return the project:
|
||||
return $this->projectStore->save($project);
|
||||
/** @var Project $project */
|
||||
$project = $this->projectStore->save($project);
|
||||
|
||||
if (array_key_exists('environments', $options)) {
|
||||
$project->setEnvironments($options['environments']);
|
||||
}
|
||||
|
||||
return $project;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue