diff --git a/RecollectApp/Backend/Routes/application.js b/RecollectApp/Backend/Routes/application.js index 66ff331..130ef35 100644 --- a/RecollectApp/Backend/Routes/application.js +++ b/RecollectApp/Backend/Routes/application.js @@ -36,7 +36,10 @@ router.post("/addNewNote" , (req,res,next) => { title: req.body.title, details: req.body.details, placeholderTitle: req.body.placeholderTitle, - placeholder: req.body.placeholder + placeholder: req.body.placeholder, + reminder: req.body.reminder, + draft: req.body.draft, + trash: req.body.trash }); console.log(' signup method occured.. 2'); @@ -165,7 +168,87 @@ router.post("/loginOne", (req, res) => { }); + + router.put("/updatereminder/:id",(req,res,next)=>{ + console.log("inside get all note data function"); + console.log("id = "+ req.params.id); + const noteData = new Note({ + _id : req.params.id, + userId: req.body.userId, + indexPosition: req.body.indexPosition, + title: req.body.title, + details: req.body.details, + placeholderTitle: req.body.placeholderTitle, + placeholder: req.body.placeholder, + reminder: req.body.reminder, + draft: req.body.draft, + trash: req.body.trash + + }); + + Note.updateOne({_id : req.params.id},noteData). + then(result=>{ + + res.status(201).json({ + message: "user update remainder successfully", + result:result, + + }); + + + + + + }); + }); + + + //// get Draft Data + + router.get("/getDraftNoteData/:id",(req,res,next)=>{ + console.log("inside get all note data function"); + console.log("id = "+ req.params.id); + Note.find({userId : req.params.id, draft:1,reminder:0,trash:0}). + then(documents => { + console.log("NoteData = "+documents); + res.json( + documents + ); + }); + }); + + + //// get Reminder Data + + router.get("/getReminderNoteData/:id",(req,res,next)=>{ + console.log("inside getReminderNoteData note data function"); + console.log("id = "+ req.params.id); + Note.find({userId : req.params.id, draft:0,reminder:1,trash:0}). + then(documents => { + console.log("NoteData = "+documents); + res.json( + documents + ); + }); + }); + + + //// get Trash Data + + router.get("/getTrasheData/:id",(req,res,next)=>{ + console.log("inside get all note data function"); + console.log("id = "+ req.params.id); + Note.find({userId : req.params.id, draft:0,reminder:0,trash:1}). + then(documents => { + console.log("NoteData = "+documents); + res.json( + documents + ); + }); + }); + + module.exports = router; diff --git a/RecollectApp/Backend/models/notedata.js b/RecollectApp/Backend/models/notedata.js index afc2f9a..aebae65 100644 --- a/RecollectApp/Backend/models/notedata.js +++ b/RecollectApp/Backend/models/notedata.js @@ -12,13 +12,16 @@ const userSchema = mongoose.Schema({ details: { type: String, required: true }, placeholderTitle: { type: String, required: true }, placeholder: { type: String, required: true }, + reminder: { type: Number, required: true }, + draft: { type: Number, required: true }, + trash: { type: Number, required: true } }); -module.exports = mongoose.model("tbl_note_data", userSchema); +module.exports = mongoose.model("noteSchema", userSchema); diff --git a/RecollectApp/Backend/models/user.js b/RecollectApp/Backend/models/user.js index ce458d0..57d5405 100644 --- a/RecollectApp/Backend/models/user.js +++ b/RecollectApp/Backend/models/user.js @@ -15,7 +15,7 @@ const userSchema = mongoose.Schema({ }); -module.exports = mongoose.model("tbl_user_basic_data", userSchema); +module.exports = mongoose.model("userSchema", userSchema); diff --git a/RecollectApp/Backend/server.js b/RecollectApp/Backend/server.js index 068a166..3a8d67f 100644 --- a/RecollectApp/Backend/server.js +++ b/RecollectApp/Backend/server.js @@ -15,7 +15,7 @@ app.use((req, res, next) => { ); res.setHeader( "Access-Control-Allow-Methods", - "GET, POST, PATCH, DELETE, OPTIONS" + "GET, POST, PATCH, DELETE, OPTIONS, PUT " ); next(); }); diff --git a/RecollectApp/src/app/Pages/main-layout/main-layout.component.html b/RecollectApp/src/app/Pages/main-layout/main-layout.component.html deleted file mode 100644 index 2af39f2..0000000 --- a/RecollectApp/src/app/Pages/main-layout/main-layout.component.html +++ /dev/null @@ -1,15 +0,0 @@ -
-
-

