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

Add custom applicaton support (work in progress) #52

Closed
wants to merge 4 commits into from

Conversation

mvantellingen
Copy link
Member

@mvantellingen mvantellingen commented Jul 14, 2020

Example usage::

newClient.CustomApplicationGetWithID(context.TODO(), "ckcmb5qvmzpes0714901hx27v")

draft := &commercetools.CustomApplicationDraft{
	Name: "terraform-test",
	NavbarMenu: commercetools.CustomApplicationNavbarMenu{
		Key:         "foobar",
		URIPath:     "no-idea",
		Permissions: []string{"ViewCategories"},
		LabelAllLocales: []commercetools.CustomApplicationLabelLocale{
			commercetools.CustomApplicationLabelLocale{
				Locale: "NL",
				Value:  "Michael Test",
			},
		},
		Submenu: []commercetools.CustomApplicationNavbarSubmenu{},
	},
}

app, err := newClient.CustomApplicationCreate(context.TODO(), draft)
if err != nil {
	panic(err)
}

@mvantellingen mvantellingen marked this pull request as draft July 14, 2020 19:58
@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #52 (c7d2465) into master (1c49bc0) will decrease coverage by 4.65%.
The diff coverage is 31.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
- Coverage   15.53%   10.88%   -4.66%     
==========================================
  Files          70       69       -1     
  Lines       15246    15272      +26     
==========================================
- Hits         2369     1662     -707     
- Misses      12360    13354     +994     
+ Partials      517      256     -261     
Impacted Files Coverage Δ
commercetools/client.go 60.37% <ø> (-5.67%) ⬇️
commercetools/service_custom_applications.go 25.00% <25.00%> (ø)
commercetools/client_graphql.go 73.13% <62.96%> (+73.13%) ⬆️
commercetools/service_message.go 0.00% <0.00%> (-60.00%) ⬇️
commercetools/service_product_projection.go 11.90% <0.00%> (-33.34%) ⬇️
commercetools/service_review.go 0.00% <0.00%> (-31.47%) ⬇️
commercetools/service_payment.go 0.00% <0.00%> (-31.47%) ⬇️
commercetools/service_shopping_list.go 0.00% <0.00%> (-31.47%) ⬇️
commercetools/service_discount_code.go 0.00% <0.00%> (-30.77%) ⬇️
commercetools/service_category.go 0.00% <0.00%> (-29.89%) ⬇️
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 089f176...84762d3. Read the comment docs.

@mvantellingen
Copy link
Member Author

@emmenko which permissions do we need to actually create a custom application. Retrieving works fine but when creating a new one I receive the following

{"errors":[{"message":"Missing or invalid authentication token.","locations":[{"line":3,"column":4}],"path":["createProjectExtensionApplication"],"extensions":{"code":"UNAUTHENTICATED"}}],"data":{"createProjectExtensionApplication":null}}

@emmenko
Copy link

emmenko commented Jul 15, 2020

Hi @mvantellingen , thanks for taking over 🙏

To manage custom applications, you need an access token with the scope manage_project_settings. For retrieving a custom application, you simply need an access token with access to the project (could be any scope).

Let me know if you need any more assist. I'm also happy to review the PR if you need me to.
Thanks

@emmenko
Copy link

emmenko commented Jul 15, 2020

FYI: we're planning to change some things about how you manage and register Custom Applications. The current API should stay for backwards compatibility, but there would be a new one.

I'll get in touch once we have it in place.

@mvantellingen
Copy link
Member Author

FYI: we're planning to change some things about how you manage and register Custom Applications. The current API should stay for backwards compatibility, but there would be a new one.

I'll get in touch once we have it in place.

Hi @emmenko,

I would like to take some steps to get the support in the terraform provider (we really need it for a couple of components we are creating). Is the new API already available?

@demeyerthom demeyerthom added the enhancement New feature or request label Aug 4, 2023
@demeyerthom
Copy link
Member

Custom apps can only be configured through the GraphQL instead

@demeyerthom demeyerthom deleted the feature/custom-apps branch August 25, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants