Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions modules/issue_tracker/css/issue_tracker_batchmode.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
flex-direction: column;
max-width: 1000px;
margin: 0 auto;
padding-bottom: 140px;
}

.filter-tabs {
Expand Down Expand Up @@ -211,3 +212,131 @@
margin-left: auto;
margin-right: 10px;
}

.batch-collapse-button {
margin-left: auto;
padding: 0 10px;
color: inherit;
}

.batch-selection-controls {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 15px;
padding: 10px;
}

.batch-select-all-control {
display: flex;
align-items: center;
margin: 0;
}

.batch-select-all-control .checkbox {
margin: 0 8px 0 0;
}

.batch-section-title {
flex-basis: 100%;
margin: 0;
padding-bottom: 8px;
border-bottom: 1px solid #ddd;
font-size: 14px;
font-weight: bold;
}

.batch-changes-title {
margin: 10px 10px 0;
}

.batch-edit-controls {
display: grid;
grid-template-columns: repeat(5, minmax(150px, 1fr));
align-items: end;
gap: 15px;
padding: 10px;
}

.batch-edit-controls label {
margin: 0;
}

.batch-edit-controls select {
margin-top: 5px;
}

.batch-update-button {
white-space: nowrap;
}

.batch-actions-panel {
position: fixed;
right: 20px;
bottom: 20px;
z-index: 1030;
width: 360px;
padding: 12px;
border: 1px solid #9aafc4;
border-radius: 4px;
background-color: #fff;
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.batch-actions-header,
.batch-action-buttons {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}

.batch-scroll-button {
white-space: nowrap;
}

.batch-actions-summary {
margin: 10px 0;
padding: 8px 0;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}

.batch-action-buttons .btn {
flex: 1;
}

.issue-card.batch-selected {
border-color: #074785;
}

.issue-card.batch-selected .issue-header {
margin: -20px -20px 15px;
padding: 12px 20px;
border-radius: 8px 8px 0 0;
background-color: #e4edf5;
}

.issue-selection-checkbox {
flex: 0 0 auto;
margin: 0 8px 0 0;
}

@media (max-width: 900px) {
.batch-edit-controls {
grid-template-columns: repeat(2, minmax(150px, 1fr));
}
}

@media (max-width: 500px) {
.batch-edit-controls {
grid-template-columns: 1fr;
}

.batch-actions-panel {
right: 10px;
bottom: 10px;
left: 10px;
width: auto;
}
}
23 changes: 21 additions & 2 deletions modules/issue_tracker/jsx/IssueCard.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useState} from 'react';
import React, {useEffect, useState} from 'react';
import PropTypes from 'prop-types';
import swal from 'sweetalert2';
import Modal from 'jsx/Modal';
Expand All @@ -18,6 +18,8 @@ const IssueCard = React.memo(function IssueCard(props) {
sites,
assignees,
otherWatchers,
isSelected,
onToggleSelection,
} = props;

const [isEditing, setIsEditing] = useState(false);
Expand All @@ -32,6 +34,11 @@ const IssueCard = React.memo(function IssueCard(props) {
const [newAssignee, setNewAssignee] = useState(issue.assignee || '');
const [newWatchers, setNewWatchers] = useState(issue.othersWatching || []);

useEffect(() => {
setEditedIssue({...issue});
setTempEditedIssue({...issue});
}, [issue]);

const handleInputChange = (field, value) => {
setTempEditedIssue((prev) => ({
...prev,
Expand Down Expand Up @@ -208,7 +215,7 @@ const IssueCard = React.memo(function IssueCard(props) {
const description = editedIssue.description || '';

return (
<div className="issue-card">
<div className={'issue-card' + (isSelected ? ' batch-selected' : '')}>
<Modal
title={t('Add New Comment', {ns: 'issue_tracker'})}
onClose={handleCloseAddCommentModal}
Expand Down Expand Up @@ -288,6 +295,16 @@ const IssueCard = React.memo(function IssueCard(props) {
</Modal>
<div className="issue-header">
<div className="issue-title-section">
{onToggleSelection && (
<input
type="checkbox"
checked={isSelected}
onChange={onToggleSelection}
className="issue-selection-checkbox"
aria-label={`${t('Select issue', {ns: 'issue_tracker'})} ` +
`#${issue.issueID}`}
/>
)}
<h3>
<span className="issue-id">#{issue.issueID}</span>
{isEditing ? (
Expand Down Expand Up @@ -572,6 +589,8 @@ IssueCard.propTypes = {
sites: PropTypes.object.isRequired,
assignees: PropTypes.object.isRequired,
otherWatchers: PropTypes.object.isRequired,
isSelected: PropTypes.bool,
onToggleSelection: PropTypes.func,
t: PropTypes.func,
};

Expand Down
Loading
Loading