Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): New Backend and authentication for Phonebook data. #7

Merged
merged 61 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1735af4
use ef for the connection to the database
paule96 Apr 5, 2019
d465a35
add some missing project files
paule96 Apr 5, 2019
fa89800
add vscode development stuff
paule96 Jun 24, 2019
6dc3f03
update orcale entiy framework version
paule96 Jun 24, 2019
114c3a0
Merge remote-tracking branch 'origin/master' into use_EF_for_oracle_DB
paule96 Jun 24, 2019
0678278
update to dotnet 3.0
paule96 Jul 25, 2019
9778930
now we get relational data from the peoplesoft backend
paule96 Aug 27, 2019
84913d4
cleanup dbcontext
paule96 Sep 2, 2019
fcd985e
fixing database changes
paule96 Oct 2, 2019
ec4d095
rewrite queries and remove newtonsoft
paule96 Oct 2, 2019
ce44d9e
complete the data model
paule96 Oct 7, 2019
f81c9f2
include as many informations as possible to a person
paule96 Oct 7, 2019
6505b90
Merge remote-tracking branch 'origin/master' into use_EF_for_oracle_DB
paule96 Mar 5, 2020
2a3798e
working implementation of the backend
paule96 Mar 18, 2020
2cb2513
Merge branch 'master' into use_EF_for_oracle_DB
DanielHabenicht Mar 18, 2020
eb13679
Update Phonebook.Frontend/src/app/shared/pipes/telephone.pipe.ts
paule96 Mar 19, 2020
e3c49c8
Update Phonebook.Frontend/src/app/modules/table/helpers.ts
paule96 Mar 19, 2020
e50e655
add support for rooms
paule96 Mar 23, 2020
109efd8
add docker support and update packages
paule96 Mar 23, 2020
aa4b1d1
Merge branch 'use_EF_for_oracle_DB' of https://github.com/T-Systems-M…
paule96 Mar 23, 2020
d600ce2
Merge remote-tracking branch 'origin/master' into use_EF_for_oracle_DB
paule96 Mar 23, 2020
bd6953f
fixing build error
paule96 Mar 24, 2020
fa6296a
fx build error again
paule96 Mar 24, 2020
0ed39a9
moving models to a seperate project
paule96 Mar 24, 2020
d7882fa
add seeding data
paule96 Mar 24, 2020
be0b9b4
add project to solution
paule96 Mar 24, 2020
f9f2940
add seeding to the main project
paule96 Mar 24, 2020
fe0abd1
change to in memory db for seeding
paule96 Mar 24, 2020
8c02b62
move docker file to the right place
paule96 Mar 24, 2020
9296ab3
fixing docker build
paule96 Mar 24, 2020
b1cc733
fix proxy config
paule96 Mar 24, 2020
3b15c59
add build for new backend
paule96 Mar 24, 2020
6ceb948
fix some build errors
paule96 Mar 24, 2020
bafeea9
add solution files
paule96 Mar 24, 2020
c6dde2b
add in memory in the right way
paule96 Mar 24, 2020
cb1cdf1
fix appsettings
paule96 Mar 24, 2020
9793eea
add sensitiv logging while we are in the seeding mode
paule96 Mar 25, 2020
2961310
use bogus to generate seeded data!
paule96 Mar 25, 2020
aa1b5bf
remove not used stuff
paule96 Mar 25, 2020
11fc4dd
add an option to run the backend without an auth process
paule96 Mar 25, 2020
00251ef
cleanup code
paule96 Mar 25, 2020
1658404
add getting started to the documentation
paule96 Mar 30, 2020
00e6499
fixing seeding bug
paule96 Mar 31, 2020
a4643c2
update old models
paule96 Mar 31, 2020
33509a5
fix a bug in the organigramm link
paule96 Mar 31, 2020
2412201
add room information again
paule96 Mar 31, 2020
f551975
maybe make docs readable
paule96 Mar 31, 2020
6f18d45
Merge remote-tracking branch 'origin/master' into use_EF_for_oracle_DB
paule96 Mar 31, 2020
bd6a916
fixing bug for the supervisor link
paule96 Mar 31, 2020
43ca3a3
add adfs support
paule96 Apr 1, 2020
43df910
Merge remote-tracking branch 'origin/master' into use_EF_for_oracle_DB
paule96 Apr 1, 2020
cf2bddc
add runtime identifiers
paule96 Apr 3, 2020
2a258a6
Update Phonebook.Frontend/src/app/shared/pipes/telephone.pipe.ts
paule96 Apr 4, 2020
44ed826
change assets path in city component
paule96 Apr 6, 2020
d7529d8
Merge branch 'use_EF_for_oracle_DB' of https://github.com/T-Systems-M…
paule96 Apr 6, 2020
9758776
change location id to building.id for pictures
paule96 Apr 6, 2020
4f6ca31
change link to pictures
paule96 Apr 6, 2020
cd0aefa
add response compression
paule96 Apr 6, 2020
6ffa60f
use higher and slower compression
paule96 Apr 6, 2020
de232f0
nullable values in person to string.empty
paule96 Apr 7, 2020
e8cf437
fix orgunit head of business shortname
paule96 Apr 7, 2020
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
18 changes: 18 additions & 0 deletions .azure/pipelines/pr/Phonebook.Source.PeopleSoft.pr.yml
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# TODO: #18
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# TODO: #18

