fix: Gantt

- Update gantt to 0.5.0
- Move gantt styles to gantt.less
- Remove local lib files and use from node_modules
This commit is contained in:
Faris Ansari 2020-06-19 18:38:03 +05:30
parent 69fc7812ae
commit 49d6d54a24
7 changed files with 39 additions and 170 deletions

View file

@ -79,6 +79,10 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView {
});
}
render_header() {
}
render_gantt() {
const me = this;
const gantt_view_mode = this.view_user_settings.gantt_view_mode || 'Day';
@ -126,8 +130,8 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView {
var item = me.get_item(task.id);
var html =
`<h5>${task.name}</h5>
<p>${moment(task._start).format('MMM D')} - ${moment(task._end).format('MMM D')}</p>`;
`<div class="title">${task.name}</div>
<div class="subtitle">${moment(task._start).format('MMM D')} - ${moment(task._end).format('MMM D')}</div>`;
// custom html in doctype settings
var custom = me.settings.gantt_custom_popup_html;
@ -204,8 +208,8 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView {
get required_libs() {
return [
"assets/frappe/js/lib/frappe-gantt/frappe-gantt.css",
"assets/frappe/js/lib/frappe-gantt/frappe-gantt.min.js"
"assets/frappe/node_modules/frappe-gantt/dist/frappe-gantt.css",
"assets/frappe/node_modules/frappe-gantt/dist/frappe-gantt.min.js"
];
}
};

View file

@ -1,118 +0,0 @@
.gantt .grid-background {
fill: none; }
.gantt .grid-header {
fill: #ffffff;
stroke: #e0e0e0;
stroke-width: 1.4; }
.gantt .grid-row {
fill: #ffffff; }
.gantt .grid-row:nth-child(even) {
fill: #f5f5f5; }
.gantt .row-line {
stroke: #ebeff2; }
.gantt .tick {
stroke: #e0e0e0;
stroke-width: 0.2; }
.gantt .tick.thick {
stroke-width: 0.4; }
.gantt .today-highlight {
fill: #fcf8e3;
opacity: 0.5; }
.gantt .arrow {
fill: none;
stroke: #666;
stroke-width: 1.4; }
.gantt .bar {
fill: #b8c2cc;
stroke: #8D99A6;
stroke-width: 0;
transition: stroke-width .3s ease;
user-select: none; }
.gantt .bar-progress {
fill: #a3a3ff; }
.gantt .bar-invalid {
fill: transparent;
stroke: #8D99A6;
stroke-width: 1;
stroke-dasharray: 5; }
.gantt .bar-invalid ~ .bar-label {
fill: #555; }
.gantt .bar-label {
fill: #fff;
dominant-baseline: central;
text-anchor: middle;
font-size: 12px;
font-weight: lighter; }
.gantt .bar-label.big {
fill: #555;
text-anchor: start; }
.gantt .handle {
fill: #ddd;
cursor: ew-resize;
opacity: 0;
visibility: hidden;
transition: opacity .3s ease; }
.gantt .bar-wrapper {
cursor: pointer; }
.gantt .bar-wrapper:hover .bar {
fill: #a9b5c1; }
.gantt .bar-wrapper:hover .bar-progress {
fill: #8a8aff; }
.gantt .bar-wrapper:hover .handle {
visibility: visible;
opacity: 1; }
.gantt .bar-wrapper.active .bar {
fill: #a9b5c1; }
.gantt .bar-wrapper.active .bar-progress {
fill: #8a8aff; }
.gantt .lower-text, .gantt .upper-text {
font-size: 12px;
text-anchor: middle; }
.gantt .upper-text {
fill: #555; }
.gantt .lower-text {
fill: #333; }
.gantt .hide {
display: none; }
.gantt-container {
position: relative;
overflow: auto;
font-size: 12px; }
.gantt-container .popup-wrapper {
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
padding: 0;
color: #959da5;
border-radius: 3px; }
.gantt-container .popup-wrapper .title {
border-bottom: 3px solid #a3a3ff;
padding: 10px; }
.gantt-container .popup-wrapper .subtitle {
padding: 10px;
color: #dfe2e5; }
.gantt-container .popup-wrapper .pointer {
position: absolute;
height: 5px;
margin: 0 0 0 -5px;
border: 5px solid transparent;
border-top-color: rgba(0, 0, 0, 0.8); }

File diff suppressed because one or more lines are too long

View file

@ -19,3 +19,28 @@
.frappe-rtl .gantt {
direction: ltr;
}
.list-paging-area .gantt-view-mode {
margin-left: 15px;
margin-right: 15px;
}
.gantt-container {
.details-container {
min-width: 160px;
.heading {
margin-bottom: 10px;
font-size: 12px;
}
.avatar-small {
width: 16px;
height: 16px;
}
.standard-image {
display: block;
}
}
}

View file

@ -471,30 +471,6 @@ input.list-check-all, input.list-row-checkbox {
}
}
// gantt
.list-paging-area .gantt-view-mode {
margin-left: 15px;
margin-right: 15px;
}
.gantt {
.details-container {
.heading {
margin-bottom: 10px;
font-size: 12px;
}
.avatar-small {
width: 16px;
height: 16px;
}
.standard-image {
display: block;
}
}
}
.inbox-attachment, .inbox-link {
margin-right: 7px;
}

View file

@ -30,7 +30,7 @@
"fast-deep-equal": "^2.0.1",
"frappe-charts": "^1.3.2",
"frappe-datatable": "^1.15.1",
"frappe-gantt": "^0.1.0",
"frappe-gantt": "^0.5.0",
"fuse.js": "^3.4.6",
"highlight.js": "^9.18.1",
"js-sha256": "^0.9.0",

View file

@ -252,18 +252,6 @@
"@types/events" "*"
"@types/node" "*"
"@types/bunyan@*":
version "1.8.6"
resolved "https://registry.yarnpkg.com/@types/bunyan/-/bunyan-1.8.6.tgz#6527641cca30bedec5feb9ab527b7803b8000582"
integrity sha512-YiozPOOsS6bIuz31ilYqR5SlLif4TBWsousN2aCWLi5233nZSX19tFbcQUPdR7xJ8ypPyxkCGNxg0CIV5n9qxQ==
dependencies:
"@types/node" "*"
"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
"@types/debug@^4.1.4":
version "4.1.5"
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd"
@ -2283,10 +2271,10 @@ frappe-datatable@^1.15.1:
lodash "^4.17.5"
sortablejs "^1.7.0"
frappe-gantt@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/frappe-gantt/-/frappe-gantt-0.1.1.tgz#63b82669a89c3e92fe74dc121cb0e6578433f716"
integrity sha1-Y7gmaaicPpL+dNwSHLDmV4Qz9xY=
frappe-gantt@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/frappe-gantt/-/frappe-gantt-0.5.0.tgz#4dc7aa125f318efea64b4ae0e38f67a720238c1d"
integrity sha512-RAskVuBmnTcPJXh87oVhYmnNGy/9lvZlLHGui8QFB8yRBuUjzpZoZfZ+hKmDtBDmWNrE2/LRta06W5WmhTzzWQ==
fresh@0.5.2:
version "0.5.2"
@ -3529,7 +3517,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
lodash@4.17.15, lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.10:
lodash@4.17.15, lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.10:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
@ -4803,11 +4791,6 @@ prettier@^1.19.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
pretty-hrtime@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1"
integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=
process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"