Skip to content

Commit

Permalink
feat: allow upload of images up to 200kb (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG authored Nov 6, 2024
1 parent 2d6ffc3 commit 26b592e
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 82 deletions.
143 changes: 77 additions & 66 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@
"@ngrx/router-store": "^18.0.1",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@onecx/accelerator": "^5.22.0",
"@onecx/angular-accelerator": "^5.22.0",
"@onecx/angular-auth": "^5.22.0",
"@onecx/angular-integration-interface": "^5.22.0",
"@onecx/angular-remote-components": "^5.22.0",
"@onecx/angular-testing": "^5.22.0",
"@onecx/angular-webcomponents": "^5.22.0",
"@onecx/integration-interface": "^5.22.0",
"@onecx/keycloak-auth": "^5.22.0",
"@onecx/portal-integration-angular": "^5.22.0",
"@onecx/portal-layout-styles": "^5.22.0",
"@onecx/accelerator": "^5.22.2",
"@onecx/angular-accelerator": "^5.22.2",
"@onecx/angular-auth": "^5.22.2",
"@onecx/angular-integration-interface": "^5.22.2",
"@onecx/angular-remote-components": "^5.22.2",
"@onecx/angular-testing": "^5.22.2",
"@onecx/angular-webcomponents": "^5.22.2",
"@onecx/integration-interface": "^5.22.2",
"@onecx/keycloak-auth": "^5.22.2",
"@onecx/portal-integration-angular": "^5.22.2",
"@onecx/portal-layout-styles": "^5.22.2",
"@webcomponents/webcomponentsjs": "^2.8.0",
"keycloak-angular": "^16.0.1",
"primeflex": "^3.3.1",
Expand All @@ -86,17 +86,17 @@
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@openapitools/openapi-generator-cli": "^2.14.1",
"@schematics/angular": "18.2.8",
"@schematics/angular": "18.2.11",
"@types/jasmine": "~5.1.4",
"@types/node": "~22.7.3",
"@types/node": "~22.9.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.6",
"jasmine-core": "~5.3.0",
"jasmine-core": "~5.4.0",
"jasmine-spec-reporter": "^7.0.0",
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ describe('ProductPropertyComponent', () => {
})

it('should not upload a file that is too large', () => {
const largeBlob = new Blob(['a'.repeat(100001)], { type: 'image/png' })
const largeBlob = new Blob(['a'.repeat(200001)], { type: 'image/png' })
const largeFile = new File([largeBlob], 'test.png', { type: 'image/png' })
const event = {
target: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class ProductPropertyComponent implements OnChanges, OnInit {
if (ev.target && (ev.target as HTMLInputElement).files) {
const files = (ev.target as HTMLInputElement).files
if (files) {
if (files[0].size > 100000) {
if (files[0].size > 200000) {
this.msgService.error({
summaryKey: 'IMAGE.CONSTRAINT_FAILED',
detailKey: 'IMAGE.CONSTRAINT_SIZE'
Expand Down

0 comments on commit 26b592e

Please sign in to comment.