Commit Graph

14 Commits

Author SHA1 Message Date
James E. Blair 4a7e86f7f6 Update web ui for dependency refactor
This updates the web ui to handle multiple changes per item.  It
is compatible with the current data output as well as the upcoming
API.

Change-Id: I536967e51b22b60c8ff7baa46b902a36d1ea44dd
2024-02-05 15:38:59 -08:00
James E. Blair a9ff6b3410 Improve support for web enqueue/dequeue
This change:

* Returns the build/buildset oldrev through the REST API (this
  field was missing).
* Updates the web UI so that when enqueuing or dequeueing a ref it will
  send exactly the oldrev/newrev values it received, including None/null.
* No longer translate None to 40*'0' when creating internal management
  events.

In concert, these changes allow a user to re-enqueue exactly as
originally enqueued buildsets for branch tips (periodic pipeline) as
well as ref updates (tag/post pipelines).

Additionally, the re-enqueue method in the web UI is updated to support
re-enqueing tag and branch heads (it only worked on change and
ref-updates before).

Finally, the buildset page is updated to show the old and new revs
if they are non-null.

Change-Id: I9886cd44f8b4bae6f4a5ce3644f0598a73ecfe0a
2023-12-14 10:18:33 -08:00
Tobias Urdin 59cd5de78b web: add dark mode and theme selection
This adds a theme selection in the preferences in the
config modal and adds a new dark theme.

Removes the line.png image and instead uses CSS
linear-gradient that is available in all browsers
since around 2018, also fixes the 15 pixels spacing
issue that is there today.

You can select between three different themes.

Auto will use your system preference to choose either the
light or dark theme, changes dynamically based on your
system preference.

Light is the current theme.

Dark is the theme added by this patch series.

The UX this changes is that if somebody has their system
preferences set to dark, for example in Mac OS X that is
in System Settings -> Appearance -> Dark the user will
get the Zuul web UI in dark by default and same for the
opposite.

This uses a poor man's dark mode for swagger-ui
as per the comment in [1].

[1] https://github.com/swagger-api/swagger-ui/issues/5327#issuecomment-742375520

Change-Id: I01cf32f3decdb885307a76eb79d644667bbbf9a3
2023-04-21 11:23:56 +00:00
James E. Blair 9d2e1339ff Support authz for read-only web access
This updates the web UI to support the requirement for authn/z
for read-only access.

If authz is required for read access, we will automatically redirect.
If we return and still aren't authorized, we will display an
"Authorization required" page (rather than continuing and popping up
API error notifications).

The API methods are updated to send an authorization token whenever
one is present.

Change-Id: I31c13c943d05819b4122fcbcf2eaf41515c5b1d9
2022-10-25 20:22:42 -07:00
James E. Blair bc1618ed5b Make promote work for any pipeline manager
This alters the behavior of the promote event handler so that it does
something useful in independent pipelines as well as dependent.  It
not only re-orders changes within a pipeline's shared queue (the old
behavior), but it also re-orders the shared queue within the pipeline.

When used in an independent pipeline, this will give the item an
advantage when requesting nodes or semaphores, or starting jobs.

This behavior applies to dependent pipelines as well -- the behavior is
the same for every pipeline.

Restarting jobs for changes in independent pipelines would be
counter-productive (and even in dependent pipelines we may have restarted
more jobs than necessary if the change at the head wasn't being altered),
so it has been altered to only dequeue/enqueue items when necessary to
achieve the requested order.

The event argument to addChange within the promote method has been
changed from the promote event to the original item enqueue event.
Methods within the pipeline manager assume that event type is a
TriggerEvent rather than a ManagementEvent and could throw some (non-fatal)
errors when reporting.

Change-Id: Ib4ab855cff27bf8e96aa852333fb4ace656235b4
2022-03-10 14:09:32 -08:00
Matthieu Huin 54635a4de7 web UI: allow a privileged user to promote a change
Add a "promote" button in the actions menu of a change, if the
currently logged in user is an admin on the tenant and if the pipeline
is dependent.
Clicking the button opens a modal, so that the user can confirm her decision.

Change-Id: I8262888aef9ba1a106e0b321cc4cf2e14465b90c
2021-11-23 11:36:45 +00:00
Matthieu Huin 84ae08fb39 Web UI: allow a privileged user to request autohold
Add a "autohold" command on a build page, displayed only if the currently
logged in user is an admin on the tenant. By clicking the command, the
user can display a form and set custom parameters for an autohold
request.

Change-Id: I0f9f069d4ad36d4961eb6925146f67fe4910cb2e
2021-11-18 16:41:06 +00:00
Matthieu Huin c82619174c web UI: allow a privileged user to re-enqueue a change
Add a "re-enqueue" action command on a Buildset page, displayed only
if the currently logged in user is an admin on the tenant. By
clicking this command, the user can re-enqueue the change with
the same parameters as the buildset.

Redux: turned the API error notifications into a more generic
notification system, that can now include success notifications.

Change-Id: I05b6b3deb912b121df8de207944d9ec26e7c92d1
2021-11-18 16:40:47 +00:00
Matthieu Huin 3152171aa5 web UI: allow a privileged user to dequeue a change
Add a togglable "Actions" kebab menu on the right of a change, if the
currently logged in user is an admin on the tenant.

Show available actions (currently "dequeue" only) when toggled.

Clicking the "Dequeue" item opens a modal, so that the user
can confirm her decision.

Change-Id: I7c97509d62ef167ee5904a816998049d88c6b3cb
2021-11-18 16:40:25 +00:00
Sorin Sbarnea ebad14f1f9 Consolidate js/jsx indentation
Previously indentation was not checked at all and in order to avoid
reviewers time with style checks, we can enforce it with eslint.

Current js/jsx changes were made by: yarn lint-fix

Note this this change can easily become outdated so we need to
coordinate and merge it quickly as each rebase would loose previous
votes.

Change-Id: I85883fc8db924ad4ce9acad5acdd42aed7e4d0e4
2020-11-20 09:39:31 +00:00
Tristan Cacqueray f61e19900f web: add change status page
This change adds a ChangeStatus page to display the status of a single
change and updates the Change component to link the icon to the new
page.

Change-Id: I265f7a390fde33721624a0da7fe5bd1cde32dc37
2018-12-14 05:36:11 +00:00
Tristan Cacqueray 68d1189871
Revert "Revert "web: rewrite interface in react""
This reverts commit 3dba813c64.

Change-Id: I233797a9b4e3485491c49675da2c2efbdba59449
2018-10-06 10:42:31 -05:00
James E. Blair 3dba813c64 Revert "web: rewrite interface in react"
Revert "Fix publish-openstack-javascript-content"

This reverts commit ca199eb9db.
This reverts commit 1082faae95.

This appears to remove the tarball publishing system that we rely on.

Change-Id: Id746fb826dfc01b157c5b772adc1d2991ddcd93a
2018-09-29 11:51:43 -07:00
Tristan Cacqueray 1082faae95 web: rewrite interface in react
This change rewrites the web interface using React:
http://lists.zuul-ci.org/pipermail/zuul-discuss/2018-August/000528.html

Depends-On: https://review.openstack.org/591964
Change-Id: Ic6c33102ac3da69ebd0b8e9c6c8b431d51f3cfd4
Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Co-Authored-By: James E. Blair <jeblair@redhat.com>
2018-09-27 02:14:46 +00:00