Skip to content
Snippets Groups Projects
Commit a47930a7 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Merge branch 'feature/dev-environment-banner' into 'master'

Feat: Added a dev mode banner and removed submission dev setting

See merge request fevermap/fevermap!33
parents d186a003 f320d755
Branches master
No related tags found
No related merge requests found
Showing
with 122 additions and 74 deletions
import { LitElement, html } from 'lit-element';
import Translator from '../util/translator';
class DevelopmentModeBanner extends LitElement {
render() {
return html`
<div class="dev-mode-banner"><p>${Translator.get('dev_mode_banner_disclaimer')}</p></div>
`;
}
createRenderRoot() {
return this;
}
}
if (!customElements.get('development-mode-banner')) {
customElements.define('development-mode-banner', DevelopmentModeBanner);
}
......@@ -8,6 +8,7 @@ import 'src/app/components/material-icon';
import 'src/app/components/language-controller';
import 'src/app/components/dialog';
import 'src/app/components/button';
import 'src/app/components/development-mode-banner';
class FevermapRoot extends LitElement {
static get properties() {
......@@ -24,6 +25,11 @@ class FevermapRoot extends LitElement {
render() {
return html`
${window.location.origin.includes('dev') || window.location.origin.includes('localhost')
? html`
<development-mode-banner></development-mode-banner>
`
: ''}
<language-controller></language-controller>
${this.hasSubmittedAtLeastOnce
? html`
......
......@@ -228,7 +228,7 @@ class FevermapDataEntry extends LitElement {
const submissionResponse = await DataEntryService.handleDataEntrySubmission(feverData);
if (submissionResponse.success || true) {
if (submissionResponse.success) {
this.handlePostSubmissionActions(feverData, Date.now(), false, submissionResponse);
this.currentQuestion = 1;
} else {
......
......@@ -134,71 +134,72 @@ class FevermapDataView extends LitElement {
</div>
</div>
<div class="previous-submissions-list">
${this.previousSubmissions.map((sub, i) => {
let previousSubmission = this.previousSubmissions[i + 1]; // +1 because we're going from latest
let symptoms = this.getSymptomsForSubmission(sub);
return html`
<div class="previous-submission">
<div class="previous-submission--data-row">
<p class="previous-submission--data-row__date">
${dayjs(Number(sub.submission_time)).format('ddd DD.MM')}
</p>
<p class="previous-submission--data-row__fever">
${previousSubmission && sub.fever_temp
? html`
${previousSubmission.fever_temp === sub.fever_temp
? html`
<material-icon
class="no-new-trend"
icon="arrow_right_alt"
></material-icon>
`
: html`
${previousSubmission.fever_temp > sub.fever_temp
? html`
<material-icon
class="downward-trend"
icon="call_received"
></material-icon>
`
: html`
<material-icon
class="upward-trend"
icon="call_made"
></material-icon>
`}
`}
`
: ''}
${sub.fever_temp
? `${FeverDataUtil.getFeverWithUnit(
false,
sub.fever_temp,
this.geoCodingInfo
)}`
: '-'}
</p>
</div>
<div class="previous-submission--symptom-row">
<div class="previous-submission--symptom-row__symptoms">
${symptoms.map((symp, i) => {
return html`
${symp.hasSymptom
? html`
<p>
${symp.translation}${i < symptoms.length - 1
? ', '
: ''}
</p>
`
: ''}
`;
})}
${this.previousSubmissions &&
this.previousSubmissions.map((sub, i) => {
let previousSubmission = this.previousSubmissions[i + 1]; // +1 because we're going from latest
let symptoms = this.getSymptomsForSubmission(sub);
return html`
<div class="previous-submission">
<div class="previous-submission--data-row">
<p class="previous-submission--data-row__date">
${dayjs(Number(sub.submission_time)).format('ddd DD.MM')}
</p>
<p class="previous-submission--data-row__fever">
${previousSubmission && sub.fever_temp
? html`
${previousSubmission.fever_temp === sub.fever_temp
? html`
<material-icon
class="no-new-trend"
icon="arrow_right_alt"
></material-icon>
`
: html`
${previousSubmission.fever_temp > sub.fever_temp
? html`
<material-icon
class="downward-trend"
icon="call_received"
></material-icon>
`
: html`
<material-icon
class="upward-trend"
icon="call_made"
></material-icon>
`}
`}
`
: ''}
${sub.fever_temp
? `${FeverDataUtil.getFeverWithUnit(
false,
sub.fever_temp,
this.geoCodingInfo
)}`
: '-'}
</p>
</div>
<div class="previous-submission--symptom-row">
<div class="previous-submission--symptom-row__symptoms">
${symptoms.map((symp, i) => {
return html`
${symp.hasSymptom
? html`
<p>
${symp.translation}${i < symptoms.length - 1
? ', '
: ''}
</p>
`
: ''}
`;
})}
</div>
</div>
</div>
</div>
`;
})}
`;
})}
</div>
</div>
</div>
......
......@@ -107,5 +107,6 @@
"approve_text": "安装",
"decline_text": "以后"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -106,5 +106,6 @@
"approve_text": "Installieren",
"decline_text": "Vielleicht später"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -107,5 +107,6 @@
"approve_text": "Install",
"decline_text": "Maybe later"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -105,5 +105,6 @@
"approve_text": "Instalar",
"decline_text": "Ahora no"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -106,5 +106,6 @@
"approve_text": "Asenna",
"decline_text": "Ehkä myöhemmin"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap on kehitystilassa. Syötetty data ei ole pysyvää."
}
......@@ -106,5 +106,6 @@
"approve_text": "Installer",
"decline_text": " Peut-être plus tard "
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -101,5 +101,6 @@
"approve_text": "Installa",
"decline_text": "Forse più tardi"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -107,5 +107,6 @@
"approve_text": "Установить",
"decline_text": "Попозже"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -107,5 +107,6 @@
"approve_text": "Installera",
"decline_text": "Kanske senare"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
......@@ -101,5 +101,6 @@
"approve_text": "Встановити",
"decline_text": "Пізніше"
}
}
},
"dev_mode_banner_disclaimer": "Fevermap is in development mode. The data inserted will now be permanent."
}
\ No newline at end of file
......@@ -94,6 +94,19 @@ fevermap-landing, fevermap-stats, fevermap-data-entry {
background: whitesmoke;
}
.dev-mode-banner {
position: fixed;
left: 0;
bottom: 11%;
background: red;
p {
font-size: 0.8rem;
margin: 0;
color: #FFF;
padding: 0.25rem;
}
}
@media only screen and (max-width: 780px) {
.container {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment