Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Feat/springsecurity #121

Open
wants to merge 97 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
a7febea
added the sample spring boot app with sample controllers for the poc …
maqboolayaz Dec 6, 2018
88f55d3
added controllers to poc spring security login
maqboolayaz Dec 6, 2018
b41c522
implementation of spring security over the rest services
maqboolayaz Dec 8, 2018
f80adfc
Adding User Login Form and authentication
aliazmi68 Dec 17, 2018
fc6289f
implementation of neo4j database and user service
maqboolayaz Dec 31, 2018
a6308fa
implemented of the test for user service
maqboolayaz Jan 1, 2019
a0bc371
integration of user login with database
maqboolayaz Jan 5, 2019
155d795
implementation of code for sending email using smtp with java
maqboolayaz Jan 13, 2019
576cfa9
Initial Front end work using angular and material
aliazmi68 Jan 13, 2019
1ce7a27
Merge remote-tracking branch 'origin/feat/springsecurity' into feat/s…
aliazmi68 Jan 13, 2019
66fb44d
removed npm
aliazmi68 Jan 13, 2019
dd55818
email signup functionality completed with mail.uni-paderbon.de smtp s…
maqboolayaz Jan 17, 2019
981401a
worked on the user controller as per the requirements changed in the …
maqboolayaz Jan 17, 2019
100fa08
worked on the spring security on login, added logs, added response be…
maqboolayaz Jan 18, 2019
cd6dadb
added the signup service for email sending functionality
maqboolayaz Jan 19, 2019
5a88694
Merge branch 'master' into feat/springsecurity
maqboolayaz Jan 19, 2019
284ced3
login, signup, admin services and spring security functionality integ…
maqboolayaz Jan 19, 2019
d6a7020
added the encryption code for password
maqboolayaz Jan 19, 2019
c1443b5
multiple improvements added in the user controller and service
maqboolayaz Jan 19, 2019
84002b4
added the configurations for routes for the spring security
maqboolayaz Jan 20, 2019
faa5f96
logout success handler added in the spring security
maqboolayaz Jan 20, 2019
42871eb
Added CRUD operations on front end
aliazmi68 Jan 20, 2019
c753a52
some configurations changed for admin user functionalities
maqboolayaz Jan 20, 2019
22c6491
resolved the cross origin issue
maqboolayaz Jan 20, 2019
e815ef5
resolved the cross origin issue on login controller
maqboolayaz Jan 20, 2019
6a70c39
Finalizing Changes
aliazmi68 Jan 21, 2019
16b057a
resolved the codacy issues that were the cause for the build failure
maqboolayaz Jan 22, 2019
d3fd769
resolving the issue for build failure on travis
maqboolayaz Jan 22, 2019
bd54d7a
added the tag for enableneo4j repositories in application configurati…
maqboolayaz Jan 22, 2019
e60d930
added neo4j-agm dependency - resolving travis build issue
maqboolayaz Jan 22, 2019
213ed6b
added neo4j-agm bolt driver dependency - resolving travis build issue
maqboolayaz Jan 22, 2019
3a60ec9
resolving travis build issue
maqboolayaz Jan 22, 2019
44416a4
resolving the travis build issue
maqboolayaz Jan 22, 2019
06215b9
user added in response bean on login
maqboolayaz Jan 24, 2019
caca9e5
fixing neo4j pom
nikit-srivastava Jan 24, 2019
fefc728
adding dependency version
nikit-srivastava Jan 24, 2019
0899217
reverting commit
nikit-srivastava Jan 24, 2019
219fdce
Adding name of user on header
aliazmi68 Jan 24, 2019
c0d0a4c
Merge remote-tracking branch 'origin/feat/springsecurity' into feat/s…
aliazmi68 Jan 24, 2019
1bd35fe
workign on the travis build issue
maqboolayaz Jan 25, 2019
271a346
remote changes merged into local changes and resolved conflicts
maqboolayaz Jan 25, 2019
11b797f
resolving the session factory neo4j issue for travis build failure
maqboolayaz Jan 25, 2019
a6cfe1b
Merge branch 'master' of https://github.com/dice-group/ida into feat/…
aliazmi68 May 4, 2019
89b96d0
Changes Related to Admin Portal UI beutification
aliazmi68 May 20, 2019
13b0813
commented the userService and repository code of neo4j, branch is wor…
maqboolayaz May 30, 2019
cc51250
User data management is working fine and Partially implemented with t…
May 30, 2019
53c80a1
added new field in usermanagement i.e lastname
Jun 1, 2019
52944ca
bug fix
Jun 1, 2019
7522c3a
temporary changes
Jun 1, 2019
38f527d
working proto...need optimisation
Jun 1, 2019
b071827
implementaion working
Jun 1, 2019
9b786be
Userrole assigned..testing left
Jun 2, 2019
76f16a6
fuseki server host changed according to docker name
Jun 2, 2019
d1f0788
small improvement and bug fixes
Jun 2, 2019
47bfbf9
Merge branch 'master' into feat/springsecurity
Jun 3, 2019
ff30efb
fixed broken package-lock after merging in master
Jun 3, 2019
368c29b
small changes for optimisation
Jun 3, 2019
7e18bcf
username is now email address
Jun 3, 2019
5b8796a
new command working
Jun 4, 2019
ec7a28a
username email address is embedded in some operations
Jun 4, 2019
a3034ef
CRUD username integrated to email address from plain URL with bug fixes
Jun 4, 2019
d133c71
connection pooling issues resolved and CRUD some bug fixes
Jun 6, 2019
0f5f426
small bug improvement and code cleaning
Jun 6, 2019
7d2e34e
authentication problem resolved and code optimisation
Jun 9, 2019
9b28a16
code optimisation
Jun 9, 2019
7dac565
salting partially implemented
Jun 12, 2019
5021ba4
salting implemented
Jun 15, 2019
52df601
checkpoint merged dk_salting branch
Jun 15, 2019
8a3e477
Changes Due to change in backend code
aliazmi68 Jun 16, 2019
f164e9a
Merge remote-tracking branch 'origin/feat/springsecurity' into feat/s…
aliazmi68 Jun 16, 2019
16c4e78
Handling arbitrary routes
aliazmi68 Jun 16, 2019
3a14c97
code optimisation
Jun 16, 2019
607b4e1
Merge branch 'feat/springsecurity' of https://github.com/dice-group/i…
Jun 16, 2019
1dddd36
Bug fixes and minor changes
aliazmi68 Jun 16, 2019
a968f82
Merge branch 'feat/springsecurity' of https://github.com/dice-group/i…
Jun 16, 2019
e697d3c
Messagerest controller bug fixed
Jun 16, 2019
a2f37b1
code cleaning and optimisation and checkpoint
Jun 16, 2019
bc78f85
Environment variable is set to 'IDA_CHATBOT' and code optimisation a…
Jun 18, 2019
59b21bc
variable name changed to 'FUSEKI_URL'
Jun 18, 2019
dddc93b
removed logs and compile outputs
Cortys Jun 18, 2019
ae282d5
set FUSEKI_URL variable for the dev and production docker stacks
Cortys Jun 18, 2019
d435838
host and port separated from dataset name, and dataset declared
Jun 18, 2019
18aa1b0
Typo and UI bug fix
aliazmi68 Jun 19, 2019
2f7b462
fixed FUSEKI_URL variable in Docker stack
Cortys Jun 20, 2019
155303c
unused file is deleted
Jun 24, 2019
96ffc34
Minor changes
aliazmi68 Jun 25, 2019
c72d1b2
Minor change
aliazmi68 Jun 26, 2019
eb60bd3
commented code and files cleaned
Jul 1, 2019
3077e42
Merge branch 'master' into feat/springsecurity
aliazmi68 Jul 4, 2019
dd3535f
minor bug fixed and code tested
Jul 4, 2019
91a3c7b
Adding test class to login controller.
nandeeshpatelgp Oct 20, 2019
4c52f8d
Changed the label from username to email for more clarity. Resolved c…
nandeeshpatelgp Oct 20, 2019
f027d3a
Resolving merge conflicts with master.
nandeeshpatelgp Oct 20, 2019
e646845
Spring security changes.
nandeeshpatelgp Jan 14, 2020
ecd0c71
Taking latest from master.
nandeeshpatelgp Jan 14, 2020
1041690
Resolving codacy issues.
nandeeshpatelgp Jan 14, 2020
fa1c098
Resolving UI codacy issues.
nandeeshpatelgp Jan 14, 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
3,072 changes: 967 additions & 2,105 deletions ida-chatbot/package-lock.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions ida-chatbot/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {NgModule} from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {UserComponent} from './components/user/user.component';
import {LoginComponent} from './components/login/login.component';
import {SignupComponent} from './components/signup/signup.component';
import {HomeComponent} from './components/home/home.component';
const routes: Routes = [
{ path: 'user', component: UserComponent },
{ path: 'login', component: LoginComponent },
{ path: 'signup', component: SignupComponent },
{ path: '', component: HomeComponent },
{ path: '**', redirectTo: '' }
];
@NgModule({
imports: [
RouterModule.forRoot(routes)
],
exports: [
RouterModule
],
declarations: []
})
export class AppRoutingModule { }
8 changes: 0 additions & 8 deletions ida-chatbot/src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
.example-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: lightseagreen;
}

