Skip to content

Commit 5beeb3b

Browse files
committed
WIP: Standalone migration/New vote view
1 parent a3c272b commit 5beeb3b

12 files changed

Lines changed: 113 additions & 16 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<os-poll-vote>
2+
<p>poll-approval-vote works!</p>
3+
</os-poll-vote>

client/src/app/site/pages/meetings/modules/poll/components/poll-approval-vote/poll-approval-vote.component.scss

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { PollApprovalVoteComponent } from './poll-approval-vote.component';
4+
5+
describe('PollApprovalVoteComponent', () => {
6+
let component: PollApprovalVoteComponent;
7+
let fixture: ComponentFixture<PollApprovalVoteComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [PollApprovalVoteComponent]
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(PollApprovalVoteComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
2+
3+
import { PollVoteComponent } from '../poll-vote/poll-vote.component';
4+
5+
@Component({
6+
selector: 'os-poll-approval-vote',
7+
imports: [PollVoteComponent],
8+
templateUrl: './poll-approval-vote.component.html',
9+
styleUrl: './poll-approval-vote.component.scss',
10+
changeDetection: ChangeDetectionStrategy.OnPush
11+
})
12+
export class PollApprovalVoteComponent {}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>poll-vote works!</p>
2+
3+
<ng-content></ng-content>

client/src/app/site/pages/meetings/modules/poll/components/poll-vote/poll-vote.component.scss

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { PollVoteComponent } from './poll-vote.component';
4+
5+
describe('PollVoteComponent', () => {
6+
let component: PollVoteComponent;
7+
let fixture: ComponentFixture<PollVoteComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [PollVoteComponent]
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(PollVoteComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'os-poll-vote',
5+
imports: [],
6+
templateUrl: './poll-vote.component.html',
7+
styleUrl: './poll-vote.component.scss',
8+
changeDetection: ChangeDetectionStrategy.OnPush
9+
})
10+
export class PollVoteComponent {}

client/src/app/site/pages/meetings/pages/motions/modules/motion-poll/components/motion-poll-detail-content/motion-poll-detail-content.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
2+
import { TranslatePipe } from '@ngx-translate/core';
23
import { combineLatestWith, map } from 'rxjs';
34
import { Permission } from 'src/app/domain/definitions/permission';
45
import { VOTE_UNDOCUMENTED } from 'src/app/domain/models/poll';
@@ -17,9 +18,9 @@ const CHART_DATA_SUBSCRIPTION_NAME = `chart_data_subscription`;
1718
@Component({
1819
selector: `os-motion-poll-detail-content`,
1920
templateUrl: `./motion-poll-detail-content.component.html`,
21+
imports: [TranslatePipe],
2022
styleUrls: [`./motion-poll-detail-content.component.scss`],
21-
changeDetection: ChangeDetectionStrategy.OnPush,
22-
standalone: false
23+
changeDetection: ChangeDetectionStrategy.OnPush
2324
})
2425
export class MotionPollDetailContentComponent extends BaseUiComponent implements OnDestroy, OnInit {
2526
private _poll!: PollData | null;

client/src/app/site/pages/meetings/pages/motions/modules/motion-poll/components/motion-poll/motion-poll.component.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@if (showPoll) {
22
<mat-card class="motion-poll-wrapper">
33
<mat-card-content>
4-
<!-- Poll Infos -->
4+
<!-- Poll Infos
55
<div class="poll-title-wrapper">
6-
<!-- Title Area -->
6+
<!-- Title Area --
77
<div class="poll-title-area">
8-
<!-- Title -->
8+
<!-- Title --
99
<span class="poll-title break-word">
1010
@if (isSameMeeting) {
1111
<a [routerLink]="getDetailLink()">
@@ -16,16 +16,17 @@
1616
}
1717
</span>
1818
</div>
19-
<!-- Dot Menu -->
19+
<!-- Dot Menu --
2020
<span *osPerms="permission.motionCanManagePolls; and: isSameMeeting" class="poll-actions">
2121
<button mat-icon-button [matMenuTriggerFor]="pollDetailMenu">
2222
<mat-icon class="icon-18">more_horiz</mat-icon>
2323
</button>
2424
</span>
2525
</div>
26-
<!-- Subtitle -->
26+
-->
27+
<!-- Subtitle
2728
<div class="italic spacer-bottom-20">
28-
<!-- Type and State -->
29+
<!-- Type and State --
2930
<div class="type-and-state italic spacer-bottom-20 break-word">
3031
<span *osPerms="permission.motionCanManagePolls; and: poll.isEVoting">
3132
<os-icon-container
@@ -43,7 +44,7 @@
4344
}
4445
&middot;&nbsp;
4546
</span>
46-
<!-- State -->
47+
<!-- State --
4748
<span class="break-word">
4849
@if (isAnonymous && poll.canBeVotedFor()) {
4950
{{ 'Voting in progress' | translate }}
@@ -53,7 +54,8 @@
5354
</span>
5455
</div>
5556
</div>
56-
<!-- Change state button -->
57+
-->
58+
<!-- Change state button
5759
<span *osPerms="permission.motionCanManagePolls; and: !hideChangeState">
5860
@if (pollStateActions[poll.state]) {
5961
<button
@@ -74,7 +76,8 @@
7476
</button>
7577
}
7678
</span>
77-
<!-- Results -->
79+
-->
80+
<!-- Results
7881
@if (poll && !poll.stateHasVotes && poll.type !== 'analog') {
7982
@if (poll && poll.isStarted) {
8083
<os-poll-progress [canManagePoll]="canManagePoll" [poll]="poll" />
@@ -88,6 +91,7 @@
8891
<ng-container [ngTemplateOutlet]="canSeeVotes ? viewTemplate : emptyTemplate"></ng-container>
8992
</span>
9093
}
94+
-->
9195
<!-- Detail link -->
9296
@if (poll.isPublished && isSameMeeting) {
9397
<div class="poll-detail-button-wrapper">

0 commit comments

Comments
 (0)