On Jan 5, 2022, at 2:28 PM, Yan <biya...@gmail.com> wrote:Hi,I have tried to call the rest api via CURL, which will call the apply() method, but click the button doesn't trigger anything. And I have tried to use JS module exposed as a WebUiPlugin, it doesn't work either. I guess the problem could be the documents and/or examples doesn't support polygerrit-ui. Can anyone help here?
Thanks.YanOn Thursday, 23 December 2021 at 11:48:01 UTC+1 Yan wrote:Hi,I have updated my server recently to 3.4.1 and rebuilt plugins according to the document https://gerrit-review.googlesource.com/Documentation/dev-plugins.html#ui_extension.My plugin should add a button to the change view, and then if the user click the button, the topic will then be extended. And by submitting, if the extension is there, some functions will be called. The buttons shows up, but nothing happens by clicking. And if I manually extended the topic, the logical functions can also be triggered by submitting. Actually, the apply method is never called in my case.Any idea?I also have found many useful examples here https://gerrit.googlesource.com/plugins/examples/and have tried the restApiPostRevision plugin, but it has the same issue by me. The button shows up, but the apply method is never called.
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/474026ce-54fd-4f40-b472-dcfb8c94d6b6n%40googlegroups.com.
On Jan 5, 2022, at 2:28 PM, Yan <biya...@gmail.com> wrote:Hi,I have tried to call the rest api via CURL, which will call the apply() method, but click the button doesn't trigger anything. And I have tried to use JS module exposed as a WebUiPlugin, it doesn't work either. I guess the problem could be the documents and/or examples doesn't support polygerrit-ui. Can anyone help here?Check the pg-plugin-dev guide: https://gerrit-review.googlesource.com/Documentation/pg-plugin-dev.htmlThe examples repo does need to be updated for PolyGerrit. Help there would be great :)
nas...@codeaurora.org schrieb am Mittwoch, 5. Januar 2022 um 22:34:32 UTC+1:On Jan 5, 2022, at 2:28 PM, Yan <biya...@gmail.com> wrote:Hi,I have tried to call the rest api via CURL, which will call the apply() method, but click the button doesn't trigger anything. And I have tried to use JS module exposed as a WebUiPlugin, it doesn't work either. I guess the problem could be the documents and/or examples doesn't support polygerrit-ui. Can anyone help here?Check the pg-plugin-dev guide: https://gerrit-review.googlesource.com/Documentation/pg-plugin-dev.htmlThe examples repo does need to be updated for PolyGerrit. Help there would be great :)You could use Zoekt to search in gerrit related projects and plugins: [1].In chromium-behavior plugin you can see one example of adding a button with handler: [2].
On Jan 5, 2022, at 2:28 PM, Yan <biya...@gmail.com> wrote:Hi,I have tried to call the rest api via CURL, which will call the apply() method, but click the button doesn't trigger anything. And I have tried to use JS module exposed as a WebUiPlugin, it doesn't work either. I guess the problem could be the documents and/or examples doesn't support polygerrit-ui. Can anyone help here?Check the pg-plugin-dev guide: https://gerrit-review.googlesource.com/Documentation/pg-plugin-dev.htmlThe examples repo does need to be updated for PolyGerrit. Help there would be great :)
Gerrit.install(plugin => {
plugin.on("showchange", params => {
const changeActions = plugin.changeActions();
MyKey = changeActions.add("revision", "HelloWorld");
changeActions.setEnabled(MyKey, true);
changeActions.setTitle(MyKey, "I want to say Hello World!")
changeActions.addTapListener(MyKey, () => {
if (confirm("Hello World?")) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
console.log(txt);
});
})
})
Gerrit.install(plugin => {
plugin.on("showchange", params => {
const changeActions = plugin.changeActions();
MyKey = changeActions.add("revision", "HelloWorld");
When I try to register a new action in my plugin in this way, then I sometimes get multiple copies of my button.})
})
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/6856d167-f9c2-49aa-ad92-bfdf57003809n%40googlegroups.com.