Recollect

- -
- - -
- - - -
- - -
diff --git a/RecollectApp/src/app/Pages/main-layout/main-layout.component.scss b/RecollectApp/src/app/Pages/main-layout/main-layout.component.scss deleted file mode 100644 index e19895f..0000000 --- a/RecollectApp/src/app/Pages/main-layout/main-layout.component.scss +++ /dev/null @@ -1,37 +0,0 @@ -@import '../../../main-style.scss'; - -.layout-box -{ - display :flex; - flex-direction :column; - height :100%; - overflow :hidden; - - -.page-content{ - flex-grow:1; - overflow-y:scroll; -} - -} - -.top-bar -{ -width:100%; -height:68px; -background:linear-gradient(to right, $pink,$blue); -display: flex; -flex-shrink: 0; - -box-shadow: 0px 0px 10px 0px rgba(black, 0.15); - -//center child element -justify-content: center; -align-items: center; - -h1 { - color: white; - font-size : 24 px; -} - -} \ No newline at end of file diff --git a/RecollectApp/src/app/Pages/main-layout/main-layout.component.spec.ts b/RecollectApp/src/app/Pages/main-layout/main-layout.component.spec.ts deleted file mode 100644 index 4acee9f..0000000 --- a/RecollectApp/src/app/Pages/main-layout/main-layout.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MainLayoutComponent } from './main-layout.component'; - -describe('MainLayoutComponent', () => { - let component: MainLayoutComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ MainLayoutComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(MainLayoutComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/RecollectApp/src/app/Pages/main-layout/main-layout.component.ts b/RecollectApp/src/app/Pages/main-layout/main-layout.component.ts deleted file mode 100644 index dbf1f1b..0000000 --- a/RecollectApp/src/app/Pages/main-layout/main-layout.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-main-layout', - templateUrl: './main-layout.component.html', - styleUrls: ['./main-layout.component.scss'] -}) -export class MainLayoutComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/RecollectApp/src/app/Pages/notes-list/notes-list.component.html b/RecollectApp/src/app/Pages/notes-list/notes-list.component.html deleted file mode 100644 index 71f4eaa..0000000 --- a/RecollectApp/src/app/Pages/notes-list/notes-list.component.html +++ /dev/null @@ -1,28 +0,0 @@ -
- -
-
-

- - - - -

-
- Add New Note -
- - -
- - - -
- - - -
\ No newline at end of file diff --git a/RecollectApp/src/app/Pages/notes-list/notes-list.component.scss b/RecollectApp/src/app/Pages/notes-list/notes-list.component.scss deleted file mode 100644 index a5ea2cb..0000000 --- a/RecollectApp/src/app/Pages/notes-list/notes-list.component.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import '../../../main-style.scss'; - -.main-container{ - display: flex; - flex-direction: column; - max-width: 500px; - - - margin : auto; - - - padding-top : 50px; -} - -.newText -{ - color:linear-gradient(to right, $pink,$blue); -} - -.notes-list -{ - margin-top : 35px; -} - -app-note-card{ - display: block; - margin-bottom: 25px;; -} \ No newline at end of file diff --git a/RecollectApp/src/app/Pages/notes-list/notes-list.component.ts b/RecollectApp/src/app/Pages/notes-list/notes-list.component.ts deleted file mode 100644 index a36cc1b..0000000 --- a/RecollectApp/src/app/Pages/notes-list/notes-list.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { NoteData } from 'src/app/note-data'; - -@Component({ - selector: 'app-notes-list', - templateUrl: './notes-list.component.html', - styleUrls: ['./notes-list.component.scss'] -}) -export class NotesListComponent implements OnInit { - - noteD : any = new NoteData("","",0,"","","New Title","Add Details Here.."); - - - noteDataArr : any = [ ]; - - - - constructor() { } - - ngOnInit(): void { - } - - - - addNewNote() - { - // console.log("Before this.noteD.indexPosition -- "+ this.noteD.indexPosition); - // console.log(" Length of Araay -- "+ this.noteDataArr.length); - // this.noteD.indexPosition = this.noteDataArr.length; - console.log(" After this.noteD.indexPosition -- "+ this.noteD.indexPosition); - this.noteDataArr.push(new NoteData("","",this.noteDataArr.length,"","","New Title","Add Details Here..")); - } - - - deleteNoteElement(cData : NoteData) - { - console.log("****This = "+this.noteD.indexPosition); - this.noteDataArr.splice(this.noteD.indexPosition, 1); - //this.noteDataArr = this.noteDataArr; - } - -} diff --git a/RecollectApp/src/app/app-routing.module.ts b/RecollectApp/src/app/app-routing.module.ts index 86934f5..1650e2e 100644 --- a/RecollectApp/src/app/app-routing.module.ts +++ b/RecollectApp/src/app/app-routing.module.ts @@ -1,8 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; -import { MainLayoutComponent } from './Pages/main-layout/main-layout.component'; -import { NotesListComponent } from './Pages/notes-list/notes-list.component'; const routes: Routes = [ { @@ -16,7 +15,10 @@ const routes: Routes = [ loadChildren: () => import('./home/home.module').then((m) => m.HomeModule), }, - +{ + path : '**', + component:PageNotFoundComponent +} /* {path : '' , component: LoginComponent}, {path : 'login' , component: LoginComponent}, diff --git a/RecollectApp/src/app/app.module.ts b/RecollectApp/src/app/app.module.ts index 6ecfd8a..445a220 100644 --- a/RecollectApp/src/app/app.module.ts +++ b/RecollectApp/src/app/app.module.ts @@ -5,15 +5,13 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { HeaderComponent } from './header/header.component'; - -import { MainLayoutComponent } from './Pages/main-layout/main-layout.component'; -import { NotesListComponent } from './Pages/notes-list/notes-list.component'; import { FormsModule } from '@angular/forms'; import{ HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { AuthInterceptor } from './auth-interceptor'; import { ErrorInterceptor } from './error-interceptor'; import { ErrorPopupComponent } from './error-popup/error-popup.component'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; @@ -21,10 +19,8 @@ import { MatDialog, MatDialogModule } from '@angular/material/dialog'; declarations: [ AppComponent, HeaderComponent, - - MainLayoutComponent, - NotesListComponent, ErrorPopupComponent, + PageNotFoundComponent, ], diff --git a/RecollectApp/src/app/auth-dash-board-child.guard.ts b/RecollectApp/src/app/auth-dash-board-child.guard.ts new file mode 100644 index 0000000..141df1d --- /dev/null +++ b/RecollectApp/src/app/auth-dash-board-child.guard.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class AuthDashBoardChildGuard implements CanActivate { + canActivate( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + + console.log(" ******* child Guard 1 "); + return true; + } + +} diff --git a/RecollectApp/src/app/auth-dash-board.guard.spec.ts b/RecollectApp/src/app/auth-dash-board.guard.spec.ts new file mode 100644 index 0000000..38d3b22 --- /dev/null +++ b/RecollectApp/src/app/auth-dash-board.guard.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { AuthDashBoardGuard } from './auth-dash-board.guard'; + +describe('AuthDashBoardGuard', () => { + let guard: AuthDashBoardGuard; + + beforeEach(() => { + TestBed.configureTestingModule({}); + guard = TestBed.inject(AuthDashBoardGuard); + }); + + it('should be created', () => { + expect(guard).toBeTruthy(); + }); +}); diff --git a/RecollectApp/src/app/auth-dash-board.guard.ts b/RecollectApp/src/app/auth-dash-board.guard.ts new file mode 100644 index 0000000..eecc334 --- /dev/null +++ b/RecollectApp/src/app/auth-dash-board.guard.ts @@ -0,0 +1,25 @@ +import { Injectable } from '@angular/core'; +import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class AuthDashBoardGuard implements CanActivate { + canActivate( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + console.log(" *************** canActivate ******localStorage.getItem******* " + localStorage.getItem("userId")); + + //check some condition + if (localStorage.getItem("userId") != null) { + + + //redirect to login/home page etc + //return false to cancel the navigation + return true; + } + return false; + } + +} diff --git a/RecollectApp/src/app/auth.service.ts b/RecollectApp/src/app/auth.service.ts index 1782d5c..a2a6813 100644 --- a/RecollectApp/src/app/auth.service.ts +++ b/RecollectApp/src/app/auth.service.ts @@ -112,7 +112,7 @@ export class AuthService { /*This is a logic to navigate to Home Page.. we can add any component */ - this.router.navigate(['/homelink']); + this.router.navigate(['/homelink/note']); }) @@ -130,13 +130,17 @@ export class AuthService { this.authStatusListener.next(false); /*This function clears all stored data inside local storage */ + localStorage.clear(); - localStorage.removeItem("token"); - localStorage.removeItem("expiration"); - localStorage.removeItem("userRole"); +localStorage.removeItem("userId"); +localStorage.removeItem("userEmailId"); +localStorage.removeItem("loggedInUser"); +localStorage.removeItem("token"); +localStorage.removeItem("expiration"); +localStorage.removeItem("userRole"); /*This is a logic to navigate to Login Page.. we can add any component */ - this.router.navigate(['/login']); + this.router.navigate(['/newLogin']); } @@ -167,6 +171,9 @@ localStorage.setItem("userEmailId", loggedInUser.email); /*This function clears all local storage data */ private clearAuthData() { localStorage.clear(); +localStorage.removeItem("userId"); +localStorage.removeItem("userEmailId"); +localStorage.removeItem("loggedInUser"); localStorage.removeItem("token"); localStorage.removeItem("expiration"); localStorage.removeItem("userRole"); @@ -191,6 +198,30 @@ userId: userId + + + +// getNoteData function is for fetching all notes +getNoteData() : any{ + console.log("inside this function getnotedata()"); + let d = new Date(); + let hostUrl = 'http://localhost:3000/apps/getAllNoteData/'; + let uid = localStorage.getItem("userId"); + console.log("***********uid._id *********** " + uid); + hostUrl = hostUrl + uid; + return this.http.get(hostUrl); +} + +//getUserEmailId function is use for diplay user account email id +getUserEmailId() : any{ + +console.log('inside getuseremailid function'); + console.log("email = "+localStorage.getItem('userEmailId') ); + return localStorage.getItem('userEmailId'); +} + + + //*** Add Note URL */ addnote(nData:NoteData){ @@ -198,34 +229,120 @@ addnote(nData:NoteData){ let uid = localStorage.getItem("userId"); console.log("***********uid._id *********** " + uid); nData.userId = uid; + nData.reminder=0; + nData.draft=1; + nData.trash=0; let body : any = nData; let d = new Date(); let hostUrl = 'http://localhost:3000/apps/addNewNote?v='+d.toLocaleTimeString(); - return this.http.post(hostUrl,body); + this.http.post(hostUrl,body).subscribe(response => { + this.router.navigate(['/homelink/note']); + }); } + +// saveReminder fuction for save note in remainder page to database +saveReminder(nData:NoteData){ + + console.log("note save in reminder"+ nData); + nData.reminder=1; + nData.draft=0; + nData.trash=0; + let body : any = nData; + let ld = new Date(); + let hostUrl = 'http://localhost:3000/apps/updatereminder/'; + let uid = nData._id; + hostUrl = hostUrl + uid; + + return this.http.put<{ user :SingupData}>(hostUrl, body).subscribe(response => + { + console.log("save remainder successfully"); + this.router.navigate(['/homelink/remainder']); + }); + + + +} +saveDraft(nData:NoteData){ + console.log("note save in draft"+ nData); + nData.reminder=0; + nData.draft=1; + nData.trash=0; + let body : any = nData; + let ld = new Date(); + let hostUrl = 'http://localhost:3000/apps/updatereminder/'; + let uid = nData._id; + hostUrl = hostUrl + uid; + + return this.http.put<{ user :SingupData}>(hostUrl, body).subscribe(response => + { + console.log("save trash successfully"); + this.router.navigate(['/homelink/note']); + }); +} +saveTrash(nData:NoteData){ + console.log("note save in trash"+ nData); + nData.reminder=0; + nData.draft=0; + nData.trash=1; + let body : any = nData; + let ld = new Date(); + let hostUrl = 'http://localhost:3000/apps/updatereminder/'; + let uid = nData._id; + hostUrl = hostUrl + uid; + + return this.http.put<{ user :SingupData}>(hostUrl, body).subscribe(response => + { + console.log("save trash successfully"); + this.router.navigate(['/homelink/trash']); + }); + + + +} + + + + + +///getReminder Page Data + // getNoteData function is for fetching all notes -getNoteData() : any{ - console.log("inside this function getnotedata()"); +getReminderData() : any{ + console.log("inside this function getReminderData()"); let d = new Date(); - let hostUrl = 'http://localhost:3000/apps/getAllNoteData/'; + let hostUrl = 'http://localhost:3000/apps/getReminderNoteData/'; let uid = localStorage.getItem("userId"); console.log("***********uid._id *********** " + uid); hostUrl = hostUrl + uid; return this.http.get(hostUrl); } -//getUserEmailId function is use for diplay user account email id -getUserEmailId() : any{ - -console.log('inside getuseremailid function'); - console.log("email = "+localStorage.getItem('userEmailId') ); - return localStorage.getItem('userEmailId'); + +// getNoteData function is for fetching all notes +getDraftNotesData() : any{ + console.log("inside this function getDraftNotesData()"); + let d = new Date(); + let hostUrl = 'http://localhost:3000/apps/getDraftNoteData/'; + let uid = localStorage.getItem("userId"); + console.log("***********uid._id *********** " + uid); + hostUrl = hostUrl + uid; + hostUrl= hostUrl+'?v='+d.toLocaleDateString(); + return this.http.get(hostUrl); } +getTrashData() : any{ + console.log("inside this function getTrashData()"); + let d = new Date(); + let hostUrl = 'http://localhost:3000/apps/getTrasheData/'; + let uid = localStorage.getItem("userId"); + console.log("***********uid._id *********** " + uid); + hostUrl = hostUrl + uid; + return this.http.get(hostUrl); +} diff --git a/RecollectApp/src/app/authentication.guard.ts b/RecollectApp/src/app/authentication.guard.ts new file mode 100644 index 0000000..a2657cb --- /dev/null +++ b/RecollectApp/src/app/authentication.guard.ts @@ -0,0 +1,34 @@ +import { Injectable } from '@angular/core'; +import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class AuthenticationGuard implements CanActivateChild { + constructor(private router : Router) { + + } + canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot,): boolean | UrlTree | Observable | Promise { + + console.log(" *************** canActivateChild ******localStorage.getItem******* " + localStorage.getItem("userId")); + + //check some condition + if (localStorage.getItem("userId") == null) { + alert('You are not allowed to view this page'); + //redirect to login/home page etc + //return false to cancel the navigation + this.router.navigate(['homelink/error']) + } + return true; + } + } + // canActivate( + // route: ActivatedRouteSnapshot, + // state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + // return true; + // } + + + + diff --git a/RecollectApp/src/app/home/default/default.component.html b/RecollectApp/src/app/home/default/default.component.html index fdf1c0c..b0b3c4c 100644 --- a/RecollectApp/src/app/home/default/default.component.html +++ b/RecollectApp/src/app/home/default/default.component.html @@ -22,19 +22,19 @@ -
+
diff --git a/RecollectApp/src/app/home/default/default.component.scss b/RecollectApp/src/app/home/default/default.component.scss index da0a4ea..80e94b5 100644 --- a/RecollectApp/src/app/home/default/default.component.scss +++ b/RecollectApp/src/app/home/default/default.component.scss @@ -11,11 +11,11 @@ left: 0; width: 250px; height: 100%; - background: #042331; + background:linear-gradient(to right, $pink,$blue); transition: all .5s ease; } .side-bar header{ - background: #063146; + background:linear-gradient(to right, $pink,$blue); font-size: 22px; color: white; text-align: center; @@ -32,6 +32,7 @@ box-sizing: border-box; border-top: 1px solid rgba(255,255,255, .1); border-bottom: 1px solid black; + color: white; } diff --git a/RecollectApp/src/app/home/default/default.component.ts b/RecollectApp/src/app/home/default/default.component.ts index 47c0682..c4648b1 100644 --- a/RecollectApp/src/app/home/default/default.component.ts +++ b/RecollectApp/src/app/home/default/default.component.ts @@ -19,4 +19,9 @@ export class DefaultComponent implements OnInit { } + logOut() + { + this.authService.logout(); + } + } diff --git a/RecollectApp/src/app/home/home-routing.module.ts b/RecollectApp/src/app/home/home-routing.module.ts index c09cb45..ab23b4b 100644 --- a/RecollectApp/src/app/home/home-routing.module.ts +++ b/RecollectApp/src/app/home/home-routing.module.ts @@ -2,6 +2,10 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; + +import { AuthDashBoardGuard } from '../auth-dash-board.guard'; + +import { PageNotFoundComponent } from '../page-not-found/page-not-found.component'; import { DefaultComponent } from './default/default.component'; import { NoteComponent } from './note/note.component'; @@ -14,15 +18,30 @@ const routes: Routes = [ { path:'', component:DefaultComponent, - children:[ + canActivate :[AuthDashBoardGuard], + + children:[ {path: 'trash', - component: TrashComponent + component: TrashComponent, + canActivate :[AuthDashBoardGuard] + }, {path: 'note', - component: NoteComponent}, + component: NoteComponent, + canActivate :[AuthDashBoardGuard] + + }, {path:'remainder', - component:RemainderComponent} + component:RemainderComponent, + canActivate :[AuthDashBoardGuard] + + }, + + { + path : '**', + component:PageNotFoundComponent + } diff --git a/RecollectApp/src/app/home/note-child/note-child.component.html b/RecollectApp/src/app/home/note-child/note-child.component.html index bca77de..af02cd9 100644 --- a/RecollectApp/src/app/home/note-child/note-child.component.html +++ b/RecollectApp/src/app/home/note-child/note-child.component.html @@ -6,24 +6,24 @@
-
+
- + -
+ English   Hindi   Marathi
- +
@@ -44,12 +44,15 @@

-    +    + +    -    + +    +    -    -    +
diff --git a/RecollectApp/src/app/home/note-child/note-child.component.ts b/RecollectApp/src/app/home/note-child/note-child.component.ts index af1ac13..9b85a97 100644 --- a/RecollectApp/src/app/home/note-child/note-child.component.ts +++ b/RecollectApp/src/app/home/note-child/note-child.component.ts @@ -69,11 +69,25 @@ export class NoteChildComponent implements OnInit { } saveNote(){ - this.authService.addnote(this.nData).subscribe((response) =>{ + this.authService.addnote(this.nData); + } + saveReminder(){ + + + this.authService.saveReminder(this.nData); + + +} + + + saveDraft(){ + this.authService.saveDraft(this.nData); + + } + + saveTrash(){ + this.authService.saveTrash(this.nData); - alert('Note Saved !'); - - }); } } diff --git a/RecollectApp/src/app/home/note/note.component.html b/RecollectApp/src/app/home/note/note.component.html index fc99f9c..ecfbc48 100644 --- a/RecollectApp/src/app/home/note/note.component.html +++ b/RecollectApp/src/app/home/note/note.component.html @@ -1,43 +1,54 @@ -
+
+
+ Note +
+
+ +
+
+
+
+ + +
+
+
-
+
+
+
+
+ +
+

+ + +

+
+
+ + + + + + + +
- - - diff --git a/RecollectApp/src/app/home/note/note.component.scss b/RecollectApp/src/app/home/note/note.component.scss index beb2cd0..ab0fe78 100644 --- a/RecollectApp/src/app/home/note/note.component.scss +++ b/RecollectApp/src/app/home/note/note.component.scss @@ -1,15 +1,15 @@ @import '../../../main-style.scss'; - + .main-container{ - display: flex; + /* display: flex; flex-direction: column; max-width: 500px; - margin : auto; + margin : auto; */ - padding-top : 150px; + padding-top : 100px; } .newText @@ -25,4 +25,4 @@ app-note-card{ display: block; margin-bottom: 25px;; -} \ No newline at end of file +} \ No newline at end of file diff --git a/RecollectApp/src/app/home/note/note.component.ts b/RecollectApp/src/app/home/note/note.component.ts index fff3202..4248436 100644 --- a/RecollectApp/src/app/home/note/note.component.ts +++ b/RecollectApp/src/app/home/note/note.component.ts @@ -9,18 +9,18 @@ import { NoteData } from 'src/app/note-data'; }) export class NoteComponent implements OnInit { - noteD : any = new NoteData("","",0,"","","New Title","Add Details Here.."); - + noteD : any = new NoteData("","",0,"","","New Title","Add Details Here..","","","",); noteDataArr : any = [ ]; - +takeNoteFlag :boolean = false; +nData : any = new NoteData("","",this.noteDataArr.length,"","","New Title","Add Details Here..","","",""); constructor( private authService : AuthService) { } ngOnInit(): void { console.log('*****inti******'); - this.authService.getNoteData().subscribe((p: NoteData[])=>{ + this.authService.getDraftNotesData().subscribe((p: NoteData[])=>{ console.log('data received3 ::--- '+p); if(p != null){ console.log('inside if notnull') @@ -32,8 +32,15 @@ export class NoteComponent implements OnInit { }) } + showCard(){ + if(this.takeNoteFlag = true){ + console.log("first card show"); + } + else{ + this.takeNoteFlag = false; + } - + } addNewNote() { @@ -41,7 +48,13 @@ export class NoteComponent implements OnInit { // console.log(" Length of Araay -- "+ this.noteDataArr.length); // this.noteD.indexPosition = this.noteDataArr.length; console.log(" After this.noteD.indexPosition -- "+ this.noteD.indexPosition); - this.noteDataArr.push(new NoteData("","",this.noteDataArr.length,"","","New Title","Add Details Here..")); + this.noteDataArr.push(new NoteData("","",this.noteDataArr.length,"","","New Title","Add Details Here..","","","")); + } + saveNote(){ + this.authService.addnote(this.nData); + window.location.reload(); + //this.showCard(); + } diff --git a/RecollectApp/src/app/home/remainder/remainder.component.html b/RecollectApp/src/app/home/remainder/remainder.component.html index 7c210d1..94fb15a 100644 --- a/RecollectApp/src/app/home/remainder/remainder.component.html +++ b/RecollectApp/src/app/home/remainder/remainder.component.html @@ -1,28 +1,37 @@
+ + +
+
+ Remainder +
+ -
-
+ + +
+
diff --git a/RecollectApp/src/app/home/remainder/remainder.component.scss b/RecollectApp/src/app/home/remainder/remainder.component.scss index b3c8cac..d1ec1b5 100644 --- a/RecollectApp/src/app/home/remainder/remainder.component.scss +++ b/RecollectApp/src/app/home/remainder/remainder.component.scss @@ -4,4 +4,17 @@ // padding: 0; // list-style: none; // text-decoration: none; -// } \ No newline at end of file +// } +@import '../../../main-style.scss'; + +.main-container{ + // display: flex; + // flex-direction: column; + // max-width: 500px; + + + // margin : auto; + + + padding-top :100px; +} \ No newline at end of file diff --git a/RecollectApp/src/app/home/remainder/remainder.component.ts b/RecollectApp/src/app/home/remainder/remainder.component.ts index 451a21d..d4ace39 100644 --- a/RecollectApp/src/app/home/remainder/remainder.component.ts +++ b/RecollectApp/src/app/home/remainder/remainder.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { AuthService } from 'src/app/auth.service'; +import { NoteData } from 'src/app/note-data'; @Component({ selector: 'app-remainder', @@ -7,9 +9,34 @@ import { Component, OnInit } from '@angular/core'; }) export class RemainderComponent implements OnInit { - constructor() { } + noteDataArr : any = [ ]; + + + + constructor( private authService : AuthService) { } ngOnInit(): void { + console.log('*****inti******'); + this.authService.getReminderData().subscribe((p: NoteData[])=>{ + console.log('data received3 ::--- '+p); + if(p != null){ + console.log('inside if notnull') + this.noteDataArr = p; + + } + + + }) + } + + deleteNoteElement(cData : NoteData) + { + console.log("****This index = "+cData.indexPosition); + this.noteDataArr.splice(cData.indexPosition, 1); + //this.noteDataArr = this.noteDataArr; + } + + } diff --git a/RecollectApp/src/app/home/trash/trash.component.html b/RecollectApp/src/app/home/trash/trash.component.html index 4ceec39..2cea263 100644 --- a/RecollectApp/src/app/home/trash/trash.component.html +++ b/RecollectApp/src/app/home/trash/trash.component.html @@ -1,5 +1,10 @@ -
-
+
+
+ Trash +
+ + + + Note    undo  
-
+
--> -
- You can use letters, numbers -
-
+ [class.is-invalid] = "email.invalid && email.touched" + pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" + /> + + + + Please enter valid email + + +

-
+
+ #contactnumber = "ngModel" + [class.is-invalid] = "contactnumber.invalid && contactnumber.touched" + minlength="10" + maxlength="10" + pattern="[0-9]*"/> + + + Please enter your correct contact number

@@ -98,16 +151,23 @@

Create your Recolle class="form-control" placeholder="address" name="address" + autocomplete="off" required [(ngModel)]="signupModelForm.address" - #address = "ngModel"/> + #address = "ngModel" required + [class.is-invalid] = "address.invalid && address.touched" + pattern="[a-zA-Z ]*"/> + + + Please enter your address


+
- +
diff --git a/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.scss b/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.scss index e69de29..39c131f 100644 --- a/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.scss +++ b/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.scss @@ -0,0 +1,5 @@ +.errormsg{ + color: red; + font-size: 12px; + font-weight:bold; +} \ No newline at end of file diff --git a/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.ts b/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.ts index 251ca43..3532993 100644 --- a/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.ts +++ b/RecollectApp/src/app/validate/new-sign-up/new-sign-up.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { FormGroup ,FormControl,FormBuilder, Validators} from '@angular/forms'; import { Router } from '@angular/router'; import { AuthService } from 'src/app/auth.service'; import { SingupData } from 'src/app/singup-data'; @@ -12,13 +13,22 @@ export class NewSignUpComponent implements OnInit { account:any="/assets/image/account.svg"; - signupModelForm = new SingupData('','','','','','',''); + signupModelForm = new SingupData('','','','','','','',''); + + passwordErrorFlag: boolean = false; + constructor(private auth:AuthService, private router: Router ,public formbuilder: FormBuilder ) { + - constructor(private auth:AuthService, private router: Router ) { } + + + } ngOnInit(): void { - } + + + } + addUser() { @@ -29,11 +39,24 @@ export class NewSignUpComponent implements OnInit { this.auth.save(this.signupModelForm).subscribe((response) =>{ - alert('New User Registerd Succeesfully !'); + // alert('New User Registerd Succeesfully !'); this.router.navigate(['/newLogin']) }); + console.log(" ---- Data ----- = "+ this.signupModelForm.contactNumber); } + checkConfirmPassword(){ + + + console.log('password is'+this.signupModelForm.password); + + console.log('confirm passwordis :'+this.signupModelForm.confirmpassword); + if(this.signupModelForm.password != this.signupModelForm.confirmpassword){ + this.passwordErrorFlag = true; + + + } + } } diff --git a/RecollectApp/src/app/validate/validate-routing.module.ts b/RecollectApp/src/app/validate/validate-routing.module.ts index 8f49d9e..ec67acf 100644 --- a/RecollectApp/src/app/validate/validate-routing.module.ts +++ b/RecollectApp/src/app/validate/validate-routing.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { PageNotFoundComponent } from '../page-not-found/page-not-found.component'; import { HeaderComponent } from './header/header.component'; import { NewLoginComponent } from './new-login/new-login.component'; import { NewSignUpComponent } from './new-sign-up/new-sign-up.component'; @@ -9,6 +10,7 @@ const routes: Routes = [ { path:'', component: HeaderComponent, + children:[ {path: 'newLogin', component: NewLoginComponent @@ -18,13 +20,16 @@ const routes: Routes = [ ] }, - - - { +{ path:'homelink', loadChildren: () => import('../home/home.module').then((m) => m.HomeModule), }, + + { + path : '**', + component:PageNotFoundComponent + }