Merge pull request #5391 from jsangmeister/update-poll-slide
Fixes motion poll slide icon size & rounding
This commit is contained in:
commit
c4f482b70c
@ -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 {
|
||||
|
@ -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.
|
||||
|
@ -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">
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user