From 2ccc2e627066fbbcec1ea4783619b185d5c919a3 Mon Sep 17 00:00:00 2001 From: Basile Spaenlehauer Date: Wed, 17 Apr 2024 10:28:33 +0200 Subject: [PATCH] fix: apply new limits (#195) * fix: apply new limits * fix: tests --- cypress/fixtures/members.ts | 2 +- package.json | 2 +- src/components/main/EditingNameField.tsx | 5 ++--- yarn.lock | 10 +++++----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cypress/fixtures/members.ts b/cypress/fixtures/members.ts index c767e534f..efe6f63c7 100644 --- a/cypress/fixtures/members.ts +++ b/cypress/fixtures/members.ts @@ -20,7 +20,7 @@ export const MEMBERS: { }, WRONG_NAME_TOO_LONG: { id: 'a7e428e9-86d3-434a-b611-d930cf8380ec', - name: 'qwertyuiopasdfghjklzxcvbnmqwert', + name: 'qwertyuio pasdfghjklzx cvbnmqwertr tyuiopa sdfghjklzxcvbnmqwe', email: 'graasp@graasp.org', nameValid: false, }, diff --git a/package.json b/package.json index 3a8dc4f0a..dfea875ba 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@emotion/react": "11.11.4", "@emotion/styled": "11.11.0", "@graasp/query-client": "3.4.1", - "@graasp/sdk": "4.7.1", + "@graasp/sdk": "4.7.2", "@graasp/translations": "1.25.3", "@graasp/ui": "4.15.0", "@mui/icons-material": "5.15.14", diff --git a/src/components/main/EditingNameField.tsx b/src/components/main/EditingNameField.tsx index 401b1915a..abbb7a057 100644 --- a/src/components/main/EditingNameField.tsx +++ b/src/components/main/EditingNameField.tsx @@ -4,6 +4,8 @@ import CloseIcon from '@mui/icons-material/Close'; import DoneIcon from '@mui/icons-material/Done'; import { IconButton, Stack, TextField } from '@mui/material'; +import { MAX_USERNAME_LENGTH, MIN_USERNAME_LENGTH } from '@graasp/sdk'; + import { useAccountTranslation } from '@/config/i18n'; import { USERNAME_CANCEL_BUTTON_ID, @@ -11,9 +13,6 @@ import { USERNAME_SAVE_BUTTON_ID, } from '@/config/selectors'; -const MIN_USERNAME_LENGTH = 3; -const MAX_USERNAME_LENGTH = 30; - type EditingUserNameFieldProps = { name: string; onSave: (newValue: string) => void; diff --git a/yarn.lock b/yarn.lock index ff1703ef2..1b30a9614 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1625,9 +1625,9 @@ __metadata: languageName: node linkType: hard -"@graasp/sdk@npm:4.7.1": - version: 4.7.1 - resolution: "@graasp/sdk@npm:4.7.1" +"@graasp/sdk@npm:4.7.2": + version: 4.7.2 + resolution: "@graasp/sdk@npm:4.7.2" dependencies: "@faker-js/faker": "npm:8.4.1" js-cookie: "npm:3.0.5" @@ -1635,7 +1635,7 @@ __metadata: peerDependencies: date-fns: ^3 uuid: ^9 - checksum: 10/182e2a33fbdf7ed2cac7fbdf5a01378a059415a753345cca501d2ddda4985b9448c81bb2931a7157dc34cd613412c5da42da38cb037e9a46438755707e4ea2aa + checksum: 10/f37de1eb4fb02fa748a00e630f8f133d937fd9eb0aa0016a6e071fa37a44d1599be61ff8754a03f77bb5996f9aebf8e6c969fdb52f4463111c71f6ce6d1fcb38 languageName: node linkType: hard @@ -7058,7 +7058,7 @@ __metadata: "@emotion/react": "npm:11.11.4" "@emotion/styled": "npm:11.11.0" "@graasp/query-client": "npm:3.4.1" - "@graasp/sdk": "npm:4.7.1" + "@graasp/sdk": "npm:4.7.2" "@graasp/translations": "npm:1.25.3" "@graasp/ui": "npm:4.15.0" "@mui/icons-material": "npm:5.15.14"