-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allow user to edit packages * Add validation for API request * Add restrictions for package update
- Loading branch information
Showing
23 changed files
with
457 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buddy\Repman\Form\Type\Api; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\IntegerType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\Validator\Constraints\NotBlank; | ||
use Symfony\Component\Validator\Constraints\PositiveOrZero; | ||
|
||
class EditPackageType extends AbstractType | ||
{ | ||
public function getBlockPrefix(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
/** | ||
* @param array<mixed> $options | ||
*/ | ||
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$builder | ||
->add('url', TextType::class, [ | ||
'required' => false, | ||
'label' => 'Repository URL', | ||
'constraints' => [ | ||
new NotBlank(), | ||
], | ||
]) | ||
->add('keepLastReleases', IntegerType::class, [ | ||
'required' => false, | ||
'label' => 'Keep last releases', | ||
'help' => 'Number of last releases that will be downloaded. Put "0" to download all.', | ||
'constraints' => [ | ||
new PositiveOrZero(), | ||
], | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buddy\Repman\Form\Type\Organization; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\IntegerType; | ||
use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\Validator\Constraints\NotBlank; | ||
use Symfony\Component\Validator\Constraints\PositiveOrZero; | ||
|
||
class EditPackageType extends AbstractType | ||
{ | ||
public function getBlockPrefix(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
/** | ||
* @param array<mixed> $options | ||
*/ | ||
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$builder | ||
->add('url', TextType::class, [ | ||
'label' => 'Repository URL', | ||
'constraints' => [ | ||
new NotBlank(), | ||
], | ||
]) | ||
->add('keepLastReleases', IntegerType::class, [ | ||
'label' => 'Keep last releases', | ||
'help' => 'Number of last releases that will be downloaded. Put "0" to download all.', | ||
'constraints' => [ | ||
new PositiveOrZero(), | ||
], | ||
]) | ||
->add('Update', SubmitType::class); | ||
} | ||
} |
Oops, something went wrong.