mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge pull request #21027 from opf/bug/69053-inline-highlighted-attributes-checked-behavior
[#69053] Remove inline highlighted attribute behavior
This commit is contained in:
@@ -44,7 +44,7 @@ See COPYRIGHT and LICENSE files for more details.
|
||||
styled_form_tag(
|
||||
{ action: :update },
|
||||
method: :patch,
|
||||
data: { controller: "admin--work-packages-general-form show-when-value-selected" }
|
||||
data: { controller: "show-when-value-selected" }
|
||||
) do
|
||||
%>
|
||||
<section class="form--section">
|
||||
@@ -80,7 +80,7 @@ See COPYRIGHT and LICENSE files for more details.
|
||||
</div>
|
||||
<% if EnterpriseToken.allows_to? :conditional_highlighting %>
|
||||
<div
|
||||
class="form--field -indented -vertical settings--highlighted-attributes"
|
||||
class="form--field -indented -vertical"
|
||||
data-show-when-value-selected-target="effect"
|
||||
data-target-name="work_package_list_default_highlighting_mode"
|
||||
data-value="inline"
|
||||
@@ -88,7 +88,7 @@ See COPYRIGHT and LICENSE files for more details.
|
||||
<%= setting_multiselect(
|
||||
:work_package_list_default_highlighted_attributes,
|
||||
Query.available_columns(nil).select(&:highlightable).map do |column|
|
||||
[column.caption, column.name.to_s, { data: { admin__work_packages_general_form_target: "highlightedAttribute" }}]
|
||||
[column.caption, column.name.to_s]
|
||||
end
|
||||
) %>
|
||||
</div>
|
||||
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* -- copyright
|
||||
* OpenProject is an open source project management software.
|
||||
* Copyright (C) the OpenProject GmbH
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 3.
|
||||
*
|
||||
* OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
* Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
* Copyright (C) 2010-2013 the ChiliProject Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* See COPYRIGHT and LICENSE files for more details.
|
||||
* ++
|
||||
*/
|
||||
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class WorkPackagesGeneralFormController extends Controller<HTMLFormElement> {
|
||||
static targets = ['highlightedAttribute'];
|
||||
|
||||
declare readonly highlightedAttributeTargets:HTMLInputElement[];
|
||||
|
||||
private abortController:AbortController|null = null;
|
||||
|
||||
connect():void {
|
||||
this.abortController = new AbortController();
|
||||
const { signal } = this.abortController;
|
||||
|
||||
this.element.addEventListener('submit', this.onSubmit.bind(this), { signal });
|
||||
}
|
||||
|
||||
disconnect():void {
|
||||
this.abortController?.abort();
|
||||
this.abortController = null;
|
||||
}
|
||||
|
||||
private onSubmit() {
|
||||
const attributes = this.highlightedAttributeTargets;
|
||||
if (attributes.every((attr) => attr.checked)) {
|
||||
attributes.forEach((attr) => { attr.checked = false; });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user