#chatBox {
position: absolute ;
Expand Down
14 changes: 1 addition & 13 deletions ida-chatbot/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
<div fxLayout="row">
<!--<div fxFlex="10%" style="background-color:#eaeaea; overflow: auto;">-->
<app-sidebar fxFlex="nogrow" [items]="getSidebarItems()" (activeItmEmitter)="changeActiveItem($event)"
[activeItem]="getActiveItem()"></app-sidebar>
<!-- </div>-->
<div fxFlex="100%" id="mainView">
<app-intro [ngClass]="{'hidden-cls': activeItem!==0 }"></app-intro>
<ng-container *ngFor="let mvw of getMainviewItems()" >
<app-data-view-container [item]="mvw" [ngClass]="{'hidden-cls': activeItem!==mvw.id }"></app-data-view-container>
</ng-container>
</div>
<app-chatbox id="chatBox" fxFlexAlign="end" fxFlex="auto" (actnEmitter)="addNewUserMessage($event)"></app-chatbox>
</div>
<router-outlet></router-outlet>
23 changes: 23 additions & 0 deletions ida-chatbot/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';

import { AppComponent } from './app.component';
import { MessageListComponent } from './components/message-list/message-list.component';
Expand All @@ -11,6 +12,11 @@ import {HttpModule} from '@angular/http';
import {CdkTableModule} from '@angular/cdk/table';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import { FlexLayoutModule } from '@angular/flex-layout';
import { LoginComponent } from './components/login/login.component';
import { UserComponent } from './components/user/user.component';
import { SignupComponent } from './components/signup/signup.component';
import {DeleteDialogComponent} from './dialogs/delete/delete.dialog.component';
import {UpdateDialogComponent} from './dialogs/update/update.dialog.component';
import {
MatAutocompleteModule,
MatButtonModule,
Expand Down Expand Up @@ -60,6 +66,9 @@ import {DatatableDetailComponent} from './components/datatable-detail/datatable-
import { SsbViewComponent } from './components/ssb-view/ssb-view.component';
import { VennViewComponent } from './components/venn-view/venn-view.component';
import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component';
import { HomeComponent } from './components/home/home.component';
import { TopbarComponent } from './components/topbar/topbar.component';
import { TopmenuComponent } from './components/topmenu/topmenu.component';
import { SpeechInputComponent } from './components/speech-input/speech-input.component';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
Expand All @@ -81,6 +90,14 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
SsbViewComponent,
VennViewComponent,
DeckglHexViewComponent,
LoginComponent,
UserComponent,
SignupComponent,
DeleteDialogComponent,
UpdateDialogComponent,
HomeComponent,
TopbarComponent,
TopmenuComponent,
SpeechInputComponent
],
imports: [
Expand Down Expand Up @@ -123,8 +140,14 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
MatToolbarModule,
MatTooltipModule,
FlexLayoutModule,
ReactiveFormsModule,
AppRoutingModule,
NgbModule
],
entryComponents: [
UpdateDialogComponent,
DeleteDialogComponent
],
providers: [{
provide: HTTP_INTERCEPTORS,
useClass: RestService ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.chat-popup {
position: fixed;
bottom: 0;
right: 9%;
z-index: 9;
width: 25%;
}
Expand Down
8 changes: 8 additions & 0 deletions ida-chatbot/src/app/components/home/home.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.example-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: lightseagreen;
}
16 changes: 16 additions & 0 deletions ida-chatbot/src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div *ngIf="!this.isHidden">
<app-topmenu></app-topmenu>
<div fxLayout="row">
<!--<div fxFlex="10%" style="background-color:#eaeaea; overflow: auto;">-->
<app-sidebar fxFlex="nogrow" [items]="getSidebarItems()" (activeItmEmitter)="changeActiveItem($event)"
[activeItem]="getActiveItem()"></app-sidebar>
<!-- </div>-->
<div fxFlex="100%">
<app-intro [ngClass]="{'hidden-cls': activeItem!==0 }"></app-intro>
<ng-container *ngFor="let mvw of getMainviewItems()" >
<app-data-view-container [item]="mvw" [ngClass]="{'hidden-cls': activeItem!==mvw.id }"></app-data-view-container>
</ng-container>
</div>
<app-chatbox fxFlexAlign="end" fxFlex="auto" (actnEmitter)="addNewUserMessage($event)"></app-chatbox>
</div>
</div>
28 changes: 28 additions & 0 deletions ida-chatbot/src/app/components/home/home.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { TestBed, async } from '@angular/core/testing';
import { HomeComponent } from './home.component';

describe('HomeComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
HomeComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(HomeComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(HomeComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(HomeComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
}));
});
171 changes: 171 additions & 0 deletions ida-chatbot/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import {Component, OnInit, ElementRef, QueryList, ViewChild, ViewChildren} from '@angular/core';
import {Message} from '../../models/message';
import {ResponseBean} from '../../models/response-bean';
import {SidebarComponent} from '../../components/sidebar/sidebar.component';
import {MainviewElement} from '../../models/mainview-element';
import {SidebarElement} from '../../models/sidebar-element';
import {ChatboxComponent} from '../../components/chatbox/chatbox.component';
import {RestService} from '../../service/rest/rest.service';
import {DataViewContainerComponent} from '../../components/data-view-container/data-view-container.component';
import {TabElement} from '../../models/tab-element';
import {UniqueIdProviderService} from '../../service/misc/unique-id-provider.service';
import {TabType} from '../../enums/tab-type.enum';
import {IdaEventService} from '../../service/event/ida-event.service';
import {UserService} from '../../service/user/user.service';
import {Router} from '@angular/router';

