Skip to content

Commit c2bb526

Browse files
committed
timer start
1 parent d59e19a commit c2bb526

17 files changed

Lines changed: 130 additions & 38 deletions

codecamp-front/package.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,6 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15-
<<<<<<< HEAD
16-
"@angular/animations": "^5.2.7",
17-
"@angular/common": "^5.2.7",
18-
"@angular/compiler": "^5.2.7",
19-
"@angular/core": "^5.2.7",
20-
"@angular/forms": "^5.2.7",
21-
"@angular/http": "^5.2.7",
22-
"@angular/platform-browser": "^5.2.7",
23-
"@angular/platform-browser-dynamic": "^5.2.7",
24-
"@angular/platform-server": "^5.2.7",
25-
"@angular/router": "^5.2.7",
26-
"@types/jquery": "^3.3.0",
27-
"angular2-flash-messages": "^2.0.5",
28-
"angular2-jwt": "^0.2.3",
29-
"bootstrap": "^4.0.0-beta.2",
30-
"core-js": "^2.4.1",
31-
"font-awesome": "^4.7.0",
32-
"jquery": "^3.3.1",
33-
"jquery-slimscroll": "^1.3.8",
34-
"ng2-ace-editor": "^0.3.4",
35-
"ng2-file-upload": "^1.3.0",
36-
"ngx-progressbar": "^2.1.1",
37-
"popper.js": "^1.12.9",
38-
"rxjs": "^5.5.6",
39-
"zone.js": "^0.8.19"
40-
=======
4115
"@angular/animations": "5.2.7",
4216
"@angular/common": "5.2.7",
4317
"@angular/compiler": "5.2.7",
@@ -62,7 +36,6 @@
6236
"popper.js": "1.12.9",
6337
"rxjs": "5.5.6",
6438
"zone.js": "0.8.19"
65-
>>>>>>> c4e2535092f743e8105bd39eb4418534f142cf6f
6639
},
6740
"devDependencies": {
6841
"@angular/cli": "1.6.5",

codecamp-front/src/app/app-routing.module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { NotAuthGuard } from './guards/not-auth.guard';
2424
import { SolultionSubmitComponent } from './components/solultion-submit/solultion-submit.component';
2525
import { SolutionComponent } from './components/solultion-submit/solution/solution.component';
2626
import { RanklistComponent } from './components/ranklist/ranklist.component';
27+
import { EditProfileComponent } from './components/edit-profile/edit-profile.component';
2728

2829

2930
const appRoutes: Routes = [
@@ -64,6 +65,10 @@ const appRoutes: Routes = [
6465
path: 'ide',
6566
component: IdeComponent
6667
},
68+
{
69+
path: ':username/edit-profile',
70+
component: EditProfileComponent
71+
},
6772
{
6873
path: ':contest/submit/:code',
6974
component: SolultionSubmitComponent

codecamp-front/src/app/app.module.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { PracticeComponent } from './components/practice/practice.component';
1515
import { DiscussComponent } from './components/discuss/discuss.component';
1616
import { ContestComponent } from './components/contest/contest.component';
1717
import { AboutComponent } from './components/about/about.component';
18+
import { EditProfileComponent } from './components/edit-profile/edit-profile.component';
1819

1920
import { AuthService } from './services/auth.service';
2021
import { ContestService } from './services/contest.service';
@@ -29,6 +30,8 @@ import { RanklistComponent } from './components/ranklist/ranklist.component';
2930
import { SolutionComponent } from './components/solultion-submit/solution/solution.component';
3031
import { ProblemComponent } from './components/problem/problem.component';
3132
import { AddProblemComponent } from './components/add-problem/add-problem.component';
33+
import { TimerComponent } from './components/timer/timer.component'
34+
3235

3336
import { AuthGuard } from './guards/auth.guard';
3437
import { NotAuthGuard } from './guards/not-auth.guard';
@@ -62,7 +65,9 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6265
AddProblemComponent,
6366
SolultionSubmitComponent,
6467
PreloaderComponent,
65-
SidebarComponent
68+
SidebarComponent,
69+
EditProfileComponent,
70+
TimerComponent
6671
],
6772
imports: [
6873
BrowserModule,

codecamp-front/src/app/components/contest/contest.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Observable } from 'rxjs/Observable';
1313
export class ContestComponent implements OnInit {
1414
contest;
1515
contestname;
16-
16+
1717
constructor(
1818
public authService: AuthService,
1919
private router: Router,
@@ -23,9 +23,9 @@ export class ContestComponent implements OnInit {
2323
ngOnInit() {
2424
this.contestService.getContest().subscribe(
2525
contest => {
26-
this.contest = contest.contests;
26+
this.contest = contest.contests;
2727
});
28-
this.contestService.currentContest.subscribe(contest => this.contestname=contest);
28+
this.contestService.currentContest.subscribe(contest => this.contestname = contest);
2929
}
3030

3131
replaceTZ(time) {

codecamp-front/src/app/components/edit-profile/edit-profile.component.css

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
Edit-profile works
3+
</p>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { EditProfileComponent } from './edit-profile.component';
4+
5+
describe('EditProfileComponent', () => {
6+
let component: EditProfileComponent;
7+
let fixture: ComponentFixture<EditProfileComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ EditProfileComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(EditProfileComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3+
import { AuthService } from '../../services/auth.service';
4+
import { Router } from '@angular/router';
5+
6+
7+
@Component({
8+
selector: 'app-edit-profile',
9+
templateUrl: './edit-profile.component.html',
10+
styleUrls: ['./edit-profile.component.css']
11+
})
12+
export class EditProfileComponent implements OnInit {
13+
14+
user;
15+
constructor(
16+
private authService: AuthService,
17+
private router: Router
18+
) {
19+
this.user = authService.getProfile().subscribe(profile => {
20+
this.user = profile.msg;
21+
//console.log(JSON.stringify(this.user));
22+
});
23+
//console.log(this.user);
24+
}
25+
ngOnInit() {
26+
}
27+
28+
}

codecamp-front/src/app/components/problems/problems.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h1 class="display-4">{{contestname}}</h1>
3030
<div class="col-md-3 head">
3131
Successful Submission
3232
</div>
33-
33+
3434
</div>
3535
<a
3636
class="nav-link problem"
@@ -49,8 +49,9 @@ <h1 class="display-4">{{contestname}}</h1>
4949
<div class="col-md-3">
5050
<div class="timer">
5151
<p>Time to start</p>
52+
<app-timer></app-timer>
5253
</div>
53-
54+
5455
</div>
5556
</div>
5657
</div>

codecamp-front/src/app/components/problems/problems.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22

33
import { ProblemsComponent } from './problems.component';
4+
import { Timer } from '../timer/timer.component';
45

56
describe('ProblemsComponent', () => {
67
let component: ProblemsComponent;

0 commit comments

Comments
 (0)