You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Workspace name input does not trim leading/trailing whitespace #17
In the initial workspace setup and in the workspace settings, when setting/changing the name of the workspace, you're allowed to have leading/trailing white space.
In my case I tried using a 2 character long workspace name (example: ab), but got stopped by the 4 character minimum. For fun I tried adding two spaces after the name to reach the 4 character minimum (eg. ab ) and was surprised that it worked. It works exactly the same when changing the name in the workspace settings.
Having invisible characters in the name (the spaces are removed in for example the user dropdown in the navbar) can be confusing, and is probably not intended.
Also -> Names (first names) with just 1 char are relatively common. So if I'm allowed to trim every field and set names to min 1, I would be happy to send a PR.
Just a heads-up, CLA is required when you send a PR, if that is okay with you. Thank you.
Would creating a local file system package imported by both client and server, maybe called shared-constants, be a reasonable long term solution to this (and future possible) discrepancy?
Activity
Philipinho commentedon Jun 30, 2024
Thank you for catching this. I will fix it.
ellieschieder commentedon Jun 30, 2024
I currently look into this (e.g. where this is the case.)
Using string transforms:
Instead of using them just as
z.string().min(2)https://zod.dev/?id=stringsAlso -> Names (first names) with just 1 char are relatively common. So if I'm allowed to trim every field and set names to min 1, I would be happy to send a PR.
Philipinho commentedon Jun 30, 2024
@ellieschieder, I am happy to review your PR.
You can set the minimum user name value to 1. It seems reasonable.
These two backend validations will need to be updated too.
docmost/apps/server/src/core/auth/dto/create-user.dto.ts
Line 12 in a0b3180
(Your changes will also help to fix the length discrepancy here. I just noticed.)
docmost/apps/server/src/core/auth/dto/create-admin-user.dto.ts
Line 6 in a0b3180
Just a heads-up, CLA is required when you send a PR, if that is okay with you.
Thank you.
ellieschieder commentedon Jun 30, 2024
Thanks, the server side validation is what I in fact did not find so easy.
I also did set (extra commit) theme per default to auto. I hope that is okay.
ellieschieder commentedon Jun 30, 2024
Ohhh also, I never worked with nextjs, where do I find the logic, that would allow me to also trim server side?
ellieschieder commentedon Jun 30, 2024
Nest/Fastify, sorry.
Philipinho commentedon Jun 30, 2024
I would prefer the default theme to be light since there is a theme preference in settings. I like the bright colors first 😃
You can find both DTO files in
/apps/server/src/core/auth/dto.Feel free to ask me any questions.
ellieschieder commentedon Jun 30, 2024
olivierIllogika commentedon Jul 19, 2024
Would creating a local file system package imported by both client and server, maybe called shared-constants, be a reasonable long term solution to this (and future possible) discrepancy?
Philipinho commentedon Oct 12, 2024
Should be fixed here #397.
Merge pull request docmost#17 from Vito0912/feat/code
Merge pull request 'feat(editor): page templates — live whole-page em…
docs(readme): sync roadmap with develop
chore(page-templates): remove dead findReferencePageIdsBySource (docm…
fix(page-templates): defense-in-depth workspace checks (docmost#36)
test(authz): fork compat suite — search completeness (I5), page-restr…