Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(2915): admin front-end for tenant support #3254

Merged
merged 27 commits into from
Feb 12, 2025

Conversation

koekiebox
Copy link
Collaborator

@koekiebox koekiebox commented Jan 29, 2025

Changes proposed in this pull request

Context

Fixes: #2915

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@koekiebox koekiebox added the pkg: frontend Changes in the frontend package. label Jan 29, 2025
@koekiebox koekiebox self-assigned this Jan 29, 2025
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. type: source Changes business logic pkg: auth Changes in the GNAP auth package. pkg: mock-ase pkg: mock-account-service-lib labels Jan 29, 2025
@mkurapov mkurapov linked an issue Jan 30, 2025 that may be closed by this pull request
4 tasks
koekiebox and others added 6 commits January 30, 2025 13:29
# Conflicts:
#	localenv/mock-account-servicing-entity/generated/graphql.ts
#	packages/backend/src/graphql/generated/graphql.schema.json
#	packages/backend/src/graphql/generated/graphql.ts
#	packages/backend/src/graphql/resolvers/tenant.ts
#	packages/backend/src/graphql/schema.graphql
#	packages/frontend/app/generated/graphql.ts
#	packages/mock-account-service-lib/src/generated/graphql.ts
#	test/integration/lib/generated/graphql.ts
@koekiebox koekiebox requested a review from njlie February 4, 2025 08:58
@github-actions github-actions bot removed the pkg: auth Changes in the GNAP auth package. label Feb 4, 2025
@koekiebox koekiebox requested a review from BlairCurrey February 4, 2025 08:58
@koekiebox koekiebox requested a review from BlairCurrey February 7, 2025 09:32
Copy link
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments

@github-actions github-actions bot removed type: tests Testing related pkg: backend Changes in the backend package. type: source Changes business logic pkg: mock-ase pkg: mock-account-service-lib labels Feb 12, 2025
@koekiebox koekiebox requested a review from mkurapov February 12, 2025 13:54
@koekiebox koekiebox requested a review from mkurapov February 12, 2025 15:30
Comment on lines 248 to 257
if (
result.data.email &&
result.data.email.trim().length > 0 &&
!new RegExp(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/).test(
result.data.email
)
) {
errors.fieldErrors.email = ['Email is invalid.']
return json({ errors }, { status: 400 })
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does const result = updateTenantSchema.safeParse(formEntries) take care of checking the email validation already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is an issue with the optional vs regEx, that always forces the regex even when the field is marked as optional.
As a workaround, I am validating it as part of the action.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think we were just missing this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As indicated by @mkurapov
colinhacks/zod#310

We have a workaround:

[`](email: z.string().email().or(z.literal('')),)

@koekiebox koekiebox requested a review from mkurapov February 12, 2025 15:42
@koekiebox koekiebox requested a review from mkurapov February 12, 2025 16:59
@koekiebox koekiebox merged commit 0b0e8a3 into 2893/multi-tenancy-v1 Feb 12, 2025
31 of 37 checks passed
@koekiebox koekiebox deleted the issues/2915-mt-frontend branch February 12, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: frontend Changes in the frontend package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Multi-Tenant] Tenant List, Create and Edit Admin UI Pages
4 participants