From a3e6b37a1baff28433a2754989b724f8e177acb1 Mon Sep 17 00:00:00 2001 From: kj1352 Date: Fri, 19 Jun 2020 18:10:20 +0530 Subject: [PATCH] Renamed details component to course details in course folder --- src/app/app-routing.module.ts | 5 ++--- src/app/app.module.ts | 4 ++-- .../course-details.component.html} | 0 .../course-details.component.scss} | 0 .../course-details.component.spec.ts} | 12 ++++++------ .../course-details.component.ts} | 14 +++++++------- 6 files changed, 17 insertions(+), 18 deletions(-) rename src/app/tabs/courses/{details/details.component.html => course-details/course-details.component.html} (100%) rename src/app/tabs/courses/{details/details.component.scss => course-details/course-details.component.scss} (100%) rename src/app/tabs/courses/{details/details.component.spec.ts => course-details/course-details.component.spec.ts} (52%) rename src/app/tabs/courses/{details/details.component.ts => course-details/course-details.component.ts} (78%) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 14acbe1..9d5f80f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { WelcomeComponent } from './welcome/welcome.component'; import { TabsComponent } from './tabs/tabs.component'; -import { DetailsComponent } from './tabs/courses/details/details.component'; +import { CourseDetailsComponent } from './tabs/courses/course-details/course-details.component'; import { VideoChapterComponent } from './tabs/courses/video-chapter/video-chapter.component'; import { VideoNotesComponent } from './tabs/courses/video-chapter/video-notes/video-notes.component'; import { CalendarComponent } from './calendar/calendar.component'; @@ -15,8 +15,7 @@ const routes: Routes = [ { component: WelcomeComponent, path: 'welcome' }, { component: TabsComponent, path: 'tabs' }, { component: TabsComponent, path: 'tabs/:subpage' }, - { component: DetailsComponent, path: 'course-details' }, - { component: DetailsComponent, path: 'course-details/:heading' }, + { component: CourseDetailsComponent, path: 'course-details/:heading' }, { component: ChapterNotesComponent, path: 'chapter-notes/:heading' }, { component: VideoChapterComponent, path: 'video-chapter/:heading' }, { component: VideoNotesComponent, path: 'video-notes/:heading' }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index bd44969..3497cea 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -13,7 +13,6 @@ import { HomeComponent } from './tabs/home/home.component'; import { CoursesComponent } from './tabs/courses/courses.component'; import { ReportsComponent } from './tabs/reports/reports.component'; import { MoreComponent } from './tabs/more/more.component'; -import { DetailsComponent } from './tabs/courses/details/details.component'; import { VideoChapterComponent } from './tabs/courses/video-chapter/video-chapter.component'; import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '../environments/environment'; @@ -24,6 +23,7 @@ import { ForumPageComponent } from './tabs/more/forum-page/forum-page.component' import { ConfirmationPopupComponent } from './reusable-components/confirmation-popup/confirmation-popup.component'; import { VideoNotesComponent } from './tabs/courses/video-chapter/video-notes/video-notes.component'; import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-notes.component'; +import { CourseDetailsComponent } from './tabs/courses/course-details/course-details.component'; @NgModule({ declarations: [ @@ -34,7 +34,6 @@ import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-note CoursesComponent, ReportsComponent, MoreComponent, - DetailsComponent, VideoChapterComponent, CalendarComponent, AttendanceComponent, @@ -43,6 +42,7 @@ import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-note ConfirmationPopupComponent, VideoNotesComponent, ChapterNotesComponent, + CourseDetailsComponent, ], imports: [ BrowserModule, diff --git a/src/app/tabs/courses/details/details.component.html b/src/app/tabs/courses/course-details/course-details.component.html similarity index 100% rename from src/app/tabs/courses/details/details.component.html rename to src/app/tabs/courses/course-details/course-details.component.html diff --git a/src/app/tabs/courses/details/details.component.scss b/src/app/tabs/courses/course-details/course-details.component.scss similarity index 100% rename from src/app/tabs/courses/details/details.component.scss rename to src/app/tabs/courses/course-details/course-details.component.scss diff --git a/src/app/tabs/courses/details/details.component.spec.ts b/src/app/tabs/courses/course-details/course-details.component.spec.ts similarity index 52% rename from src/app/tabs/courses/details/details.component.spec.ts rename to src/app/tabs/courses/course-details/course-details.component.spec.ts index 1d5cbeb..ccb5ff5 100644 --- a/src/app/tabs/courses/details/details.component.spec.ts +++ b/src/app/tabs/courses/course-details/course-details.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { DetailsComponent } from './details.component'; +import { CourseDetailsComponent } from './course-details.component'; -describe('DetailsComponent', () => { - let component: DetailsComponent; - let fixture: ComponentFixture; +describe('CourseDetailsComponent', () => { + let component: CourseDetailsComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DetailsComponent ] + declarations: [ CourseDetailsComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(DetailsComponent); + fixture = TestBed.createComponent(CourseDetailsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/tabs/courses/details/details.component.ts b/src/app/tabs/courses/course-details/course-details.component.ts similarity index 78% rename from src/app/tabs/courses/details/details.component.ts rename to src/app/tabs/courses/course-details/course-details.component.ts index 3f16dd7..bd2d39e 100644 --- a/src/app/tabs/courses/details/details.component.ts +++ b/src/app/tabs/courses/course-details/course-details.component.ts @@ -4,11 +4,11 @@ import { Subscription } from 'rxjs'; import { Location } from '@angular/common'; @Component({ - selector: 'app-details', - templateUrl: './details.component.html', - styleUrls: ['./details.component.scss'] + selector: 'app-course-details', + templateUrl: './course-details.component.html', + styleUrls: ['./course-details.component.scss'] }) -export class DetailsComponent implements OnInit { +export class CourseDetailsComponent implements OnInit { selectedSegment: string = 'home'; heading: string; routeSubscription: Subscription; @@ -16,16 +16,16 @@ export class DetailsComponent implements OnInit { showDeletePopup: boolean = false; isSubSegment: boolean = true; - constructor( + constructor( private route: ActivatedRoute, private location: Location ) { } - ngOnInit(): void { + ngOnInit(): void { this.routeSubscription = this.route.params.subscribe((params) => { this.heading = params['heading']; }); - } + } ngOnDestroy() { this.routeSubscription.unsubscribe();