Tweak: Conditionally show Cloud Kits tab [ED-19355]#31367
Conversation
| * @return array|\WP_Error | ||
| */ | ||
| public function get_kits_quota() { | ||
| return $this->http_request( 'GET', 'quota/kits', [], [ |
There was a problem hiding this comment.
Based on HLD...
| return $this->http_request( 'GET', 'quota/kits', [], [ | |
| return $this->http_request( 'GET', 'kits/quota', [], [ |
There was a problem hiding this comment.
@ManorHazaz - @max-zu ended up using quota/kits
app/modules/kit-library/module.php
Outdated
| Plugin::$instance->data_manager_v2->register_controller( new Kits_Controller() ); | ||
| Plugin::$instance->data_manager_v2->register_controller( new Taxonomies_Controller() ); | ||
| Plugin::$instance->data_manager_v2->register_controller( new Kits_Cloud_Controller() ); | ||
| Plugin::$instance->data_manager_v2->register_controller( new Kits_Cloud_Eligibility_Controller() ); |
There was a problem hiding this comment.
Why do we need to create another controller?
Why not use Kits_Cloud_Controller?
There was a problem hiding this comment.
For this, and for your other question about the component, mainly because I wanted to use $e.data.get().
The existing component is for $e.data.get( 'kits-cloud/index' ) and it maps to Kits_Cloud_Controller()
I could not create a command under the same component $e.data.get( 'kits-cloud/eligibility' ) for example, because if you look at the nature of Elementor\Data\V2\Base\Controller it only supports one root GET route per controller. And any other endpoint that belongs to this controller maps to something/{id} and $e.data.get( 'kits-cloud/eligibility/{what_id}' ) would not make sense.
So I had to create a separate controller/component.
There was a problem hiding this comment.
@ManorHazaz Please disregard the above comment, I made a mistake. I updated the code and am now using the existing component.
app/modules/kit-library/assets/js/hooks/use-cloud-kits-eligibility.js
Outdated
Show resolved
Hide resolved
| $e.components.register( new TaxonomiesComponent() ); | ||
| $e.components.register( new KitLibraryComponent() ); | ||
| $e.components.register( new KitsCloudComponent() ); | ||
| $e.components.register( new KitsCloudEligibilityComponent() ); |
There was a problem hiding this comment.
Why register a new component? why not use the same component?
…lity.js Co-authored-by: Manor Hazaz <manorhazaz@gmail.com>
…o ED-19355 merge
…o ED-19355 merge
No description provided.