@@ -12,6 +12,7 @@ import AccessionSummary from 'repository/components/accession-summary';
1212import formatDatetime from ' repository/helpers/format-datetime' ;
1313
1414import type RequestService from ' repository/services/request' ;
15+ import type RouterService from ' @ember/routing/router-service' ;
1516import type { components } from ' schema/openapi' ;
1617
1718type Accession = components [' schemas' ][' Accession' ];
@@ -28,15 +29,24 @@ interface Signature {
2829
2930export default class extends Component <Signature > {
3031 @service declare request: RequestService ;
32+ @service declare router: RouterService ;
3133
3234 @action
3335 async downloadFile(url : string ) {
3436 await this .request .downloadFile (url );
3537 }
3638
39+ @action
40+ backToAccession() {
41+ this .router .refresh ();
42+ this .router .transitionTo (' accession' , this .args .model .accession .number );
43+ }
44+
3745 <template >
3846 <div class =" mb-3" >
39- <LinkTo @ route =" accession" @ model ={{@ model.accession.number }} >« Back to accession</LinkTo >
47+ <LinkTo @ route =" accession" @ model ={{@ model.accession.number }} {{on " click" this . backToAccession}} >
48+ « Back to accession
49+ </LinkTo >
4050 </div >
4151
4252 <AccessionSummary @ accession ={{@ model.accession }} />
@@ -80,10 +90,27 @@ export default class extends Component<Signature> {
8090
8191 <div >
8292 <dt >Validity</dt >
83- <dd ><ValidityBadge @ validity ={{@ model.renewal.validity }} /></dd >
93+
94+ <dd >
95+ <ValidityBadge @ validity ={{@ model.renewal.validity }} />
96+
97+ {{#if @ model.renewal.validation_details.length }}
98+ <span class =" badge bg-secondary" >{{@ model.renewal.validation_details.length }} </span >
99+ {{/if }}
100+ </dd >
84101 </div >
85102 </dl >
86103
104+ {{#if @ model.renewal.file }}
105+ <h3 >File</h3 >
106+
107+ <button
108+ type =" button"
109+ class =" btn btn-link p-0 mb-3"
110+ {{on " click" ( fn this . downloadFile @ model.renewal.file.url) }}
111+ >{{@ model.renewal.file.filename }} </button >
112+ {{/if }}
113+
87114 {{#if @ model.renewal.validation_details.length }}
88115 <h3 >Validation Results</h3 >
89116
@@ -105,14 +132,5 @@ export default class extends Component<Signature> {
105132 </tbody >
106133 </table >
107134 {{/if }}
108-
109- {{#if @ model.renewal.file }}
110- <h3 >File</h3 >
111- <button
112- type =" button"
113- class =" btn btn-link p-0"
114- {{on " click" ( fn this . downloadFile @ model.renewal.file.url) }}
115- >{{@ model.renewal.file.filename }} </button >
116- {{/if }}
117135 </template >
118136}
0 commit comments