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

Default user columns to current user for templates #14839

Merged

Conversation

adrinr
Copy link
Collaborator

@adrinr adrinr commented Oct 21, 2024

Description

With the new templates containing user columns, we need a way to set valid values for it. Otherwise, the data will be trimmed on the way out, causing some unexpected behaviours on the template.

This PR ensures that when a new app comes from a template, the user column data will be defaulted to the creator of the app.

Also, updating multiple interface and typings that were not correct and misleading

Screenshoots

Using the following data as a template

image

Before, using that template, the user column was empty

image

After, the data gets populated with the user creator

image

Copy link

linear bot commented Oct 21, 2024

Copy link

qa-wolf bot commented Oct 21, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@adrinr adrinr requested a review from mike12345567 October 21, 2024 15:58
@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/s labels Oct 21, 2024
@adrinr adrinr force-pushed the BUDI-8766/default-user-columns-to-current-user-for-templates branch from 5f755c6 to cb5082a Compare October 22, 2024 08:25
@adrinr adrinr marked this pull request as ready for review October 22, 2024 08:26
@adrinr adrinr requested a review from a team as a code owner October 22, 2024 08:26
@adrinr adrinr mentioned this pull request Oct 22, 2024
@adrinr adrinr marked this pull request as draft October 22, 2024 09:35
@github-actions github-actions bot added size/m and removed size/s labels Oct 22, 2024
@adrinr adrinr marked this pull request as ready for review October 22, 2024 11:20
@adrinr adrinr requested a review from samwho October 22, 2024 11:20
@@ -279,6 +276,10 @@ async function performAppCreate(ctx: UserCtx<CreateAppRequest, App>) {
const instance = await createInstance(appId, instanceConfig)
const db = context.getAppDB()

if (instanceConfig.useTemplate && !instanceConfig.file) {
await updateUserColumns(appId, db, ctx.user._id!)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the actual work that does the required job, the rest is just typing and cleaning

@adrinr adrinr merged commit 9d4cbaa into v3-ui Oct 22, 2024
11 checks passed
@adrinr adrinr deleted the BUDI-8766/default-user-columns-to-current-user-for-templates branch October 22, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firestorm Data/Infra/Revenue Team size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants