-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
17 changed files
with
296 additions
and
6 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
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
1 change: 1 addition & 0 deletions
1
web/src/app/components/list-details/list-details.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 @@ | ||
<p>list-details works!</p> |
Empty file.
25 changes: 25 additions & 0 deletions
25
web/src/app/components/list-details/list-details.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ListDetailsComponent } from './list-details.component'; | ||
|
||
describe('ListDetailsComponent', () => { | ||
let component: ListDetailsComponent; | ||
let fixture: ComponentFixture<ListDetailsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ListDetailsComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ListDetailsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
web/src/app/components/list-details/list-details.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,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-list-details', | ||
templateUrl: './list-details.component.html', | ||
styleUrls: ['./list-details.component.scss'] | ||
}) | ||
export class ListDetailsComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { GroupModel } from './group.model'; | ||
|
||
export interface ListDetailsModel { | ||
title: string; | ||
group: GroupModel; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { ListContentModel } from './list-item'; | ||
import { ListDetailsModel } from './list-detail.model'; | ||
|
||
export interface ListModel { | ||
text: string; | ||
content?: ListContentModel; | ||
details?: Array<ListDetailsModel>; | ||
} |
15 changes: 15 additions & 0 deletions
15
web/src/app/views/repository-detail/repository-detail.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,15 @@ | ||
<div class="details"> | ||
<div class="header"> | ||
<div #headerText class="header-text" | ||
*ngFor="let item of repoDetails;let i = index" | ||
(mouseenter)="onMouseEnter(headerText)" | ||
(mouseleave)="onMouseLeave()" | ||
(click)="onClick(headerText, i)"> | ||
{{item.title}} | ||
</div> | ||
</div> | ||
<div #underscore class="header-underscore"></div> | ||
<div #groupWrapper class="group-wrapper"> | ||
<app-groups [groupData]="getGroupData()"></app-groups> | ||
</div> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
web/src/app/views/repository-detail/repository-detail.component.scss
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,30 @@ | ||
@import "../../../assets/colors.scss"; | ||
|
||
.header { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
margin-bottom: 60px; | ||
margin-left: 60px; | ||
>*:not(:first-child) { | ||
margin-left: 120px; | ||
} | ||
|
||
&-text{ | ||
text-decoration: none; | ||
font-size: 22px; | ||
color: $color-dark-grey; | ||
cursor: pointer; | ||
} | ||
|
||
&-underscore { | ||
height: 1px; | ||
background: $color-dark-grey; | ||
width: 200px; | ||
position: absolute; | ||
transition: all 0.35s; | ||
} | ||
} | ||
|
||
.group-wrapper { | ||
overflow-y: scroll; | ||
} |
25 changes: 25 additions & 0 deletions
25
web/src/app/views/repository-detail/repository-detail.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { RepositoryDetailComponent } from './repository-detail.component'; | ||
|
||
describe('RepositoryDetailComponent', () => { | ||
let component: RepositoryDetailComponent; | ||
let fixture: ComponentFixture<RepositoryDetailComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ RepositoryDetailComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(RepositoryDetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
133 changes: 133 additions & 0 deletions
133
web/src/app/views/repository-detail/repository-detail.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,133 @@ | ||
import { Component, OnInit, ViewChild, ViewChildren, QueryList, AfterViewInit, ElementRef } from '@angular/core'; | ||
import { GroupModel } from 'src/app/models/group.model'; | ||
import { ListDetailsModel } from 'src/app/models/list-detail.model'; | ||
import { GroupsComponent } from 'src/app/components/groups/groups.component'; | ||
|
||
@Component({ | ||
selector: 'app-repository-detail', | ||
templateUrl: './repository-detail.component.html', | ||
styleUrls: ['./repository-detail.component.scss'] | ||
}) | ||
export class RepositoryDetailComponent implements OnInit, AfterViewInit { | ||
@ViewChildren('headerText') headerTexts:QueryList<ElementRef>; | ||
@ViewChild('underscore') underscore: ElementRef; | ||
@ViewChild('groupWrapper') groupWrapper: ElementRef; | ||
|
||
groupEl: HTMLElement; | ||
underscoreEl: HTMLElement; | ||
activeHeadEl: HTMLElement; | ||
currentGroupIndex = 0; | ||
heightOffset = 7; | ||
|
||
//INPUT IN FUTURE | ||
public repoDetails: Array<ListDetailsModel>; | ||
|
||
constructor() { | ||
const groupProperty:GroupModel = { | ||
smallColorbox:true, | ||
listItems:[ | ||
{text: "2.0.0-release1"}, | ||
{text: "1.3.1"}, | ||
{text: "1.2.4"}, | ||
{text: "1.2.3"}, | ||
{text: "1.2.2"}, | ||
{text: "1.2.1"}, | ||
{text: "1.1.4"}, | ||
{text: "1.1.3"}, | ||
{text: "1.1.2"}, | ||
{text: "1.1.1"}, | ||
{text: "1.0.1"} | ||
] | ||
} | ||
const groupImage:GroupModel = { | ||
listItems:[ | ||
{text: "2.0.0-release1"}, | ||
{text: "1.3.1"}, | ||
] | ||
} | ||
const groupBuilds:GroupModel = { | ||
listItems:[ | ||
{text: "2.0.0-release1"}, | ||
] | ||
} | ||
|
||
this.repoDetails = [ | ||
{title: "Properties", group: groupProperty}, | ||
{title: "Images", group: groupImage}, | ||
{title: "Builds", group: groupBuilds} | ||
] | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
ngAfterViewInit(): void { | ||
this.groupEl = this.groupWrapper.nativeElement; | ||
this.activeHeadEl = this.headerTexts.toArray()[0].nativeElement; | ||
this.underscoreEl = this.underscore.nativeElement; | ||
this.resetUnderscore(); | ||
|
||
const offsetTop = this.groupEl.offsetTop; | ||
const windowHeight = window.innerHeight; | ||
const calculatedHeight = windowHeight - offsetTop; | ||
console.log(calculatedHeight) | ||
|
||
this.groupEl.style.height = calculatedHeight + "px"; | ||
} | ||
|
||
resetUnderscore(): void { | ||
const offsetTop = this.activeHeadEl.offsetTop; | ||
const offsetLeft = this.activeHeadEl.offsetLeft; | ||
const height = this.activeHeadEl.clientHeight; | ||
const width = this.activeHeadEl.clientWidth; | ||
const underscoreOffset = offsetTop + height + this.heightOffset; | ||
|
||
this.underscoreEl.style.left = offsetLeft + "px"; | ||
this.underscoreEl.style.top = underscoreOffset + "px"; | ||
this.underscoreEl.style.width = width + "px"; | ||
} | ||
|
||
expandUnderscore(targetEl: HTMLElement): void { | ||
const currentLeft = this.underscoreEl.offsetLeft; | ||
const currentWidth = this.underscoreEl.offsetWidth; | ||
const targetLeft = targetEl.offsetLeft; | ||
const targetWidth = targetEl.clientWidth; | ||
|
||
let newLeft; | ||
let newWidth; | ||
|
||
if(targetLeft < currentLeft) { | ||
newLeft = targetLeft < currentLeft? targetLeft : currentLeft; | ||
newWidth = currentLeft - targetLeft + currentWidth; | ||
} else { | ||
newLeft = currentLeft; | ||
newWidth = targetLeft - currentLeft + targetWidth; | ||
} | ||
|
||
|
||
|
||
this.underscoreEl.style.left = newLeft + "px"; | ||
this.underscoreEl.style.width = newWidth +"px"; | ||
} | ||
|
||
onClick(headerEl: HTMLElement, index: number) { | ||
this.activeHeadEl = headerEl; | ||
this.resetUnderscore(); | ||
this.currentGroupIndex = index; | ||
} | ||
|
||
onMouseEnter(headerText: HTMLElement) { | ||
this.expandUnderscore(headerText); | ||
} | ||
|
||
|
||
onMouseLeave() { | ||
this.resetUnderscore(); | ||
} | ||
|
||
|
||
getGroupData() { | ||
return this.repoDetails[this.currentGroupIndex].group; | ||
} | ||
|
||
} |
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
Oops, something went wrong.