adding display information for manual source.
This commit is contained in:
parent
3cd3448fa5
commit
a486f917e4
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="card-footer text-center p-1" style="width:100%">
|
||||
<small class="tx-gray-700">
|
||||
{{sourceInfo?.metadata.display}}
|
||||
{{sourceInfo?.metadata?.display || getSourceDisplayName(sourceInfo)}}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||
import {SourceListItem} from '../../pages/medical-sources/medical-sources.component';
|
||||
import moment from 'moment/moment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-medical-sources-card',
|
||||
|
@ -22,4 +23,14 @@ export class MedicalSourcesCardComponent implements OnInit {
|
|||
this.onClick.emit(this.sourceInfo)
|
||||
}
|
||||
|
||||
getSourceDisplayName(sourceItem: SourceListItem): string {
|
||||
if(sourceItem.metadata?.display) {
|
||||
return sourceItem.metadata?.display
|
||||
}
|
||||
if(sourceItem.source?.source_type == 'manual') {
|
||||
return 'Uploaded ' + moment(sourceItem.source?.created_at).format('MMM DD, YYYY')
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ import {BackgroundJob} from './background-job';
|
|||
|
||||
export class Source extends LighthouseSourceMetadata{
|
||||
id?: string
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
user_id?: number
|
||||
source_type: string
|
||||
latest_background_job?: BackgroundJob
|
||||
|
|
Loading…
Reference in New Issue