-
Notifications
You must be signed in to change notification settings - Fork 35
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
Complaints suggestions #49
base: master
Are you sure you want to change the base?
Changes from all commits
bc78eef
d0ab16a
9ce0d43
805109f
a8e5d0c
bd50c25
d3873d0
f0b5e51
d94fdfb
825dbbc
58db2e8
60aec58
ef3e8c6
ab90d2b
e5fb7d1
fa6d142
659389a
bc6f9f9
076a2df
f061836
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,52 @@ export interface IUserTagCategory { | |
tags: IUserTag[]; | ||
} | ||
|
||
export interface IComplaintTag { | ||
id: string; | ||
tag_uri: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Identifier 'tag_uri' is not in camel case. |
||
} | ||
|
||
export interface IComplaintComment { | ||
id: string; | ||
time: string; | ||
text: string; | ||
commented_by: IUserProfile; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Identifier 'commented_by' is not in camel case. |
||
reported_date: string; | ||
} | ||
|
||
export interface IComplaint { | ||
id: string; | ||
created_by: IUserProfile; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Identifier 'created_by' is not in camel case. |
||
description: string; | ||
suggestions: string; | ||
location_details: string; | ||
report_date: string; | ||
reported_date: string; | ||
status: string; | ||
status_color: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Identifier 'status_color' is not in camel case. |
||
latitude: number; | ||
longitude: number; | ||
location_description: string; | ||
tags: IComplaintTag; | ||
users_up_voted: IUserProfile[]; | ||
images: string[]; | ||
comments: IComplaintComment[]; | ||
vote_count: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Identifier 'vote_count' is not in camel case. |
||
is_subscribed: number; | ||
upvoted: boolean; | ||
} | ||
|
||
export interface IComplaintPost { | ||
description: string; | ||
suggestions: string; | ||
location_details: string; | ||
latitude: number; | ||
longitude: number; | ||
location_description: string; | ||
tags: string[]; | ||
images: string[]; | ||
} | ||
|
||
export interface IInstituteRole { | ||
id: string; | ||
name: string; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.complaint-card { | ||
text-decoration: none; | ||
} | ||
|
||
.complaint-divider { | ||
padding: 1%; | ||
} | ||
|
||
.complaint-card-content { | ||
font-size: medium; | ||
padding-top: 3%; | ||
} | ||
|
||
.complaint-description { | ||
white-space: pre-wrap; | ||
} | ||
|
||
.complaint-location-details { | ||
padding-top: 2%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Expected indentation of 2 spaces (indentation) |
||
} | ||
|
||
.card { | ||
margin: 5%; | ||
width: 80%; | ||
} | ||
|
||
.footer { | ||
position: relative; | ||
text-align: center; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Expected indentation of 2 spaces (indentation) |
||
} | ||
|
||
.footer-button-container { | ||
display: inline; | ||
} | ||
|
||
.complaint-upvote-active { | ||
color: #536dfe; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Expected indentation of 2 spaces (indentation) |
||
} | ||
|
||
.status { | ||
float: right; | ||
background-color: red; | ||
border-width: medium; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Expected indentation of 2 spaces (indentation) |
||
color: white; | ||
padding: 0 2.5%; | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue found: Expected indentation of 2 spaces (indentation) |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<div class="complaint-card"> | ||
<mat-card class="card" [routerLink]="['/venter/complaint', complaint.id]"> | ||
<div class="status" [style.backgroundColor]="complaint.status_color"> | ||
{{ complaint.status }} | ||
</div> | ||
<mat-card-header> | ||
<img mat-card-avatar src="{{complaint.created_by.profile_pic}}" | ||
src-fallback="assets/add_image_placeholder.svg"> | ||
<mat-card-title>{{ complaint.created_by.name }}</mat-card-title> | ||
<mat-card-subtitle> | ||
<div>{{ complaint.reported_date }}</div> | ||
<div>{{ complaint.location_description }}</div> | ||
</mat-card-subtitle> | ||
</mat-card-header> | ||
<span class="complaint-divider"> | ||
<mat-divider></mat-divider> | ||
</span> | ||
<mat-card-content> | ||
<div> | ||
<div> | ||
<div class="complaint-card-content"><b>Complaint:</b></div> | ||
<pre><div class="complaint-description">{{ complaint.description }}</div></pre> | ||
</div> | ||
<div *ngIf="complaint.suggestions"> | ||
<div class="complaint-card-content"><b>Suggestions:</b></div> | ||
<div>{{ complaint.suggestions }}</div> | ||
</div> | ||
<div *ngIf="complaint.location_details"> | ||
<div class="complaint-card-content"><b>Location Details:</b></div> | ||
<div class="complaint-location-details">{{ complaint.location_details }}</div> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
<div class="complaint-divider"> | ||
<mat-divider></mat-divider> | ||
</div> | ||
<mat-card-footer> | ||
<div class="footer"> | ||
<div class="footer-button-container"> | ||
<div *ngIf="complaint.upvoted" class="complaint-upvote-active, footer-button-container"> | ||
<button (click)="[upVoteComplaint(complaint.upvoted, complaint.id), onClickEvent($event)]" | ||
class="complaint-upvote-active" mat-icon-button> | ||
<mat-icon>arrow_upward</mat-icon>{{ complaint.users_up_voted.length }} | ||
</button> | ||
</div> | ||
<div *ngIf="!complaint.upvoted" class="footer-button-container"> | ||
<button (click)="[upVoteComplaint(complaint.upvoted, complaint.id), onClickEvent($event)]" | ||
mat-icon-button> | ||
<mat-icon>arrow_upward</mat-icon>{{ complaint.users_up_voted.length }} | ||
</button> | ||
</div> | ||
</div> | ||
<button mat-icon-button class="footer-button-container"> | ||
<mat-icon>insert_comment</mat-icon>{{ complaint.comments.length }} | ||
</button> | ||
<div class="footer-button-container"> | ||
<div *ngIf="complaint.is_subscribed" class="footer-button-container"> | ||
<button (click)="[subscribeToComplaint(complaint.complaint_subscribed), onClickEvent($event)]" | ||
mat-icon-button> | ||
<mat-icon>notifications_active</mat-icon> | ||
</button> | ||
</div> | ||
<div *ngIf="!complaint.is_subscribed" class="footer-button-container"> | ||
<button (click)="[subscribeToComplaint(complaint.complaint_subscribed), onClickEvent($event)]" | ||
mat-icon-button> | ||
<mat-icon>notifications</mat-icon> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</mat-card-footer> | ||
</mat-card> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { IComplaint } from '../../interfaces'; | ||
import { DataService } from '../../data.service'; | ||
import { API } from '../../../api'; | ||
import { VenterDataService } from '../venter-data.service'; | ||
|
||
@Component({ | ||
selector: 'app-complaint-card', | ||
templateUrl: './complaint-card.component.html', | ||
styleUrls: ['./complaint-card.component.css'] | ||
}) | ||
export class ComplaintCardComponent implements OnInit { | ||
|
||
@Input() complaint: IComplaint; | ||
constructor( | ||
public dataService: DataService, | ||
public venterDataService: VenterDataService, | ||
) { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
refresh() { | ||
/* Get complaint from server*/ | ||
this.dataService.FireGET<IComplaint>(API.Complaint, { complaintId: this.complaint.id }).subscribe(result => { | ||
this.complaint = result; | ||
this.venterDataService.getDetailedComplaintInfo(this.complaint); | ||
}); | ||
} | ||
|
||
onClickEvent(event) { | ||
event.stopPropagation(); | ||
} | ||
|
||
subscribeToComplaint(complaint_subscribed: number, complaintId: string) { | ||
this.venterDataService.subscribeToComplaint(complaint_subscribed, complaintId); | ||
this.refresh(); | ||
} | ||
|
||
upVoteComplaint(has_upvoted: boolean, complaintId: string) { | ||
this.venterDataService.upVoteComplaint(has_upvoted, complaintId); | ||
this.refresh(); | ||
} | ||
} |
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.
Issue found: Strings must use doublequote.