-
Notifications
You must be signed in to change notification settings - Fork 51
Vote detail view #6251
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
Draft
Elblinator
wants to merge
25
commits into
OpenSlides:feature/vote
Choose a base branch
from
Elblinator:new-vote-detail
base: feature/vote
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Vote detail view #6251
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8582702
Navigate to correct place
Elblinator c644fcf
Add detail page
Elblinator 2e77c9e
Change rerouting
Elblinator 6a1a27d
Change navigation again
Elblinator ca49dcb
Add route
Elblinator e33145d
intermediate
Elblinator 2f8d3d9
Move poll-list
Elblinator e15ecd5
Moree poll-list moveing
Elblinator 3930b0b
Merge remote-tracking branch 'origin/feature/vote' into new-vote-detail
Elblinator 4834fe8
Change module place
Elblinator f573a54
Working routing
Elblinator dfd4f99
Clean up poll.module
Elblinator 1151499
First basic implementation from poll detail
Elblinator d8abf51
Add onDestroy and load poll
Elblinator 5e1534e
Adjust poll call
Elblinator 1aade4f
Adjust content
Elblinator f020a3e
linter
Elblinator 70f3658
Change to aria label
Elblinator a23007f
Change poll-list redirection
Elblinator a996cdb
Adjust Link and backbutton
Elblinator c76fb5a
(start of) actual detail page
Elblinator 939ee12
Add entitled users and single votes as their own components
Elblinator 3273e65
Update detail view
Elblinator 7b8d36a
Change requests
Elblinator 848ad2e
Add Subscriptioon and empty(?) list
Elblinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...rc/app/site/pages/meetings/modules/poll/components/poll-detail/poll-detail.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <os-head-bar [nav]="false"> | ||
| <div class="title-slot"> | ||
| <h1 class="mock-h2">{{ poll()?.title }}</h1> | ||
| </div> | ||
| </os-head-bar> | ||
|
|
||
| <mat-card class="os-card"> | ||
| <mat-card-content> | ||
| <a [aria-label]="'Direct link to module of poll' | translate" [routerLink]="getDetailLink()"> | ||
| <h1>{{ poll()?.title }}</h1> | ||
| </a> | ||
| <mat-card-content> | ||
| <div class="poll-title-wrapper"> | ||
| <div class="italic spacer-bottom-20"> | ||
| <!-- Type and State --> | ||
| <div class="type-and-state italic spacer-bottom-20 break-word"> | ||
| <span> | ||
| <os-icon-container | ||
| class="poll-type break-word" | ||
| color="primary" | ||
| icon="info" | ||
| size="large" | ||
| [showIcon]="poll().isAnonymous" | ||
| [swap]="true" | ||
| > | ||
| {{ poll().visibility | translateKey: 'poll_visibility' }} | ||
| </os-icon-container> | ||
| @if (poll().isAnonymous) { | ||
| <span> </span> | ||
| } | ||
| · | ||
| </span> | ||
| <!-- State --> | ||
| <span class="break-word"> | ||
| @if (poll().isEVoting && poll().canBeVotedFor()) { | ||
| {{ 'Voting in progress' | translate }} | ||
| } @else if (poll().isFinished && poll().published) { | ||
| {{ 'published' | translate }} | ||
| } @else { | ||
| {{ poll().state | translateKey: 'poll_state' }} | ||
| } | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div>Candidate table</div> | ||
| <div>Single votes / entitled users tabs</div> | ||
| </mat-card-content> | ||
| </mat-card-content> | ||
| </mat-card> | ||
| <mat-card class="os-card"> | ||
| <mat-card-content><os-poll [poll]="poll()"></os-poll></mat-card-content> | ||
| </mat-card> |
61 changes: 61 additions & 0 deletions
61
.../src/app/site/pages/meetings/modules/poll/components/poll-detail/poll-detail.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { ChangeDetectionStrategy, Component, computed, inject, Signal } from '@angular/core'; | ||
| import { toSignal } from '@angular/core/rxjs-interop'; | ||
| import { MatCardModule } from '@angular/material/card'; | ||
| import { MatCheckboxModule } from '@angular/material/checkbox'; | ||
| import { MatFormFieldModule } from '@angular/material/form-field'; | ||
| import { MatInputModule } from '@angular/material/input'; | ||
| import { MatSelectModule } from '@angular/material/select'; | ||
| import { MatTooltipModule } from '@angular/material/tooltip'; | ||
| import { ActivatedRoute, RouterLink } from '@angular/router'; | ||
| import { TranslatePipe, TranslateService } from '@ngx-translate/core'; | ||
| import { map } from 'rxjs'; | ||
| import { BaseComponent } from 'src/app/site/base/base.component'; | ||
| import { HeadBarModule } from 'src/app/ui/modules/head-bar'; | ||
| import { IconContainerComponent } from 'src/app/ui/modules/icon-container'; | ||
| import { PipesModule } from 'src/app/ui/pipes'; | ||
|
|
||
| import { ViewPoll } from '../../../../pages/polls'; | ||
| import { PollControllerService } from '../../services/poll-controller.service'; | ||
| import { VotingService } from '../../services/voting.service'; | ||
| import { PollComponent } from '../poll/poll.component'; | ||
|
|
||
| @Component({ | ||
| selector: `os-poll-detail`, | ||
| templateUrl: `./poll-detail.component.html`, | ||
| styleUrls: [`../poll/poll.component.scss`], | ||
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| imports: [ | ||
| PollComponent, | ||
| IconContainerComponent, | ||
| TranslatePipe, | ||
| HeadBarModule, | ||
| MatInputModule, | ||
| MatFormFieldModule, | ||
| MatCheckboxModule, | ||
| MatSelectModule, | ||
| MatCardModule, | ||
| MatTooltipModule, | ||
| RouterLink, | ||
| PipesModule | ||
| ] | ||
| }) | ||
| export class PollDetailComponent extends BaseComponent { | ||
| public poll: Signal<ViewPoll>; | ||
|
|
||
| public getDetailLink = computed(() => { | ||
| return `/${this.poll().getDetailStateUrl()}`; | ||
| }); | ||
|
|
||
| public override translate = inject(TranslateService); | ||
| public pollRepo = inject(PollControllerService); | ||
| public votingService = inject(VotingService); | ||
| private activatedRoute = inject(ActivatedRoute); | ||
|
|
||
| public constructor() { | ||
| super(); | ||
| super.setTitle(`Singular poll`); | ||
| this.poll = toSignal( | ||
| this.pollRepo.getViewModelObservable(toSignal(this.activatedRoute.params.pipe(map(p => p['id'])))()) | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...nt/src/app/site/pages/meetings/modules/poll/components/poll-list/poll-list.component.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| .detail-link { | ||
| color: inherit; | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .detail-link:hover { | ||
| text-decoration: none; | ||
| cursor: pointer; | ||
| } |
File renamed without changes.
60 changes: 60 additions & 0 deletions
60
client/src/app/site/pages/meetings/modules/poll/components/poll-list/poll-list.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; | ||
| import { MatIconModule } from '@angular/material/icon'; | ||
| import { MatTooltipModule } from '@angular/material/tooltip'; | ||
| import { RouterLink } from '@angular/router'; | ||
| import { TranslatePipe, TranslateService } from '@ngx-translate/core'; | ||
| import { PollState } from 'src/app/domain/models/poll/poll-constants'; | ||
| import { BaseMeetingListViewComponent } from 'src/app/site/pages/meetings/base/base-meeting-list-view.component'; | ||
| import { PollControllerService } from 'src/app/site/pages/meetings/modules/poll/services/poll-controller.service/poll-controller.service'; | ||
| import { VotingService } from 'src/app/site/pages/meetings/modules/poll/services/voting.service'; | ||
| import { HeadBarModule } from 'src/app/ui/modules/head-bar'; | ||
| import { TranslateKeyPipe } from 'src/app/ui/pipes/translate-key/translate-key.pipe'; | ||
|
|
||
| import { ViewPoll } from '../../../../pages/polls'; | ||
| import { PollListFilterService } from '../../../../pages/polls/services/poll-list-filter.service/poll-list-filter.service'; | ||
| import { DetailViewModule } from '../../../meetings-component-collector/detail-view/detail-view.module'; | ||
| import { ProjectableListModule } from '../../../meetings-component-collector/projectable-list/projectable-list.module'; | ||
|
|
||
| const POLL_LIST_STORAGE_INDEX = `polls`; | ||
|
|
||
| @Component({ | ||
| selector: `os-poll-list`, | ||
| templateUrl: `./poll-list.component.html`, | ||
| styleUrls: [`./poll-list.component.scss`], | ||
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| imports: [ | ||
| HeadBarModule, | ||
| DetailViewModule, | ||
| ProjectableListModule, | ||
| TranslateKeyPipe, | ||
| RouterLink, | ||
| TranslatePipe, | ||
| MatIconModule, | ||
| MatTooltipModule | ||
| ] | ||
| }) | ||
| export class PollListComponent extends BaseMeetingListViewComponent<ViewPoll> { | ||
| public filterProps = [`title`, `state`]; | ||
|
|
||
| public override translate = inject(TranslateService); | ||
| public pollRepo = inject(PollControllerService); | ||
| public votingService = inject(VotingService); | ||
| public filterService = inject(PollListFilterService); | ||
|
|
||
| public constructor() { | ||
| super(); | ||
| super.setTitle(`List of electronic votes`); | ||
| this.listStorageIndex = POLL_LIST_STORAGE_INDEX; | ||
| } | ||
|
|
||
| /** | ||
| * TODO: Can be removed, when OpenSlides/openslides-autoupdate-service#262 is resolved. | ||
| */ | ||
| public canBeVoteFor(poll: ViewPoll): boolean { | ||
| if (poll.state === PollState.Finished) { | ||
| return false; | ||
| } | ||
|
|
||
| return poll.canBeVotedFor(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
43 changes: 0 additions & 43 deletions
43
.../pages/meetings/pages/polls/modules/poll-list/components/poll-list/poll-list.component.ts
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
client/src/app/site/pages/meetings/pages/polls/modules/poll-list/poll-list-routing.module.ts
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
client/src/app/site/pages/meetings/pages/polls/modules/poll-list/poll-list.module.ts
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...pp/site/pages/meetings/pages/polls/modules/poll-list/services/poll-list-service.module.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.