Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/*
*.db
*.ts
force-app/main/default/lwc/.eslintrc.json
force-app/main/default/lwc/jsconfig.json
2 changes: 1 addition & 1 deletion .sfdx/sfdx-config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"defaultdevhubusername": "my-hub-org",
"defaultusername": "ADK"
"defaultusername": "gantt-chart2"
}
6 changes: 4 additions & 2 deletions config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"orgName": "spencerhsieh Company",
"edition": "Developer",
"orgPreferences" : {
"enabled": ["S1DesktopEnabled"]
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
}
}
}
4 changes: 2 additions & 2 deletions force-app/main/default/lwc/gantt_chart/gantt_chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1 class="slds-text-heading_medium slds-truncate">
<div class="slds-grid">
<template for:each={dates} for:item="date">
<div
key={date}
key={date.name}
class="slds-col lwc-timeline_month-container"
style={date.style}
>
Expand All @@ -106,7 +106,7 @@ <h1 class="slds-text-heading_medium slds-truncate">
</div>
<div class="slds-grid">
<template for:each={date.days} for:item="day">
<div key={day} class={day.class}>
<div key={day.label} class={day.class}>
<div if:true={day.dayName}>{day.dayName}</div>
<div>{day.label}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3 class="slds-text-body_small slds-text-color_weak">
<!-- Time Slots-->
<div class="slds-grid slds-is-absolute lwc-timeslots-container">
<template for:each={times} for:item="time" for:index="index">
<div key={time} class={time.class} data-index={index} data-start={time.start} data-end={time.end}
<div key={time.start} class={time.class} data-index={index} data-start={time.start} data-end={time.end}
onclick={handleTimeslotClick} ondragenter={handleDragEnter}>
<!-- nothing -->
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,25 @@ export default class GanttChartResource extends LightningElement {
id: projectId,
allocations: []
};

/*
self.resource.allocationsByProject[projectId].forEach(allocation => {
allocation.class = self.calcClass(allocation);
allocation.style = self.calcStyle(allocation);
allocation.labelStyle = self.calcLabelStyle(allocation);

project.allocations.push(allocation);
});
*/
//fix for Uncaught (in promise) TypeError: 'set' on proxy: trap returned falsish for property 'class'
self.resource.allocationsByProject[projectId].forEach(allocation2 => {

let allocation = JSON.parse(JSON.stringify(allocation2))
allocation.class = self.calcClass(allocation);
allocation.style = self.calcStyle(allocation);
allocation.labelStyle = self.calcLabelStyle(allocation);

project.allocations.push(allocation);
});

self.projects.push(project);
});
Expand Down