Merge pull request #5391 from jsangmeister/update-poll-slide

Fixes motion poll slide icon size & rounding
This commit is contained in:
Emanuel Schütze 2020-06-03 19:16:29 +02:00 committed by GitHub
commit c4f482b70c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 5 deletions

View File

@ -31,7 +31,11 @@ os-icon-container {
} }
&.large-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 { .content-node {

View File

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

View File

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

View File

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

View File

@ -8,6 +8,13 @@ import { VOTE_MAJORITY, VOTE_UNDOCUMENTED } from '../models/poll/base-poll';
name: 'parsePollNumber' name: 'parsePollNumber'
}) })
export class ParsePollNumberPipe implements PipeTransform { 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 constructor(private translate: TranslateService) {}
public transform(value: number): number | string { public transform(value: number): number | string {
@ -17,7 +24,7 @@ export class ParsePollNumberPipe implements PipeTransform {
case VOTE_UNDOCUMENTED: case VOTE_UNDOCUMENTED:
return this.translate.instant('undocumented'); return this.translate.instant('undocumented');
default: default:
return value; return this.formatter.format(value);
} }
} }
} }

View File

@ -7,6 +7,6 @@
<h2 class="poll-title">{{ data.data.poll.title }}</h2> <h2 class="poll-title">{{ data.data.poll.title }}</h2>
</div> </div>
<div *ngIf="data.data.poll.state === PollState.Published"> <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> </div>
</ng-container> </ng-container>