</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html</context>
- <context context-type="linenumber">66</context>
+ <context context-type="linenumber">72</context>
</context-group>
</trans-unit>
<trans-unit id="7886570921510760899" datatype="html">
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html</context>
- <context context-type="linenumber">58</context>
+ <context context-type="linenumber">64</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/bulk-editor/bulk-editor.component.html</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html</context>
- <context context-type="linenumber">74</context>
+ <context context-type="linenumber">80</context>
</context-group>
</trans-unit>
<trans-unit id="5421255270838137624" datatype="html">
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html</context>
- <context context-type="linenumber">82</context>
+ <context context-type="linenumber">88</context>
</context-group>
</trans-unit>
<trans-unit id="3188389494264426470" datatype="html">
<context context-type="linenumber">15</context>
</context-group>
</trans-unit>
+ <trans-unit id="3047655754312785383" datatype="html">
+ <source>Current ASN</source>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html</context>
+ <context context-type="linenumber">20</context>
+ </context-group>
+ </trans-unit>
<trans-unit id="8693603235657020323" datatype="html">
<source>Other</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts</context>
- <context context-type="linenumber">65</context>
+ <context context-type="linenumber">66</context>
</context-group>
</trans-unit>
<trans-unit id="8187573012244728580" datatype="html">
<ng-container i18n>Total characters</ng-container>:
<span class="badge bg-secondary text-light rounded-pill">{{statistics?.character_count | number}}</span>
</div>
+ @if (statistics?.current_asn) {
+ <div class="list-group-item d-flex justify-content-between align-items-center" routerLink="/documents/">
+ <ng-container i18n>Current ASN</ng-container>:
+ <span class="badge bg-secondary text-light rounded-pill">{{statistics?.current_asn | number}}</span>
+ </div>
+ }
@if (statistics?.document_file_type_counts?.length > 1) {
<div class="list-group-item filetypes">
<div class="d-flex justify-content-between align-items-center my-2">
'Other(0.9%)'
)
})
+
+ it('should display the current ASN', () => {
+ const mockStats = {
+ current_asn: 122,
+ }
+
+ const req = httpTestingController.expectOne(
+ `${environment.apiBaseUrl}statistics/`
+ )
+
+ req.flush(mockStats)
+ fixture.detectChanges()
+
+ expect(fixture.nativeElement.textContent.replace(/\s/g, '')).toContain(
+ 'CurrentASN:122'
+ )
+ })
+
+ it('should not display the current ASN if it is not available', () => {
+ const mockStats = {
+ current_asn: 0,
+ }
+
+ const req = httpTestingController.expectOne(
+ `${environment.apiBaseUrl}statistics/`
+ )
+
+ req.flush(mockStats)
+ fixture.detectChanges()
+
+ expect(fixture.nativeElement.textContent.replace(/\s/g, '')).not.toContain(
+ 'CurrentASN:'
+ )
+ })
})
.get("characters__sum")
)
+ current_asn = Document.objects.aggregate(
+ Max("archive_serial_number", default=0),
+ ).get(
+ "archive_serial_number__max",
+ )
+
return Response(
{
"documents_total": documents_total,
"correspondent_count": correspondent_count,
"document_type_count": document_type_count,
"storage_path_count": storage_path_count,
+ "current_asn": current_asn,
},
)