Skip to content
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

Closed
wants to merge 9 commits into from
Closed

[#94] addnation (connects #94) #100

wants to merge 9 commits into from

Conversation

Pr0chin
Copy link
Contributor

@Pr0chin Pr0chin commented Oct 18, 2017

No description provided.

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",
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👍

@@ -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';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like extra line

@@ -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';
Copy link
Member

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

<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">
Copy link
Member

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

<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">
Copy link
Member

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

Copy link
Contributor

@midsorbet midsorbet Oct 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed into a reactive form so that you can use Angular's built in required validator. @Pr0chin can see an example here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LKhadka 👍

export class NationComponent implements OnInit {
message = '';
constructor(
private couchService: CouchService,
Copy link
Member

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

Copy link
Contributor Author

@Pr0chin Pr0chin Oct 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulbert ok 👍

}
onSubmit(nation) {
if (nation.nation_name !== '' && nation.nationurl !== '' && nation.type !=="") {
console.log(nation.nation_name, nation.nationurl, nation.type);
Copy link
Member

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

Copy link
Member

@paulbert paulbert left a 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'",
Copy link
Member

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.

<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">
Copy link
Member

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.

<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">
Copy link
Member

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

<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">
Copy link
Member

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.

<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">
Copy link
Member

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.

@@ -0,0 +1,15 @@
#admin_name {
Copy link
Member

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{
Copy link
Member

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.

@Rupesh87 Rupesh87 added the WIP label Oct 25, 2017
razu9861 and others added 5 commits October 25, 2017 11:37
* [#95]List of nation

* [#95] Fetch Nation List

* Update nation.component.ts

* list nation

* list nations
* [#96] added community commponent

* [#96] Added filter

* [#96] Added select option for status

* [#96] css and indent fixed

* [#96] Removed community.component.scss file
@lmmrssa lmmrssa closed this Oct 31, 2017
@lmmrssa lmmrssa deleted the 94-Addnation branch November 7, 2017 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants