-
Notifications
You must be signed in to change notification settings - Fork 47
[Blade] Form Sectioning + UI Nits #288
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
Conversation
| }, | ||
| }); | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
packages/api/src/routers/forms.ts
Outdated
| }); | ||
| if (sectionToDelete) { | ||
| await db | ||
| .delete(FormSectionRoles) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) => |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
DGoel1602
left a comment
There was a problem hiding this 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
DGoel1602
left a comment
There was a problem hiding this 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
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