Skip to content
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

Merged
merged 4 commits into from
Mar 11, 2016
Merged

Conversation

Arminek
Copy link
Contributor

@Arminek Arminek commented Mar 4, 2016

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets #4374
License MIT

@Arminek Arminek changed the title Adding country feature [Admin] Adding country feature Mar 4, 2016
@Arminek Arminek changed the title [Admin] Adding country feature [Admin] Adding scenarios for country feature Mar 4, 2016
@Arminek Arminek changed the title [Admin] Adding scenarios for country feature [Admin] Adding scenarios for managing country Mar 4, 2016
@@ -34,6 +34,7 @@ imports:
- suites/ui_cart.yml
- suites/ui_channel.yml
- suites/ui_checkout.yml
- suites/ui_localization.yml
Copy link
Member

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? :)

@Arminek Arminek force-pushed the managing_countries branch 8 times, most recently from 0f9e5bc to 74ba0bf Compare March 9, 2016 12:46
@Arminek Arminek changed the title [Admin] Adding scenarios for managing country [Admin] Adding country Mar 9, 2016
@Arminek Arminek changed the title [Admin] Adding country [Admin] Adding countries Mar 9, 2016
@Arminek Arminek force-pushed the managing_countries branch 2 times, most recently from 525f3fa to 4e876ee Compare March 10, 2016 10:16
ui_addressing:
contexts_as_services:
- sylius.behat.context.hook.doctrine_orm
- sylius.behat.context.transform.lexical
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Arminek Arminek force-pushed the managing_countries branch 2 times, most recently from b2f410d to 33ccb6b Compare March 10, 2016 10:37
* @param IndexPageInterface $adminCountryIndexPage
* @param CreatePageInterface $adminCountryCreatePage
*/
public function __construct(SharedStorageInterface $sharedStorage, IndexPageInterface $adminCountryIndexPage, CreatePageInterface $adminCountryCreatePage)
Copy link
Member

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

}

/**
* @return string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* @return bool
*
* @throws ElementNotFoundException
Copy link
Contributor

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

try {
$rows = $this->tableManipulator->getRowsWithFields($this->getElement('table'), $parameters);

return 0 !== count($rows);
Copy link
Contributor

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.

@michalmarcinkowski
Copy link
Contributor

👍

@@ -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>
Copy link
Member

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".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UpdatePage ?

Copy link
Contributor

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).

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@Arminek Arminek force-pushed the managing_countries branch 3 times, most recently from 7fa2850 to 711e76b Compare March 11, 2016 13:13
…y context and custom Create page for country resource. Add grid and routing configuration in AdminBundle
@Arminek
Copy link
Contributor Author

Arminek commented Mar 11, 2016

One thing we need to discuss, this protected getter on resource name and i think it is ready to go.

pjedrzejewski pushed a commit that referenced this pull request Mar 11, 2016
@pjedrzejewski pjedrzejewski merged commit 894fa80 into Sylius:master Mar 11, 2016
@pjedrzejewski
Copy link
Member

Thanks Arek! Nice work! 👍

pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants