Skip to content

Commit 705b54b

Browse files
mschwrdtnrDanielHabenicht
authored andcommitted
feat(welcome-page): list contributors on welcome page (#219)
resolves #219 resolves #140
1 parent 75ed69a commit 705b54b

17 files changed

+880
-339
lines changed

Phonebook.Frontend/src/app/pages/page-information/page-information.component.html

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="pb-margin-left-right-responsive">
2-
<div class="header pb-margin-top-20">
2+
<div class="pb-text-align-center pb-margin-top-20">
33
<h1 i18n="PageInformationComponent|Title of the page information@@PageInformationComponentTitle">
44
Phonebook
55
</h1>
@@ -10,9 +10,9 @@ <h1 i18n="PageInformationComponent|Title of the page information@@PageInformatio
1010
</div>
1111
<div class="pb-flex pb-center-element">
1212
<!-- contact and feedback -->
13-
<mat-card class="small-card">
14-
<mat-card-header>
15-
<mat-card-title
13+
<mat-card class="small-card pb-text-align-center pb-margin-05">
14+
<mat-card-header class="pb-center-element">
15+
<mat-card-title class="pb-icon-60"
1616
><mat-icon color="primary">sentiment_satisfied_alt</mat-icon>
1717
<p
1818
i18n="Page-informationComponent|Subtitle for Contact and Feedback@@PageInformationComponentSubTitleFeedback"
@@ -39,9 +39,9 @@ <h1 i18n="PageInformationComponent|Title of the page information@@PageInformatio
3939
</mat-card-content>
4040
</mat-card>
4141
<!-- cookie notice -->
42-
<mat-card class="small-card">
43-
<mat-card-header>
44-
<mat-card-title
42+
<mat-card class="small-card pb-text-align-center pb-margin-05">
43+
<mat-card-header class="pb-center-element">
44+
<mat-card-title class="pb-icon-60"
4545
><mat-icon color="primary">info_outline</mat-icon>
4646
<p i18n="Page-informationComponent|Subtitle for Cookie@@PageInformationComponentSubTitleCookie">
4747
Cookie Notice
@@ -56,44 +56,13 @@ <h1 i18n="PageInformationComponent|Title of the page information@@PageInformatio
5656
</mat-card-content>
5757
</mat-card>
5858
</div>
59-
<div class="pb-flex pb-center-element">
60-
<!-- call for contributors -->
61-
<mat-card class="pb-w-100">
62-
<mat-card-header>
63-
<mat-card-title
64-
><mat-icon color="primary">error_outline</mat-icon>
65-
<p i18n="Page-informationComponent|Subtitle Contributes@@PageInformationComponentSubTitleContribute">
66-
Call for Contributors!
67-
</p></mat-card-title
68-
>
69-
</mat-card-header>
70-
71-
<mat-card-content i18n="Page-informationComponent|Text for Contribute@@PageInformationComponentSectionContribute">
72-
<span>
73-
The Phonebook is an Open Source Project and lives from his active contributors. There are many different
74-
topics where you can work on. You can help with solving an
75-
<a href="https://github.com/T-Systems-MMS/phonebook/issues" target="_blank">Issue</a>, work out an User-Guide
76-
or document new
77-
<a href="https://github.com/T-Systems-MMS/phonebook/issues/new/choose" target="_blank">Bugs</a>.
78-
</span>
79-
<span>
80-
You can get in touch with us
81-
<a href="https://github.com/T-Systems-MMS/phonebook/" target="_blank">in our official Repository</a> or you
82-
take a look at our <a href="https://t-systems-mms.github.io/phonebook/" target="_blank">Documentation</a>.
83-
<div><b>To be a part of this community it is not required to have programming skills.</b></div>
84-
</span>
85-
<div class="pb-margin-top-20">
86-
<h2>Thanks to our Contributors!</h2>
87-
<div class="contributors-table" [innerHTML]="contributorsHTML"></div>
88-
</div>
89-
</mat-card-content>
90-
</mat-card>
91-
</div>
59+
<!-- call for contributors -->
60+
<app-contributors class="pb-center-element pb-margin-05"></app-contributors>
9261
<!-- licences -->
9362
<div class="pb-flex pb-center-element">
94-
<mat-card class="pb-w-100">
95-
<mat-card-header>
96-
<mat-card-title
63+
<mat-card class="pb-w-100 pb-text-align-center pb-margin-05">
64+
<mat-card-header class="pb-center-element">
65+
<mat-card-title class="pb-icon-60"
9766
><mat-icon color="primary">attachment_outlined</mat-icon>
9867
<p i18n="Page-informationComponent|Subtitle for Licenses@@PageInformationComponentSubTitleLicenses">
9968
Licenses
Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
1-
@import 'mixins';
2-
@import 'media-queries';
3-
@import '~@angular/material/theming';
4-
5-
.header {
6-
text-align: center;
7-
}
8-
9-
mat-card {
10-
text-align: center;
11-
margin: 0.5%;
12-
13-
mat-card-header {
14-
justify-content: center;
15-
mat-card-title {
16-
line-height: 1;
17-
}
18-
mat-icon {
19-
@include mat-icon-size(60px);
20-
}
21-
}
22-
}
23-
241
.small-card {
252
width: 50%;
263
}
27-
28-
.contributors-table {
29-
::ng-deep table {
30-
display: flex;
31-
flex-flow: column wrap;
32-
}
33-
::ng-deep tr {
34-
display: flex;
35-
flex-flow: row wrap;
36-
justify-content: center;
37-
}
38-
::ng-deep td {
39-
width: 110px;
40-
a[title] {
41-
display: none;
42-
}
43-
}
44-
}
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
22
import { Environment, RuntimeEnvironmentInterface } from 'src/environments/EnvironmentInterfaces';
33
import { runtimeEnvironment } from 'src/environments/runtime-environment';
4-
import { HttpClient } from '@angular/common/http';
54

65
@Component({
76
selector: 'app-page-information',
@@ -11,27 +10,9 @@ import { HttpClient } from '@angular/common/http';
1110
export class PageInformationComponent implements OnInit {
1211
public isPreview: boolean = true;
1312
public runtimeEnvironment: RuntimeEnvironmentInterface = runtimeEnvironment;
14-
public contributorsHTML: string = '';
15-
constructor(private httpClient: HttpClient) {}
13+
constructor() {}
1614

1715
public ngOnInit() {
1816
this.isPreview = runtimeEnvironment.environment === Environment.production ? false : true;
19-
this.loadContributors();
20-
}
21-
22-
public loadContributors(): void {
23-
const text = 'Contributors could not be loaded.';
24-
this.httpClient
25-
.get('assets/CONTRIBUTORS.md', {
26-
responseType: 'text'
27-
})
28-
.subscribe(
29-
success => {
30-
this.contributorsHTML = success;
31-
},
32-
error => {
33-
this.contributorsHTML = 'Contributors could not be loaded.';
34-
}
35-
);
3617
}
3718
}

Phonebook.Frontend/src/app/pages/page-information/page-information.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { RouterModule, Routes } from '@angular/router';
77
import { PageInformationComponent } from 'src/app/pages/page-information/page-information.component';
88
import { FeedbackDrawerModule } from 'src/app/shared/directives/feedback-drawer/feedback-drawer.module';
99
import { MatIconModule } from '@angular/material';
10+
import { ContributorsModule } from 'src/app/shared/components/contributors/contributors.module';
1011

1112
const routes: Routes = [
1213
{
@@ -24,7 +25,8 @@ const routes: Routes = [
2425
MatButtonModule,
2526
MatListModule,
2627
FeedbackDrawerModule,
27-
MatIconModule
28+
MatIconModule,
29+
ContributorsModule
2830
],
2931
providers: []
3032
})
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<mat-card class="pb-text-align-center">
2+
<mat-card-header class="pb-center-element">
3+
<mat-card-title class="pb-icon-60"
4+
><mat-icon color="primary">error_outline</mat-icon>
5+
<p i18n="Page-informationComponent|Subtitle Contributes@@PageInformationComponentSubTitleContribute">
6+
Call for Contributors!
7+
</p></mat-card-title
8+
>
9+
</mat-card-header>
10+
11+
<mat-card-content i18n="Page-informationComponent|Text for Contribute@@PageInformationComponentSectionContribute">
12+
<span>
13+
The Phonebook is an Open Source Project and lives from his active contributors. There are many different topics
14+
where you can work on. You can help with solving an
15+
<a href="https://github.com/T-Systems-MMS/phonebook/issues" target="_blank">Issue</a>, work out an User-Guide or
16+
document new <a href="https://github.com/T-Systems-MMS/phonebook/issues/new/choose" target="_blank">Bugs</a>.
17+
</span>
18+
<span>
19+
You can get in touch with us
20+
<a href="https://github.com/T-Systems-MMS/phonebook/" target="_blank">in our official Repository</a> or you take a
21+
look at our <a href="https://t-systems-mms.github.io/phonebook/" target="_blank">Documentation</a>.
22+
<div><b>To be a part of this community it is not required to have programming skills.</b></div>
23+
</span>
24+
<div *ngIf="contributorsLoaded" class="pb-margin-top-20">
25+
<h2>Thanks to our Contributors!</h2>
26+
<div class="contributors-table" [innerHTML]="contributorsHTML"></div>
27+
</div>
28+
</mat-card-content>
29+
</mat-card>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.contributors-table {
2+
::ng-deep table {
3+
width: 100%;
4+
table-layout: fixed;
5+
}
6+
::ng-deep tr {
7+
display: inline;
8+
}
9+
::ng-deep td {
10+
display: inline-block;
11+
a[title] {
12+
display: none;
13+
}
14+
}
15+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { ContributorsComponent } from './contributors.component';
3+
import { MatIconModule, MatCardModule, MatSnackBarModule } from '@angular/material';
4+
import { HttpClientTestingModule } from '@angular/common/http/testing';
5+
import { I18n } from '@ngx-translate/i18n-polyfill';
6+
7+
describe('ContributorsComponent', () => {
8+
let component: ContributorsComponent;
9+
let fixture: ComponentFixture<ContributorsComponent>;
10+
11+
beforeEach(async(() => {
12+
TestBed.configureTestingModule({
13+
declarations: [ContributorsComponent],
14+
imports: [HttpClientTestingModule, MatIconModule, MatCardModule, MatSnackBarModule],
15+
providers: [{ provide: I18n }]
16+
}).compileComponents();
17+
}));
18+
19+
beforeEach(() => {
20+
fixture = TestBed.createComponent(ContributorsComponent);
21+
component = fixture.componentInstance;
22+
fixture.detectChanges();
23+
});
24+
25+
it('should create', () => {
26+
expect(component).toBeTruthy();
27+
});
28+
});
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { HttpClient } from '@angular/common/http';
3+
import { I18n } from '@ngx-translate/i18n-polyfill';
4+
import { MatSnackBar } from '@angular/material/snack-bar';
5+
6+
@Component({
7+
selector: 'app-contributors',
8+
templateUrl: './contributors.component.html',
9+
styleUrls: ['./contributors.component.scss']
10+
})
11+
export class ContributorsComponent implements OnInit {
12+
public contributorsLoaded: boolean = false;
13+
public contributorsHTML: string = '';
14+
constructor(private httpClient: HttpClient, private i18n: I18n, private snackBar: MatSnackBar) {}
15+
16+
public ngOnInit() {
17+
this.loadContributors();
18+
}
19+
20+
public loadContributors(): void {
21+
this.httpClient
22+
.get('assets/CONTRIBUTORS.md', {
23+
responseType: 'text'
24+
})
25+
.subscribe(
26+
success => {
27+
this.contributorsLoaded = true;
28+
this.contributorsHTML = success;
29+
},
30+
error => {
31+
this.snackBar.open(
32+
this.i18n({
33+
value: 'Contributors could not be loaded.',
34+
description: 'Contributors error Message',
35+
id: 'ContributorsErrorMessage',
36+
meaning: 'ContributorsErrorMessage'
37+
}),
38+
'',
39+
{
40+
duration: 5000
41+
}
42+
);
43+
}
44+
);
45+
}
46+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { ContributorsComponent } from './contributors.component';
4+
import { MatIconModule, MatCardModule, MatSnackBarModule } from '@angular/material';
5+
6+
@NgModule({
7+
declarations: [ContributorsComponent],
8+
imports: [CommonModule, MatIconModule, MatCardModule, MatSnackBarModule],
9+
exports: [ContributorsComponent]
10+
})
11+
export class ContributorsModule {}

Phonebook.Frontend/src/app/shared/dialogs/dialogs.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { BugReportConsentComponent } from 'src/app/shared/dialogs/bug-report-con
44
import { DisplayNotificationDialog } from 'src/app/shared/dialogs/display-notification-dialog/display-notification.dialog';
55
import { ReleaseNotificationDialog } from 'src/app/shared/dialogs/release-notification-dialog/release-notification.dialog';
66
import { MaterialModule } from 'src/app/shared/material.module';
7+
import { ContributorsModule } from 'src/app/shared/components/contributors/contributors.module';
78

89
@NgModule({
910
declarations: [ReleaseNotificationDialog, DisplayNotificationDialog, BugReportConsentComponent],
10-
imports: [RouterModule, MaterialModule],
11+
imports: [RouterModule, MaterialModule, ContributorsModule],
1112
exports: [ReleaseNotificationDialog, DisplayNotificationDialog, BugReportConsentComponent],
1213
entryComponents: [ReleaseNotificationDialog, DisplayNotificationDialog, BugReportConsentComponent]
1314
})

0 commit comments

Comments
 (0)