-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps): create summary column (#520)
Create a summary column in the prs application for displaying information about a pull request. PR Close #520
- Loading branch information
1 parent
ccf9d47
commit 8a7e038
Showing
8 changed files
with
84 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
|
||
import {MatTableModule} from '@angular/material/table'; | ||
import {SummaryColumn} from './summary/summary.component'; | ||
|
||
@NgModule({ | ||
declarations: [SummaryColumn], | ||
imports: [CommonModule, MatTableModule], | ||
}) | ||
export class ColumnsModule {} |
16 changes: 16 additions & 0 deletions
16
apps/prs/src/app/pr-table/columns/summary/summary.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,16 @@ | ||
|
||
<mat-header-cell *matHeaderCellDef>Pull Request</mat-header-cell> | ||
<mat-cell *matCellDef="let pr"> | ||
<div class="summary"> | ||
<a target="_blank" rel="noopener" href="//github.com/{{pr.owner}}/{{pr.repo}}/pull/{{pr.number}}">{{pr.title}}</a> | ||
</div> | ||
<div class="info"> | ||
<span class="pr-number">#{{pr.number}}</span> | ||
<span class="pr-author">{{pr.user?.name}}</span> | ||
<span class="pr-labels"> | ||
<span *ngFor="let label of pr.labels" class="label" [style.background-color]="label.color" [style.color]="label.fontColor"> | ||
{{label.name}} | ||
</span> | ||
</span> | ||
</div> | ||
</mat-cell> |
34 changes: 34 additions & 0 deletions
34
apps/prs/src/app/pr-table/columns/summary/summary.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,34 @@ | ||
.mat-column-summary { | ||
&.mat-header-cell { | ||
} | ||
|
||
&.mat-cell { | ||
flex-direction: column; | ||
|
||
.summary { | ||
width: 100%; | ||
a { | ||
text-decoration: none; | ||
color: currentColor; | ||
} | ||
} | ||
|
||
.info { | ||
width: 100%; | ||
.pr-number, .pr-author { | ||
margin-right: 8px; | ||
font-size: .8em; | ||
} | ||
|
||
.label { | ||
border-radius: 0.5em; | ||
padding: 0.1em 0.4em; | ||
font-size: .8em; | ||
margin-right: 4px; | ||
background-color: #b1b1b1; | ||
color: currentColor; | ||
white-space: nowrap; | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
apps/prs/src/app/pr-table/columns/summary/summary.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,12 @@ | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import {BaseColumn} from '../base'; | ||
|
||
@Component({ | ||
selector: 'summary-column', | ||
templateUrl: './summary.component.html', | ||
styleUrls: ['./summary.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class SummaryColumn extends BaseColumn { | ||
name = 'summary'; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {PullRequest as SharedPullRequest} from '../../../shared/models/app-models'; | ||
|
||
export class PullRequest extends SharedPullRequest {} | ||
export class PullRequest extends SharedPullRequest {} |
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 |
---|---|---|
|
@@ -38,5 +38,6 @@ ts_library( | |
), | ||
deps = [ | ||
"@npm//@octokit/webhooks-types", | ||
"@npm//font-color-contrast", | ||
], | ||
) |
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