From 6c2468650900fbd14fe017ac9ed9f306a98b0d18 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 1 May 2024 12:07:19 -0700 Subject: [PATCH 1/6] Fix: always refresh document after save --- .../components/document-detail/document-detail.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index db0d16f5a..aea7ca472 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -638,13 +638,17 @@ export class DocumentDetailComponent this.documentForm.patchValue(docValues) this.store.next(this.documentForm.value) this.openDocumentService.setDirty(this.document, false) + this.openDocumentService.save() this.toastService.showInfo($localize`Document saved successfully.`) this.networkActive = false this.error = null - close && + if (close) { this.close(() => this.openDocumentService.refreshDocument(this.documentId) ) + } else { + this.openDocumentService.refreshDocument(this.documentId) + } }, error: (error) => { this.networkActive = false From 8b4fc02955bb21f2c3cac45a7f12fc922d11f31d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:09:03 -0700 Subject: [PATCH 2/6] Hide unusable filters --- .../document-list/filter-editor/filter-editor.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html index ccbe50cac..451f84f9f 100644 --- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html +++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html @@ -60,7 +60,7 @@ [documentCounts]="documentTypeDocumentCounts" [allowSelectNone]="true"> } - @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.StoragePath)) { + @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.StoragePath) && storagePaths.length > 0) { } - @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.CustomField)) { + @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.CustomField) && customFields.length > 0) { Date: Tue, 30 Apr 2024 22:06:19 -0700 Subject: [PATCH 3/6] Fix relative date test that will fail across months --- src-ui/src/app/pipes/custom-date.pipe.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/pipes/custom-date.pipe.spec.ts b/src-ui/src/app/pipes/custom-date.pipe.spec.ts index ddc03c773..32505fa7c 100644 --- a/src-ui/src/app/pipes/custom-date.pipe.spec.ts +++ b/src-ui/src/app/pipes/custom-date.pipe.spec.ts @@ -33,8 +33,9 @@ describe('CustomDatePipe', () => { const notNow = new Date(now) notNow.setDate(now.getDate() - 1) expect(datePipe.transform(notNow, 'relative')).toEqual('1 day ago') - notNow.setDate(now.getDate() - 2) - expect(datePipe.transform(notNow, 'relative')).toEqual('2 days ago') + notNow.setDate(now.getDate()) + notNow.setMonth(now.getMonth() - 1) + expect(datePipe.transform(notNow, 'relative')).toEqual('1 month ago') expect(datePipe.transform(now, 'relative')).toEqual('Just now') }) }) From f503cd8758119a8728d4b0327a88e02aa46f6559 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 19:20:06 +0000 Subject: [PATCH 4/6] Chore(deps): Bump the frontend-angular-dependencies group (#6539) Bumps the frontend-angular-dependencies group in /src-ui with 13 updates: | Package | From | To | | --- | --- | --- | | [@angular/cdk](https://github.com/angular/components) | `17.3.2` | `17.3.6` | | [@angular/common](https://github.com/angular/angular/tree/HEAD/packages/common) | `17.3.2` | `17.3.7` | | [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) | `17.3.2` | `17.3.7` | | [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) | `17.3.2` | `17.3.7` | | [@angular/forms](https://github.com/angular/angular/tree/HEAD/packages/forms) | `17.3.2` | `17.3.7` | | [@angular/localize](https://github.com/angular/angular) | `17.3.2` | `17.3.7` | | [@angular/platform-browser](https://github.com/angular/angular/tree/HEAD/packages/platform-browser) | `17.3.2` | `17.3.7` | | [@angular/platform-browser-dynamic](https://github.com/angular/angular/tree/HEAD/packages/platform-browser-dynamic) | `17.3.2` | `17.3.7` | | [@angular/router](https://github.com/angular/angular/tree/HEAD/packages/router) | `17.3.2` | `17.3.7` | | [@angular-builders/jest](https://github.com/just-jeb/angular-builders/tree/HEAD/packages/jest) | `17.0.2` | `17.0.3` | | [@angular-devkit/build-angular](https://github.com/angular/angular-cli) | `17.3.2` | `17.3.6` | | [@angular/cli](https://github.com/angular/angular-cli) | `17.3.2` | `17.3.6` | | [@angular/compiler-cli](https://github.com/angular/angular/tree/HEAD/packages/compiler-cli) | `17.3.2` | `17.3.7` | Updates `@angular/cdk` from 17.3.2 to 17.3.6 - [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/17.3.2...17.3.6) Updates `@angular/common` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/common) Updates `@angular/compiler` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/compiler) Updates `@angular/core` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/core) Updates `@angular/forms` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/forms) Updates `@angular/localize` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/compare/17.3.2...17.3.7) Updates `@angular/platform-browser` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/platform-browser) Updates `@angular/platform-browser-dynamic` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/platform-browser-dynamic) Updates `@angular/router` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/router) Updates `@angular-builders/jest` from 17.0.2 to 17.0.3 - [Release notes](https://github.com/just-jeb/angular-builders/releases) - [Changelog](https://github.com/just-jeb/angular-builders/blob/master/packages/jest/CHANGELOG.md) - [Commits](https://github.com/just-jeb/angular-builders/commits/@angular-builders/jest@17.0.3/packages/jest) Updates `@angular-devkit/build-angular` from 17.3.2 to 17.3.6 - [Release notes](https://github.com/angular/angular-cli/releases) - [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular-cli/compare/17.3.2...17.3.6) Updates `@angular/cli` from 17.3.2 to 17.3.6 - [Release notes](https://github.com/angular/angular-cli/releases) - [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular-cli/compare/17.3.2...17.3.6) Updates `@angular/compiler-cli` from 17.3.2 to 17.3.7 - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/17.3.7/packages/compiler-cli) --- updated-dependencies: - dependency-name: "@angular/cdk" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/common" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/compiler" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/core" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/forms" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/localize" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/platform-browser" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/platform-browser-dynamic" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/router" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular-builders/jest" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular-devkit/build-angular" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/cli" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies - dependency-name: "@angular/compiler-cli" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: frontend-angular-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src-ui/package-lock.json | 252 +++++++++++++++++++-------------------- src-ui/package.json | 24 ++-- 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src-ui/package-lock.json b/src-ui/package-lock.json index 38622c6b5..40f4d863c 100644 --- a/src-ui/package-lock.json +++ b/src-ui/package-lock.json @@ -9,15 +9,15 @@ "version": "0.0.0", "hasInstallScript": true, "dependencies": { - "@angular/cdk": "^17.3.2", - "@angular/common": "~17.3.2", - "@angular/compiler": "~17.3.2", - "@angular/core": "~17.3.2", - "@angular/forms": "~17.3.2", - "@angular/localize": "~17.3.2", - "@angular/platform-browser": "~17.3.2", - "@angular/platform-browser-dynamic": "~17.3.2", - "@angular/router": "~17.3.2", + "@angular/cdk": "^17.3.6", + "@angular/common": "~17.3.7", + "@angular/compiler": "~17.3.7", + "@angular/core": "~17.3.7", + "@angular/forms": "~17.3.7", + "@angular/localize": "~17.3.7", + "@angular/platform-browser": "~17.3.7", + "@angular/platform-browser-dynamic": "~17.3.7", + "@angular/router": "~17.3.7", "@ng-bootstrap/ng-bootstrap": "^16.0.0", "@ng-select/ng-select": "^12.0.7", "@ngneat/dirty-check-forms": "^3.0.3", @@ -38,14 +38,14 @@ "zone.js": "^0.14.4" }, "devDependencies": { - "@angular-builders/jest": "17.0.2", - "@angular-devkit/build-angular": "~17.3.2", + "@angular-builders/jest": "17.0.3", + "@angular-devkit/build-angular": "~17.3.6", "@angular-eslint/builder": "17.3.0", "@angular-eslint/eslint-plugin": "17.3.0", "@angular-eslint/eslint-plugin-template": "17.3.0", "@angular-eslint/schematics": "17.3.0", "@angular-eslint/template-parser": "17.3.0", - "@angular/cli": "~17.3.2", + "@angular/cli": "~17.3.6", "@angular/compiler-cli": "~17.3.2", "@playwright/test": "^1.42.1", "@types/jest": "^29.5.12", @@ -86,9 +86,9 @@ } }, "node_modules/@angular-builders/common": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@angular-builders/common/-/common-1.0.1.tgz", - "integrity": "sha512-qPgTjz3ISdGIY+vOIiUzpZRXwchdL/HEhCRzM2QKdqz/c5AB06X9wKhvXezabtzpYSq4lN9fliPYCntqimefFw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@angular-builders/common/-/common-1.0.2.tgz", + "integrity": "sha512-lUusRq6jN1It5LcUTLS6Q+AYAYGTo/EEN8hV0M6Ek9qXzweAouJaSEnwv7p04/pD7yJTl0YOCbN79u+wGm3x4g==", "dev": true, "dependencies": { "@angular-devkit/core": "^17.1.0", @@ -100,12 +100,12 @@ } }, "node_modules/@angular-builders/jest": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@angular-builders/jest/-/jest-17.0.2.tgz", - "integrity": "sha512-IoEDqudGTpPBhUv0R7TU0eewASVDMIj+pFZTyHCSb2Y17DkE98mo5wp/GXRBl09LO6VK63bHNBB56oXbKG93fA==", + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@angular-builders/jest/-/jest-17.0.3.tgz", + "integrity": "sha512-LW4s8t+NLnWR7Aud+EZup8dOBfQF8rfOIncsarDtP/48rz/Ucnzvum7xEt/NYAlZ6y/Dpk7wO6SlqAsaOPf8mA==", "dev": true, "dependencies": { - "@angular-builders/common": "1.0.1", + "@angular-builders/common": "1.0.2", "@angular-devkit/architect": ">=0.1700.0 < 0.1800.0", "@angular-devkit/core": "^17.0.0", "jest-preset-angular": "14.0.3", @@ -123,12 +123,12 @@ } }, "node_modules/@angular-devkit/architect": { - "version": "0.1703.2", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1703.2.tgz", - "integrity": "sha512-fT5gSzwDHOyGv8zF97t8rjeoYSGSxXjWWstl3rN1nXdO0qgJ5m6Sv0fupON+HltdXDCBLRH+2khNpqx/Fh0Qww==", + "version": "0.1703.6", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1703.6.tgz", + "integrity": "sha512-Ck501FD/QuOjeKVFs7hU92w8+Ffetv0d5Sq09XY2/uygo5c/thMzp9nkevaIWBxUSeU5RqYZizDrhFVgYzbbOw==", "dev": true, "dependencies": { - "@angular-devkit/core": "17.3.2", + "@angular-devkit/core": "17.3.6", "rxjs": "7.8.1" }, "engines": { @@ -138,15 +138,15 @@ } }, "node_modules/@angular-devkit/build-angular": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-17.3.2.tgz", - "integrity": "sha512-muPCUyL0uHvRkLH4NLWiccER6P2vCm/Q5DDvqyN4XOzzY3tAHHLrKrpvY87sgd2oNJ6Ci8x7GPNcfzR5KELCnw==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-17.3.6.tgz", + "integrity": "sha512-K4CEZvhQZUUOpmXPVoI1YBM8BARbIlqE6FZRxakmnr+YOtVTYE5s+Dr1wgja8hZIohNz6L7j167G9Aut7oPU/w==", "dev": true, "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "0.1703.2", - "@angular-devkit/build-webpack": "0.1703.2", - "@angular-devkit/core": "17.3.2", + "@angular-devkit/architect": "0.1703.6", + "@angular-devkit/build-webpack": "0.1703.6", + "@angular-devkit/core": "17.3.6", "@babel/core": "7.24.0", "@babel/generator": "7.23.6", "@babel/helper-annotate-as-pure": "7.22.5", @@ -157,7 +157,7 @@ "@babel/preset-env": "7.24.0", "@babel/runtime": "7.24.0", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "17.3.2", + "@ngtools/webpack": "17.3.6", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.18", @@ -198,8 +198,8 @@ "terser": "5.29.1", "tree-kill": "1.2.2", "tslib": "2.6.2", - "undici": "6.7.1", - "vite": "5.1.5", + "undici": "6.11.1", + "vite": "5.1.7", "watchpack": "2.4.0", "webpack": "5.90.3", "webpack-dev-middleware": "6.1.2", @@ -725,12 +725,12 @@ "dev": true }, "node_modules/@angular-devkit/build-webpack": { - "version": "0.1703.2", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1703.2.tgz", - "integrity": "sha512-w7rVFQcZK4iTCd/MLfQWIkDkwBOfAs++txNQyS9qYID8KvLs1V+oWYd2qDBRelRv1u3YtaCIS1pQx3GFKBC3OA==", + "version": "0.1703.6", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1703.6.tgz", + "integrity": "sha512-pJu0et2SiF0kfXenHSTtAART0omzbWpLgBfeUo4hBh4uwX5IaT+mRpYpr8gCXMq+qsjoQp3HobSU3lPDeBn+bg==", "dev": true, "dependencies": { - "@angular-devkit/architect": "0.1703.2", + "@angular-devkit/architect": "0.1703.6", "rxjs": "7.8.1" }, "engines": { @@ -744,9 +744,9 @@ } }, "node_modules/@angular-devkit/core": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-17.3.2.tgz", - "integrity": "sha512-1vxKo9+pdSwTOwqPDSYQh84gZYmCJo6OgR5+AZoGLGMZSeqvi9RG5RiUcOMLQYOnuYv0arlhlWxz0ZjyR8ApKw==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-17.3.6.tgz", + "integrity": "sha512-FVbkT9dEwHEvjnxr4mvMNSMg2bCFoGoP4X68xXU9dhLEUpC05opLvfbaR3Qh543eCJ5AstosBFVzB/krfIkOvA==", "dev": true, "dependencies": { "ajv": "8.12.0", @@ -777,12 +777,12 @@ "dev": true }, "node_modules/@angular-devkit/schematics": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-17.3.2.tgz", - "integrity": "sha512-AYO6oc6QpFGigc1KiDzEVT1CeLnwvnIedU5Q/U3JDZ/Yqmvgc09D64g9XXER2kg6tV7iEgLxiYnonIAQOHq7eA==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-17.3.6.tgz", + "integrity": "sha512-2G1YuPInd8znG7uUgKOS7z72Aku50lTzB/2csWkWPJLAFkh7vKC8QZ40x8S1nC9npVYPhI5CRLX/HVpBh9CyxA==", "dev": true, "dependencies": { - "@angular-devkit/core": "17.3.2", + "@angular-devkit/core": "17.3.6", "jsonc-parser": "3.2.1", "magic-string": "0.30.8", "ora": "5.4.1", @@ -1287,9 +1287,9 @@ } }, "node_modules/@angular/cdk": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-17.3.2.tgz", - "integrity": "sha512-mC2U7aoIf7RSpGgIwVyfQEbaPDDX59plQt88KeTz15wjF8vosLt2DG0rZEoV8Mq14YS47J+jI76q/LJfd6/GCw==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-17.3.6.tgz", + "integrity": "sha512-7eKrC61/6pmMAxllU/vYKadZRF7x7GxUYpA5G70fNaQsIUUiZvxx/SJN9AuZEoPGAtF6atKlJD8QVmFoDzv/Lw==", "dependencies": { "tslib": "^2.3.0" }, @@ -1303,15 +1303,15 @@ } }, "node_modules/@angular/cli": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-17.3.2.tgz", - "integrity": "sha512-g6r4XZyGnh9P6GmWgaFh8RmR4L6UdQ408e3SpG3rjncuPRD57Ur8806GfCLPt6HIA9TARiKmaJ0EJ3RsIjag0g==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-17.3.6.tgz", + "integrity": "sha512-poKaRPeI+hFqX+AxIaEriaIggFVcC3XqlT9E1/uBC2rfHirE1n5F9Z7xqEDtMHduKwLbNXhQIPoKIKya8+Hnew==", "dev": true, "dependencies": { - "@angular-devkit/architect": "0.1703.2", - "@angular-devkit/core": "17.3.2", - "@angular-devkit/schematics": "17.3.2", - "@schematics/angular": "17.3.2", + "@angular-devkit/architect": "0.1703.6", + "@angular-devkit/core": "17.3.6", + "@angular-devkit/schematics": "17.3.6", + "@schematics/angular": "17.3.6", "@yarnpkg/lockfile": "1.1.0", "ansi-colors": "4.1.3", "ini": "4.1.2", @@ -1343,9 +1343,9 @@ "dev": true }, "node_modules/@angular/common": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-17.3.2.tgz", - "integrity": "sha512-7fo+hrQEzo+VX0fJAKK+P4YNeiEnpdMOAkyIdwweyAeUZYeFIs6TKtax3CiJAubnkIkhQ/52uxiusDhK3Wg/WQ==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-17.3.7.tgz", + "integrity": "sha512-A7LRJu1vVCGGgrfZXjU+njz50SiU4weheKCar5PIUprcdIofS1IrHAJDqYh+kwXxkjXbZMOr/ijQY0+AESLEsw==", "dependencies": { "tslib": "^2.3.0" }, @@ -1353,14 +1353,14 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/core": "17.3.2", + "@angular/core": "17.3.7", "rxjs": "^6.5.3 || ^7.4.0" } }, "node_modules/@angular/compiler": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-17.3.2.tgz", - "integrity": "sha512-+/l/FQpVsOPbxZzSKyqEra+yxoI/r8LlTRqshVACv10+DKMWJMHnDkVUrNxvWHutfn4RszpGMtbtHp3yM9rxcA==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-17.3.7.tgz", + "integrity": "sha512-AlKiqPoxnrpQ0hn13fIaQPSVodaVAIjBW4vpFyuKFqs2LBKg6iolwZ21s8rEI0KR2gXl+8ugj0/UZ6YADiVM5w==", "dependencies": { "tslib": "^2.3.0" }, @@ -1368,7 +1368,7 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/core": "17.3.2" + "@angular/core": "17.3.7" }, "peerDependenciesMeta": { "@angular/core": { @@ -1377,9 +1377,9 @@ } }, "node_modules/@angular/compiler-cli": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-17.3.2.tgz", - "integrity": "sha512-PG81BrJjeF679tkafjt+t9VEBE1rPq39cdLoBTnPY7Q+E/thVoem5JTRG6hmnLmwEc0xxY6sfYpvx2BB5ywUSA==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-17.3.7.tgz", + "integrity": "sha512-vSg5IQZ9jGmvYjpbfH8KbH4Sl1IVeE+Mr1ogcxkGEsURSRvKo7EWc0K7LSEI9+gg0VLamMiP9EyCJdPxiJeLJQ==", "dependencies": { "@babel/core": "7.23.9", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -1399,14 +1399,14 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/compiler": "17.3.2", + "@angular/compiler": "17.3.7", "typescript": ">=5.2 <5.5" } }, "node_modules/@angular/core": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-17.3.2.tgz", - "integrity": "sha512-eylatBGaN8uihKomEcXkaSHmAea5bEqu1OXifEoVOJiJpJA9Dbt/VcLXkIRFnRGH2NWUT5W79vSoU9GRvPMk5w==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-17.3.7.tgz", + "integrity": "sha512-HWcrbxqnvIMSxFuQdN0KPt08bc87hqr0LKm89yuRTUwx/2sNJlNQUobk6aJj4trswGBttcRDT+GOS4DQP2Nr4g==", "dependencies": { "tslib": "^2.3.0" }, @@ -1419,9 +1419,9 @@ } }, "node_modules/@angular/forms": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-17.3.2.tgz", - "integrity": "sha512-sbHYjAEeEWW+02YDEKuuuTEUukm6AayQuHiAu37vACj/2q/2RWQar49IoRcSJfAwP2ckqRSK4mmLoDX4IG/KSg==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-17.3.7.tgz", + "integrity": "sha512-FEhXh/VmT++XCoO8i7bBtzxG7Am/cE1zrr9aF+fWW+4jpWvJvVN1IaSiJxgBB+iPsOJ9lTBRwfRW3onlcDkhrw==", "dependencies": { "tslib": "^2.3.0" }, @@ -1429,16 +1429,16 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/common": "17.3.2", - "@angular/core": "17.3.2", - "@angular/platform-browser": "17.3.2", + "@angular/common": "17.3.7", + "@angular/core": "17.3.7", + "@angular/platform-browser": "17.3.7", "rxjs": "^6.5.3 || ^7.4.0" } }, "node_modules/@angular/localize": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-17.3.2.tgz", - "integrity": "sha512-8DMdpWqBZwj367jdT2fSnD406wyNP6WD9wmZr1gzDyViGsM6xUM4udbIJHQ+EABkriSKj3usHqZw6LAzO9kepw==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-17.3.7.tgz", + "integrity": "sha512-GidwcxquawJBZXNQs6cJ3GvmyowupW9JFkG5sVsS6KG4yu9SIt4FZC+EbrVtYDhXI3U2wxGkm+9vDKvkSGzG0g==", "dependencies": { "@babel/core": "7.23.9", "@types/babel__core": "7.20.5", @@ -1454,14 +1454,14 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/compiler": "17.3.2", - "@angular/compiler-cli": "17.3.2" + "@angular/compiler": "17.3.7", + "@angular/compiler-cli": "17.3.7" } }, "node_modules/@angular/platform-browser": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-17.3.2.tgz", - "integrity": "sha512-rBVmpJ/uh+CTjYef3Nib1K+31GFbM4mZaw2R2PowKZLgWOT3MWXKy41i44NEyM8qY1dxESmzMzy4NuGfZol42Q==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-17.3.7.tgz", + "integrity": "sha512-Nn8ZMaftAvO9dEwribWdNv+QBHhYIBrRkv85G6et80AXfXoYAr/xcfnQECRFtZgPmANqHC5auv/xrmExQG+Yeg==", "dependencies": { "tslib": "^2.3.0" }, @@ -1469,9 +1469,9 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/animations": "17.3.2", - "@angular/common": "17.3.2", - "@angular/core": "17.3.2" + "@angular/animations": "17.3.7", + "@angular/common": "17.3.7", + "@angular/core": "17.3.7" }, "peerDependenciesMeta": { "@angular/animations": { @@ -1480,9 +1480,9 @@ } }, "node_modules/@angular/platform-browser-dynamic": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.3.2.tgz", - "integrity": "sha512-fcGo9yQ+t9VaG9zPgjQW5HIizbYOKj+9kVk9FPru+uJbYyvJUwEDgpD3aI0DUrQy/OvSf4NMzY/Ucgw1AUknQw==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.3.7.tgz", + "integrity": "sha512-9c2I4u0L1p2v1/lW8qy+WaNHisUWbyy6wqsv2v9FfCaSM49Lxymgo9LPFPC4qEG5ei5nE+eIQ2ocRiXXsf5QkQ==", "dependencies": { "tslib": "^2.3.0" }, @@ -1490,16 +1490,16 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/common": "17.3.2", - "@angular/compiler": "17.3.2", - "@angular/core": "17.3.2", - "@angular/platform-browser": "17.3.2" + "@angular/common": "17.3.7", + "@angular/compiler": "17.3.7", + "@angular/core": "17.3.7", + "@angular/platform-browser": "17.3.7" } }, "node_modules/@angular/router": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@angular/router/-/router-17.3.2.tgz", - "integrity": "sha512-BJiaG7zldhe8FPsg3Xv1o2xsmWNMIuntubRiSt2NlSceAr/NEgHoARpZfAGKTaFSngl6jc407wHOmBBPPALECw==", + "version": "17.3.7", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-17.3.7.tgz", + "integrity": "sha512-lMkuRrc1ZjP5JPDxNHqoAhB0uAnfPQ/q6mJrw1s8IZoVV6VyM+FxR5r13ajNcXWC38xy/YhBjpXPF1vBdxuLXg==", "dependencies": { "tslib": "^2.3.0" }, @@ -1507,9 +1507,9 @@ "node": "^18.13.0 || >=20.9.0" }, "peerDependencies": { - "@angular/common": "17.3.2", - "@angular/core": "17.3.2", - "@angular/platform-browser": "17.3.2", + "@angular/common": "17.3.7", + "@angular/core": "17.3.7", + "@angular/platform-browser": "17.3.7", "rxjs": "^6.5.3 || ^7.4.0" } }, @@ -4844,9 +4844,9 @@ } }, "node_modules/@ngtools/webpack": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-17.3.2.tgz", - "integrity": "sha512-E8zejFF4aJ8l2XcF+GgnE/1IqsZepnPT1xzulLB4LXtjVuXLFLoF9xkHQwxs7cJWWZsxd/SlNsCIcn/ezrYBcQ==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-17.3.6.tgz", + "integrity": "sha512-equxbgh2DKzZtiFMoVf1KD4yJcH1q8lpqQ/GSPPQUvONcmHrr+yqdRUdaJ7oZCyCYmXF/nByBxtMKtJr6nKZVg==", "dev": true, "engines": { "node": "^18.13.0 || >=20.9.0", @@ -5604,13 +5604,13 @@ ] }, "node_modules/@schematics/angular": { - "version": "17.3.2", - "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-17.3.2.tgz", - "integrity": "sha512-zPINvow0Qo6ionnDl25ZzSSLDyDxBjqRPEJWGHU70expbjXK4A2caQT9P/8ImhapbJAXJCfxg4GF9z1d/sWe4w==", + "version": "17.3.6", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-17.3.6.tgz", + "integrity": "sha512-jCNZdjHSVrI8TrrCnCoXC8GYvQRj7zh+SDdmm91Ve8dbikYNmBOKYLuPaCTsmojWx7ytv962yLlgKzpaa2bbfw==", "dev": true, "dependencies": { - "@angular-devkit/core": "17.3.2", - "@angular-devkit/schematics": "17.3.2", + "@angular-devkit/core": "17.3.6", + "@angular-devkit/schematics": "17.3.6", "jsonc-parser": "3.2.1" }, "engines": { @@ -5935,9 +5935,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.43", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", - "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.0.tgz", + "integrity": "sha512-bGyep3JqPCRry1wq+O5n7oiBgGWmeIJXPjXXCo8EK0u8duZGSYar7cGqd3ML2JUsLGeB7fmc06KYo9fLGWqPvQ==", "dev": true, "dependencies": { "@types/node": "*", @@ -6046,9 +6046,9 @@ } }, "node_modules/@types/qs": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", - "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "dev": true }, "node_modules/@types/range-parser": { @@ -6089,14 +6089,14 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", - "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", "dev": true, "dependencies": { "@types/http-errors": "*", - "@types/mime": "*", - "@types/node": "*" + "@types/node": "*", + "@types/send": "*" } }, "node_modules/@types/sockjs": { @@ -11056,9 +11056,9 @@ "dev": true }, "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", + "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", "dev": true, "engines": { "node": ">= 10" @@ -18066,9 +18066,9 @@ } }, "node_modules/undici": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.7.1.tgz", - "integrity": "sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.11.1.tgz", + "integrity": "sha512-KyhzaLJnV1qa3BSHdj4AZ2ndqI0QWPxYzaIOio0WzcEJB9gvuysprJSLtpvc2D9mhR9jPDUk7xlJlZbH2KR5iw==", "dev": true, "engines": { "node": ">=18.0" @@ -18295,9 +18295,9 @@ } }, "node_modules/vite": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", - "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.7.tgz", + "integrity": "sha512-sgnEEFTZYMui/sTlH1/XEnVNHMujOahPLGMxn1+5sIT45Xjng1Ec1K78jRP15dSmVgg5WBin9yO81j3o9OxofA==", "dev": true, "dependencies": { "esbuild": "^0.19.3", diff --git a/src-ui/package.json b/src-ui/package.json index b6b0678ee..af8187877 100644 --- a/src-ui/package.json +++ b/src-ui/package.json @@ -11,15 +11,15 @@ }, "private": true, "dependencies": { - "@angular/cdk": "^17.3.2", - "@angular/common": "~17.3.2", - "@angular/compiler": "~17.3.2", - "@angular/core": "~17.3.2", - "@angular/forms": "~17.3.2", - "@angular/localize": "~17.3.2", - "@angular/platform-browser": "~17.3.2", - "@angular/platform-browser-dynamic": "~17.3.2", - "@angular/router": "~17.3.2", + "@angular/cdk": "^17.3.6", + "@angular/common": "~17.3.7", + "@angular/compiler": "~17.3.7", + "@angular/core": "~17.3.7", + "@angular/forms": "~17.3.7", + "@angular/localize": "~17.3.7", + "@angular/platform-browser": "~17.3.7", + "@angular/platform-browser-dynamic": "~17.3.7", + "@angular/router": "~17.3.7", "@ng-bootstrap/ng-bootstrap": "^16.0.0", "@ng-select/ng-select": "^12.0.7", "@ngneat/dirty-check-forms": "^3.0.3", @@ -40,14 +40,14 @@ "zone.js": "^0.14.4" }, "devDependencies": { - "@angular-builders/jest": "17.0.2", - "@angular-devkit/build-angular": "~17.3.2", + "@angular-builders/jest": "17.0.3", + "@angular-devkit/build-angular": "~17.3.6", "@angular-eslint/builder": "17.3.0", "@angular-eslint/eslint-plugin": "17.3.0", "@angular-eslint/eslint-plugin-template": "17.3.0", "@angular-eslint/schematics": "17.3.0", "@angular-eslint/template-parser": "17.3.0", - "@angular/cli": "~17.3.2", + "@angular/cli": "~17.3.6", "@angular/compiler-cli": "~17.3.2", "@playwright/test": "^1.42.1", "@types/jest": "^29.5.12", From 39b57f695aee58ebf0f156e23fb7c4c5bdb2db57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 19:27:19 +0000 Subject: [PATCH 5/6] Chore(deps-dev): Bump ejs from 3.1.9 to 3.1.10 in /src-ui (#6540) Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](https://github.com/mde/ejs/compare/v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src-ui/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-ui/package-lock.json b/src-ui/package-lock.json index 40f4d863c..1f202938c 100644 --- a/src-ui/package-lock.json +++ b/src-ui/package-lock.json @@ -9100,9 +9100,9 @@ "dev": true }, "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "dependencies": { "jake": "^10.8.5" From 2de9d1b7aea3d5285bbe1e69e0dd7838a98179d5 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 1 May 2024 21:57:18 -0700 Subject: [PATCH 6/6] Enhancement: improve layout for custom fields dropdown (#6362) --- src-ui/messages.xlf | 452 +++++++++++------- .../custom-fields-dropdown.component.html | 42 +- .../custom-fields-dropdown.component.scss | 12 +- .../custom-fields-dropdown.component.spec.ts | 156 +++++- .../custom-fields-dropdown.component.ts | 135 +++++- .../document-detail.component.spec.ts | 6 +- 6 files changed, 544 insertions(+), 259 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 3478d4d40..bdc803132 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -993,11 +993,11 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 82 + 96 src/app/components/document-list/filter-editor/filter-editor.component.html - 90 + 96 src/app/components/manage/mail/mail.component.html @@ -1287,7 +1287,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 88 + 102 src/app/components/manage/custom-fields/custom-fields.component.html @@ -1362,7 +1362,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 142 + 156 src/app/components/manage/custom-fields/custom-fields.component.html @@ -1798,12 +1798,12 @@ 37 - src/app/components/document-list/document-list.component.html - 236 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 11 - src/app/components/document-list/filter-editor/filter-editor.component.html - 76 + src/app/components/document-list/document-list.component.html + 236 src/app/data/document.ts @@ -2161,15 +2161,15 @@ src/app/components/document-detail/document-detail.component.ts - 769 + 773 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 591 + 711 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 630 + 750 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2204,27 +2204,27 @@ src/app/components/document-detail/document-detail.component.ts - 771 + 775 src/app/components/document-detail/document-detail.component.ts - 1064 + 1068 src/app/components/document-detail/document-detail.component.ts - 1102 + 1106 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 632 + 752 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 665 + 785 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 684 + 804 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2637,12 +2637,20 @@ 2 - src/app/components/common/date-dropdown/date-dropdown.component.html - 34 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 38 - src/app/components/common/date-dropdown/date-dropdown.component.html - 55 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 59 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 104 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 125 @@ -2671,19 +2679,23 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 367 + 398 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 407 + 438 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 445 + 476 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 483 + 514 + + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 576 @@ -2773,39 +2785,25 @@ 62 - - Create New Field + + Search fields src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html - 22 + 10 - - Add to document + + Create new field src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html - 25 - - - - Choose field - - src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts - 52 - - - - No unused fields found - - src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts - 56 + 21 Saved field "". src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts - 120 + 124 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2816,7 +2814,7 @@ Error saving field. src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts - 128 + 133 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2826,50 +2824,81 @@ now - src/app/components/common/date-dropdown/date-dropdown.component.html - 21 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 25 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 91 After - src/app/components/common/date-dropdown/date-dropdown.component.html - 30 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 34 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 100 Before - src/app/components/common/date-dropdown/date-dropdown.component.html - 51 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 55 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 121 + + + + Added + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 76 + + + src/app/components/document-list/document-list.component.html + 245 + + + src/app/data/document.ts + 42 + + + src/app/data/document.ts + 93 Last 7 days - src/app/components/common/date-dropdown/date-dropdown.component.ts - 42 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 45 Last month - src/app/components/common/date-dropdown/date-dropdown.component.ts - 47 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 50 Last 3 months - src/app/components/common/date-dropdown/date-dropdown.component.ts - 52 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 55 Last year - src/app/components/common/date-dropdown/date-dropdown.component.ts - 57 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 60 @@ -4905,7 +4934,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 114 + 128 src/app/components/document-list/document-card-large/document-card-large.component.html @@ -5038,7 +5067,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 312 + 343 this string is used to separate processing, failed and added on the file upload widget @@ -5113,7 +5142,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 92 + 106 @@ -5142,7 +5171,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 95 + 109 @@ -5153,7 +5182,7 @@ src/app/components/document-detail/document-detail.component.ts - 1120 + 1124 src/app/guards/dirty-saved-view.guard.ts @@ -5186,7 +5215,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 115 + 121 src/app/data/document.ts @@ -5478,29 +5507,29 @@ Document saved successfully. src/app/components/document-detail/document-detail.component.ts - 641 + 642 src/app/components/document-detail/document-detail.component.ts - 652 + 656 Error saving document src/app/components/document-detail/document-detail.component.ts - 656 + 660 src/app/components/document-detail/document-detail.component.ts - 697 + 701 Confirm delete src/app/components/document-detail/document-detail.component.ts - 724 + 728 src/app/components/manage/management-list/management-list.component.ts @@ -5515,138 +5544,138 @@ Do you really want to delete document ""? src/app/components/document-detail/document-detail.component.ts - 725 + 729 The files for this document will be deleted permanently. This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 726 + 730 Delete document src/app/components/document-detail/document-detail.component.ts - 728 + 732 Error deleting document src/app/components/document-detail/document-detail.component.ts - 747 + 751 Redo OCR confirm src/app/components/document-detail/document-detail.component.ts - 767 + 771 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 628 + 748 This operation will permanently redo OCR for this document. src/app/components/document-detail/document-detail.component.ts - 768 + 772 Redo OCR operation will begin in the background. Close and re-open or reload this document after the operation has completed to see new content. src/app/components/document-detail/document-detail.component.ts - 779 + 783 Error executing operation src/app/components/document-detail/document-detail.component.ts - 790 + 794 Page Fit src/app/components/document-detail/document-detail.component.ts - 859 + 863 Split confirm src/app/components/document-detail/document-detail.component.ts - 1062 + 1066 This operation will split the selected document(s) into new documents. src/app/components/document-detail/document-detail.component.ts - 1063 + 1067 Split operation will begin in the background. src/app/components/document-detail/document-detail.component.ts - 1078 + 1082 Error executing split operation src/app/components/document-detail/document-detail.component.ts - 1087 + 1091 Rotate confirm src/app/components/document-detail/document-detail.component.ts - 1099 + 1103 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 661 + 781 This operation will permanently rotate the original version of the current document. src/app/components/document-detail/document-detail.component.ts - 1100 + 1104 This will alter the original copy. src/app/components/document-detail/document-detail.component.ts - 1101 + 1105 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 663 + 783 Rotation will begin in the background. Close and re-open the document after the operation has completed to see the changes. src/app/components/document-detail/document-detail.component.ts - 1117 + 1121 Error executing rotate operation src/app/components/document-detail/document-detail.component.ts - 1129 + 1133 @@ -5714,64 +5743,90 @@ 65 + + Custom fields + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 78 + + + src/app/components/document-list/filter-editor/filter-editor.component.html + 75 + + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 129 + + + + Filter custom fields + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 79 + + + src/app/components/document-list/filter-editor/filter-editor.component.html + 76 + + Merge src/app/components/document-list/bulk-editor/bulk-editor.component.html - 98 + 112 Include: src/app/components/document-list/bulk-editor/bulk-editor.component.html - 120 + 134 Archived files src/app/components/document-list/bulk-editor/bulk-editor.component.html - 124 + 138 Original files src/app/components/document-list/bulk-editor/bulk-editor.component.html - 128 + 142 Use formatted filename src/app/components/document-list/bulk-editor/bulk-editor.component.html - 133 + 147 Error executing bulk operation src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 229 + 247 "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 304 + 335 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 310 + 341 "" and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 306 + 337 This is for messages like 'modify "tag1" and "tag2"' @@ -5779,7 +5834,7 @@ and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 314,316 + 345,347 this is for messages like 'modify "tag1", "tag2" and "tag3"' @@ -5787,14 +5842,14 @@ Confirm tags assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 331 + 362 This operation will add the tag "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 337 + 368 @@ -5803,14 +5858,14 @@ )"/> to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 342,344 + 373,375 This operation will remove the tag "" from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 350 + 381 @@ -5819,7 +5874,7 @@ )"/> from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 355,357 + 386,388 @@ -5830,126 +5885,176 @@ )"/> on selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 359,363 + 390,394 Confirm correspondent assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 400 + 431 This operation will assign the correspondent "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 402 + 433 This operation will remove the correspondent from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 404 + 435 Confirm document type assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 438 + 469 This operation will assign the document type "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 440 + 471 This operation will remove the document type from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 442 + 473 Confirm storage path assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 476 + 507 This operation will assign the storage path "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 478 + 509 This operation will remove the storage path from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 480 + 511 + + + + Confirm custom field assignment + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 540 + + + + This operation will assign the custom field "" to selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 546 + + + + This operation will assign the custom fields to selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 551,553 + + + + This operation will remove the custom field "" from selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 559 + + + + This operation will remove the custom fields from selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 564,566 + + + + This operation will assign the custom fields and remove the custom fields on selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 568,572 Delete confirm src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 589 + 709 This operation will permanently delete selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 590 + 710 Delete document(s) src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 593 + 713 This operation will permanently redo OCR for selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 629 + 749 This operation will permanently rotate the original version of document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 662 + 782 Merge confirm src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 682 + 802 This operation will merge selected documents into a new document. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 683 + 803 Merged document will be queued for consumption. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 696 + 816 @@ -6180,7 +6285,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.html - 96 + 102 @@ -6205,7 +6310,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 120 + 126 src/app/data/document.ts @@ -6287,25 +6392,6 @@ 241 - - Added - - src/app/components/document-list/document-list.component.html - 245 - - - src/app/components/document-list/filter-editor/filter-editor.component.html - 82 - - - src/app/data/document.ts - 42 - - - src/app/data/document.ts - 93 - - Shared @@ -6356,67 +6442,67 @@ 285 + + Dates + + src/app/components/document-list/filter-editor/filter-editor.component.html + 86 + + Title & content src/app/components/document-list/filter-editor/filter-editor.component.ts - 118 - - - - Custom fields - - src/app/components/document-list/filter-editor/filter-editor.component.ts - 123 + 124 Advanced search src/app/components/document-list/filter-editor/filter-editor.component.ts - 127 + 133 More like src/app/components/document-list/filter-editor/filter-editor.component.ts - 133 + 139 equals src/app/components/document-list/filter-editor/filter-editor.component.ts - 139 + 145 is empty src/app/components/document-list/filter-editor/filter-editor.component.ts - 143 + 149 is not empty src/app/components/document-list/filter-editor/filter-editor.component.ts - 147 + 153 greater than src/app/components/document-list/filter-editor/filter-editor.component.ts - 151 + 157 less than src/app/components/document-list/filter-editor/filter-editor.component.ts - 155 + 161 @@ -6425,14 +6511,14 @@ )?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 175,177 + 181,183 Without correspondent src/app/components/document-list/filter-editor/filter-editor.component.ts - 179 + 185 @@ -6441,14 +6527,14 @@ )?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 185,187 + 191,193 Without document type src/app/components/document-list/filter-editor/filter-editor.component.ts - 189 + 195 @@ -6457,14 +6543,14 @@ )?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 195,197 + 201,203 Without storage path src/app/components/document-list/filter-editor/filter-editor.component.ts - 199 + 205 @@ -6472,49 +6558,65 @@ ?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 203,204 + 209,210 Without any tag src/app/components/document-list/filter-editor/filter-editor.component.ts - 208 + 214 + + + + Custom fields: + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 218,220 + + + + Without any custom field + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 224 Title: src/app/components/document-list/filter-editor/filter-editor.component.ts - 212 + 228 ASN: src/app/components/document-list/filter-editor/filter-editor.component.ts - 215 + 231 Owner: src/app/components/document-list/filter-editor/filter-editor.component.ts - 218 + 234 Owner not in: src/app/components/document-list/filter-editor/filter-editor.component.ts - 221 + 237 Without an owner src/app/components/document-list/filter-editor/filter-editor.component.ts - 224 + 240 diff --git a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html index 2489c995a..9111a4b29 100644 --- a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html +++ b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html @@ -1,31 +1,27 @@ -
+
-
    -
  • - - -
  • -
+
+ @for (field of filteredFields; track field.id) { + + } + @if (!filterText?.length || filteredFields.length === 0) { + + } +
diff --git a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.scss b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.scss index 3240063aa..302dbfe77 100644 --- a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.scss +++ b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.scss @@ -1,5 +1,5 @@ .custom-fields-dropdown { - min-width: 380px; + min-width: 300px; // correct position on mobile @media (max-width: 575.98px) { @@ -8,13 +8,3 @@ } } } - -::ng-deep .custom-fields-dropdown .ng-select .ng-select-container .ng-value-container .ng-placeholder, -::ng-deep .custom-fields-dropdown .ng-select .ng-option, -::ng-deep .custom-fields-dropdown .ng-select .ng-select-container .ng-value-container .ng-value { - font-size: 0.875rem; -} - -::ng-deep .custom-fields-dropdown .paperless-input-select .ng-select .ng-select-container .ng-value-container .ng-input { - top: 4px; -} diff --git a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.spec.ts b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.spec.ts index 7c24578e6..121591ef1 100644 --- a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.spec.ts +++ b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.spec.ts @@ -1,5 +1,9 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - +import { + ComponentFixture, + TestBed, + fakeAsync, + tick, +} from '@angular/core/testing' import { CustomFieldsDropdownComponent } from './custom-fields-dropdown.component' import { HttpClientTestingModule } from '@angular/common/http/testing' import { ToastService } from 'src/app/services/toast.service' @@ -71,28 +75,33 @@ describe('CustomFieldsDropdownComponent', () => { let addedField component.added.subscribe((f) => (addedField = f)) component.documentId = 11 - component.field = fields[0].id - component.addField() + component.addField({ field: fields[0].id } as any) expect(addedField).not.toBeUndefined() }) - it('should clear field on open / close, updated unused fields', () => { - component.field = fields[1].id - component.onOpenClose() - expect(component.field).toBeUndefined() - - expect(component.unusedFields).toEqual(fields) - const updateSpy = jest.spyOn( - CustomFieldsDropdownComponent.prototype as any, - 'updateUnusedFields' - ) - component.existingFields = [{ field: fields[1].id } as any] - component.onOpenClose() - expect(updateSpy).toHaveBeenCalled() - expect(component.unusedFields).toEqual([fields[0]]) + it('should support filtering fields', () => { + const input = fixture.debugElement.query(By.css('input')) + input.nativeElement.value = 'Field 1' + input.triggerEventHandler('input', { target: input.nativeElement }) + fixture.detectChanges() + expect(component.filteredFields.length).toEqual(1) + expect(component.filteredFields[0].name).toEqual('Field 1') }) - it('should support creating field, show error if necessary', () => { + it('should support update unused fields', () => { + component.existingFields = [{ field: fields[0].id } as any] + component['updateUnusedFields']() + expect(component['unusedFields'].length).toEqual(1) + expect(component['unusedFields'][0].name).toEqual('Field 2') + }) + + it('should support getting data type label', () => { + expect(component.getDataTypeLabel(CustomFieldDataType.Integer)).toEqual( + 'Integer' + ) + }) + + it('should support creating field, show error if necessary, then add', fakeAsync(() => { let modal: NgbModalRef modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1])) const toastErrorSpy = jest.spyOn(toastService, 'showError') @@ -101,8 +110,9 @@ describe('CustomFieldsDropdownComponent', () => { CustomFieldsDropdownComponent.prototype as any, 'getFields' ) + const addFieldSpy = jest.spyOn(component, 'addField') - const createButton = fixture.debugElement.queryAll(By.css('button'))[1] + const createButton = fixture.debugElement.queryAll(By.css('button'))[3] createButton.triggerEventHandler('click') expect(modal).not.toBeUndefined() @@ -115,9 +125,11 @@ describe('CustomFieldsDropdownComponent', () => { // succeed editDialog.succeeded.emit(fields[0]) + tick(100) expect(toastInfoSpy).toHaveBeenCalled() expect(getFieldsSpy).toHaveBeenCalled() - }) + expect(addFieldSpy).toHaveBeenCalled() + })) it('should support creating field with name', () => { let modal: NgbModalRef @@ -128,4 +140,106 @@ describe('CustomFieldsDropdownComponent', () => { const editDialog = modal.componentInstance as CustomFieldEditDialogComponent expect(editDialog.object.name).toEqual('Foo bar') }) + + it('should support arrow keyboard navigation', fakeAsync(() => { + fixture.nativeElement + .querySelector('button') + .dispatchEvent(new MouseEvent('click')) // open + fixture.detectChanges() + tick(100) + const filterInputEl: HTMLInputElement = + component.listFilterTextInput.nativeElement + expect(document.activeElement).toEqual(filterInputEl) + const itemButtons = Array.from( + (fixture.nativeElement as HTMLDivElement).querySelectorAll( + '.custom-fields-dropdown button' + ) + ).filter((b) => b.textContent.includes('Field')) + filterInputEl.dispatchEvent( + new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }) + ) + expect(document.activeElement).toEqual(itemButtons[0]) + itemButtons[0].dispatchEvent( + new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }) + ) + expect(document.activeElement).toEqual(itemButtons[1]) + itemButtons[1].dispatchEvent( + new KeyboardEvent('keydown', { key: 'ArrowUp', bubbles: true }) + ) + expect(document.activeElement).toEqual(itemButtons[0]) + itemButtons[0].dispatchEvent( + new KeyboardEvent('keydown', { key: 'ArrowUp', bubbles: true }) + ) + expect(document.activeElement).toEqual(filterInputEl) + filterInputEl.value = 'foo' + component.filterText = 'foo' + + // dont move focus if we're traversing the field + filterInputEl.selectionStart = 1 + expect(document.activeElement).toEqual(filterInputEl) + + // now we're at end, so move focus + filterInputEl.selectionStart = 3 + filterInputEl.dispatchEvent( + new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }) + ) + expect(document.activeElement).toEqual(itemButtons[0]) + })) + + it('should support arrow keyboard navigation after tab keyboard navigation', fakeAsync(() => { + fixture.nativeElement + .querySelector('button') + .dispatchEvent(new MouseEvent('click')) // open + fixture.detectChanges() + tick(100) + const filterInputEl: HTMLInputElement = + component.listFilterTextInput.nativeElement + expect(document.activeElement).toEqual(filterInputEl) + const itemButtons = Array.from( + (fixture.nativeElement as HTMLDivElement).querySelectorAll( + '.custom-fields-dropdown button' + ) + ).filter((b) => b.textContent.includes('Field')) + filterInputEl.dispatchEvent( + new KeyboardEvent('keydown', { key: 'Tab', bubbles: true }) + ) + itemButtons[0]['focus']() // normally handled by browser + itemButtons[0].dispatchEvent( + new KeyboardEvent('keydown', { key: 'Tab', bubbles: true }) + ) + itemButtons[1]['focus']() // normally handled by browser + itemButtons[1].dispatchEvent( + new KeyboardEvent('keydown', { + key: 'Tab', + shiftKey: true, + bubbles: true, + }) + ) + itemButtons[0]['focus']() // normally handled by browser + itemButtons[0].dispatchEvent( + new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }) + ) + expect(document.activeElement).toEqual(itemButtons[1]) + })) + + it('should support enter keyboard navigation', fakeAsync(() => { + jest.spyOn(component, 'canCreateFields', 'get').mockReturnValue(true) + const addFieldSpy = jest.spyOn(component, 'addField') + const createFieldSpy = jest.spyOn(component, 'createField') + component.filterText = 'Field 1' + component.listFilterEnter() + expect(addFieldSpy).toHaveBeenCalled() + + component.filterText = 'Field 3' + component.listFilterEnter() + expect(createFieldSpy).toHaveBeenCalledWith('Field 3') + + addFieldSpy.mockClear() + createFieldSpy.mockClear() + + component.filterText = undefined + component.listFilterEnter() + expect(createFieldSpy).not.toHaveBeenCalled() + expect(addFieldSpy).not.toHaveBeenCalled() + })) }) diff --git a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts index 79c0d1b58..652d7f3d8 100644 --- a/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts +++ b/src-ui/src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.ts @@ -1,13 +1,17 @@ import { Component, + ElementRef, EventEmitter, Input, OnDestroy, Output, + QueryList, + ViewChild, + ViewChildren, } from '@angular/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { Subject, first, takeUntil } from 'rxjs' -import { CustomField } from 'src/app/data/custom-field' +import { CustomField, DATA_TYPE_LABELS } from 'src/app/data/custom-field' import { CustomFieldInstance } from 'src/app/data/custom-field-instance' import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' import { ToastService } from 'src/app/services/toast.service' @@ -39,23 +43,25 @@ export class CustomFieldsDropdownComponent implements OnDestroy { @Output() created: EventEmitter = new EventEmitter() + @ViewChild('listFilterTextInput') listFilterTextInput: ElementRef + @ViewChildren('button') buttons: QueryList + private customFields: CustomField[] = [] - public unusedFields: CustomField[] + private unusedFields: CustomField[] = [] + private keyboardIndex: number - public name: string + public get filteredFields(): CustomField[] { + return this.unusedFields.filter( + (f) => + !this.filterText || + f.name.toLowerCase().includes(this.filterText.toLowerCase()) + ) + } - public field: number + public filterText: string private unsubscribeNotifier: Subject = new Subject() - get placeholderText(): string { - return $localize`Choose field` - } - - get notFoundText(): string { - return $localize`No unused fields found` - } - get canCreateFields(): boolean { return this.permissionsService.currentUserCan( PermissionAction.Add, @@ -87,28 +93,26 @@ export class CustomFieldsDropdownComponent implements OnDestroy { }) } - public getCustomFieldFromInstance( - instance: CustomFieldInstance - ): CustomField { - return this.customFields.find((f) => f.id === instance.field) - } - private updateUnusedFields() { this.unusedFields = this.customFields.filter( - (f) => - !this.existingFields?.find( - (e) => this.getCustomFieldFromInstance(e)?.id === f.id - ) + (f) => !this.existingFields?.find((e) => e.field === f.id) ) } - onOpenClose() { - this.field = undefined + onOpenClose(open: boolean) { + if (open) { + setTimeout(() => { + this.listFilterTextInput.nativeElement.focus() + }, 100) + } else { + this.filterText = undefined + } this.updateUnusedFields() } - addField() { - this.added.emit(this.customFields.find((f) => f.id === this.field)) + addField(field: CustomField) { + this.added.emit(field) + this.updateUnusedFields() } createField(newName: string = null) { @@ -121,6 +125,7 @@ export class CustomFieldsDropdownComponent implements OnDestroy { this.customFieldsService.clearCache() this.getFields() this.created.emit(newField) + setTimeout(() => this.addField(newField), 100) }) modal.componentInstance.failed .pipe(takeUntil(this.unsubscribeNotifier)) @@ -128,4 +133,82 @@ export class CustomFieldsDropdownComponent implements OnDestroy { this.toastService.showError($localize`Error saving field.`, e) }) } + + getDataTypeLabel(dataType: string) { + return DATA_TYPE_LABELS.find((l) => l.id === dataType)?.name + } + + public listFilterEnter() { + if (this.filteredFields.length === 1) { + this.addField(this.filteredFields[0]) + } else if ( + this.filterText && + this.filteredFields.length === 0 && + this.canCreateFields + ) { + this.createField(this.filterText) + } + } + + private focusNextButtonItem(setFocus: boolean = true) { + this.keyboardIndex = Math.min( + this.buttons.length - 1, + this.keyboardIndex + 1 + ) + if (setFocus) this.setButtonItemFocus() + } + + focusPreviousButtonItem(setFocus: boolean = true) { + this.keyboardIndex = Math.max(0, this.keyboardIndex - 1) + if (setFocus) this.setButtonItemFocus() + } + + setButtonItemFocus() { + this.buttons.get(this.keyboardIndex)?.nativeElement.focus() + } + + public listKeyDown(event: KeyboardEvent) { + switch (event.key) { + case 'ArrowDown': + if (event.target instanceof HTMLInputElement) { + if ( + !this.filterText || + event.target.selectionStart === this.filterText.length + ) { + this.keyboardIndex = -1 + this.focusNextButtonItem() + event.preventDefault() + } + } else if (event.target instanceof HTMLButtonElement) { + this.focusNextButtonItem() + event.preventDefault() + } + break + case 'ArrowUp': + if (event.target instanceof HTMLButtonElement) { + if (this.keyboardIndex === 0) { + this.listFilterTextInput.nativeElement.focus() + } else { + this.focusPreviousButtonItem() + } + event.preventDefault() + } + break + case 'Tab': + // just track the index in case user uses arrows + if (event.target instanceof HTMLInputElement) { + this.keyboardIndex = 0 + } else if (event.target instanceof HTMLButtonElement) { + if (event.shiftKey) { + if (this.keyboardIndex > 0) { + this.focusPreviousButtonItem(false) + } + } else { + this.focusNextButtonItem(false) + } + } + default: + break + } + } } diff --git a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts index b26ad9024..b439c770f 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts @@ -945,9 +945,9 @@ describe('DocumentDetailComponent', () => { fixture.detectChanges() expect(component.document.custom_fields).toHaveLength(initialLength - 1) expect(component.customFieldFormFields).toHaveLength(initialLength - 1) - expect(fixture.debugElement.nativeElement.textContent).not.toContain( - 'Field 1' - ) + expect( + fixture.debugElement.query(By.css('form')).nativeElement.textContent + ).not.toContain('Field 1') const updateSpy = jest.spyOn(documentService, 'update') component.save(true) expect(updateSpy.mock.lastCall[0].custom_fields).toHaveLength(