-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Admin] Adding countries #4395
[Admin] Adding countries #4395
Conversation
Arminek
commented
Mar 4, 2016
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | #4374 |
License | MIT |
@@ -34,6 +34,7 @@ imports: | |||
- suites/ui_cart.yml | |||
- suites/ui_channel.yml | |||
- suites/ui_checkout.yml | |||
- suites/ui_localization.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think more appropriate suite name would be addressing
, where we will put:
- country management
- zones
Any better ideas? :)
0f9e5bc
to
74ba0bf
Compare
525f3fa
to
4e876ee
Compare
ui_addressing: | ||
contexts_as_services: | ||
- sylius.behat.context.hook.doctrine_orm | ||
- sylius.behat.context.transform.lexical |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to split each type of context with blank line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
b2f410d
to
33ccb6b
Compare
* @param IndexPageInterface $adminCountryIndexPage | ||
* @param CreatePageInterface $adminCountryCreatePage | ||
*/ | ||
public function __construct(SharedStorageInterface $sharedStorage, IndexPageInterface $adminCountryIndexPage, CreatePageInterface $adminCountryCreatePage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is too long
33ccb6b
to
98ba52e
Compare
} | ||
|
||
/** | ||
* @return string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | ||
* @return bool | ||
* | ||
* @throws ElementNotFoundException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we catch that exception, it wouldn't be needed
e264853
to
955b9aa
Compare
try { | ||
$rows = $this->tableManipulator->getRowsWithFields($this->getElement('table'), $parameters); | ||
|
||
return 0 !== count($rows); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 1 === count($rows)
to validate that only one resource was found.
👍 |
955b9aa
to
d7756f4
Compare
@@ -23,6 +23,9 @@ | |||
<parameter key="sylius.behat.table_manipulator.class">Sylius\Behat\TableManipulator</parameter> | |||
<parameter key="sylius.behat.page.class">Sylius\Behat\Page\Page</parameter> | |||
<parameter key="sylius.behat.symfony_page.class">Sylius\Behat\Page\SymfonyPage</parameter> | |||
<parameter key="sylius.behat.page.admin.crud.index.class">Sylius\Behat\Page\Admin\Crud\IndexPage</parameter> | |||
<parameter key="sylius.behat.page.admin.crud.create.class">Sylius\Behat\Page\Admin\Crud\CreatePage</parameter> | |||
<parameter key="sylius.behat.page.admin.crud.edit.class">Sylius\Behat\Page\Admin\Crud\EditPage</parameter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in code we should be consistent and use Update
instead of Edit
. UI (buttons, etc.) is a different story, but in Sylius codebase everything is "update".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpdatePage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me EditPage
sounds more appropriate than UpdatePage
. The action is update
, but the page is where we edit (want to change) and something is updated after we update it (save edited changes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I found EditPage
much more appropriate, but in terms of CRUD. On the other hand Resource action is named Update
, so for now I would stay with update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but update de facto has no page, it only updates data on object. I know action in ResourceController
is named updateAction
, but in this case I think we should based on what we're using this page for. For editing object, update follows edit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now we use update as a name of action and routes suffix for both displaying form and updating resource. As @pjedrzejewski mention, in a whole codebase, we use update to express everything around update. For me is more important to be consistent with the codebase rather than on feeling what is more appropriate. Action is with an update keyword, route is with an update word, so page should also be with update keyword.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just feel update more than action, edit more than having access to update possibility. But I'm 100% sure consistency is the greatest aim we should follow for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reasons outlined by @lchrusciel I say we go with UpdatePage for now, to be consistent. I think the whole discussion is caused by completely different problem: lack of separation of edit and update in ResourceController, but that's not something we can look at right now.
7fa2850
to
711e76b
Compare
…y context and custom Create page for country resource. Add grid and routing configuration in AdminBundle
711e76b
to
5de44a9
Compare
One thing we need to discuss, this protected getter on resource name and i think it is ready to go. |
5de44a9
to
d296fe2
Compare
[Admin] Adding countries
Thanks Arek! Nice work! 👍 |
[Admin] Adding countries
[Admin] Adding countries