To minimize AJAX requests, send the initial dataset with in Drupal.settings.k8s Javascript object when the page is rendered.

Comments

baldwinlouie created an issue. See original summary.

baldwinlouie’s picture

Status: Active » Needs review
StatusFileSize
new60.41 KB

Attaching patch with this refactoring. The patch refactors the common functions used in the APIController.php and K8sNamespaceCostsChartcontroller.php into a K8sBlockTrait.php

The Blocks can use these common functions to build the initial dataset.

@masami and @MasatoTakada should also review this because the refactoring touches code from the https://www.drupal.org/project/cloud/issues/3168861

baldwinlouie’s picture

Issue summary: View changes
StatusFileSize
new462.13 KB

Screenshot of the data sent in the Javascript array.

yas’s picture

@baldwinlouie

Thank you for the refactoring. I tested the patch and it looks good to me.

@masami

What do you think?

yas’s picture

Version: 3.0.0-alpha1 » 3.x-dev
masami’s picture

Status: Needs review » Reviewed & tested by the community

@yas
@baldwinlouie
The patch looks great, so I change the status to RTBC.

yas’s picture

@masami

Thank you for your review. I'll merge the patch to 8.x-2.x and 3.x and close this issue as Fixed.

  • yas committed 1c96039 on 8.x-2.x authored by baldwinlouie
    Issue #3170519 by baldwinlouie, yas, Masami: Provide initial dataset...

  • yas committed 631ac09 on 3.x authored by baldwinlouie
    Issue #3170519 by baldwinlouie, yas, Masami: Provide initial dataset...
yas’s picture

Status: Reviewed & tested by the community » Fixed
yas’s picture

Status: Fixed » Needs review
StatusFileSize
new729 bytes

@baldwinloue @masami

Fixing the coding standard violation.

yas’s picture

Status: Needs review » Reviewed & tested by the community

I'll merge the patch to 8.x-2.x and 3.x and close this issue as Fixed.

  • yas committed e8ec18d on 8.x-2.x
    Issue #3170519 by baldwinlouie, yas, Masami: Provide initial dataset...

  • yas committed 8fbbda7 on 3.x
    Issue #3170519 by baldwinlouie, yas, Masami: Hotfix - Provide initial...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.