Skip to content
This repository was archived by the owner on Jan 4, 2022. It is now read-only.

Conversation

@Christian-Rades
Copy link
Contributor

Implemented the "export all action" as a batch process to handle big amounts without gui tmeouts

@Christian-Rades Christian-Rades self-assigned this Oct 18, 2017
@coveralls
Copy link

coveralls commented Oct 18, 2017

Coverage Status

Coverage decreased (-0.04%) to 37.959% when pulling 44786e0 on CON-4873 into df35db2 on master.

@coveralls
Copy link

coveralls commented Oct 18, 2017

Coverage Status

Coverage decreased (-0.02%) to 37.977% when pulling b8aa3c3 on CON-4873 into df35db2 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Oct 18, 2017

Coverage Status

Coverage decreased (-0.02%) to 37.977% when pulling b8aa3c3 on CON-4873 into df35db2 on master.

@coveralls
Copy link

coveralls commented Oct 18, 2017

Coverage Status

Coverage decreased (-0.02%) to 37.977% when pulling cb01d0c on CON-4873 into df35db2 on master.

@Christian-Rades Christian-Rades removed their assignment Oct 18, 2017
.psh.yml Outdated
DB_USER: "shopware"
DB_PASSWORD: "shopware"
DB_HOST: "localhost"
DB_USER: "app"
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think this is special for your setup in docker?
i guess it wouldn't work for everybody else

Shopware()->Session()->connectReservation = null;
}

public function getAllArticleSourceIds($offset, $batchSize)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why you need this?
i would suggest to put the repo as a dependency where this function is used
if this is used in a controller please add a proper service function
Imho helper classes are an antipattern
dataflow should be controller->service->repo

Also dochints are missing

* @return array
*/
public function getAllNonConnectArticleIds()
public function getBatchOfArticles($offset, $batchSize)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above put this in aproper service function don't overload the helper
and also no dochints

return array_map(function ($row) {
return $row['article_id'];
}, $result);
public function getLocalArticleCount()
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

*/
public function getArticleCountAction()
{
try {
Copy link
Collaborator

Choose a reason for hiding this comment

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

call a service method here

offset = parseInt(offset);
batchSize = parseInt(batchSize);
count = parseInt(count);
// if ((offset+batchSize) > count ){
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove unused outcommented code


/**
* Contains the amount of products export all will export as batches
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

why a global variable == global state? can you refactor it so that this is passed as argument


/**
* Contains the amount of products export all will export as batches
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here and above exportAll too


Ext.create('Shopware.apps.Connect.view.export.product.manyProductsDialog', {
sourceIds: operation.sourceIds
exportAll: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Imho these bool switches are also bad practice
maybe we can find a cleaner solution here

me.cancelButton.setDisabled(true);

me.fireEvent('startExport', me.sourceIds, me.batchSize, me);
if (me.exportAll) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think the progress bar shouldn't fire any event at all
it should just show some progress that will be updated but shouldn't know anything more
i would suggest firing this event after creating this progess bar

@coveralls
Copy link

coveralls commented Nov 3, 2017

Coverage Status

Coverage increased (+0.2%) to 38.207% when pulling 3927d5b on CON-4873 into df35db2 on master.

@coveralls
Copy link

coveralls commented Nov 3, 2017

Coverage Status

Coverage increased (+0.2%) to 38.207% when pulling efcdc32 on CON-4873 into df35db2 on master.

@coveralls
Copy link

coveralls commented Nov 8, 2017

Coverage Status

Coverage decreased (-0.05%) to 38.653% when pulling 5eaa4a1 on CON-4873 into fa4462a on master.

@keulinho keulinho merged commit eff6d0b into master Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants