Skip to content

Commit

Permalink
Merge pull request #3186 from archivesspace/ANW-2001-rde
Browse files Browse the repository at this point in the history
ANW-2001: Fix Staff Rapid Data Entry modal
  • Loading branch information
thimios committed May 22, 2024
2 parents dbad9e0 + fc84c2a commit 076a989
Show file tree
Hide file tree
Showing 12 changed files with 332 additions and 118 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.yaml
*.json
frontend/app/assets/stylesheets/vendor/
frontend/app/assets/stylesheets/jquery.*
frontend/vendor/
public/app/assets/javascripts/bootstrap-accessibility/
public/vendor/assets/javascripts/
19 changes: 0 additions & 19 deletions frontend/app/assets/javascripts/zelip.js

This file was deleted.

8 changes: 8 additions & 0 deletions frontend/app/assets/stylesheets/archivesspace/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ td .btn-group {
column-gap: 1rem;
}

.gap-x-4 {
column-gap: 1.5rem;
}

.gap-bs-x-15px {
column-gap: 15px; // because bootstrap `.row`s
}
Expand Down Expand Up @@ -322,3 +326,7 @@ td .btn-group {
color: var(--bs-text-body);
background-color: var(--light);
}

.colon-after::after {
content: ':';
}
138 changes: 132 additions & 6 deletions frontend/app/assets/stylesheets/archivesspace/rde.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import 'archivesspace/mixins';
@import 'bootstrap';
@import 'bootstrap/mixins';
@import '../jquery.kiketable.colsizable-1.1.css';

#rde_form {
.sections {
Expand All @@ -18,6 +19,7 @@
table {
border-collapse: separate;
border-spacing: 0;
padding-right: 1rem;
}

thead tr:first-child th {
Expand Down Expand Up @@ -90,8 +92,7 @@
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0.25rem;

a {
&:hover {
text-decoration: none;
Expand Down Expand Up @@ -144,12 +145,23 @@
/* Fix https://archivesspace.atlassian.net/browse/AR-1211 */
&.kiketable-th {
height: 30px !important;
padding: 0.25rem;
}

.kiketable-th-text {
height: auto;
line-height: 30px; // Vertically center text
}

.kiketable-colsizable-handler {
background-image: asset-url('archivesspace/drag_handle.png');
border: none;
position: relative;
height: 30px;
width: 4px;
right: -0.2rem;
float: right;
border: none;
background-image: asset-url('archivesspace/drag_handle.png');
cursor: e-resize;
}
}
td {
Expand Down Expand Up @@ -250,8 +262,7 @@
@include opacity(90);

z-index: 1;
@include box-shadow(1px 1px 3px #aaa);

box-shadow: 1px 1px 3px #aaa;
margin-left: -5px;
border-top: none;
background-color: $errorBackground;
Expand Down Expand Up @@ -369,3 +380,118 @@
.kiketable-colsizable td.overflow-visible {
overflow: visible;
}

// ANW-2001: Restore the Top Containers linker layout after the Bootstrap v4 upgrade
.rde-top-containers-linker-grid {
display: grid;
grid-template-columns: minmax(auto, 1fr) minmax(max-content, auto);
}
.rde-top-containers-linker-grid > ul.token-input-list {
order: 1;
width: 100%;
}
.rde-top-containers-linker-grid > div.input-group-append {
order: 2;
}
.rde-top-containers-linker-grid > section {
order: 3;
}

/* ANW-2001: Restore `.btn-group > .btn.btn-default` for the Top Containers
linker button after the Bootstrap v4 upgrade */
.rde-top-containers-linker {
position: relative;
margin-left: -1px;
flex: 1 1 auto;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-color: var(--secondary);
background-color: var(--white);
color: var(--bs-text-body);
cursor: pointer;
}
.rde-top-containers-linker:hover {
z-index: 1;
background-color: #e9ecef;
color: var(--bs-text-body);
}

/* ANW-2001: Restore `.btn.btn-default` styles for the footer
action buttons after the Bootstrap v4 upgrade */
#rapidDataEntryModal .btn.btn-default {
color: var(--bs-text-body);
background-color: var(--white);
border-color: var(--secondary);
cursor: pointer;
}
#rapidDataEntryModal .btn.btn-default:hover {
z-index: 1;
background-color: #e9ecef;
color: var(--bs-text-body);
}

// ANW-2001: Fix the RDE form toolbar
#rapidDataEntryModal [data-id='rde_select_template'] {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
line-height: 1.5;
border-radius: 0.2rem;
}

// ANW-2001: Fix the RDE 'Apply RDE Template' toolbar dropdown
// by rectifying the missing bootstrap-select.css
#rapidDataEntryModal
.bootstrap-select.btn-group
.dropdown-menu
li
a
span.check-mark {
display: none;
}

#rapidDataEntryModal .bootstrap-select.btn-group > .disabled {
cursor: not-allowed;
}
#rapidDataEntryModal .bootstrap-select.btn-group > .disabled:focus {
outline: none !important;
}

