Skip to content

Commit

Permalink
user comdule renaming and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shivarajnaidu committed Feb 28, 2019
1 parent bd0bcf7 commit 03072b2
Show file tree
Hide file tree
Showing 18 changed files with 156 additions and 178 deletions.
23 changes: 16 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/app/services/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ export class UserService {
return this.http.get(id);
}


getUsers() {
return this.http.get(this.API_URLs.users);
}


}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { EditComponent } from './edit.component';
import { CreateUserComponent } from './create-user.component';

describe('EditComponent', () => {
let component: EditComponent;
let fixture: ComponentFixture<EditComponent>;
describe('CreateUserComponent', () => {
let component: CreateUserComponent;
let fixture: ComponentFixture<CreateUserComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EditComponent ]
declarations: [ CreateUserComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(EditComponent);
fixture = TestBed.createComponent(CreateUserComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { ProfileService } from '../../services/profile/profile.service';
import { ProfileService } from 'src/app/services/profile/profile.service';

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

constructor(
private profileServ: ProfileService
Expand All @@ -18,4 +18,5 @@ export class CreateComponent implements OnInit {
const data = form.value;
const profileRes = await this.profileServ.newUser(data);
}

}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { CreateComponent } from './create.component';
import { EditUserComponent } from './edit-user.component';

describe('CreateComponent', () => {
let component: CreateComponent;
let fixture: ComponentFixture<CreateComponent>;
describe('EditUserComponent', () => {
let component: EditUserComponent;
let fixture: ComponentFixture<EditUserComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateComponent ]
declarations: [ EditUserComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(CreateComponent);
fixture = TestBed.createComponent(EditUserComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { ProfileService } from '../../services/profile/profile.service';
import { ProfileService } from 'src/app/services/profile/profile.service';

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

EditProfile: any;

constructor(
Expand All @@ -31,5 +32,4 @@ export class EditComponent implements OnInit {
}
ngOnInit() {
}

}
55 changes: 0 additions & 55 deletions src/app/users/list/list.component.html

This file was deleted.

72 changes: 0 additions & 72 deletions src/app/users/list/list.component.ts

This file was deleted.

18 changes: 9 additions & 9 deletions src/app/users/users-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CreateComponent } from './create/create.component';
import { EditComponent } from './edit/edit.component';
import { ListComponent } from './list/list.component';
import { UsersComponent } from './users/users.component';
import { CreateUserComponent } from './create-user/create-user.component';
import { EditUserComponent } from './edit-user/edit-user.component';

const routes: Routes = [
{
path: 'new',
component: CreateComponent
path: '',
component: UsersComponent
},
{
path: ':id/edit',
component: EditComponent
path: 'new',
component: CreateUserComponent
},
{
path: '',
component: ListComponent
path: ':id/edit',
component: EditUserComponent
}
];

Expand Down
12 changes: 6 additions & 6 deletions src/app/users/users.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CreateComponent } from './create/create.component';
import { ListComponent } from './list/list.component';
import { EditComponent } from './edit/edit.component';
import { UsersRoutingModule } from './users-routing.module';
import { MatComponentsModule } from '../mat-components/mat-components.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';
import { UsersComponent } from './users/users.component';
import { EditUserComponent } from './edit-user/edit-user.component';
import { CreateUserComponent } from './create-user/create-user.component';

@NgModule({
imports: [
Expand All @@ -18,9 +18,9 @@ import { FlexLayoutModule } from '@angular/flex-layout';
FlexLayoutModule
],
declarations: [
CreateComponent,
ListComponent,
EditComponent
UsersComponent,
EditUserComponent,
CreateUserComponent
]
})
export class UsersModule { }
Loading

0 comments on commit 03072b2

Please sign in to comment.