-
Notifications
You must be signed in to change notification settings - Fork 37
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
Implemented rating resources function (Fixes #269) #270
Conversation
Implemented UI with comment. Added updating to database feature. Every time the same user gives a new rating, the old rating will be updated. |
I want to extract route parameter in ngOnInit but once I insert code into it, once restart, the app fails launching. Is there anything wrong with this? @paulbert @lmmrssa @nirojdyola this.route.paramMap.pipe(switchMap((params: ParamMap) => {
this.getResource(params.get('id'));
this.id = params.get('id');
}))
.subscribe(resource => this.resource = resource); |
@yaoxing1990 It seems you have added package-lock.json file, could you remove that? Also you have changed some of the package versions and added ts-lint on production. Please revert that as well. |
This reverts commit 440fd72.
@lmmrssa Reverted |
package.json
Outdated
@@ -58,7 +58,7 @@ | |||
"protractor": "~5.1.2", | |||
"request-promise": "^4.2.1", | |||
"ts-node": "~3.2.0", | |||
"tslint": "~5.3.2", | |||
"tslint": "^5.3.2", |
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 tslint is aded in package.json, its already been added you dont have to change it
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.
@razu9861 I accidentally changed it form "~" to "^"
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.
Yes, this change is not required for the given issue. The issue requires only rating function . So, you don;t have to change it. Could you revert it back ?
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.
@nirojdyola Reverted
}) | ||
export class ResourcesRateComponent implements OnInit { | ||
|
||
ratingForm: FormGroup; |
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 follow tslint rule for indentation
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.
package.json
Outdated
@@ -58,7 +58,7 @@ | |||
"protractor": "~5.1.2", | |||
"request-promise": "^4.2.1", | |||
"ts-node": "~3.2.0", | |||
"tslint": "~5.3.2", | |||
"tslint": "^5.3.2", |
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.
Yes, this change is not required for the given issue. The issue requires only rating function . So, you don;t have to change it. Could you revert it back ?
@@ -0,0 +1,45 @@ | |||
<h1 i18n>Submit your rating</h1> | |||
<form [formGroup]="ratingForm" (ngSubmit)="onSubmit()"> | |||
|
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.
Could you please remove extra line ?
<mat-error><planet-form-error-messages [control]="ratingForm.controls.id"></planet-form-error-messages></mat-error> | ||
</mat-form-field> | ||
</div> | ||
|
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.
Remove extra line please.
<mat-error><planet-form-error-messages [control]="ratingForm.controls.user"></planet-form-error-messages></mat-error> | ||
</mat-form-field> | ||
</div> | ||
|
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 are more extra line . Could you please remove all those ?
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.
@nirojdyola All removed ole-vi@45ffaf3
@@ -10,7 +10,10 @@ export class ResourcesComponent implements OnInit, AfterViewInit { | |||
resources = new MatTableDataSource(); | |||
@ViewChild(MatPaginator) paginator: MatPaginator; | |||
displayedColumns = [ 'title', 'rating' ]; | |||
readonly dbName = 'resources'; | |||
readonly resourceDb = 'resources'; |
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.
I don't understand why readonly dbName = 'resources'; has been changed to readonly resourceDb = 'resources';
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.
Because another database named "rating" also exists, to avoid confusion
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.
…to rating-resource
@lmmrssa Because during registration, user gender is not recorded, so currently the gender cannot be obtained, Also the new database not in installation script is still a issue |
Error Received
|
d36dcbe
to
f2b5ad5
Compare
f2b5ad5
to
158a70b
Compare
I had to force push a few updates because something strange happened where all of the previous commits on this PR were showing up as different from my local commits. Before working on this you should delete your local branch ( |
@paulbert No problem. Is it caused by rebase? Laxman did rebase on this branch last night |
@yaoxing1990 i have attatched images for rating please implement this, have a look at both images add a button for rating on second image while clicking buton it should show popup for ratng. please try to implement it |
Closing since this was incorporated with #321 |
Implemented UI for user to submit rating:
![capture](https://user-images.githubusercontent.com/10969547/34310210-c480db48-e71b-11e7-8f70-50c9c8ccfa73.PNG)