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

Card is not updated after edit action #1848

Closed
mvorisek opened this issue Aug 31, 2022 · 6 comments · Fixed by #2004
Closed

Card is not updated after edit action #1848

mvorisek opened this issue Aug 31, 2022 · 6 comments · Fixed by #2004

Comments

@mvorisek
Copy link
Member

mvorisek commented Aug 31, 2022

tested on demos in RW mode (commented out transaction throw/break and no initPreventModification):

  • after edit: Card is not updated
  • after delete: Card is not removed from the View
  • after add: Card reloads (completely, and also quite slow with all ~250 countries CardDeck items on 1 page)

in RO mode (default):

  • after add: no reload at all
  • edit/delete testing is useless, until CardDeck updates correctly in RW mode, but then the same reload behaviour in RW/RO demos is expected

Dedup the reload code with Crud. Crud currently works as expected.

@mkrecek234
Copy link
Contributor

Regarding your comment on dedup CardDeck vs. Crud - I appreciate to see CardDeck just as another way of displaying a Crud, and having everything else the same. I made a quick overview of analogies, and also of parts that are missing in CardDeck implementation that are present though in Crud, not exhaustive, but a good starting point how a CardDeck derived from Crud could benefit from existing code.

CrudVsCardDeck.xlsx

@mkrecek234
Copy link
Contributor

@mvorisek Can we do a quick fix on this, as otherwise the CardDeck is in a way useless if it does not immediately reflect edits and deletes upon execution. The refactoring as a variant of Crud will take more time certainly to implement. Alternatively, @ibelar could you have a look how to make sure all APPLIES_TO_SINGLE_RECORD userAction updates are triggering a reload of the CardDeck after submit? And same with deletes?

@mkrecek234
Copy link
Contributor

For Single record actions, around this line

$c->addClickAction($action, null, $this->getReloadArgs());

also the initActionExecutor's logic has to be added to the Executor to reload if action was successful

@mkrecek234
Copy link
Contributor

@ibelar After some further look at the history commits, looks like this is broken since executor refactor by you done last year - any chance you can fix this easily? CardDeck is powerful and we should get it back running

@ibelar
Copy link
Contributor

ibelar commented Oct 20, 2022

@mkrecek234 I don't think Card reload or delete was ever implement, yet, in CardDeck. It was mainly for UserAction that does not modify model record.

@mkrecek234
Copy link
Contributor

mkrecek234 commented Oct 20, 2022

@ibelar I did not dig deeply in it, but check this code out. Isn't this the reload feature (which actually works OK for added cards, but is not initialized for SINGLE_RECORD updates/deletes?

protected function initActionExecutor(Model\UserAction $action): ExecutorInterface

I'd think we have to somehow also make sure the we add a hook also after UserAction success/completed. Unfortunately, not experienced with the whole Executor logic as you are ;-) We have to make sure that $this->addClickAction also registers a hook after a completed UserAction to reload the CardDeck.

@mvorisek mvorisek changed the title CardDeck is not updated after edit action Card is not updated after edit action Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants