Skip to content

Conversation

@DVidal1205
Copy link
Contributor

Why

Because not everyone with READ_FORMS or EDIT_FORMS should see every form

What

Adds a form tab style sectioning, where each tab is configured with a role. Users can only create tabs for roles that they currently have. Then forms remain hidden. Editing a form without access will also redirect you, and deleting a tab moves all of its forms into the open access "General" tab. Also did some minor UI fixes (like having back buttons in all of our form pages...)

Test Plan

image image image image image

},
});

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
Copy link
Contributor

Choose a reason for hiding this comment

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

Why

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wanted to shut up LSP without reloading and losing my place. its irrelevant now, just deleted

});
}),

renameSection: permProcedure
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldnt this be in update cause its ID based

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if ur referring to updateFormSection, that doesn't update a section. what it does is it takes a form, and moves it to a new section. now that i say it out loud, that logic couldve gone into updateForm as well but i was separation of concerns brained

});
if (sectionToDelete) {
await db
.delete(FormSectionRoles)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe do this with a cascade instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true dat


const userRoleIds = new Set(userRoles.map((r) => r.roleId));

const hasAllRoles = input.roleIds.every((roleId) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Idk if theres a set AND in JS but if there itd be cool to use it here

allowResubmission: t.boolean().notNull().default(false),
formData: t.jsonb().notNull(),
formValidatorJson: t.jsonb().notNull(),
section: t.varchar({ length: 255 }).notNull().default("General"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you have both name and ID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't want to display an ID in the UI

Copy link
Contributor

@DGoel1602 DGoel1602 left a comment

Choose a reason for hiding this comment

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

lgtm lets just make a note to change the section name storage in forms

Copy link
Contributor

@DGoel1602 DGoel1602 left a comment

Choose a reason for hiding this comment

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

I forgot to approve

@DGoel1602 DGoel1602 added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit cc82870 Jan 16, 2026
5 checks passed
@DGoel1602 DGoel1602 deleted the blade/form-refinements-final branch January 16, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants