-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#94] addnation (connects #94) #100
Conversation
package.json
Outdated
@@ -53,6 +53,7 @@ | |||
"karma-jasmine": "~1.1.0", | |||
"karma-jasmine-html-reporter": "^0.2.2", | |||
"node-sass": "^4.5.3", | |||
"popper.js": "^1.12.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be in this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
src/app/home/home-router.module.ts
Outdated
@@ -5,12 +5,15 @@ import { DashboardComponent } from '../dashboard/dashboard.component'; | |||
import { UsersComponent } from '../users/users.component'; | |||
import { HomeComponent } from './home.component'; | |||
import { CoursesComponent } from '../courses/courses.component'; | |||
import { NationComponent } from '../nation/nation.component'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like extra line
src/app/home/home.module.ts
Outdated
@@ -11,7 +11,8 @@ import { HomeRouterModule } from './home-router.module'; | |||
import { CoursesComponent } from '../courses/courses.component'; | |||
import { FormErrorMessagesComponent } from '../form-error-messages/form-error-messages.component'; | |||
|
|||
import { CourseValidatorService } from '../validators/course-validator.service'; | |||
import { CourseValidatorService } from '../validators/course-validator.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this line showing as change
src/app/nation/nation.component.html
Outdated
<form class="form-horizontal"(ngSubmit)="onSubmit(nation.value)" #nation="ngForm"> | ||
<div class="form-group"> | ||
<label for="admin_name">Admin Name</label> | ||
<input type="text" style="width:50%;" class="form-control" id="admin_name" required minlength="5" maxlength="30" [(ngModel)]="nation.admin_name" name="admin_name" #admin_name="ngModel"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better not to put inline style
src/app/nation/nation.component.html
Outdated
<label for="admin_name">Admin Name</label> | ||
<input type="text" style="width:50%;" class="form-control" id="admin_name" required minlength="5" maxlength="30" [(ngModel)]="nation.admin_name" name="admin_name" #admin_name="ngModel"> | ||
<div *ngIf="admin_name.errors && (admin_name.dirty || admin_name.touched)" class="alert alert-danger" style="width:50%;"> | ||
<div [hidden]="!admin_name.errors.required"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably can be changed better way. @LKhadka had something that adds error message later based on validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LKhadka 👍
src/app/nation/nation.component.ts
Outdated
export class NationComponent implements OnInit { | ||
message = ''; | ||
constructor( | ||
private couchService: CouchService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be indented to 4, not 3 spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulbert ok 👍
src/app/nation/nation.component.ts
Outdated
} | ||
onSubmit(nation) { | ||
if (nation.nation_name !== '' && nation.nationurl !== '' && nation.type !=="") { | ||
console.log(nation.nation_name, nation.nationurl, nation.type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be indented within the if block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the other comments, please remove the package-lock.json
file.
We need to make sure we use the same development environment with the same versions of node & npm. The package lock functionality was added with a newer version of npm than we began development with.
@@ -7,12 +7,12 @@ | |||
"start": "LNG=${LNG:-en};ng serve --aot --i18n-file=src/i18n/messages.$LNG.xlf --locale=$LNG --i18n-format=xlf", | |||
"v-serve": "vagrant ssh -c 'cd /vagrant;ng serve'", | |||
"build": "ng build", | |||
"v-build":"vagrant ssh -c 'cd /vagrant;ng build'", | |||
"v-build": "vagrant ssh -c 'cd /vagrant;ng build'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file are unrelated to the issue, so please remove them.
src/app/nation/nation.component.html
Outdated
<div class="form-group"> | ||
<label for="admin_name">Admin Name</label> | ||
<input type="text" class="form-control" id="admin_name" required minlength="5" maxlength="30" [(ngModel)]="nation.admin_name" name="admin_name" #admin_name="ngModel"> | ||
<div *ngIf="admin_name.errors && (admin_name.dirty || admin_name.touched)" class="alert alert-danger" id = "danger"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The id
referenced here is not unique, which is invalid HTML. Please use a class
for this.
Also, the space around the equals should be removed.
src/app/nation/nation.component.html
Outdated
<div class="form-group"> | ||
<label for="nation_name">Name</label> | ||
<input type="text" class="form-control" id="nation_name" required minlength="5" maxlength="30" [(ngModel)]="nation.nation_name" name="nation_name" #nation_name="ngModel"> | ||
<div *ngIf="nation_name.errors && (nation_name.dirty || nation_name.touched)" class="alert alert-danger" id = "danger"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix id
same as above
src/app/nation/nation.component.html
Outdated
<div class="form-group"> | ||
<label for="nation_name">Nationurl</label> | ||
<input type="text" class="form-control" id="nationurl" required minlength="5" maxlength="30" [(ngModel)]="nation.nationurl" name="nationurl" #nationurl="ngModel"> | ||
<div *ngIf="nationurl.errors && (nationurl.dirty || nationurl.touched)" class="alert alert-danger" id = "danger"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix id
same as above.
src/app/nation/nation.component.html
Outdated
<div class="form-group"> | ||
<label for="nation_name">Type</label> | ||
<input type="text" class="form-control" id="type" required minlength="5" maxlength="30" [(ngModel)]="nation.type" name="type" #type="ngModel"> | ||
<div *ngIf="type.errors && (type.dirty || type.touched)" class="alert alert-danger" id = "danger"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix id
same as above.
src/app/nation/nation.component.scss
Outdated
@@ -0,0 +1,15 @@ | |||
#admin_name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very repetitive, and more fitting as a class in the main styles.scss since this is reusable.
alert('Nation has been sucessfully created'); | ||
this.router.navigate(['']); | ||
}, (error) => this.message = 'Error'); | ||
}else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add spaces here to change it to } else {
.
Before pushing code please make sure it runs through the linter either with the git hook or you can run it manually on your own.
No description provided.