Hello.
Can i find somewhere a list of location where i can add my form fragment?
Actually i'm developing Stash plugin and i want to place the form fragment into the page of repository settings (Repository details).
Any help would be appreciated.
Community moderators have prevented the ability to post new answers.
Hi,
A good starting point is https://developer.atlassian.com/stash/docs/latest/reference/web-fragments.html.
For repository settings, you can use
<web-item key="your-key" name="your-name" weight="30" section="stash.repository.settings.panel/repository-settings-addons-section"> </web-item>
Hope this helps.
Cheers,
Michael
Hi Michael. This solution doesnt work for me. I've added to atlassian-plugin.xml the following: <form-fragment key="file-size-merge-restrict-fragment" location="stash.repository.settings.panel/repository-settings-addons-section" class="path.to.my.class.FileSizeMergeRestrictFormFragment" weight="200"/> But it doesnt appear on the page Projects->MyProject->Repositories->MyRepo->Settings->Repository Details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry, I misread your question and thought you would like to add a settings page to the repository settings. According to http://localhost:7990/stash/projects/PROJECT_1/repos/rep_1/settings?web.items&web.sections&web.panels you can officially only add a button to the action panel on the top right of the page or a web panel banner to the repository details page. If you want to add another setting (e.g., an input field) to this page, you have to do it with a (not-supported) JavaScript hack...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for help, Michael. Could you explain me how to add the field with JavaScript hack? Thank you in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, you could define a stash-resource with a javascript file and limit it to the repository details context "stash.page.repository.generalSettings". Then, your JS would only run on this page. You could then change this page by altering the DOM (e.g., with JQuery) to your liking. But please note that this is in no way as safe in terms of future changes as the official extension points are => such changes could break with any new Stash version...
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.