Skip to content

Commit

Permalink
feat: replace HistoryRecord to harmony view
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVorop committed Apr 10, 2024
1 parent 2fdf221 commit e60ced3
Show file tree
Hide file tree
Showing 8 changed files with 256 additions and 420 deletions.
16 changes: 4 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@sentry/nextjs": "7.99.0",
"@tanstack/react-query": "4.29.5",
"@tanstack/react-query-devtools": "4.29.6",
"@taskany/bricks": "5.26.1",
"@taskany/bricks": "5.27.0",
"@taskany/colors": "1.13.0",
"@taskany/icons": "2.0.7",
"@tippyjs/react": "4.2.6",
Expand Down
52 changes: 27 additions & 25 deletions src/components/GoalActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,34 @@ export const GoalActivity = forwardRef<HTMLDivElement, GoalActivityProps>(
<ActivityFeed ref={ref}>
{header}

{unionFeed.map((item) =>
nullable(item, ({ type, value }) => {
if (type === 'history') {
return (
<HistoryRecordGroup
key={`${type}.${value.length}${value.at(-1)?.id ?? ''}`}
subject={value[value.length - 1].subject}
groupped={value.length > 1}
values={value.map(
({ id, action, author, subject, nextValue, previousValue, createdAt }) => ({
author,
from: previousValue,
to: nextValue,
action,
id,
subject,
createdAt,
}),
)}
/>
);
}
<div>
{unionFeed.map((item) =>
nullable(item, ({ type, value }) => {
if (type === 'history') {
return (
<HistoryRecordGroup
key={`${type}.${value.length}${value.at(-1)?.id ?? ''}`}
subject={value[value.length - 1].subject}
groupped={value.length > 1}
values={value.map(
({ id, action, author, subject, nextValue, previousValue, createdAt }) => ({
author,
from: previousValue,
to: nextValue,
action,
id,
subject,
createdAt,
}),
)}
/>
);
}

return <React.Fragment key={value.id}>{renderCommentItem(value)}</React.Fragment>;
}),
)}
return <React.Fragment key={value.id}>{renderCommentItem(value)}</React.Fragment>;
}),
)}
</div>

{footer}
</ActivityFeed>
Expand Down
4 changes: 3 additions & 1 deletion src/components/HistoryRecord/HistoryRecord.i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
"partner project": "",
"author and more made changes in": "{author} and {count} more made changes in{space}{subject}",
"author and the other author made changes in": "{author} and {oneMoreAuthor} made changes in{space}{subject}",
"author made changes in": "{author} made changes in{space}{subject}"
"author made changes in": "{author} made changes in{space}{subject}",
"Expand changes": "",
"Collapse changes": ""
}
6 changes: 4 additions & 2 deletions src/components/HistoryRecord/HistoryRecord.i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
"to": "на",
"replace": "заменил(а)",
"as completed": "как выполненный",
"as uncompleted": "как не выполненный",
"as uncompleted": "как невыполненный",
"as criteria": "как критерий",
"goal complete": "выполнил(а) цель",
"goal in progress": "вернул(а) цель в работу",
"partner project": "партнерский проект",
"author and more made changes in": "{author} и еще {count} внесли изменения в{space}{subject}",
"author and the other author made changes in": "{author} и {oneMoreAuthor} внесли изменения в{space}{subject}",
"author made changes in": "{author} внес(ла) изменения в{space}{subject}"
"author made changes in": "{author} внес(ла) изменения в{space}{subject}",
"Expand changes": "Развернуть изменения",
"Collapse changes": "Свернуть изменения"
}
24 changes: 24 additions & 0 deletions src/components/HistoryRecord/HistoryRecord.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.HistoryRecordLongTextChangeButton {
display: inline-block;
}

.HistoryInlineBadge {
display: inline-flex;
}

.HistoryBadge {
line-height: 1;
}

.HistoryUserBadge {
position: relative;
bottom: -7px;
}

.HistoryRecordText {
color: var(--text-secondary);
}

.HistoryRecordTextPrimary {
color: var(--text-primary);
}
Loading

0 comments on commit e60ced3

Please sign in to comment.