+ `);
this.timeline_wrapper.append(this.timeline_actions_wrapper);
this.timeline_wrapper.append(this.timeline_items_wrapper);
@@ -52,23 +56,12 @@ frappe.ui.form.NewTimeline = class {
this.timeline_items.push(...this.get_communication_timeline_contents());
this.timeline_items.push(...this.get_comment_timeline_contents());
this.timeline_items.push(...this.get_energy_point_timeline_contents());
- this.timeline_items.push(...this.get_share_timeline_contents());
this.timeline_items.push(...this.get_version_timeline_contents());
- this.timeline_items.push(...this.get_creation_timeline_content());
+ this.timeline_items.push(...this.get_share_timeline_contents());
// attachments
// milestones
}
- get_creation_timeline_content() {
- if (this.frm && this.frm.doc) {
- return [{
- icon: 'edit',
- creation: this.frm.doc.creation,
- content: __("{0} created", [this.get_user_link(this.frm.doc.owner)]),
- }];
- }
- }
-
get_user_link(user) {
const user_display_text = (frappe.user_info(user).fullname || '').bold();
return frappe.utils.get_form_link('User', user, true, user_display_text);
@@ -91,12 +84,14 @@ frappe.ui.form.NewTimeline = class {
`);
} else if (item.timeline_indicator) {
timeline_item.append(item.timeline_indicator);
+ } else {
+ timeline_item.append(`
`);
}
timeline_item.append(`
`);
timeline_item.find('.timeline-content').append(item.content);
if (!item.hide_timestamp && !item.card) {
- timeline_item.find('.timeline-content').append(` -
${comment_when(item.creation)}`);
+ timeline_item.find('.timeline-content').append(`
${comment_when(item.creation)}
`);
}
return timeline_item;
}
@@ -112,7 +107,6 @@ frappe.ui.form.NewTimeline = class {
`;
view_timeline_contents.push({
- icon: 'view',
creation: view.creation,
content: view_content,
});
@@ -153,7 +147,10 @@ frappe.ui.form.NewTimeline = class {
}
get_comment_timeline_content(doc) {
- const comment_content = frappe.render_template('timeline_message_box', { doc });
+ const comment_content = $(frappe.render_template('timeline_message_box', { doc }));
+
+ comment_content.find('.actions').append(`
${__("Edit")}`);
+ comment_content.find('.actions').append(`
${frappe.utils.icon('close', 'sm')}`);
return comment_content;
}
@@ -163,7 +160,6 @@ frappe.ui.form.NewTimeline = class {
const contents = get_version_timeline_content(version, this.frm);
contents.forEach((content) => {
version_timeline_contents.push({
- icon: 'edit',
creation: version.creation,
content: content,
});
@@ -174,14 +170,10 @@ frappe.ui.form.NewTimeline = class {
get_share_timeline_contents() {
let share_timeline_contents = [];
- (this.doc_info.shared || []).forEach(share => {
+ (this.doc_info.share_logs || []).forEach(share => {
share_timeline_contents.push({
- icon: 'share',
creation: share.creation,
- content: __("{0} shared this document with {1}", [
- this.get_user_link(share.owner),
- share.everyone ? 'everyone' : this.get_user_link(share.user)
- ]),
+ content: share.content,
});
});
return share_timeline_contents;
diff --git a/frappe/public/js/frappe/form/footer/version_timeline_content_builder.js b/frappe/public/js/frappe/form/footer/version_timeline_content_builder.js
index d3b5bc437c..5b78a1c0be 100644
--- a/frappe/public/js/frappe/form/footer/version_timeline_content_builder.js
+++ b/frappe/public/js/frappe/form/footer/version_timeline_content_builder.js
@@ -130,8 +130,8 @@ function get_version_timeline_content(version_doc, frm) {
}
});
- // creation by updater reference
if (data.creation && data.created_by) {
+ // created via automation
if (updater_reference_link) {
out.push(get_version_comment(version_doc, __('{0} created {1}', [get_user_link(version_doc), updater_reference_link])));
} else {
diff --git a/frappe/public/scss/global.scss b/frappe/public/scss/global.scss
index eeaf0c53b6..9fa266f911 100644
--- a/frappe/public/scss/global.scss
+++ b/frappe/public/scss/global.scss
@@ -361,4 +361,8 @@ kbd {
.criticism {
background-color: var(--criticism-bg) !important;
color: var(--criticism-color) !important;
+}
+
+.frappe-timestamp {
+ cursor: default;
}
\ No newline at end of file
diff --git a/frappe/public/scss/timeline.scss b/frappe/public/scss/timeline.scss
index c4b87171ab..5608b576cf 100644
--- a/frappe/public/scss/timeline.scss
+++ b/frappe/public/scss/timeline.scss
@@ -1,6 +1,6 @@
$timeline-item-icon-size: 34px;
$timeline-item-left-margin: var(--margin-xl);
-$threshold: 25;
+$threshold: 40;
@mixin timeline-indicator($indicator-size) {
width: $indicator-size;
@@ -11,11 +11,12 @@ $threshold: 25;
// please do not touch this sacred code
top: unquote("clamp(0px, 50% - #{$indicator-size}/2, max(0px, (#{$threshold}px - (50% - #{$indicator-size}/2)) * #{$threshold}))");
left: calc(-1 * (#{$indicator-size}/2));
- background-color: var(--gray-600);
+ background-color: var(--bg-color);
+ border: 1px solid var(--dark-border-color);
display: inline-flex;
align-items: center;
justify-content: center;
- --icon-stroke: var(--gray-50);
+ --icon-stroke: var(--gray-600);
}
.new-timeline {
@@ -29,18 +30,24 @@ $threshold: 25;
border-left: 1px solid var(--dark-border-color);
bottom: -150px; // arbitrary
}
+ .timeline-dot {
+ @include timeline-indicator(16px);
+ &:before {
+ content: ' ';
+ background: var(--gray-600);
+ border-radius: 50%;
+ height: 4px;
+ width: 4px;
+ }
+ }
.timeline-actions {
margin-bottom: var(--margin-md);
padding: var(--padding-sm);
position: relative;
- &:before {
- content: ' ';
- @include timeline-indicator(10px);
- }
.action-btn {
margin-left: var(--margin-md)
}
- .action-btn:first-child {
+ .action-btn:first-of-type {
margin-left: $timeline-item-left-margin;
}
}