feature/IO-3291-Tasks-Notifications: Checkpoint

This commit is contained in:
Dave Richer
2025-07-08 11:38:18 -04:00
parent 9845c1cea5
commit 443ed717cb
2 changed files with 113 additions and 29 deletions

View File

@@ -169,6 +169,7 @@ function Header(props) {
setTaskCenterVisible(false); // Close task center setTaskCenterVisible(false); // Close task center
return; return;
} }
if (isTaskCenterClick) { if (isTaskCenterClick) {
setNotificationVisible(scenarioNotificationsOn ? false : notificationVisible); // Close notification center if enabled setNotificationVisible(scenarioNotificationsOn ? false : notificationVisible); // Close notification center if enabled
return; return;
@@ -177,6 +178,7 @@ function Header(props) {
if (taskCenterVisible && taskCenterRef.current && !taskCenterRef.current.contains(event.target)) { if (taskCenterVisible && taskCenterRef.current && !taskCenterRef.current.contains(event.target)) {
setTaskCenterVisible(false); setTaskCenterVisible(false);
} }
if ( if (
scenarioNotificationsOn && scenarioNotificationsOn &&
notificationVisible && notificationVisible &&
@@ -213,9 +215,10 @@ function Header(props) {
}, },
[handleMenuClick] [handleMenuClick]
); );
// --- Menu Items --- // --- Menu Items ---
// built externally to keep the component clean // built externally to keep the component clean, but on this level to prevent unnecessary re-renders
const accountingChildren = useMemo( const accountingChildren = useMemo(
() => () =>
buildAccountingChildren({ buildAccountingChildren({

View File

@@ -2,65 +2,146 @@
position: absolute; position: absolute;
top: 64px; top: 64px;
right: 0; right: 0;
z-index: 1000;
width: 400px; width: 400px;
max-height: 500px; max-width: 400px;
background: #fff; background: #fff;
border-left: 1px solid #ccc; color: rgba(0, 0, 0, 0.85);
box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.1); border: 1px solid #d9d9d9;
overflow: hidden; border-radius: 6px;
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.06);
z-index: 1000;
display: none; display: none;
overflow-x: hidden;
&.visible { &.visible {
display: block; display: block;
} }
.task-header { .task-header {
padding: 4px 16px;
border-bottom: 1px solid #f0f0f0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 8px 12px; background: #fafafa;
background-color: #f5f5f5;
border-bottom: 1px solid #ddd;
}
.task-toggle { h3 {
display: flex; margin: 0;
align-items: center;
gap: 4px;
.anticon {
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.85);
}
.task-controls {
display: flex;
align-items: center;
gap: 8px;
.task-toggle {
align-items: center;
.anticon {
font-size: 14px;
color: #1677ff;
vertical-align: middle;
}
}
.ant-switch {
&.ant-switch-small {
min-width: 28px;
height: 16px;
line-height: 16px;
.ant-switch-handle {
width: 12px;
height: 12px;
}
&.ant-switch-checked {
background-color: #1677ff;
.ant-switch-handle {
left: calc(100% - 14px);
}
}
}
}
.ant-btn-link {
padding: 0;
color: #1677ff;
&:hover {
color: #69b1ff;
}
&:disabled {
color: rgba(0, 0, 0, 0.25);
cursor: not-allowed;
}
}
} }
} }
.task-item { .task-item {
padding: 12px; padding: 12px 16px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
display: block;
overflow: visible;
width: 100%;
box-sizing: border-box;
cursor: pointer; cursor: pointer;
transition: background-color 0.2s;
&:hover { &:hover {
background-color: #fafafa; background: #fafafa;
} }
&.task-completed { &.task-completed {
opacity: 0.6; background: #fff;
color: rgba(0, 0, 0, 0.65);
} }
.ro-number { &.task-incomplete {
font-weight: bold; background: #f5f5f5;
margin-right: 8px; color: rgba(0, 0, 0, 0.85);
}
.task-content {
width: 100%;
}
.task-title {
margin: 0;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
box-sizing: border-box;
.ro-number {
margin: 0;
color: #1677ff;
flex-shrink: 0;
white-space: nowrap;
}
.relative-time {
margin: 0;
font-size: 12px;
color: rgba(0, 0, 0, 0.45);
white-space: nowrap;
flex-shrink: 0;
margin-left: auto;
}
} }
.task-body { .task-body {
display: block;
margin-top: 4px; margin-top: 4px;
} color: inherit;
.relative-time {
float: right;
font-size: 0.8em;
} }
} }
.ant-badge {
width: 100%;
}
} }