mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	fix code style issues
solve merge conflicts format code format code format code
This commit is contained in:
		
							
								
								
									
										3
									
								
								.github/workflows/project-actions.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/project-actions.yml
									
									
									
									
										vendored
									
									
								
							| @@ -8,9 +8,6 @@ on: | ||||
|     types: | ||||
|       - opened | ||||
|       - reopened | ||||
|     branches: | ||||
|       - main | ||||
|       - dev | ||||
|  | ||||
| # map fields with customized labels | ||||
| env: | ||||
|   | ||||
| @@ -51,8 +51,7 @@ | ||||
| 							"src/favicon.ico", | ||||
| 							"src/apple-touch-icon.png", | ||||
| 							"src/assets", | ||||
|               "src/manifest.webmanifest", | ||||
|               { | ||||
| 							"src/manifest.webmanifest", { | ||||
| 								"glob": "pdf.worker.min.js", | ||||
| 								"input": "node_modules/pdfjs-dist/build/", | ||||
| 								"output": "/assets/js/" | ||||
| @@ -102,9 +101,7 @@ | ||||
| 							] | ||||
| 						}, | ||||
| 						"en-US": { | ||||
|               "localize": [ | ||||
|                 "en-US" | ||||
|               ] | ||||
| 							"localize": ["en-US"] | ||||
| 						} | ||||
| 					}, | ||||
| 					"defaultConfiguration": "" | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| module.exports = { | ||||
|   moduleNameMapper: { | ||||
|     "@core/(.*)": "<rootDir>/src/app/core/$1", | ||||
|     '@core/(.*)': '<rootDir>/src/app/core/$1', | ||||
|   }, | ||||
|   preset: "jest-preset-angular", | ||||
|   setupFilesAfterEnv: ["<rootDir>/setup-jest.ts"], | ||||
|   testPathIgnorePatterns: ["/node_modules/", "/cypress/"], | ||||
| }; | ||||
|   preset: 'jest-preset-angular', | ||||
|   setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'], | ||||
|   testPathIgnorePatterns: ['/node_modules/', '/cypress/'], | ||||
| } | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|     "lint": "ng lint", | ||||
|     "e2e": "ng e2e", | ||||
|     "cy:run": "cypress run", | ||||
|     "e2e:ci": "concurrently \"npm run start\" \"wait-on http-get://localhost:4200 && npm run cy:run\" --kill-others --success first" | ||||
|     "e2e:ci": "concurrently 'npm run start' 'wait-on http-get://localhost:4200 && npm run cy:run' --kill-others --success first" | ||||
|   }, | ||||
|   "private": true, | ||||
|   "dependencies": { | ||||
|   | ||||
| @@ -1,30 +1,30 @@ | ||||
| import 'jest-preset-angular/setup-jest'; | ||||
| import 'jest-preset-angular/setup-jest' | ||||
|  | ||||
| /* global mocks for jsdom */ | ||||
| const mock = () => { | ||||
|   let storage: { [key: string]: string } = {}; | ||||
|   let storage: { [key: string]: string } = {} | ||||
|   return { | ||||
|     getItem: (key: string) => (key in storage ? storage[key] : null), | ||||
|     setItem: (key: string, value: string) => (storage[key] = value || ''), | ||||
|     removeItem: (key: string) => delete storage[key], | ||||
|     clear: () => (storage = {}), | ||||
|   }; | ||||
| }; | ||||
|   } | ||||
| } | ||||
|  | ||||
| Object.defineProperty(window, 'localStorage', { value: mock() }); | ||||
| Object.defineProperty(window, 'sessionStorage', { value: mock() }); | ||||
| Object.defineProperty(window, 'localStorage', { value: mock() }) | ||||
| Object.defineProperty(window, 'sessionStorage', { value: mock() }) | ||||
| Object.defineProperty(window, 'getComputedStyle', { | ||||
|   value: () => ['-webkit-appearance'], | ||||
| }); | ||||
| }) | ||||
|  | ||||
| Object.defineProperty(document.body.style, 'transform', { | ||||
|   value: () => { | ||||
|     return { | ||||
|       enumerable: true, | ||||
|       configurable: true, | ||||
|     }; | ||||
|     } | ||||
|   }, | ||||
| }); | ||||
| }) | ||||
|  | ||||
| /* output shorter and more meaningful Zone error stack traces */ | ||||
| // Error.stackTraceLimit = 2; | ||||
| // Error.stackTraceLimit = 2 | ||||
|   | ||||
| @@ -19,27 +19,27 @@ export abstract class EditDialogComponent<T extends ObjectWithId> | ||||
|   ) {} | ||||
|  | ||||
|   @Input() | ||||
|   dialogMode: string = 'create'; | ||||
|   dialogMode: string = 'create' | ||||
|  | ||||
|   @Input() | ||||
|   object: T; | ||||
|   object: T | ||||
|  | ||||
|   @Output() | ||||
|   success = new EventEmitter(); | ||||
|   success = new EventEmitter() | ||||
|  | ||||
|   networkActive = false; | ||||
|   networkActive = false | ||||
|  | ||||
|   closeEnabled = false; | ||||
|   closeEnabled = false | ||||
|  | ||||
|   error = null; | ||||
|   error = null | ||||
|  | ||||
|   abstract getForm(): FormGroup; | ||||
|   abstract getForm(): FormGroup | ||||
|  | ||||
|   objectForm: FormGroup = this.getForm(); | ||||
|   objectForm: FormGroup = this.getForm() | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     if (this.object != null) { | ||||
|       this.objectForm.patchValue(this.object); | ||||
|       this.objectForm.patchValue(this.object) | ||||
|     } | ||||
|  | ||||
|     // wait to enable close button so it doesnt steal focus from input since its the first clickable element in the DOM | ||||
| @@ -49,34 +49,34 @@ export abstract class EditDialogComponent<T extends ObjectWithId> | ||||
|   } | ||||
|  | ||||
|   getCreateTitle() { | ||||
|     return $localize`Create new item`; | ||||
|     return $localize`Create new item` | ||||
|   } | ||||
|  | ||||
|   getEditTitle() { | ||||
|     return $localize`Edit item`; | ||||
|     return $localize`Edit item` | ||||
|   } | ||||
|  | ||||
|   getSaveErrorMessage(error: string) { | ||||
|     return $localize`Could not save element: ${error}`; | ||||
|     return $localize`Could not save element: ${error}` | ||||
|   } | ||||
|  | ||||
|   getTitle() { | ||||
|     switch (this.dialogMode) { | ||||
|       case 'create': | ||||
|         return this.getCreateTitle(); | ||||
|         return this.getCreateTitle() | ||||
|       case 'edit': | ||||
|         return this.getEditTitle(); | ||||
|         return this.getEditTitle() | ||||
|       default: | ||||
|         break | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   getMatchingAlgorithms() { | ||||
|     return MATCHING_ALGORITHMS; | ||||
|     return MATCHING_ALGORITHMS | ||||
|   } | ||||
|  | ||||
|   get patternRequired(): boolean { | ||||
|     return this.objectForm?.value.matching_algorithm !== MATCH_AUTO; | ||||
|     return this.objectForm?.value.matching_algorithm !== MATCH_AUTO | ||||
|   } | ||||
|  | ||||
|   save() { | ||||
| @@ -90,7 +90,7 @@ export abstract class EditDialogComponent<T extends ObjectWithId> | ||||
|         serverResponse = this.service.create(newObject) | ||||
|         break | ||||
|       case 'edit': | ||||
|         serverResponse = this.service.update(newObject); | ||||
|         serverResponse = this.service.update(newObject) | ||||
|       default: | ||||
|         break | ||||
|     } | ||||
| @@ -108,6 +108,6 @@ export abstract class EditDialogComponent<T extends ObjectWithId> | ||||
|   } | ||||
|  | ||||
|   cancel() { | ||||
|     this.activeModal.close(); | ||||
|     this.activeModal.close() | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -17,6 +17,6 @@ import { AbstractInputComponent } from '../abstract-input' | ||||
| }) | ||||
| export class CheckComponent extends AbstractInputComponent<boolean> { | ||||
|   constructor() { | ||||
|     super(); | ||||
|     super() | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,21 +1,24 @@ | ||||
| import { TestBed } from '@angular/core/testing'; | ||||
| import { TestBed } from '@angular/core/testing' | ||||
|  | ||||
| type CompilerOptions = Partial<{ | ||||
|   providers: any[]; | ||||
|   useJit: boolean; | ||||
|   preserveWhitespaces: boolean; | ||||
| }>; | ||||
| export type ConfigureFn = (testBed: typeof TestBed) => void; | ||||
|   providers: any[] | ||||
|   useJit: boolean | ||||
|   preserveWhitespaces: boolean | ||||
| }> | ||||
| export type ConfigureFn = (testBed: typeof TestBed) => void | ||||
|  | ||||
| export const configureTests = (configure: ConfigureFn, compilerOptions: CompilerOptions = {}) => { | ||||
| export const configureTests = ( | ||||
|   configure: ConfigureFn, | ||||
|   compilerOptions: CompilerOptions = {} | ||||
| ) => { | ||||
|   const compilerConfig: CompilerOptions = { | ||||
|     preserveWhitespaces: false, | ||||
|     ...compilerOptions, | ||||
|   }; | ||||
|   } | ||||
|  | ||||
|   const configuredTestBed = TestBed.configureCompiler(compilerConfig); | ||||
|   const configuredTestBed = TestBed.configureCompiler(compilerConfig) | ||||
|  | ||||
|   configure(configuredTestBed); | ||||
|   configure(configuredTestBed) | ||||
|  | ||||
|   return configuredTestBed.compileComponents().then(() => configuredTestBed); | ||||
| }; | ||||
|   return configuredTestBed.compileComponents().then(() => configuredTestBed) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Frank Strieter
					Frank Strieter