Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
Apply pr review corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Apr 8, 2021
1 parent 2de051a commit 2143163
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app/pages/my-polls/my-polls.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</nz-page-header>

<!-- Poll list -->
<div class="poll-list-container" *ngIf="polls !== undefined && polls !== null && polls.length > 0">
<div class="poll-list-container" *ngIf="polls?.length">
<nz-collapse nzBordered="false" nzAccordion class="no-select">
<nz-collapse-panel #p *ngFor="let poll of polls" [nzHeader]="header" [nzExtra]="options"
[nzExpandedIcon]="expandedIcon">
Expand Down Expand Up @@ -75,7 +75,7 @@
</div>

<!-- Empty result -->
<app-result-empty *ngIf="polls !== undefined && polls !== null && polls.length === 0"
<app-result-empty *ngIf="!polls?.length"
message="You do not have any polls yet. Click on the 'New poll' button above to create one.">
</app-result-empty>

Expand Down
11 changes: 5 additions & 6 deletions src/app/pages/poll/poll.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@
</nz-page-header-extra>
</nz-page-header>
<!-- Poll item list -->
<div class="poll-item-list-container no-select" *ngIf="poll.pollItems.length > 0">
<nz-collapse class="poll-item-list" nzBordered="false" nzAccordion
*ngIf="poll.pollItems !== undefined && poll.pollItems !== null && poll.pollItems.length > 0"
<div class="poll-item-list-container no-select" *ngIf="poll?.pollItems?.length">
<nz-collapse class="poll-item-list" nzBordered="false" nzAccordion *ngIf="poll.pollItems?.length"
cdkDropList (cdkDropListDropped)="drop($event)">
<nz-collapse-panel class="poll-item" #p *ngFor="let pollItem of poll.pollItems" [nzHeader]="header"
[nzExtra]="options" [nzExpandedIcon]="expandedIcon" cdkDrag cdkDragLockAxis="y">
Expand Down Expand Up @@ -136,7 +135,7 @@
</div>

<!-- No poll items -->
<app-result-empty *ngIf="poll.pollItems === undefined || poll.pollItems.length === 0"
<app-result-empty *ngIf="!poll.pollItems?.length"
message="You do not have any questions yet."></app-result-empty>
</nz-tab>
<nz-tab [nzTitle]="titleAnalytics">
Expand All @@ -145,7 +144,7 @@
</ng-template>

<!-- No results -->
<app-result-empty *ngIf="poll.pollItems === undefined || poll.pollItems.length === 0 || poll.startDate > currentDate || poll.startDate.getTime() === 0"
<app-result-empty *ngIf="!poll.pollItems?.length || poll.startDate > currentDate || poll.startDate.getTime() === 0"
message="The analytics of your poll are not yet available."></app-result-empty>
</nz-tab>
<nz-tab [nzTitle]="titleQA">
Expand All @@ -169,7 +168,7 @@
</nz-page-header>

<!-- Loading indicator -->
<nz-spin *ngIf="!error && poll === undefined" nzSize="large"></nz-spin>
<nz-spin *ngIf="!error && !poll" nzSize="large"></nz-spin>

<!-- Error message -->
<app-result-error *ngIf="error" title="Error" subtitle="An error occurred while loading the poll"></app-result-error>
Expand Down
13 changes: 12 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@
<meta charset="utf-8">
<title>LivePoll - Create live polls for your presentation</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=0.9">

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" href="assets/icons/apple-icon-180.png"/>
<!-- Theme tab color for Chrome mobile -->
<meta name="theme-color" content="#38C6BC">
<!-- PWA web manifest -->
<link rel="manifest" href="manifest.json">

<!-- Set initial scale factor depending on device size -->
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.1">
<script>
let [sw, sh] = [screen.width, screen.height];
let fw = window.matchMedia("(orientation: landscape)").matches ? sh : sw;
if (fw < 768) {
let mvp = document.getElementById("viewport");
mvp.setAttribute("content","width=device-width,initial-scale=0.9");
}
</script>
</head>
<body>
<!-- Main app -->
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"name": "My Polls",
"short_name": "My Polls",
"description": "View the list of polls, you have already created",
"description": "View the list of polls you have already created",
"url": "/my-polls",
"icons": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/ngsw-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ self.addEventListener('notificationclick', function (event) {
const notification = event.notification;
notification.close();
if (clients.openWindow) {
clients.openWindow('https://example.blog.com/2015/03/04/something-new.html');
clients.openWindow('https://www.live-poll.de/login');
}
});

Expand Down

0 comments on commit 2143163

Please sign in to comment.