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

✨ feat. reload table / relationships #2427

Closed

Conversation

RocKhalil
Copy link
Contributor

@RocKhalil RocKhalil commented Jan 29, 2024

Description

I've added a button to reload the content of a specific frame.
For example, I'm doing updates via console, or the user did something on his end, and I was to reload this specific relationship or table without refreshing the whole page; the button will find the nearest frame and reload it.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Notes:

I know that you guys prefer using stimulus controllers for these type of things, but I was not able to make it run with a controller looking like this:

import { Controller } from '@hotwired/stimulus'
export default class extends Controller {
  get parentTurboFrame() {
    return this.context.scope.element.closest('turbo-frame')
  }

  refresh() {
    if (!this.parentTurboFrame.src) return
    this.parentTurboFrame.reload()
  }
}

Copy link

codeclimate bot commented Jan 29, 2024

Code Climate has analyzed commit 238471f and detected 0 issues on this pull request.

View more on Code Climate.

@adrianthedev
Copy link
Collaborator

It's so cool you submitted this PR.

We were thinking about the same thing but a bit more integrated.
Please follow #2386 for updates. It's close to merge.

Will close this one.
Thank you!

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

2 participants