#rapidDataEntryModal .bootstrap-select.btn-group ul.dropdown-menu-inner {
> li {
> a {
display: block;
padding: 3px 20px;
font-weight: normal;
line-height: 1.4286;
color: #333;
white-space: nowrap;

&:hover,
&:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}

&:hover {
cursor: default;
}
}

&.selected:not(.disabled) > a {
color: #fff;
text-decoration: none;
outline: 0;
background-color: #2e6ea5;
}

&.disabled > a,
&.disabled > a:hover {
color: #262626;
text-decoration: none;
outline: 0;
background-color: #fff;
cursor: not-allowed;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.kiketable-colsizable{
table-layout: fixed;
width : 100%;
position: relative;
}
.kiketable-colsizable td,
.kiketable-colsizable th{
overflow : hidden;
}
.kiketable-th{
/* Don't set "position: relative" in IE */
white-space: nowrap !important; /* Only works for THs in IE */
text-align: left;
height: 18px; /* value safe to change */
}
.kiketable-th-text{
height: 100%;
overflow: hidden;
}
.kiketable-colsizable-handler{
float: right;
cursor: e-resize;
height: 100%;
border-left:2px outset white;
border-right:2px inset white;
position: relative;
right: -4px;
}
html > body .kiketable-colsizable-handler{
border-right:1px outset white;
}
.kiketable-colsizable-dragLine{
display: none;
}
.kiketable-colsizable-dragArea{
position: absolute;
cursor: e-resize;
background-color:red; /* value safe to change */
background-color: #000;
}
.kiketable-colsizable-minimized{
background-color: #ffd; /* value safe to change */
color: #bbb; /* value safe to change */
}
11 changes: 5 additions & 6 deletions frontend/app/views/archival_objects/_rde_templates.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<% define_template "rde_archival_object_row", jsonmodel_definition(:archival_object) do |form, archival_object| %>
<% first_row = form.current_context.first == "children[0]" %>
<tr>
<td data-col="status" class="status">
<td data-col="status" class="status p-1">
<span class="glyphicon glyphicon-exclamation-sign invalid"></span>
<span class="glyphicon glyphicon-ok valid"></span>
<div class="error-summary">
Expand Down Expand Up @@ -420,11 +420,10 @@
<%= form.checkbox "publish", {}, false %>
<% end %>
</td>
<td data-col="actions" class="form-group">
<div class="btn-group">
<button class="btn btn-success add-row"><span class="glyphicon glyphicon-plus icon-white"></span></button>
<% if !first_row %><button class="btn remove-row btn-default"><span class="glyphicon glyphicon-remove"></span></button><% end %>
</div>
<td data-col="actions" class="form-group px-1">
<% if !first_row %><div class="btn-group"><% end %>
<button class="btn btn-success add-row"><span class="glyphicon glyphicon-plus icon-white"></span></button>
<% if !first_row %><button class="btn remove-row btn-default"><span class="glyphicon glyphicon-remove"></span></button></div><% end %>
</td>
</tr>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<% define_template "rde_digital_object_component_row", jsonmodel_definition(:digital_object_component) do |form, digital_object_component| %>
<% first_row = form.current_context.first == "children[0]" %>
<tr data-index="">
<td data-col="status" class="status">
<td data-col="status" class="status p-1">
<span class="glyphicon glyphicon-exclamation-sign invalid"></span>
<span class="glyphicon glyphicon-ok valid"></span>
<div class="error-summary">
Expand Down Expand Up @@ -345,11 +345,10 @@
<% end %>
</td>

<td data-col="actions" class="form-group">
<div class="btn-group">
<button class="btn btn-success add-row"><span class="glyphicon glyphicon-plus icon-white"></span></button>
<% if !first_row %><button class="btn remove-row"><span class="glyphicon glyphicon-remove"></span></button><% end %>
</div>
<td data-col="actions" class="form-group px-1">
<% if !first_row %><div class="btn-group"><% end %>
<button class="btn btn-success add-row"><span class="glyphicon glyphicon-plus icon-white"></span></button>
<% if !first_row %><button class="btn remove-row btn-default"><span class="glyphicon glyphicon-remove"></span></button></div><% end %>
</td>
</tr>
<% end %>
6 changes: 3 additions & 3 deletions frontend/app/views/notes/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

add_button_text ||= "note._frontend.action.add"

add_note_class = 'add-note btn btn-sm btn-default ml-auto'
add_note_class = 'add-note btn btn-sm btn-default'
help_link = link_to_help :topic => "#{form['jsonmodel_type']}_notes"
add_note_class += ' mt-3 mr-3 mb-3' if help_link.nil?
%>
Expand All @@ -26,7 +26,7 @@
</<%= header_size%>>

<% if show_apply_note_order_action %>
<div class="btn-group ml-auto">
<div class="btn-group">
<% end %>
<% unless form.readonly? %>
Expand All @@ -39,7 +39,7 @@
<% if show_apply_note_order_action %>
<button
class="btn btn-sm btn-default ml-auto apply-note-order"
class="btn btn-sm btn-default apply-note-order"
disabled="disabled"
type="button"
data-action="apply note order"
Expand Down
Loading

0 comments on commit 076a989

Please sign in to comment.