Patch #41827 » v3_01_cf_name_limit_and_ui_fixes.patch
| app/models/custom_field.rb | ||
|---|---|---|
|
|
||
|
validates_presence_of :name, :field_format
|
||
|
validates_uniqueness_of :name, :scope => :type, :case_sensitive => true
|
||
|
validates_length_of :name, :maximum => 30
|
||
|
validates_length_of :name, maximum: 255
|
||
|
validates_length_of :regexp, maximum: 255
|
||
|
validates_inclusion_of :field_format,
|
||
|
:in => proc {Redmine::FieldFormat.available_formats}
|
||
| /dev/null → db/migrate/20241016120800_change_custom_fields_name_limit.rb | ||
|---|---|---|
|
class ChangeCustomFieldsNameLimit < ActiveRecord::Migration[7.2]
|
||
|
def up
|
||
|
change_column :custom_fields, :name, :string, limit: 255, default: ''
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
change_column :custom_fields, :name, :string, limit: 30, default: ''
|
||
|
end
|
||
|
end
|
||
| test/unit/custom_field_test.rb | ||
|---|---|---|
|
assert field.save
|
||
|
end
|
||
|
|
||
|
def test_name_should_be_validated
|
||
|
field = CustomField.new(name: 'Very long custom field name' * 10, field_format: 'int')
|
||
|
assert field.invalid?
|
||
|
end
|
||
|
|
||
|
def test_default_value_should_be_validated
|
||
|
field = CustomField.new(:name => 'Test', :field_format => 'int')
|
||
|
field.default_value = 'abc'
|
||
|
-
|
||
| app/assets/stylesheets/application.css | ||
|---|---|---|
|
#list-definition > div .field{
|
||
|
width: 160px;
|
||
|
}
|
||
|
.query-columns { max-width: min(58vw, 500px); }
|
||
|
.query-columns label {
|
||
|
display:block;
|
||
|
}
|
||
| ... | ... | |
|
}
|
||
|
.query-columns select {
|
||
|
min-width:150px;
|
||
|
width: 100%;
|
||
|
}
|
||
|
.query-columns select option {
|
||
|
overflow: hidden;
|
||
|
text-overflow: ellipsis;
|
||
|
}
|
||
|
#query_form fieldset#options select#group_by,
|
||
|
#query-form fieldset#options select#query_group_by {
|
||
|
max-width: 500px;
|
||
|
width: 100%;
|
||
|
}
|
||
|
#query-form fieldset#sort select {
|
||
|
max-width:min(36vw, 500px);
|
||
|
}
|
||
|
|
||
|
.query-totals {text-align:right; margin-top:-2.3em; font-size: 93%;}
|
||
| ... | ... | |
|
}
|
||
|
|
||
|
.add-filter {width:35%; float:right; text-align: right; vertical-align: top;}
|
||
|
.add-filter select { max-width: 70%; }
|
||
|
|
||
|
#issue_is_private_wrap {float:right; margin-right:1em;}
|
||
|
.toggle-multiselect { margin-right:5px; cursor:pointer;}
|
||
|
-
|
||
| app/assets/javascripts/application-legacy.js | ||
|---|---|---|
|
|
||
|
// columns selection
|
||
|
function moveOptions(theSelFrom, theSelTo) {
|
||
|
$(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
|
||
|
$(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo)).
|
||
|
filter('[title]').tooltip("close");
|
||
|
}
|
||
|
|
||
|
function moveOptionUp(theSel) {
|
||
| ... | ... | |
|
}
|
||
|
|
||
|
function setupHoverTooltips(container) {
|
||
|
$(".js-overflow-to-tooltip").each(function () {
|
||
|
const currentTitle = this.getAttribute('title');
|
||
|
if ((this.scrollWidth > this.clientWidth ||
|
||
|
this.scrollHeight > this.clientHeight) &&
|
||
|
!currentTitle) {
|
||
|
this.setAttribute('title', this.textContent);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$(container || 'body').find("[title]:not(.no-tooltip)").tooltip({
|
||
|
show: {
|
||
|
delay: 400
|
||
| ... | ... | |
|
button.click(function(e){
|
||
|
main.addClass("animate");
|
||
|
main.toggleClass('collapsedsidebar');
|
||
|
setupHoverTooltips();
|
||
|
applyState();
|
||
|
e.preventDefault();
|
||
|
return false;
|
||
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
|
||
|
def query_available_inline_columns_options(query)
|
||
|
(query.available_inline_columns - query.columns).
|
||
|
reject(&:frozen?).collect {|column| [column.caption, column.name]}
|
||
|
reject(&:frozen?).collect {|column| column_select_option(column)}
|
||
|
end
|
||
|
|
||
|
def query_selected_inline_columns_options(query)
|
||
|
(query.inline_columns & query.available_inline_columns).
|
||
|
reject(&:frozen?).collect {|column| [column.caption, column.name]}
|
||
|
reject(&:frozen?).collect {|column| column_select_option(column)}
|
||
|
end
|
||
|
|
||
|
def column_select_option(column)
|
||
|
[column.caption, column.name, {class: 'js-overflow-to-tooltip'}]
|
||
|
end
|
||
|
|
||
|
def render_query_columns_selection(query, options={})
|
||
| app/views/my/blocks/_issues.erb | ||
|---|---|---|
|
<div class="contextual">
|
||
|
<%= link_to_function sprite_icon('settings', l(:label_options)), "$('##{block}-settings').toggle();", :class => 'icon-only icon-settings', :title => l(:label_options) %>
|
||
|
<%= link_to_function sprite_icon('settings', l(:label_options)), "$('##{block}-settings').toggle(); setupHoverTooltips();", :class => 'icon-only icon-settings', :title => l(:label_options) %>
|
||
|
</div>
|
||
|
|
||
|
<h3>
|
||
| app/views/queries/_query_form.html.erb | ||
|---|---|---|
|
|
||
|
<% if @query.available_columns.any? %>
|
||
|
<fieldset id="options" class="collapsible collapsed">
|
||
|
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
|
||
|
<legend onclick="toggleFieldset(this); setupHoverTooltips();" class="icon icon-collapsed">
|
||
|
<%= sprite_icon("angle-right", rtl: true) %>
|
||
|
<%= l(:label_options) %>
|
||
|
</legend>
|
||
| ... | ... | |
|
$('input[name=display_type]').change(function (e) {
|
||
|
if ($("#display_type_list").is(':checked')) {
|
||
|
$('table#list-definition').show();
|
||
|
setupHoverTooltips();
|
||
|
} else {
|
||
|
$('table#list-definition').hide();
|
||
|
}
|
||
|
-
|
||
| app/assets/stylesheets/application.css | ||
|---|---|---|
|
max-width:min(36vw, 500px);
|
||
|
}
|
||
|
|
||
|
.query-totals {text-align:right; margin-top:-2.3em; font-size: 93%;}
|
||
|
.query-totals {text-align:right; font-size: 93%;}
|
||
|
.query-totals>span:not(:first-child) {margin-left:0.6em;}
|
||
|
.query-totals .value {font-weight:bold;}
|
||
|
body.controller-timelog .query-totals {margin-top:initial;}
|
||
|
-
|
||
| app/assets/javascripts/application-legacy.js | ||
|---|---|---|
|
},
|
||
|
position: {
|
||
|
my: "center bottom-5",
|
||
|
at: "center top"
|
||
|
at: "center top",
|
||
|
collision: "flipfit flip"
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
-
|
||
- « Previous
- 1
- …
- 5
- 6
- 7
- Next »