diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 21a459c6d..d977126ed 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -1,6 +1,6 @@ { "appId": "io.numbersprotocol.capturelite", - "appName": "Capture Lite", + "appName": "Capture", "bundledWebRuntime": false, "npmClient": "npm", "webDir": "www", diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 44e103096..86b7af1d3 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ - Capture Lite - Capture Lite + Capture + Capture io.numbersprotocol.capturelite io.numbersprotocol.capturelite diff --git a/capacitor.config.json b/capacitor.config.json index 21a459c6d..d977126ed 100644 --- a/capacitor.config.json +++ b/capacitor.config.json @@ -1,6 +1,6 @@ { "appId": "io.numbersprotocol.capturelite", - "appName": "Capture Lite", + "appName": "Capture", "bundledWebRuntime": false, "npmClient": "npm", "webDir": "www", diff --git a/src/app/pages/home/asset/asset.page.html b/src/app/pages/home/asset/asset.page.html index 3574a4b2d..d2868d018 100644 --- a/src/app/pages/home/asset/asset.page.html +++ b/src/app/pages/home/asset/asset.page.html @@ -2,7 +2,7 @@ - {{ t('proofDetails') }} + {{ t('captureDetails') }} diff --git a/src/app/pages/home/asset/sending-post-capture/sending-post-capture.page.html b/src/app/pages/home/asset/sending-post-capture/sending-post-capture.page.html index 1ca005302..31fd6b822 100644 --- a/src/app/pages/home/asset/sending-post-capture/sending-post-capture.page.html +++ b/src/app/pages/home/asset/sending-post-capture/sending-post-capture.page.html @@ -29,7 +29,8 @@ - + diff --git a/src/app/shared/post-capture-card/post-capture-card.component.spec.ts b/src/app/shared/post-capture-card/post-capture-card.component.spec.ts index d287cbb71..199c9b829 100644 --- a/src/app/shared/post-capture-card/post-capture-card.component.spec.ts +++ b/src/app/shared/post-capture-card/post-capture-card.component.spec.ts @@ -7,6 +7,7 @@ import { MatIconTestingModule } from '@angular/material/icon/testing'; import { MatListModule } from '@angular/material/list'; import { IonicModule } from '@ionic/angular'; import { Asset } from 'src/app/services/publisher/numbers-storage/data/asset/asset'; +import { Transaction } from 'src/app/services/publisher/numbers-storage/numbers-storage-api.service'; import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; import { PostCaptureCardComponent } from './post-capture-card.component'; @@ -25,7 +26,14 @@ describe('PostCaptureCardComponent', () => { uploaded_at: '', is_original_owner: true }; - const expectedImageSrc = 'https://picsum.photos/200/300'; + const expectedTranasction: Transaction = { + id: '', + sender: '', + asset: expectedAsset, + created_at: '', + expired: false, + fulfilled_at: '' + }; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -45,7 +53,7 @@ describe('PostCaptureCardComponent', () => { fixture = TestBed.createComponent(PostCaptureCardComponent); component = fixture.componentInstance; component.asset = expectedAsset; - component.imageSrc = expectedImageSrc; + component.transaction = expectedTranasction; fixture.detectChanges(); })); diff --git a/src/app/shared/post-capture-card/post-capture-card.component.ts b/src/app/shared/post-capture-card/post-capture-card.component.ts index 4e51d45a8..0648af5bb 100644 --- a/src/app/shared/post-capture-card/post-capture-card.component.ts +++ b/src/app/shared/post-capture-card/post-capture-card.component.ts @@ -1,14 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { concatMap, map, pluck, switchMap } from 'rxjs/operators'; -import { CapacitorProvider } from 'src/app/services/collector/information/capacitor-provider/capacitor-provider'; -import { Caption } from 'src/app/services/data/caption/caption'; -import { CaptionRepository } from 'src/app/services/data/caption/caption-repository.service'; -import { InformationRepository } from 'src/app/services/data/information/information-repository.service'; -import { Proof } from 'src/app/services/data/proof/proof'; -import { ProofRepository } from 'src/app/services/data/proof/proof-repository.service'; import { Asset } from 'src/app/services/publisher/numbers-storage/data/asset/asset'; -import { isNonNullable } from 'src/app/utils/rx-operators'; +import { Transaction } from 'src/app/services/publisher/numbers-storage/numbers-storage-api.service'; @Component({ selector: 'app-post-capture-card', @@ -17,43 +9,16 @@ import { isNonNullable } from 'src/app/utils/rx-operators'; }) export class PostCaptureCardComponent implements OnInit { - @Input() userName!: string; + @Input() transaction!: Transaction; @Input() asset!: Asset; - @Input() imageSrc!: string; - proof$!: Observable; - caption$!: Observable; - latitude$!: Observable; - longitude$!: Observable; + latitude!: string; + longitude!: string; openMore = false; - constructor( - private readonly proofRepository: ProofRepository, - private readonly informationRepository: InformationRepository, - private readonly captionRepository: CaptionRepository - ) { } - ngOnInit() { - this.proof$ = this.proofRepository.getByHash$(this.asset.proof_hash).pipe( - isNonNullable() - ); - this.caption$ = this.proof$.pipe( - isNonNullable(), - concatMap(proof => this.captionRepository.getByProof$(proof)), - isNonNullable() - ); - this.latitude$ = this.proof$.pipe( - switchMap(proof => this.informationRepository.getByProof$(proof)), - map(informationList => informationList.find(information => information.provider === CapacitorProvider.ID && information.name === 'Current GPS Latitude')), - isNonNullable(), - pluck('value') - ); - this.longitude$ = this.proof$.pipe( - switchMap(proof => this.informationRepository.getByProof$(proof)), - map(informationList => informationList.find(information => information.provider === CapacitorProvider.ID && information.name === 'Current GPS Longitude')), - isNonNullable(), - pluck('value') - ); + this.latitude = this.asset.information.information.find(info => info.name === 'Current GPS Latitude')?.value || 'unknown'; + this.longitude = this.asset.information.information.find(info => info.name === 'Current GPS Longitude')?.value || 'unknown'; } } diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 23e26aa89..25680fba8 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -3,7 +3,7 @@ "profile": "Profile", "settings": "Settings", "privacy": "Privacy", - "proofDetails": "Proof Details", + "captureDetails": "Capture Details", "informationDetails": "Information Details", "caption": "Caption", "hash": "Hash", diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index a0c717bd7..bd8f90d41 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -3,7 +3,7 @@ "profile": "個人資料", "settings": "設定", "privacy": "隱私", - "proofDetails": "拍攝資訊", + "captureDetails": "拍攝資訊", "informationDetails": "詳細資訊", "caption": "標題", "hash": "雜湊",