Skip to content

Commit 13ee8e0

Browse files
46275 feat(print): Add print styles and integrate print.css for improved printing functionality across components
1 parent c838cf8 commit 13ee8e0

6 files changed

Lines changed: 48 additions & 31 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* stylelint-disable declaration-no-important */
2+
@media print {
3+
html,
4+
body {
5+
overflow: visible !important;
6+
height: auto !important;
7+
}
8+
9+
[id='pneumatic-frontend'] {
10+
overflow: visible !important;
11+
height: auto !important;
12+
}
13+
14+
main .container-fluid .row {
15+
display: flex !important;
16+
}
17+
18+
* {
19+
print-color-adjust: exact;
20+
}
21+
22+
* {
23+
scrollbar-width: none;
24+
}
25+
26+
*::-webkit-scrollbar {
27+
display: none;
28+
}
29+
30+
.no-print {
31+
display: none !important;
32+
}
33+
}
34+

frontend/src/public/assets/css/style.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Table of Contents
33
// -------------------
44
// 00. Variables
5+
// 00.1. Print
56
// 01. Library
67
// 02. Reset style
78
// 03. Base style
@@ -14,6 +15,12 @@
1415

1516
@import './variables/color';
1617

18+
/* ===================
19+
// 00.1. Print
20+
// =================== */
21+
22+
@import './print/print.css';
23+
1724
/* ===================
1825
// 01. Library
1926
// ===================
@@ -93,4 +100,4 @@ svg {
93100
/* Fix bootstrap style */
94101
.form-control {
95102
font-size: 1.5rem !important;
96-
}
103+
}

frontend/src/public/components/TaskCard/TaskCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ export function TaskCard({
365365
<UsersDropdown
366366
isMulti
367367
controlSize="sm"
368-
className={styles['responsible']}
368+
className={classnames(styles['responsible'], 'no-print')}
369369
placeholder={formatMessage({ id: 'user.search-field-placeholder' })}
370370
options={[...performerGroupDropdownOption, ...performerDropdownOption]}
371371
value={[...performerDropdownValue, ...performerGroupDropdownValue]}
@@ -379,7 +379,7 @@ export function TaskCard({
379379
)}
380380

381381
{viewMode !== ETaskCardViewMode.Guest && !task.isReadOnlyViewer && (
382-
<GuestController ref={guestsControllerRef} taskId={task.id} className={styles['guest-dropdown']} />
382+
<GuestController ref={guestsControllerRef} taskId={task.id} className={classnames(styles['guest-dropdown'], 'no-print')} />
383383
)}
384384
</>
385385
);
@@ -497,7 +497,7 @@ export function TaskCard({
497497
);
498498

499499
return (
500-
<div className={styles['buttons']}>
500+
<div className={classnames(styles['buttons'], 'no-print')}>
501501
<div className={styles['buttons__complete']}>
502502
{isEmbeddedWorkflowsComplete ? (
503503
renderCompleteButton(!isEmbeddedWorkflowsComplete)

frontend/src/public/components/Workflows/WorkflowLog/WorkflowLog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export const WorkflowLog = ({
222222
}
223223

224224
return (
225-
<div className={styles['comment-field']}>
225+
<div className={classnames(styles['comment-field'], 'no-print')}>
226226
<PopupCommentFieldContainer sendComment={sendComment} taskId={taskId} mentions={mentions} />
227227
</div>
228228
);

frontend/src/public/components/Workflows/WorkflowLog/WorkflowLogEvents/WorkflowLogTaskComment/WorkflowLogTaskComment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export function WorkflowLogTaskComment({
158158
if (currentUserId !== userId || workflowStatus === EWorkflowStatus.Finished) return null;
159159

160160
return (
161-
<div className={styles['comment__actions']}>
161+
<div className={classnames(styles['comment__actions'], 'no-print')}>
162162
{renderDeleteButton()}
163163
{!isDelete && (
164164
<button
@@ -327,7 +327,7 @@ export function WorkflowLogTaskComment({
327327
<Tooltip
328328
visible={isShowTooltipEmoji}
329329
size="auto"
330-
containerClassName={classnames(styles['comment__footer-item'], styles['is-add-emoji'])}
330+
containerClassName={classnames(styles['comment__footer-item'], styles['is-add-emoji'], 'no-print')}
331331
content={
332332
isShowEmoji && (
333333
<Picker

frontend/src/public/layout/MainLayout/MainLayout.css

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,3 @@
55
flex-direction: column;
66
height: 100%;
77
}
8-
9-
/* Print styles need !important to override global #pneumatic-frontend and framework CSS. */
10-
/* stylelint-disable declaration-no-important */
11-
@media print {
12-
html,
13-
body {
14-
overflow: visible !important;
15-
height: auto !important;
16-
}
17-
18-
[id='pneumatic-frontend'] {
19-
overflow: visible !important;
20-
height: auto !important;
21-
}
22-
23-
main .container-fluid .row {
24-
display: flex !important;
25-
}
26-
27-
* {
28-
print-color-adjust: exact;
29-
}
30-
}
31-
/* stylelint-enable declaration-no-important */

0 commit comments

Comments
 (0)