diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-10-01 21:40:38 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-10-02 08:48:53 +0000 |
commit | 1c4c9d08fd0ee73fd2b29620c1b8fc914666ee7e (patch) | |
tree | 05afb9465237b846673b85c64872d969096d3419 | |
parent | 9bed50d64cfe8d64f6af4fb0267e93c8fa884fa2 (diff) |
Hide disabled submit button when stage is shown
We usually don't have stage and submit buttons enabled.
This change makes sure that both are shown when they are both enabled,
but in the case of only stage being enabled, we hide the submit
button.
Fixes: QTQAINFRA-3245
Change-Id: I97cc7c85969169b87998d7edeaf4c1afb0c202d1
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r-- | qt-gerrit-ui-plugin/qt-gerrit-ui-plugin.html | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-gerrit-ui-plugin/qt-gerrit-ui-plugin.html b/qt-gerrit-ui-plugin/qt-gerrit-ui-plugin.html index 9bedbb9..205b43d 100644 --- a/qt-gerrit-ui-plugin/qt-gerrit-ui-plugin.html +++ b/qt-gerrit-ui-plugin/qt-gerrit-ui-plugin.html @@ -129,6 +129,15 @@ plugin.buttons[key] = plugin.ca.add(action.__type, action.label); plugin.ca.setTitle(plugin.buttons[key], action.title); plugin.ca.addTapListener(plugin.buttons[key], buttonEventCallback); + + // hide submit button when it would be disabled next to the stage button + if (key === 'gerrit-plugin-qt-workflow~stage') { + let submit = plugin.ca.getActionDetails('submit'); + if (!submit.enabled) { + plugin.ca.setActionHidden('revision', 'submit', true); + } + } + } }); |