From 7754a96fe11d024b70870a83a45907fb4feb1df7 Mon Sep 17 00:00:00 2001 From: Sanna Hautala Date: Wed, 24 Apr 2024 20:33:33 +0300 Subject: [PATCH] Update texts and styles and add scan object for engineers (#6) * chore: add an extra informative text * chore: update medical texts and styles * chore: update science texts and styles * feat: add scan object for engineers, remove extra butra buttons * chore: remove console.logs --- src/components/Carousel.vue | 17 +-- src/components/EngineeringScanObject.vue | 152 ++++++++++++++++++++++ src/components/GameScanner.vue | 6 + src/components/MedicalDiagnosis.vue | 4 +- src/components/MedicalRecords.vue | 29 +++-- src/components/MedicalSample.vue | 3 + src/components/MedicalScanner.vue | 3 + src/components/ScienceArtifactDetails.vue | 12 +- src/components/ScienceInspectObject.vue | 4 +- 9 files changed, 198 insertions(+), 32 deletions(-) create mode 100644 src/components/EngineeringScanObject.vue diff --git a/src/components/Carousel.vue b/src/components/Carousel.vue index 216b7b2..457d466 100644 --- a/src/components/Carousel.vue +++ b/src/components/Carousel.vue @@ -33,6 +33,7 @@ import MedicalSample from './MedicalSample.vue' import MedicalScanner from './MedicalScanner.vue' import ScienceArtifactDetails from './ScienceArtifactDetails.vue' import ScienceInspectObject from './ScienceInspectObject.vue' +import EngineeringScanObject from './EngineeringScanObject.vue' import Locator from './Locator.vue' import ShipDatabase from './ShipDatabase.vue' import SampleList from './SampleList.vue'; @@ -64,11 +65,6 @@ const PAGES = [ title: 'Operate scanners', page: MedicalScanner, }, - { - icon: 'book', - title: 'View samples', - page: SampleList, - }, ], }, { @@ -83,9 +79,9 @@ const PAGES = [ page: GameScanner, }, { - icon: 'info-circle', - title: 'Ship knowledge database', - page: ShipDatabase, + icon: 'futbol', + title: 'Scan object', + page: EngineeringScanObject, }, ], }, @@ -115,11 +111,6 @@ const PAGES = [ title: 'Operate scanners', page: MedicalScanner, }, - { - icon: 'book', - title: 'View samples', - page: SampleList, - }, ], }, { diff --git a/src/components/EngineeringScanObject.vue b/src/components/EngineeringScanObject.vue new file mode 100644 index 0000000..23d5a41 --- /dev/null +++ b/src/components/EngineeringScanObject.vue @@ -0,0 +1,152 @@ + + + + diff --git a/src/components/GameScanner.vue b/src/components/GameScanner.vue index 89e3d8e..79ff129 100644 --- a/src/components/GameScanner.vue +++ b/src/components/GameScanner.vue @@ -4,6 +4,7 @@

Scanning...

+

[Scan an engineering task NFC tag]

Tag contents:

@@ -233,3 +234,8 @@ export default { }, } + diff --git a/src/components/MedicalDiagnosis.vue b/src/components/MedicalDiagnosis.vue index 7c38f36..812ffba 100644 --- a/src/components/MedicalDiagnosis.vue +++ b/src/components/MedicalDiagnosis.vue @@ -68,7 +68,7 @@ export default { } }, showRecord() { - this.resultText = get(this.res, 'data.description', this.tagNotFoundMessage) + '\n\nReady to scan another injury'; + this.resultText = get(this.res, 'data.description', this.tagNotFoundMessage) + '\n\n\nReady to scan another injury'; this.state = 'results'; }, async show() { @@ -110,7 +110,7 @@ export default { }, }, created() { - this.title = 'DIAGNOSE AN INJURY'; + this.title = 'DIAGNOSE INJURY'; this.resultText = 'Scan an injury'; this.tagRegexp = /^medic:..*/; this.tagNotFoundMessage = 'This injury is unknown'; diff --git a/src/components/MedicalRecords.vue b/src/components/MedicalRecords.vue index 92d9b89..7aaadbb 100644 --- a/src/components/MedicalRecords.vue +++ b/src/components/MedicalRecords.vue @@ -36,7 +36,7 @@ export default { id: 0, query: '', results: [ ], - resultText: 'Scan a patient ID card', + resultText: 'Scan patient bio ID', hasInput: !hasNfc(), scanProgress: 0, dataProgress: 0, @@ -53,40 +53,47 @@ export default { const person = this.record; if (!person) return this.resultText = `Unknown person. -Ready to scan another patient ID card`; +Ready to scan another patient bio ID`; this.query = '' - this.resultText = `Medical details: + this.resultText = `MEDICAL DETAILS: + Name: ${ person.full_name } Age: ${ 542 - person.birth_year } Fitness level: ${ person.medical_fitness_level || 'Unknown' } Last fitness check: ${ person.medical_last_fitness_check || 'Unknown' } - Blood type: ${ person.blood_type || 'Unknown' } + Blood type: ${ person.medical_blood_type || 'Unknown' } + Allergies: ${ person.medical_allergies || 'None / Unknown' } - Medical records: +CURRENT MEDICATION: +${ person.medical_current_medication || 'None / Unknown' } -${ parseEntries(this.record.entries, 'MEDICAL') } +ACTIVE CONDITIONS: +${ person.medical_active_conditions.replaceAll('\n\n','\n') || 'None / Unknown' } +MEDICAL RECORDS: +${ parseEntries(this.record.entries, 'MEDICAL').join('\n').replaceAll('\n\n','\n') } -Ready to scan another patient ID card` + +Ready to scan another patient bio ID` this.state = 'results'; }, async getRecords(message) { console.log('messa', message); if (this.state === 'processing') return; - if (message.startsWith('card:')) { + if (message.startsWith('bio:')) { this.id = message.split( ':', 2)[1] if (!this.id) return; - this.record = await getBlob('/person/card', this.id) + this.record = await getBlob('/person/bio', this.id) if (this.record) { this.analyze(); } else { this.showRecord(); } } else { - this.resultText = `This does not seem to be an ID card. + this.resultText = `This does not seem to be an bio ID. -Scan a patient ID card`; +Scan patient bio ID`; } }, analyze() { diff --git a/src/components/MedicalSample.vue b/src/components/MedicalSample.vue index 78527d4..402a7f5 100644 --- a/src/components/MedicalSample.vue +++ b/src/components/MedicalSample.vue @@ -222,6 +222,9 @@ input, textarea, .type-select { margin: 1rem; margin-top: 0.5rem; } +option { + background: lighten($gray, 45); +} .type-select { text-align: center; } diff --git a/src/components/MedicalScanner.vue b/src/components/MedicalScanner.vue index 5c7c63b..cccf69b 100644 --- a/src/components/MedicalScanner.vue +++ b/src/components/MedicalScanner.vue @@ -281,6 +281,9 @@ input, textarea, .type-select { margin: 1rem; margin-top: 0.5rem; } +option { + background: lighten($gray, 45); +} .type-select { text-align: center; } diff --git a/src/components/ScienceArtifactDetails.vue b/src/components/ScienceArtifactDetails.vue index bd0644e..94acd85 100644 --- a/src/components/ScienceArtifactDetails.vue +++ b/src/components/ScienceArtifactDetails.vue @@ -53,17 +53,21 @@ export default { const artifact = this.record; if (!artifact) return this.resultText = `This artifact is unknown.`; this.query = '' - this.resultText = `Artifact scan results: + this.resultText = `ARTIFACT SCAN RESULTS: Name: ${ artifact.name } + Catalog ID: ${ artifact.catalog_id } + Artifact origin: ${ artifact.type || 'Unknown' } Discovered by: ${ artifact.discovered_by || 'Unknown' } Discovery time: ${ artifact.discovered_at || 'Unknown' } Discovery location: ${ artifact.discovered_from || 'Unknown' } - Artifact type: ${ artifact.type || 'Unknown' } - Additional entries: +ARTIFACT DESCRIPTION: +${ artifact.text.split("![]")[0].trim() || 'None' } + +ADDITIONAL ENTRIES: +${ parseEntries(this.record.entries).join('\n\n').replaceAll('\n\n', '\n')} -${ parseEntries(this.record.entries) } Ready to scan a new artifact.` this.state = 'results'; diff --git a/src/components/ScienceInspectObject.vue b/src/components/ScienceInspectObject.vue index 20e489d..1637075 100644 --- a/src/components/ScienceInspectObject.vue +++ b/src/components/ScienceInspectObject.vue @@ -69,7 +69,7 @@ export default { } }, showRecord() { - this.resultText = get(this.res, 'data.description', this.tagNotFoundMessage) + '\n\nReady to scan another object'; + this.resultText = get(this.res, 'data.description', this.tagNotFoundMessage) + '\n\n\nReady to scan another object'; this.state = 'results'; }, async show() { @@ -110,7 +110,7 @@ export default { }, }, created() { - this.title = 'INSPECT OBJECT'; + this.title = 'SCAN OBJECT'; this.resultText = 'Ready to scan an object'; this.tagRegexp = /^science:..*/; this.tagNotFoundMessage = 'This object is unknown';