@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {

idCount = 1;
title = 'app';
isHidden = true;
public introSideItem = new SidebarElement(0, 'Introduction', 'intro');
public activeItem = 0;
private sidebarItems: SidebarElement[] = [this.introSideItem];
private mainViewItems: MainviewElement[] = [];
@ViewChild(ChatboxComponent)
private chatboxComp: ChatboxComponent;
@ViewChildren(DataViewContainerComponent)
private dataVwCompList: QueryList<DataViewContainerComponent>;
@ViewChild(SidebarComponent)
private sbComp: SidebarComponent;

constructor(private restservice: RestService, private uis: UniqueIdProviderService,
private ies: IdaEventService, private userservice: UserService, private router: Router) {
ies.dtTblEvnt.subscribe((reqTbl) => {
this.getDataTable(reqTbl);
});
}

ngOnInit() {
this.checkLoggedIn();
}

HomeComponent() {
}

public actionHandler(resp: ResponseBean) {
if (resp.actnCode === 1) {
const newId = this.idCount++;
// load the dataset
const sdbEle = new SidebarElement(newId, resp.payload.label, resp.payload.dsName);
this.sidebarItems.push(sdbEle);
const mvEle = new MainviewElement(newId, resp.payload.dataset, resp.payload.dsMd);
this.mainViewItems.push(mvEle);
this.activeItem = newId;
} else if (resp.actnCode === 2) {
// Open new tab with Force Directed Graph
const newTab = new TabElement(this.uis.getUniqueId(), 'Force Directed Graph', TabType.FDG, resp.payload.fdgData, true, true);
this.addNewTab(newTab, resp);
} else if (resp.actnCode === 3) {
// Open new tab with Bar Graph
const newTab = new TabElement(this.uis.getUniqueId(), 'Bar Graph', TabType.BG, resp.payload.bgData, true, true);
this.addNewTab(newTab, resp);
} else if (resp.actnCode === 4) {
// Open new tab with DataTable
const newTab = new TabElement(this.uis.getUniqueId(), resp.payload.tabLabel, TabType.DTTBL, resp.payload.clusterData, true, true);
this.addNewTab(newTab, resp);
} else if (resp.actnCode === 5) {
// Open new tab with DataTable
const newTab = new TabElement(this.uis.getUniqueId(), resp.payload.actvTbl, TabType.DTTBL, resp.payload.dataTable, true, true);
this.addNewTab(newTab, resp);
}
}

addNewTab(newTab: TabElement, resp: ResponseBean) {
for (const mvwItem of this.mainViewItems) {
if (Number(resp.payload.actvScrId) === mvwItem.id) {
// Add a tab to extra tabs
mvwItem.tabArr.push(newTab);
this.getActiveMainView().focusLastTab();
break;
}
}
}

addNewUserMessage(message: Message) {
this.chatboxComp.addNewMessage(message);
let actvTbl = '';
let actvDs = '';
if (this.getActiveMainView() && this.sbComp) {
actvTbl = this.getActiveMainView().getActiveDataTableName();
actvDs = this.sbComp.getActiveDatasetName();
}
const prmobj = {
msg: message.content,
actvScrId: this.activeItem,
actvTbl: actvTbl == null ? '' : actvTbl,
actvDs: actvDs == null ? '' : actvDs
};
// Send the message to server
this.restservice.getRequest('/message/sendmessage', prmobj).subscribe(resp => this.processBotResponse(resp));
}

getDataTable(reqTbl: string) {
let actvDs = '';
if (this.getActiveMainView() && this.sbComp) {
actvDs = this.sbComp.getActiveDatasetName();
}
const prmobj = {
actvScrId: this.activeItem,
actvTbl: reqTbl == null ? '' : reqTbl,
actvDs: actvDs == null ? '' : actvDs
};
// Send the message to server
this.restservice.getRequest('/message/getdatatable', prmobj).subscribe(resp => this.processBotResponse(resp));
}

processBotResponse(resp: ResponseBean) {
this.restservice.requestEvnt.emit(false);
const msg: Message = new Message(resp.chatmsg, 'Assistant', 'chatbot', new Date());
// Putting delay to make responses look natural
setTimeout(() => this.chatboxComp.addNewMessage(msg), 300);
if (resp.actnCode > 0) {
// load the dataset
this.actionHandler(resp);
}
}

checkLoggedIn() {
this.restservice.getRequest('/auth/check-login', {}).subscribe(resp => {
const returnResp = this.userservice.processUserResponse(resp);
if (returnResp.status === true) {
this.isHidden = false;
} else {
this.router.navigate(['login']);
}
});
}

public getActiveMainView(): DataViewContainerComponent {
let activeMainDtVw = null;
this.dataVwCompList.forEach((mvEntry) => {
if (mvEntry.item.id === this.activeItem) {
activeMainDtVw = mvEntry;
}
});
return activeMainDtVw;
}

public getMainviewItems() {
return this.mainViewItems;
}

public getSidebarItems() {
return this.sidebarItems;
}

public changeActiveItem(newId: number) {
this.activeItem = newId;
}

public getActiveItem() {
return this.activeItem;
}

}
33 changes: 33 additions & 0 deletions ida-chatbot/src/app/components/login/login.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
mat-form-field{
width: 400px;
}
mat-card-title{
text-align: center;
}
mat-card{
width: 400px;
margin: 70px auto;
}
mat-spinner{
position: absolute;
top: 50%;
left: 38%;
}

.mat-card-header .mat-card-title, .mat-card-subtitle{
font-size: 12px;
}

.mat-display-2{
margin: 0 0 20px;
}

mat-form-field, mat-card-content{
width: 100%;
}

mat-card-actions{
width: 100%;
text-align: right;
margin-bottom: 0;
}
Loading