Hi!
I'm creating an add-on for Bitbucket and need to show the button in the repo navigation only for certain repos. I can probably do that with conditions, but I can't find the right condition. This page just gives a couple examples, but not a full list: https://developer.atlassian.com/static/bitbucket/concepts/conditions.html
Community moderators have prevented the ability to post new answers.
Hi Konstantin,
Our documentation is currently getting an over-haul and hence the full list is not included. For a quick band-aid, I will list out all of our conditions. In the future, these conditions will be included in our docs.
Checks whether the current user has permissions to an account.
{ "params": { "permission": <collaborator|admin> } }
Checks whether the current user is logged in
Valid values: true, false
Checks whether the user has a specific permission with a repo.
{ "params": { "permission": <read|write|admin> } }
This tests whether a certain file exists in a repository. If the "cset" parameter is provided, then the test happens on that specific changeset. If the "cset" parameter is not provided, the test happens on the head of the "main-branch" of the repo (configurable from the repo settings).
{ "params": { "cset": <optional-changeset>, "filename": <name-of-file> } }
This tests whether the repository in question is Git or Hg.
{ "params": { "type": <git|hg> } }
Tests whether the specific file is binary (this condition is useful for custom file-viewers).
Valid values: true, false
There aren't many hidden conditions (I don't think there are any at all). What you're describing is a remote condition. You'd have to do the logic on your side of the application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! Thanks for the quick response! As far as I understand, the location of a module is defined strictly in connect.json. I can check the repo name and show specific content inside the app, but I can't check it and hide the module, because the app code is not executed until the module is opened. The app I'm creating adds a storefront to the repo page. The idea is to allow developers sell project merch right from the repo page. This implies that the module's content is different for each repo (can easily be done inside the app) and that the module should be hidden for repos without assigned storefronts (can't be done from inside the app, as far as I know).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.