-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(arc): created demo component to demo all the gantt component
created demo component to demo all the gantt component GH-58
- Loading branch information
1 parent
f1c79b0
commit 5e2bdda
Showing
12 changed files
with
217 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 17 additions & 5 deletions
22
...ects/arc-lib/src/lib/components/gantt/components/gantt-header/gantt-header.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
...ts/arc-lib/src/lib/components/gantt/components/gantt-tooltip/gantt-tooltip.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
projects/arc/src/app/components/gantt-demo/gantt-demo.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<nb-layout> | ||
<nb-layout-header fixed class="border-basic-bottom"> | ||
<div class="header-wrapper"> | ||
<div class="header"> | ||
<arc-gantt-header | ||
[desc]="headerDesc" | ||
[name]="headerName" | ||
[searchPlaceholder]="headerSearchPlaceholder" | ||
[showSearch]="headerShowSearch" | ||
></arc-gantt-header> | ||
</div> | ||
</div> | ||
</nb-layout-header> | ||
<nb-sidebar> | ||
<div class="sidebar"> | ||
<arc-gantt-column | ||
[items]="items" | ||
[showParentInitials]="showParentInitials" | ||
[showChildInitials]="showChildInitials" | ||
[showOverallocatedIcon]="showOverallocatedIcon" | ||
></arc-gantt-column> | ||
</div> | ||
</nb-sidebar> | ||
<nb-layout-column> | ||
<nb-card> | ||
<nb-card-header> </nb-card-header> | ||
<nb-card-body> | ||
<arc-gantt-bars | ||
[item]="item" | ||
[allocationTypes]="allocationTypes" | ||
[allocationBase]="allocationBase" | ||
></arc-gantt-bars> | ||
</nb-card-body> | ||
</nb-card> | ||
</nb-layout-column> | ||
|
||
<arc-gantt-tooltip [item]="selectedItem"></arc-gantt-tooltip> | ||
</nb-layout> |
Empty file.
23 changes: 23 additions & 0 deletions
23
projects/arc/src/app/components/gantt-demo/gantt-demo.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { GanttDemoComponent } from './gantt-demo.component'; | ||
|
||
describe('GanttDemoComponent', () => { | ||
let component: GanttDemoComponent; | ||
let fixture: ComponentFixture<GanttDemoComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ GanttDemoComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(GanttDemoComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
101 changes: 101 additions & 0 deletions
101
projects/arc/src/app/components/gantt-demo/gantt-demo.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import {Component} from '@angular/core'; | ||
import {NbSidebarService} from '@nebular/theme'; | ||
import {Item, empData} from '@project-lib/components/gantt/model/item.model'; | ||
|
||
@Component({ | ||
selector: 'arc-gantt-demo', | ||
templateUrl: './gantt-demo.component.html', | ||
styleUrls: ['./gantt-demo.component.scss'], | ||
}) | ||
export class GanttDemoComponent { | ||
// data for tooltip component | ||
showTooltip = false; | ||
selectedItem: Item; | ||
|
||
onBarHovered(itemData: Item) { | ||
this.selectedItem = itemData; | ||
this.showTooltip = true; | ||
} | ||
|
||
onBarMouseLeave() { | ||
this.showTooltip = false; | ||
} | ||
|
||
itemData: Item = { | ||
allocatedHours: 1600, | ||
billingRate: 100, | ||
startDate: new Date('2024-01-01'), | ||
endDate: new Date('2024-12-31'), | ||
allotedDeals: [ | ||
{name: 'Deal 1', allocatedHours: 800, status: 'approved'}, | ||
{name: 'Deal 2', allocatedHours: 900, status: 'pending'}, | ||
], | ||
}; | ||
|
||
allocationMap = new Map<string, boolean>([ | ||
['Deal 1', true], | ||
['Deal 2', false], | ||
]); | ||
|
||
// Data for GanttColumnComponent | ||
items: empData[] = [ | ||
{ | ||
name: 'john Doe ', | ||
subtitle: 'Manager', | ||
hasChildren: false, | ||
isParent: false, | ||
$open: false, | ||
overallocated: false, | ||
}, | ||
{ | ||
name: 'kelly', | ||
subtitle: 'Assistant Manager', | ||
hasChildren: false, | ||
isParent: false, | ||
$open: false, | ||
overallocated: false, | ||
}, | ||
{ | ||
name: 'Clove', | ||
subtitle: 'Software Developer', | ||
hasChildren: false, | ||
isParent: false, | ||
$open: false, | ||
overallocated: false, | ||
}, | ||
{ | ||
name: 'Classy', | ||
subtitle: 'DevOps', | ||
hasChildren: false, | ||
isParent: false, | ||
$open: false, | ||
overallocated: false, | ||
}, | ||
]; | ||
showParentInitials = true; | ||
showChildInitials = true; | ||
showOverallocatedIcon = true; | ||
|
||
allocationTypes = { | ||
PlaceholderResource: 'PlaceholderResource', | ||
}; | ||
|
||
allocationBase = 40; | ||
|
||
item: Item = { | ||
type: 'ActualResource', | ||
allocation: 32, | ||
payload: {dealStage: 'closedwon', billingRate: 100}, | ||
classes: ['example-class'], | ||
subAllocations: [ | ||
{percent: 50, allocation: 16, allocatedHours: 16, classes: ['class1']}, | ||
{percent: 50, allocation: 16, allocatedHours: 16, classes: ['class2']}, | ||
], | ||
}; | ||
|
||
// Data for GanttHeaderComponent | ||
headerDesc = true; | ||
headerName = 'Dynamic Project Gantt'; | ||
headerSearchPlaceholder = 'Search your tasks'; | ||
headerShowSearch = true; | ||
} |