Skip to content

Tweak: Conditionally show Cloud Kits tab [ED-19355]#31367

Merged
louiswol94 merged 22 commits intomainfrom
ED-19355
Jun 3, 2025
Merged

Tweak: Conditionally show Cloud Kits tab [ED-19355]#31367
louiswol94 merged 22 commits intomainfrom
ED-19355

Conversation

@louiswol94
Copy link
Copy Markdown
Contributor

No description provided.

@louiswol94 louiswol94 requested review from ManorHazaz and max-zu June 2, 2025 14:00
* @return array|\WP_Error
*/
public function get_kits_quota() {
return $this->http_request( 'GET', 'quota/kits', [], [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on HLD...

Suggested change
return $this->http_request( 'GET', 'quota/kits', [], [
return $this->http_request( 'GET', 'kits/quota', [], [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ManorHazaz - @max-zu ended up using quota/kits

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() );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to create another controller?
Why not use Kits_Cloud_Controller?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ManorHazaz Please disregard the above comment, I made a mistake. I updated the code and am now using the existing component.

$e.components.register( new TaxonomiesComponent() );
$e.components.register( new KitLibraryComponent() );
$e.components.register( new KitsCloudComponent() );
$e.components.register( new KitsCloudEligibilityComponent() );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why register a new component? why not use the same component?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

louiswol94 and others added 2 commits June 3, 2025 11:18
…lity.js

Co-authored-by: Manor Hazaz <manorhazaz@gmail.com>
@louiswol94 louiswol94 requested a review from ManorHazaz June 3, 2025 09:30
ManorHazaz
ManorHazaz previously approved these changes Jun 3, 2025
@louiswol94 louiswol94 requested a review from ManorHazaz June 3, 2025 11:37
@louiswol94 louiswol94 merged commit aaa7ff6 into main Jun 3, 2025
43 checks passed
@louiswol94 louiswol94 deleted the ED-19355 branch June 3, 2025 11:53
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.

3 participants