Merge branch 'master' into customViews

This commit is contained in:
Safwan Samsudeen 2024-11-28 17:19:08 +05:30 committed by GitHub
commit a08de40f47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 19 additions and 1349 deletions

File diff suppressed because one or more lines are too long

1312
dist/frappe-gantt.es.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -108,10 +108,9 @@
// on_hover (task, x, y) {
// console.log("Hover", x, y);
// }
view_mode: 'Day',
view_mode: 'Custom Day',
view_mode_padding: { DAY: '3d' },
// popup_on: 'click',
custom_view_modes: [//option to add custom views
custom_view_modes: [
{
name: 'Custom Day',
padding: '1m',
@ -119,7 +118,8 @@
unit: "day",
}
]
// popup: false,
// popup_on: 'click',
// move_dependencies: false,
// scroll_to: 'today',
// view_mode_select: true,
// dates_readonly: true,

View File

@ -22,13 +22,13 @@
--dark-blue: #2c94ec;
}
.gantt-container {
line-height: 14.5px;
position: relative;
overflow: auto;
font-size: 12px;
height: 500px;
width: fit-content;
& .popup-wrapper {
position: absolute;
@ -158,7 +158,6 @@
}
}
.gantt {
user-select: none;
-webkit-user-select: none;
@ -217,7 +216,7 @@
stroke-width: 1;
stroke-dasharray: 5;
&~.bar-label {
& ~ .bar-label {
fill: var(--text-light);
}
}
@ -272,7 +271,6 @@
& .bar-wrapper {
cursor: pointer;
&.active {
& .handle {
visibility: visible;
@ -304,4 +302,4 @@
& .hide {
display: none;
}
}
}

View File

@ -36,6 +36,7 @@ const DEFAULT_OPTIONS = {
padding: 18,
view_mode: 'Day',
date_format: 'YYYY-MM-DD',
move_dependencies: true,
show_expected_progress: false,
popup: null,
popup_on: 'hover',
@ -1085,10 +1086,16 @@ export default class Gantt {
y_on_start = e.offsetY || e.layerY;
parent_bar_id = bar_wrapper.getAttribute('data-id');
const ids = [
parent_bar_id,
...this.get_all_dependent_tasks(parent_bar_id),
];
let ids;
if (this.options.move_dependencies) {
ids = [
parent_bar_id,
...this.get_all_dependent_tasks(parent_bar_id),
];
} else {
ids = [parent_bar_id];
}
console.log('BARS', ids);
bars = ids.map((id) => this.get_bar(id));
this.bar_being_dragged = parent_bar_id;