Skip to content

Commit

Permalink
Merge branch 'update-forms' into update-forms-2
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Nov 30, 2021
2 parents 55402fa + 7234009 commit a1aeca2
Show file tree
Hide file tree
Showing 16 changed files with 228 additions and 206 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:entry title="${%File path}" field="path">
<f:entry title="${%File path}" field="path" class="jenkins-!-margin-bottom-0">
<f:textbox />
</f:entry>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package jenkins.mvn.GlobalMavenConfig
def f = namespace(lib.FormTagLib)

f.section(title:_("Maven Configuration")) {
div(class: "jenkins-form-item") {
f.dropdownDescriptorSelector(title:_("Default settings provider"), field:"settingsProvider")
}
div(class: "jenkins-form-item") {
f.dropdownDescriptorSelector(title:_("Default global settings provider"), field:"globalSettingsProvider")
}
f.dropdownDescriptorSelector(title:_("Default settings provider"), field:"settingsProvider")
f.dropdownDescriptorSelector(title:_("Default global settings provider"), field:"globalSettingsProvider")
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ l.layout(permission:app.SYSTEM_READ, title:my.displayName) {
Functions.getSortedDescriptorsForGlobalConfigByDescriptor(my.FILTER).each { Descriptor descriptor ->
set("descriptor",descriptor)
set("instance",descriptor)
f.rowSet(name:descriptor.jsonSafeClassName) {
f.rowSet(name:descriptor.jsonSafeClassName, class: "jenkins-!-margin-bottom-0") {
st.include(from:descriptor, page:descriptor.globalConfigPage)
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/lib/form/entry.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ THE SOFTWARE.
This content is HTML (unless the boolean variable escapeEntryTitleAndDescription is set). Use h.escape if necessary.
</st:attribute>
<st:attribute name="class">
Classes to apply to the form
Classes to apply to the form item
</st:attribute>
<st:attribute name="help">
URL to the HTML page. When this attribute is specified, the entry gets
Expand Down Expand Up @@ -96,7 +96,7 @@ THE SOFTWARE.
</j:if>
</j:when>
<j:otherwise>
<div class="jenkins-checkbox-help-wrapper">
<div>
<d:invokeBody />
<f:helpLink url="${attrs.help}" featureName="${title}"/>
</div>
Expand Down
7 changes: 3 additions & 4 deletions core/src/main/resources/lib/form/hetero-list.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ THE SOFTWARE.
</st:documentation>
<d:taglib uri="local">
<d:tag name="body">
<div style="width:100%">
<div class="help-sibling" style="width:100%">
<j:set var="help" value="${descriptor.helpFile}" />

<div class="repeated-chunk__header">
Expand All @@ -95,14 +95,13 @@ THE SOFTWARE.
</j:if>
</div>

<!-- TODO: help support is unintuitive; people should be able to see help from drop-down menu -->
<j:if test="${help!=null}">
<f:helpArea />
</j:if>

<d:invokeBody/>

<f:class-entry descriptor="${descriptor}" />

<d:invokeBody/>
</div>
</d:tag>
</d:taglib>
Expand Down
17 changes: 4 additions & 13 deletions core/src/main/resources/lib/form/repeatable/repeatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,10 @@ Behaviour.specify("INPUT.repeatable-add", 'repeatable', 0, function(e) {
e = null; // avoid memory leak
});

Behaviour.specify("INPUT.repeatable-delete", 'repeatable', 0, function(e) {
var b = makeButton(e,function(e) {
repeatableSupport.onDelete(e.target);
});
var be = $(b.get("element"));
be.on("mouseover",function() {
$(this).up(".repeated-chunk").addClassName("hover");
});
be.on("mouseout",function() {
$(this).up(".repeated-chunk").removeClassName("hover");
});

e = be = null; // avoid memory leak
Behaviour.specify("BUTTON.repeatable-delete", 'repeatable', 0, function(e) {
e.addEventListener("click", function() {
repeatableSupport.onDelete(e);
})
});

// radio buttons in repeatable content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ THE SOFTWARE.
</st:attribute>
</st:documentation>
<st:adjunct includes="lib.form.repeatable.repeatable"/>
<input type="button" value="${attrs.value ?: '%Delete'}" tooltip="${attrs.value ?: '%Delete'}" class="repeatable-delete danger" />
<button tooltip="${attrs.value ?: '%Delete'}" class="repeatable-delete danger" type="button">
<l:ionicon name="close-outline" />
</button>
</j:jelly>
5 changes: 4 additions & 1 deletion core/src/main/resources/lib/form/rowSet.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ THE SOFTWARE.
<st:attribute name="isFormItem">
Removes the "jenkins-form-item" class if false
</st:attribute>
<st:attribute name="class">
Classes to apply to the container (this will be the form item if 'isFormItem' is true)
</st:attribute>
</st:documentation>

<j:choose>
Expand All @@ -46,7 +49,7 @@ THE SOFTWARE.
<d:invokeBody />
</j:when>
<j:otherwise>
<div class="${isFormItem.equals('false') ? '' : 'jenkins-form-item'}">
<div class="${isFormItem.equals('false') ? '' : 'jenkins-form-item'} ${class}">
<div ref="${attrs.ref}" class="row-set-start row-group-start tr" style="display:none" name="${attrs.name}"></div>
<d:invokeBody />
<div class="row-set-end row-group-end tr"></div>
Expand Down
72 changes: 0 additions & 72 deletions war/src/main/js/widgets/config/tabbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -158,78 +158,6 @@
}
}

// Repeatable elements

.repeated-container > .repeated-chunk {
padding: 0.75rem;
}

.repeated-chunk.hover {
border-color: var(--line-blue);
box-shadow: 0 2px 10px var(--shade), inset 0 200px 200px -200px var(--brightest-bg-color);
position: relative;
z-index: 2
}

.repeated-chunk {
border: 1px solid var(--shade);
margin: 2px;
position: relative;
}
// Styling for drag & drop items
.repeated-chunk.repeated-chunk--sortable-ghost,
.repeated-chunk.repeated-chunk--sortable-chosen {
border-width: 2px;
border-color: var(--line-blue);
}

.repeatable-delete {
position: absolute;
top: -4px;
right: 40px;
height: 20px;
width: 30px;
}

.repeatable-delete button {
text-align: center;
text-indent: -9999px;
width: 30px !important;
height: 18px !important;
padding: 0 !important;
margin: 0 !important;
.border-radius-top(0) !important;
background-color: var(--danger);
color: var(--light-bg-color);
border: 1px solid var(--danger-line);
line-height: 12px !important;
display: inline-block;
font-size: 8px;
min-width: 0;
min-height: 0;

&:focus,
&:hover {
background-color: var(--danger-dark);
border-color: var(--danger-dark-line);
color: var(--brightest-bg-color);
}

&:before {
content: 'X';
font-weight: bold;
position: absolute;
display: block;
left: 0;
top: 2;
width: 30px;
height: 16px;
text-align: center;
font-size: 12px;
text-indent: 0;
}
}

span.highlight {
background-color: #ffff00;
}
Expand Down
85 changes: 7 additions & 78 deletions war/src/main/less/base/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -924,15 +924,16 @@ table.parameters > tbody:hover {

/* ========================= editable combobox style ========================= */
.comboBoxList {
border: 1px solid #000;
overflow: visible;
background-color: white;
color: black;
background-color: var(--background);
color: var(--text-color);
border-radius: var(--form-input-border-radius);
box-shadow: 0 10px 20px rgba(black, 0.1);
}

.comboBoxSelectedItem {
background-color: Highlight;
color: HighlightText;
background-color: var(--primary);
color: var(--text-color);
}

.combobox-values {
Expand Down Expand Up @@ -1112,54 +1113,6 @@ table.fingerprint-in-build td {
border-radius: 0.25em;
}

/* ========================= repeatable elements ========================= */

.repeated-chunk {
border: 2px dashed var(--input-border);
padding: 1rem;
border-radius: 6px;
}

.repeated-chunk.hover {
border-color: var(--medium-grey);
}

.repeated-chunk .show-if-last { visibility: hidden; }
.repeated-chunk.last .show-if-last { visibility: visible; }

.repeated-chunk .show-if-not-last { visibility: visible; }
.repeated-chunk.last .show-if-not-last { visibility: hidden; }

.repeated-chunk .show-if-not-only { visibility: visible; }
.repeated-chunk.only .show-if-not-only { visibility: hidden; }

/* == nested repeatable elements / 2 deep == */
.repeated-chunk .repeated-chunk .show-if-last { visibility: hidden; }
.repeated-chunk .repeated-chunk.last .show-if-last { visibility: visible; }

.repeated-chunk .repeated-chunk .show-if-not-last { visibility: visible; }
.repeated-chunk .repeated-chunk.last .show-if-not-last { visibility: hidden; }

.repeated-chunk .repeated-chunk .show-if-not-only { visibility: visible; }
.repeated-chunk .repeated-chunk.only .show-if-not-only { visibility: hidden; }

/* == nested repeatable elements / 3 deep == */
.repeated-chunk .repeated-chunk .repeated-chunk .show-if-last { visibility: hidden; }
.repeated-chunk .repeated-chunk .repeated-chunk.last .show-if-last { visibility: visible; }

.repeated-chunk .repeated-chunk .repeated-chunk .show-if-not-last { visibility: visible; }
.repeated-chunk .repeated-chunk .repeated-chunk.last .show-if-not-last { visibility: hidden; }

.repeated-chunk .repeated-chunk .repeated-chunk .show-if-not-only { visibility: visible; }
.repeated-chunk .repeated-chunk .repeated-chunk.only .show-if-not-only { visibility: hidden; }

/*
<DIV>s marked with to-be-removed is used in conjunction with repeatable.jelly and hetero-list.jelly
and represents a master copy that gets pulled out from HTML, then inserted later upon demand multiple times
when the user does "Add".
*/
div.to-be-removed { display: none; }

/* ========================= Other form related CSS ========================= */

.radioBlock-container {
Expand Down Expand Up @@ -1201,6 +1154,7 @@ div.to-be-removed { display: none; }
opacity: 0!important;
max-height: 0!important;
height: 0!important;
overflow: hidden;
}

.row-set-end { display: none; }
Expand Down Expand Up @@ -1231,31 +1185,6 @@ textarea.rich-editor {
visibility: hidden;
}

/* ========================= D&D support in heterogenous/repeatable lists = */

.hetero-list-container.with-drag-drop .repeated-chunk,
.repeated-container.with-drag-drop .repeated-chunk {
margin-top: 0.5em;
margin-bottom: 0.5em;
}

// SortableJS drag & drop classes
.repeated-chunk--sortable-ghost {
height: 100px;
width: 100%;
overflow: hidden;
}
.repeated-chunk--sortable-chosen {
height: 100px;
width: 100%;
background-color: transparent;
border: 2px solid var(--primary);

& > * {
display: none;
}
}

/* ========================= plugin update center ========================= */

#plugins .excerpt {
Expand Down
5 changes: 5 additions & 0 deletions war/src/main/less/base/yui-compatibility.less
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,8 @@ div.yahooTree td {
display: inline-block;
}
}

.yui-panel,
.yui-panel .bd {
background-color: var(--background) !important;
}
Loading

0 comments on commit a1aeca2

Please sign in to comment.