Compare commits

...
Author SHA1 Message Date
dependabot[bot] 5e8d026ab4 Chore(deps): Bump the frontend-angular-dependencies group
Bumps the frontend-angular-dependencies group in /src-ui with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [@angular/cdk](https://github.com/angular/components) | `22.2.2` | `22.2.4` |
| [@angular/common](https://github.com/angular/angular/tree/HEAD/packages/common) | `22.2.2` | `22.2.3` |
| [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) | `22.2.2` | `22.2.3` |
| [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) | `22.2.2` | `22.2.3` |
| [@angular/forms](https://github.com/angular/angular/tree/HEAD/packages/forms) | `22.2.2` | `22.2.3` |
| [@angular/localize](https://github.com/angular/angular) | `22.2.2` | `22.2.3` |
| [@angular/platform-browser](https://github.com/angular/angular/tree/HEAD/packages/platform-browser) | `22.2.2` | `22.2.3` |
| [@angular/router](https://github.com/angular/angular/tree/HEAD/packages/router) | `22.2.2` | `22.2.3` |
| [@angular-devkit/core](https://github.com/angular/angular-cli) | `22.2.2` | `22.2.4` |
| [@angular-devkit/schematics](https://github.com/angular/angular-cli) | `22.2.2` | `22.2.4` |
| [@angular/build](https://github.com/angular/angular-cli) | `22.2.2` | `22.2.4` |
| [@angular/cli](https://github.com/angular/angular-cli) | `22.2.2` | `22.2.4` |
| [@angular/compiler-cli](https://github.com/angular/angular/tree/HEAD/packages/compiler-cli) | `22.2.2` | `22.2.3` |


Updates `@angular/cdk` from 22.2.2 to 22.2.4
- [Release notes](https://github.com/angular/components/releases)
- [Changelog](https://github.com/angular/components/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/components/compare/v22.2.2...v22.2.4)

Updates `@angular/common` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/common)

Updates `@angular/compiler` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/compiler)

Updates `@angular/core` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/core)

Updates `@angular/forms` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/forms)

Updates `@angular/localize` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/compare/v22.2.2...v22.2.3)

Updates `@angular/platform-browser` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/platform-browser)

Updates `@angular/router` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/router)

Updates `@angular-devkit/core` from 22.2.2 to 22.2.4
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/v22.2.4/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/v22.2.2...v22.2.4)

Updates `@angular-devkit/schematics` from 22.2.2 to 22.2.4
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/v22.2.4/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/v22.2.2...v22.2.4)

Updates `@angular/build` from 22.2.2 to 22.2.4
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/v22.2.4/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/v22.2.2...v22.2.4)

Updates `@angular/cli` from 22.2.2 to 22.2.4
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/v22.2.4/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/v22.2.2...v22.2.4)

Updates `@angular/compiler-cli` from 22.2.2 to 22.2.3
- [Release notes](https://github.com/angular/angular/releases)
- [Commits](https://github.com/angular/angular/commits/v22.2.3/packages/compiler-cli)

---
updated-dependencies:
- dependency-name: "@angular/cdk"
  dependency-version: 22.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/common"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/compiler"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/core"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/forms"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/localize"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/platform-browser"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/router"
  dependency-version: 22.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular-devkit/core"
  dependency-version: 22.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular-devkit/schematics"
  dependency-version: 22.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/build"
  dependency-version: 22.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/cli"
  dependency-version: 22.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
- dependency-name: "@angular/compiler-cli"
  dependency-version: 22.2.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: frontend-angular-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-01 20:23:12 +00:00
shamoon 5b63c9a0ff Fixhancement: add tag names to document history list (#14625) 2026-11-01 05:39:52 -08:00
shamoon 217c5e681d Fix: add button type to zoom buttons to prevent form submission (#14624) 2026-11-01 05:35:38 -08:00
6 changed files with 498 additions and 387 deletions

No files matched your search

+13 -13
View File
@@ -15,14 +15,14 @@
},
"private": true,
"dependencies": {
"@angular/cdk": "^22.2.2",
"@angular/common": "~22.2.2",
"@angular/compiler": "~22.2.2",
"@angular/core": "~22.2.2",
"@angular/forms": "~22.2.2",
"@angular/localize": "~22.2.2",
"@angular/platform-browser": "~22.2.2",
"@angular/router": "~22.2.2",
"@angular/cdk": "^22.2.4",
"@angular/common": "~22.2.3",
"@angular/compiler": "~22.2.3",
"@angular/core": "~22.2.3",
"@angular/forms": "~22.2.3",
"@angular/localize": "~22.2.3",
"@angular/platform-browser": "~22.2.3",
"@angular/router": "~22.2.3",
"@ng-bootstrap/ng-bootstrap": "^21.0.0",
"@ng-select/ng-select": "~24.2.1",
"@ngneat/dirty-check-forms": "^3.0.3",
@@ -46,16 +46,16 @@
},
"devDependencies": {
"@angular-builders/jest": "^22.0.1",
"@angular-devkit/core": "^22.2.2",
"@angular-devkit/schematics": "^22.2.2",
"@angular-devkit/core": "^22.2.4",
"@angular-devkit/schematics": "^22.2.4",
"@angular-eslint/builder": "22.6.0",
"@angular-eslint/eslint-plugin": "22.6.0",
"@angular-eslint/eslint-plugin-template": "22.6.0",
"@angular-eslint/schematics": "22.6.0",
"@angular-eslint/template-parser": "22.6.0",
"@angular/build": "22.2.2",
"@angular/cli": "22.2.2",
"@angular/compiler-cli": "~22.2.2",
"@angular/build": "22.2.4",
"@angular/cli": "22.2.4",
"@angular/compiler-cli": "~22.2.3",
"@playwright/test": "^1.62.1",
"@types/jest": "^30.0.0",
"@types/node": "^26.6.2",
+420 -371
View File
File diff suppressed because it is too large. Load diff
@@ -485,7 +485,7 @@
</div>
}
<div class="input-group input-group-sm w-auto flex-nowrap">
<button class="btn btn-outline-secondary" (click)="decreaseZoom()" aria-label="Zoom out" i18n-aria-label>
<button class="btn btn-outline-secondary" type="button" (click)="decreaseZoom()" aria-label="Zoom out" i18n-aria-label>
<i-bs width="1em" height="1em" name="dash"></i-bs>
</button>
<select class="form-select" (change)="setZoom($event.target.value)" [ngModelOptions]="{standalone: true}" [ngModel]="currentZoom" aria-label="Zoom" i18n-aria-label>
@@ -495,7 +495,7 @@
</option>
}
</select>
<button class="btn btn-outline-secondary" (click)="increaseZoom()" aria-label="Zoom in" i18n-aria-label>
<button class="btn btn-outline-secondary" type="button" (click)="increaseZoom()" aria-label="Zoom in" i18n-aria-label>
<i-bs width="1em" height="1em" name="plus"></i-bs>
</button>
</div>
@@ -47,6 +47,8 @@
<span>{{ change.key | titlecase }}</span>:&nbsp;
@if (change.key === 'content') {
<code class="text-primary">{{ change.value[1]?.substring(0,100) }}...</code>
} @else if (change.key === 'tags') {
<code class="text-primary">{{ getTagNames($any(change.value[1])) | async }}</code>
} @else {
<code class="text-primary">{{ getPrettyName(change.key, change.value[1]) | async }}</code>
}
@@ -12,6 +12,7 @@ import { CorrespondentService } from 'src/app/services/rest/correspondent.servic
import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
import { DocumentService } from 'src/app/services/rest/document.service'
import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { TagService } from 'src/app/services/rest/tag.service'
import { UserService } from 'src/app/services/rest/user.service'
import { DocumentHistoryComponent } from './document-history.component'
@@ -174,6 +175,39 @@ describe('DocumentHistoryComponent', () => {
})
})
it('should render bulk tag history with names and preserve missing tag IDs', () => {
const getCachedSpy = jest
.spyOn(TestBed.inject(TagService), 'getCached')
.mockImplementation((id) =>
of(id === 1 ? { id: 1, name: 'Invoice' } : null)
)
component.entries.set([
{
id: 1,
action: AuditLogAction.Update,
timestamp: '2021-01-01T00:00:00Z',
remote_addr: null,
changes: JSON.parse('{"tags":[[],[1,2345]]}'),
},
])
component.loading.set(false)
fixture.detectChanges()
expect(fixture.nativeElement.querySelector('code').textContent).toBe(
'Invoice, 2345'
)
fixture.detectChanges()
expect(getCachedSpy).toHaveBeenCalledTimes(2)
})
it('should handle removal of all tags without a lookup', () => {
const getCachedSpy = jest.spyOn(TestBed.inject(TagService), 'getCached')
component.getTagNames([]).subscribe((result) => {
expect(result).toBe('')
})
expect(getCachedSpy).not.toHaveBeenCalled()
})
it('getPrettyName should return the value as is for other types', () => {
const id = '123'
component.getPrettyName('other', id).subscribe((result) => {
@@ -2,7 +2,7 @@ import { AsyncPipe, KeyValuePipe, TitleCasePipe } from '@angular/common'
import { Component, Input, OnInit, inject, signal } from '@angular/core'
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { Observable, first, map, of, shareReplay } from 'rxjs'
import { Observable, first, forkJoin, map, of, shareReplay } from 'rxjs'
import { AuditLogAction, AuditLogEntry } from 'src/app/data/auditlog-entry'
import { DataType } from 'src/app/data/datatype'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
@@ -10,6 +10,7 @@ import { CorrespondentService } from 'src/app/services/rest/correspondent.servic
import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
import { DocumentService } from 'src/app/services/rest/document.service'
import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { TagService } from 'src/app/services/rest/tag.service'
import { UserService } from 'src/app/services/rest/user.service'
@Component({
@@ -30,6 +31,7 @@ export class DocumentHistoryComponent implements OnInit {
private readonly correspondentService = inject(CorrespondentService)
private readonly storagePathService = inject(StoragePathService)
private readonly documentTypeService = inject(DocumentTypeService)
private readonly tagService = inject(TagService)
private readonly userService = inject(UserService)
public AuditLogAction = AuditLogAction
@@ -63,6 +65,30 @@ export class DocumentHistoryComponent implements OnInit {
}
}
getTagNames(tagIds: number[]): Observable<string> {
const cacheKey = `tags:${JSON.stringify(tagIds)}`
const cachedNames = this.prettyNameCache.get(cacheKey)
if (cachedNames) {
return cachedNames
}
const tagNames$ = tagIds.length
? forkJoin(
tagIds.map((tagId) =>
this.tagService.getCached(tagId).pipe(
first(),
map((tag) => tag?.name ?? String(tagId))
)
)
).pipe(map((names) => names.join(', ')))
: of('')
const names$ = tagNames$.pipe(
shareReplay({ bufferSize: 1, refCount: true })
)
this.prettyNameCache.set(cacheKey, names$)
return names$
}
getPrettyName(type: DataType | string, id: string): Observable<string> {
const cacheKey = `${type}:${id}`
const cached = this.prettyNameCache.get(cacheKey)