Configurations off-canvas: link to trigger off-canvas

Created on 27 January 2023, almost 2 years ago
Updated 27 January 2024, 10 months ago

Problem/Motivation

Attach ajaxified link to the gridstack container children.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇺🇦Ukraine Panchuk Volyn, Lutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Panchuk
  • 🇺🇦Ukraine Panchuk Volyn, Lutsk
  • Assigned to boddy
  • 🇺🇦Ukraine Panchuk Volyn, Lutsk
  • First commit to issue fork.
  • @royalpinto007 opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India royalpinto007

    This change was made to enhance the user experience and improve page performance. By utilizing AJAX, we are able to retrieve and update data asynchronously, allowing the user to interact with the page while data is being loaded. The Gridstack container children serve as a perfect candidate for this functionality, as they require frequent updates to their contents.

  • 🇺🇦Ukraine Panchuk Volyn, Lutsk

    @royalpinto007 Thanks for your contribution to Paragraphs Gridstack.

    I didn't add a good description for this task, so probably you didn't understand the idea of the task.
    Also, this issue is already assigned to another contributor and this is a bad tone to work on assigned tasks.

    The first problem with your MR is using a 'field_children' field name to get a child paragraphs, but this is a paragraph behavior plugin and it could be applied to any type of paragraph.

        // Attach ajaxified link to gridstack container children.
        $children = $paragraph->get('field_children');
    

    The second problem is using 'entity.node.canonical' for generating a Link to the paragraph. Also, the setOptions() method is not applicable to the Link object. It works only for a URL object.

          // Create a link for the child entity.
          $link = Link::createFromRoute($child_entity->label(), 'entity.node.canonical', ['node' => $child_entity->id()]);
    
          // Ajaxify the link.
          $link->setOptions([
            'attributes' => [
              'class' => ['use-ajax'],
              'data-dialog-type' => 'modal',
            ],
          ]);
    

    And the last piece of code that doesn't work:

          // Attach the link to the child entity.
          $child_entity->link = $link;
    
  • 🇺🇦Ukraine Panchuk Volyn, Lutsk

    @royalpinto007 How did you write this code? Did you use some kind of AI e.g. ChatGPT?

  • 🇺🇦Ukraine Panchuk Volyn, Lutsk
  • Status changed to Active almost 2 years ago
  • 🇺🇦Ukraine Panchuk Volyn, Lutsk
  • 🇮🇳India royalpinto007

    Oops, I didn't notice that it was already assigned to someone else. I apologize for the same.
    Also, I made changes in the code taking some reference from the Stack Overflow website.

  • Assigned to Andrii Momotov
  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • Pipeline finished with Failed
    10 months ago
    #83276
  • Pipeline finished with Canceled
    8 months ago
    Total: 84s
    #126186
  • Pipeline finished with Success
    8 months ago
    Total: 168s
    #126187
  • Pipeline finished with Failed
    8 months ago
    Total: 240s
    #126196
Production build 0.71.5 2024