-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert RefundPayment state values to lowercase
- Loading branch information
Dmitri Perunov
committed
Mar 11, 2020
1 parent
d05447c
commit 083e706
Showing
10 changed files
with
65 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20200304172851 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Updates sylius_refund_payment state values to new schema'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('UPDATE sylius_refund_payment SET state = "new" WHERE state = "New"'); | ||
$this->addSql('UPDATE sylius_refund_payment SET state = "completed" WHERE state = "Completed"'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('UPDATE sylius_refund_payment SET state = "New" WHERE state = "new"'); | ||
$this->addSql('UPDATE sylius_refund_payment SET state = "Completed" WHERE state = "completed"'); | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
src/Resources/views/Common/Label/refundPaymentState.html.twig
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,13 @@ | ||
{% | ||
set viewOptions = { | ||
completed: { icon: 'adjust', color: 'green' }, | ||
new: { icon: 'clock', color: 'olive' }, | ||
} | ||
%} | ||
|
||
{% set value = 'sylius_refund.ui.' ~ data %} | ||
|
||
<span class="ui {{ viewOptions[data]['color'] }} label"> | ||
<i class="{{ viewOptions[data]['icon'] }} icon"></i> | ||
{{ value|trans }} | ||
</span> |
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
4 changes: 0 additions & 4 deletions
4
src/Resources/views/RefundPayment/Label/State/completed.html.twig
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.