Custom repository information

56 views
Skip to first unread message

Duft Markus

unread,
Aug 22, 2018, 7:13:49 AM8/22/18
to repo-d...@googlegroups.com

Hey,

 

I would like to write a plugin which enriches the repository list in polygerrit with custom (extracted from the actual repository information). In my case there is a file in each of the repositories, which contains some values (numbers, text), and I want to be able (if the file exists) to display these values in the Browse > Repositories list of repos. Can this be done? Alternatively, it would be OK to have a separate, dedicated page which lists all the repos which have this file along with the information. The question in this case is, how can I hook this up to polygerrit? I want it to be shown “inside” the PG UI, so that the PG header/footer is present. Can I hook the top menu somehow to achieve this?

 

Thanks!

Markus

 

--

Mit freundlichen Grüßen / Best regards

 

Markus Duft | Software Architect

SSI SCHÄFER | SSI Schäfer IT Solutions GmbH | Friesachstraße 15 | 8114 Friesach bei Graz | Austria

Phone +43 3127 200-575 | Fax +43 3127 200-22

marku...@ssi-schaefer.com

Website | Blog | YouTube | Facebook

 


SSI Schäfer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria
Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz

Duft Markus

unread,
Aug 23, 2018, 10:07:24 AM8/23/18
to repo-d...@googlegroups.com

Nobody ideas on how to extend PG UI? :D

 

Cheers,

Markus

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

matthewwi...@gmail.com

unread,
Aug 24, 2018, 10:35:06 AM8/24/18
to Repo and Gerrit Discussion
I have created a plugin which modifies the PG UI. The way I have done this is quite messy and fragile due to a lack of supported API methods for doing so. (I think).

The buttons that I have created are in the screenshot attached, see if this is what you are after.

I have done this via raw JavaScript in a custom element as detailed in the PolyGerrit Plugin docs.

Creating the buttons:

function addButton() {
   
var button = document.createElement('div');
    button
.innerHTML = "<gr-button> My Button </gr-button>"
    document
.getElementById('topContainer').appendChild(button);
}

if (window.location.href.includes('/admin/projects') && document.title.startsWith('Projects')) {
   
//Poll, addButton() if the button doesnt exist already (Poll with setInterval(() =>)


The rest you can learn by looking at /elements/gr-app.html (You can find this by being in a PolyGerrit window and right-click --> view source)

You also probably want to look at the massive JavaScript file and figure out how things work.

Good luck

matthewwi...@gmail.com

unread,
Aug 24, 2018, 10:36:03 AM8/24/18
to Repo and Gerrit Discussion
Forgot to include the image, here it is

custom buttons.png



On Wednesday, August 22, 2018 at 12:13:49 PM UTC+1, Markus Duft wrote:

Duft Markus

unread,
Aug 27, 2018, 2:37:56 AM8/27/18
to matthewwi...@gmail.com, Repo and Gerrit Discussion

Hey,

 

That’s at least a starting point, thanks a lot J I guess this has to improve somehow before GWT disappears…

 

Cheers,

Markus

--

--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Pursehouse

unread,
Aug 27, 2018, 2:44:26 AM8/27/18
to Duft Markus, matthewwi...@gmail.com, Repo and Gerrit Discussion
On Mon, Aug 27, 2018 at 3:37 PM Duft Markus <Marku...@ssi-schaefer.com> wrote:

Hey,

 

That’s at least a starting point, thanks a lot J I guess this has to improve somehow before GWT disappears…


If there are things that are missing in Polygerrit compared to GWT, please file an issue and add the label "Hotlist-GWT".


 

 

Cheers,

Markus

 

From: repo-d...@googlegroups.com [mailto:repo-d...@googlegroups.com] On Behalf Of matthewwi...@gmail.com
Sent: Friday, August 24, 2018 4:36 PM
To: Repo and Gerrit Discussion <repo-d...@googlegroups.com>
Subject: Re: Custom repository information

Forgot to include the image, here it is

image001.jpg
Reply all
Reply to author
Forward
0 new messages