trigger: none
pr:
branches:
include:
- master
paths:
include:
- Phonebook.Source.PeopleSoft/**

jobs:
- job: build
displayName: build docker image
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: |
docker build .
workingDirectory: 'Phonebook.Source.PeopleSoft/'
27 changes: 26 additions & 1 deletion .azure/pipelines/production/Phonebook.Source.PeopleSoft.yml
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# TODO: #18
trigger:
batch: true
branches:
include:
- master
paths:
include:
- Phonebook.Source.PeopleSoft/
pr: none

jobs:
- job: build
displayName: build docker image
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: |
docker build -t $dockerRepo:$tag .
docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD
docker push $dockerRepo:$tag
workingDirectory: 'Phonebook.Source.PeopleSoft/'
env:
DOCKER_REGISTRY_PASSWORD: $(DOCKER_REGISTRY_PASSWORD)
DOCKER_REGISTRY_USER: $(DOCKER_REGISTRY_USER)
dockerRepo: tsystemsmms/phonebook-build
tag: source-peoplesoft
36 changes: 36 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Phonebook.Source.PeopleSoft/src/Phonebook.Source.PeopleSoft/bin/Debug/netcoreapp2.2/Phonebook.Source.PeopleSoft.dll",
"args": [],
"cwd": "${workspaceFolder}/Phonebook.Source.PeopleSoft/src/Phonebook.Source.PeopleSoft",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
36 changes: 36 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Phonebook.Source.PeopleSoft/src/Phonebook.Source.PeopleSoft/Phonebook.Source.PeopleSoft.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Phonebook.Source.PeopleSoft/src/Phonebook.Source.PeopleSoft/Phonebook.Source.PeopleSoft.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/Phonebook.Source.PeopleSoft/src/Phonebook.Source.PeopleSoft/Phonebook.Source.PeopleSoft.csproj"
],
"problemMatcher": "$tsc"
}
]
}
4 changes: 2 additions & 2 deletions Phonebook.Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"scripts": {
"ng": "ng",
"start": "npm run start:en",
"start:en": "concurrently -n mock-backend,assets,angular \"docker run --rm -p 8080:80 --name phonebook-backend-mock tsystemsmms/phonebook-build:mock-backend\" \"docker run --rm -p 8081:80 --name phonebook-assets tsystemsmms/phonebook-build:assets\" \"ng serve --ssl --proxy-config proxy.conf.json --configuration en\"",
"start:de": "concurrently -n mock-backend,assets,angular \"docker run --rm -p 8080:80 --name phonebook-backend-mock tsystemsmms/phonebook-build:mock-backend\" \"docker run --rm -p 8081:80 --name phonebook-assets tsystemsmms/phonebook-build:assets\" \"ng serve --ssl --proxy-config proxy.conf.json --configuration de\"",
"start:en": "concurrently -n mock-backend,assets,angular \"docker run --rm -p 8080:80 --name phonebook-source-mock -e ASPNETCORE_ENVIRONMENT=Development tsystemsmms/phonebook-build:source-peoplesoft\" \"docker run --rm -p 8081:80 --name phonebook-assets tsystemsmms/phonebook-build:assets\" \"ng serve --ssl --proxy-config proxy.conf.json --configuration en\"",
"start:de": "concurrently -n mock-backend,assets,angular \"docker run --rm -p 8080:80 --name phonebook-source-mock -e ASPNETCORE_ENVIRONMENT=Development tsystemsmms/phonebook-build:source-peoplesoft\" \"docker run --rm -p 8081:80 --name phonebook-assets tsystemsmms/phonebook-build:assets\" \"ng serve --ssl --proxy-config proxy.conf.json --configuration de\"",
"start:debug": "ng serve --ssl --proxy-config=proxy.conf.json --configuration debug",
"start-compose": "npm run compose-build && docker-compose run --rm --service-ports angular npm run start:en",
"start-compose:debug": "npm run compose-build && docker-compose run --rm --service-ports angular npm run start:debug",
Expand Down
9 changes: 6 additions & 3 deletions Phonebook.Frontend/proxy.conf.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"/signin-wsfed": {
"target": "http://localhost:8080",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/api/*": {
"target": "http://localhost:8080",
"secure": false,
"changeOrigin": true,
"pathRewrite": {
"^/api": ""
},
"logLevel": "debug"
},
"/external_assets/*": {
Expand Down
6 changes: 4 additions & 2 deletions Phonebook.Frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//Angular Imports
import { DragDropModule } from '@angular/cdk/drag-drop';
import { PlatformModule } from '@angular/cdk/platform';
import { HttpClientModule } from '@angular/common/http';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatBadgeModule } from '@angular/material/badge';
import { MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
Expand Down Expand Up @@ -52,6 +52,7 @@ import { environment } from 'src/environments/environment';
// Services
import { FloorplanService } from './services/floorplan.service';
import { SearchComponent } from './shared/components/search/search.component';
import { HttpRedirectToLogin } from 'src/app/shared/interceptors/HttpRedirectToLogin';

declare const require;

Expand Down Expand Up @@ -95,6 +96,7 @@ declare const require;
UserPagesModule
],
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: HttpRedirectToLogin, multi: true },
// {
// provide: TRANSLATIONS,
// useFactory: (locale: string) => {
Expand All @@ -115,4 +117,4 @@ declare const require;
],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</mat-card-header>
<img
mat-card-image
[src]="runtimeEnvironment.assetsEndpoint + location.LinkPicture"
[src]="runtimeEnvironment.assetsEndpoint + '/locations/' + location.LinkPicture"
[alt]="location.LinkRoutingInfo"
/>
<mat-card-content>
Expand All @@ -43,16 +43,11 @@ <h3 mat-subheader>
[href]="location.LinkRoutingWebsite"
target="_blank"
rel="noopener"
*ngIf="
location.LinkRoutingWebsite != '' &&
location.LinkRoutingWebsite != null
"
*ngIf="location.LinkRoutingWebsite != '' && location.LinkRoutingWebsite != null"
class="mat-small"
>
<mat-icon>open_in_new</mat-icon>
<span i18n="@@GeneralShowOnMapButton"
>Show on Google-Maps</span
>
<span i18n="@@GeneralShowOnMapButton">Show on Google-Maps</span>
</a>
</h3>
<mat-list-item>
Expand All @@ -61,12 +56,7 @@ <h3 mat-subheader>
</div>
</mat-list-item>
<h3 mat-subheader i18n="@@DataLocationContact">Contact</h3>
<mat-list-item
*ngIf="
location.ReceptionPhone != '' &&
location.ReceptionPhone != null
"
>
<mat-list-item *ngIf="location.ReceptionPhone != '' && location.ReceptionPhone != null">
<mat-icon mat-list-icon>call</mat-icon>
<h4 mat-line i18n="@@ColumnTitlePhone">Phone</h4>
<p mat-line>
Expand All @@ -81,43 +71,27 @@ <h4 mat-line i18n="@@ColumnTitlePhone">Phone</h4>
</button>
</p>
</mat-list-item>
<mat-list-item
*ngIf="
location.ReceptionFax != '' && location.ReceptionFax != null
"
>
<mat-list-item *ngIf="location.ReceptionFax != '' && location.ReceptionFax != null">
<mat-icon mat-list-icon>print</mat-icon>
<h4 mat-line i18n="@@DataPersonFax">Fax</h4>
<p mat-line>
<button
mat-button
actionDrawer
[copy]="location.ReceptionFax"
>
<button mat-button actionDrawer [copy]="location.ReceptionFax">
{{ location.ReceptionFax }}
</button>
</p></mat-list-item
>
</p>
</mat-list-item>

<mat-list-item
*ngIf="
location.ContactPerson != '' && location.ContactPerson != null
"
>
<mat-list-item *ngIf="location.ContactPerson != '' && location.ContactPerson != null">
<mat-icon mat-list-icon>person</mat-icon>
<h4 mat-line i18n="@@DataLocationContactPerson">
Contact Person
</h4>
<p mat-line>
<button
mat-button
stopPropagation
[routerLink]="['/search/' + location.ContactPerson]"
>
<button mat-button stopPropagation [routerLink]="['/search/' + location.ContactPerson]">
{{ location.ContactPerson }}
</button>
</p></mat-list-item
>
</p>
</mat-list-item>
</mat-list>
</mat-card-content>
</mat-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class RoomDetailComponent implements OnInit {
this.room = this.node.data as Room;
}
this.personService
.getPersonsByRoom(RoomHelpers.getParamsAsArray(params, ['cityId', 'buildingId', 'floorId', 'roomId']))
.getPersonsByRoom(RoomHelpers.getParamsAsArray(params, ['roomId'])[0])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das funktioniert nicht, es gibt Räume die die gleiche RoomId haben, oder mittlerweile nicht mehr?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test before close. The room Id is now the DatabaseId, thats mean it is unique.

.subscribe(person => {
this.persons = person;
});
Expand Down
5 changes: 4 additions & 1 deletion Phonebook.Frontend/src/app/modules/table/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ export class Helpers {
* Removes Accents from the string.
* @param str Any String
*/
public static removeAccents(str: string): string {
public static removeAccents(str: string | null): string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

das verursacht evtl. unbeabsichtigtes fehlverhalten, da removeAccents in sortierfunktionen eingesetzt wird. Ich bau es mal so um, dass es trotzdem funktioniert.

Ich hoffe du hast es die nullbaren Dinge in den Models angepasst?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set all model properties to nullable.

if(str === null){
return '';
}
return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
}
}
28 changes: 13 additions & 15 deletions Phonebook.Frontend/src/app/services/api/person.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class PersonService {
item.Contacts.Fax,
item.Contacts.Email,
item.Contacts.Phone,
new Messenger(item.Contacts.Messenger.Text, item.Contacts.Messenger.State)
new Messenger("", null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Da steht nie etwas drin?
Es wird auch im Phonebook nicht genutzt... Soll ich es entfernen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ja!!!!!! bitte!

),
new Location(
item.Location.City,
Expand Down Expand Up @@ -74,15 +74,16 @@ export class PersonService {
return this.allPersonObservable;
}

const observable = this.http.get<Person[]>('/api/persons').pipe(
map(personArray => {
return TableLogic.sort(this.generateRealPersonArray(personArray), {
column: ColumnDefinitions.fullname,
direction: PhonebookSortDirection.asc
});
}),
publishReplay()
);
const observable = this.http.get<Person[]>('/api/people')
.pipe(
map(personArray => {
return TableLogic.sort(this.generateRealPersonArray(personArray), {
column: ColumnDefinitions.fullname,
direction: PhonebookSortDirection.asc
});
}),
publishReplay()
);
(observable as ConnectableObservable<Person[]>).connect();
this.allPersonObservable = observable;
return this.allPersonObservable;
Expand All @@ -102,15 +103,12 @@ export class PersonService {
);
}

public getPersonsByRoom(positionArray: string[]): Observable<Person[]> {
public getPersonsByRoom(roomId: string): Observable<Person[]> {
paule96 marked this conversation as resolved.
Show resolved Hide resolved
return this.getAll().pipe(
map(personArray => {
return personArray.filter(x => {
return (
x.Location.RoomCollection[0].Place === positionArray[0] &&
x.Location.RoomCollection[0].Building === positionArray[1] &&
x.Location.RoomCollection[0].Floor.toString() === positionArray[2] &&
x.Location.RoomCollection[0].Number === positionArray[3]
x.Location.RoomCollection.some( x=> x.Number == roomId)
);
});
})
Expand Down
Loading