Fixes motion poll slide icon size & rounding

This commit is contained in:
Joshua Sangmeister 2020-05-28 16:12:35 +02:00 committed by Emanuel Schütze
parent dcf5d5316c
commit f4907e6604
6 changed files with 19 additions and 5 deletions

View File

@ -31,7 +31,11 @@ os-icon-container {
}
&.large-container {
@include icon-container(24px, 16px, 500);
@include icon-container(24px, 16px, 400);
}
&.gigantic-container {
@include icon-container(34px, 22px, 400);
}
.content-node {

View File

@ -24,7 +24,7 @@ export class IconContainerComponent {
* Optional size property. Can be large, if needed.
*/
@Input()
public size: 'small' | 'medium' | 'large' = 'medium';
public size: 'small' | 'medium' | 'large' | 'gigantic' = 'medium';
/**
* Reverse text and icon.

View File

@ -9,7 +9,7 @@
<tr *ngFor="let row of getTableData()" [class]="row.votingOption">
<!-- YNA/Valid etc -->
<td>
<os-icon-container *ngIf="row.value[0].icon" [icon]="row.value[0].icon">
<os-icon-container *ngIf="row.value[0].icon" [icon]="row.value[0].icon" [size]="iconSize">
{{ row.votingOption | pollKeyVerbose | translate }}
</os-icon-container>
<span *ngIf="!row.value[0].icon">

View File

@ -19,6 +19,9 @@ export class MotionPollDetailContentComponent implements OnInit {
@Input()
public chartData: BehaviorSubject<ChartData>;
@Input()
public iconSize: 'large' | 'gigantic' = 'large';
public get hasVotes(): boolean {
return this.poll && !!this.poll.options;
}

View File

@ -8,6 +8,13 @@ import { VOTE_MAJORITY, VOTE_UNDOCUMENTED } from '../models/poll/base-poll';
name: 'parsePollNumber'
})
export class ParsePollNumberPipe implements PipeTransform {
private formatter = new Intl.NumberFormat('us-us', {
style: 'decimal',
useGrouping: false,
minimumFractionDigits: 0,
maximumFractionDigits: 6
});
public constructor(private translate: TranslateService) {}
public transform(value: number): number | string {
@ -17,7 +24,7 @@ export class ParsePollNumberPipe implements PipeTransform {
case VOTE_UNDOCUMENTED:
return this.translate.instant('undocumented');
default:
return value;
return this.formatter.format(value);
}
}
}

View File

@ -7,6 +7,6 @@
<h2 class="poll-title">{{ data.data.poll.title }}</h2>
</div>
<div *ngIf="data.data.poll.state === PollState.Published">
<os-motion-poll-detail-content [poll]="pollData" [chartData]="chartDataSubject"> </os-motion-poll-detail-content>
<os-motion-poll-detail-content [poll]="pollData" [chartData]="chartDataSubject" iconSize="gigantic"></os-motion-poll-detail-content>
</div>
</ng-container>