Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(bug): notification has been removed from feedback and it is made …
Browse files Browse the repository at this point in the history
…more intuitive.
  • Loading branch information
sanketpathak authored and arunkumars08 committed Apr 26, 2018
1 parent 282f9ff commit 6b89758
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<fab-toast-notification [notifications]="feedbackMessages"></fab-toast-notification>
<!-- <fab-toast-notification [notifications]="feedbackMessages"></fab-toast-notification> -->
<div class="analytics-component-feedback">
<div *ngIf="feedback?.feedbackTemplate" class="feedback">
<span (click)="handleFeedback($event, true)">
<i class="fa fa-thumbs-o-up" aria-hidden="true"></i>
<span (click)="feedbackColorTypeUp=!feedbackColorTypeUp;handleFeedback($event, true, feedbackColorTypeUp);" [ngClass]="{'thumbs-up': !feedbackColorTypeUp , 'thumbs-up-true': feedbackColorTypeUp}"
aria-label="positive feedback">
<i [ngClass]="{'fa': true,'fa-thumbs-o-up': !feedbackColorTypeUp , 'fa-thumbs-up': feedbackColorTypeUp}" aria-hidden="true"></i>
</span>
<span (click)="handleFeedback($event, false)">
<i class="fa fa-thumbs-o-down" aria-hidden="true"></i>
<span (click)="feedbackColorTypeDown=!feedbackColorTypeDown;handleFeedback($event, false, feedbackColorTypeDown);" [ngClass]="{'thumbs-down': !feedbackColorTypeDown , 'thumbs-down-true': feedbackColorTypeDown}"
aria-label="negative feedback">
<i [ngClass]="{'fa': true,'fa-thumbs-o-down': !feedbackColorTypeDown , 'fa-thumbs-down': feedbackColorTypeDown}" aria-hidden="true"></i>
</span>
</div>
<span class="no-feedback" *ngIf="!feedback?.feedbackTemplate">-----</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@
margin-right: 10px;
}

.thumbs-up {
color:#363636;
&:hover {
color:#6ec664;
}
&:active {
color:#6ec664;
}
&-true {
color:#6ec664;
}
}

.thumbs-down {
color:#363636;
&:hover {
color:#c00;
}
&:active {
color:#c00;
}
&-true {
color:#c00;
}
}

.no-feedback {
font-size: unset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import { ComponentFeedbackService } from './component-feedback.service';
export class ComponentFeedbackComponent implements OnChanges {
@Input() feedback: MComponentFeedback;
feedbackMessages: Array<any> = [];
feedbackColorTypeUp: boolean = false;
feedbackColorTypeDown: boolean = false;

constructor(private feedbackService: ComponentFeedbackService) {}

public handleFeedback(event: MouseEvent, type: boolean): void {
public handleFeedback(event: MouseEvent, type: boolean, colorType: boolean): void {
event.stopPropagation();
if (this.feedback && this.feedback.feedbackTemplate) {
this.feedback.feedbackTemplate.feedback_type = type;
Expand All @@ -40,6 +42,15 @@ export class ComponentFeedbackComponent implements OnChanges {
});
}
}
if (type) {
if (colorType) {
this.feedbackColorTypeDown = false;
}
} else {
if (colorType) {
this.feedbackColorTypeUp = false;
}
}
}

ngOnChanges(changes: SimpleChanges) {
Expand Down

0 comments on commit 6b89758

Please sign in to comment.