Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for more flexible layouts in layout.jelly #8794

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

janfaracik
Copy link
Contributor

@janfaracik janfaracik commented Dec 20, 2023

Background

Currently in Jenkins you're limited to three layout types - two-column, one-column and full-screen. This PR reworks layout.jelly to allow for more layout types, for example a three column layout or a layout with the side panel on the right.

This gives developers more flexibility in how they approach the design of their pages and also simplifies how layout.jelly and it's related stylings work.

Testing done

Proposed changelog entries

  • N/A

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@jenkinsci/sig-ux

Before the changes are marked as ready-for-merge:

Maintainer checklist

@@ -27,8 +27,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout permissions="${app.MANAGE_AND_SYSTEM_READ}" title="${%System}" type="one-column">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue with the current approach is that there can be a mismatch between the page type and it's contents - on the Configure page it includes a sidebar however it isn't displayed due to the type being set to one-column. The inverse could be true as well where the page type is two-column but a side panel hasn't been provided.

@@ -34,16 +34,14 @@ THE SOFTWARE.
Generates a row containing the page title and an optional set of controls
</st:documentation>

<j:if test="${mode=='main-panel' or mode=='side-panel'}">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if condition wasn't needed so I've removed it.

@@ -58,7 +58,7 @@ THE SOFTWARE.
(The permissions will be checked against the "it" object.)
</st:attribute>
<st:attribute name="type" use="optional">
Available values: two-column (by default), one-column (full-width size) or full-screen (since 2.53).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type attribute now only works if it's set to full-screen.

@@ -3,7 +3,6 @@
.jenkins-section {
border-top: 2px solid var(--panel-border-color);
padding: var(--section-padding) 0 0 0;
max-width: 1800px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified the styling, let's just fill the available width and let the parent container control how wide that can be.

Comment on lines -195 to -197
<j:set var="mode" value="side-panel" />
<d:invokeBody />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks all context menus, see ModelObjectWithContextMenu.ContextMenu#from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed it and added a comment to side-panel.jelly

@daniel-beck
Copy link
Member

This PR looks a lot like

For new APIs and extension points, there is a link to at least one consumer.

would apply (on a UI level), but I don't see consumers for this change?

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Jan 25, 2024
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Mar 18, 2024
@janfaracik
Copy link
Contributor Author

This PR looks a lot like

For new APIs and extension points, there is a link to at least one consumer.

would apply (on a UI level), but I don't see consumers for this change?

I've added some guidance on using the new layout system in the Design Library - jenkinsci/design-library-plugin#315 - intending to update the UI of the plugin itself to use a multi column layout, however I haven't had the time recently.

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Apr 4, 2024
Copy link

github-actions bot commented Apr 4, 2024

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot added unresolved-merge-conflict There is a merge conflict with the target branch. and removed unresolved-merge-conflict There is a merge conflict with the target branch. labels Apr 4, 2024
Copy link

github-actions bot commented Apr 8, 2024

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants