Skip to content

Create new entity modal and restyle update modal to match#1480

Merged
ktuite merged 8 commits intomasterfrom
ktuite/create_entity_2
Mar 13, 2026
Merged

Create new entity modal and restyle update modal to match#1480
ktuite merged 8 commits intomasterfrom
ktuite/create_entity_2

Conversation

@ktuite
Copy link
Member

@ktuite ktuite commented Feb 26, 2026

Closes getodk/central#1638

Alternate approach to: #1477

When updating the visual design, the update and create modals actually became quite similar. In the other PR, they are different enough (with the 3rd column showing the old value in the update case) that I created an entirely new create modal.

In this case, there's a shared "upsert" modal that create and update use. The row has been modified to not have a column for the old value. It has also been modified to have the label column be optional so it can be used for the label field at the top of the modal outside the table.

Create modal:
Screenshot 2026-02-27 at 1 14 34 PM

Update modal:
Screenshot 2026-02-27 at 1 14 57 PM

What has been done to verify that this works as intended?

Trying it out

Why is this the best possible solution? Were any other approaches considered?

Other approaches were considered (reusing old update modal, different styles on input fields)

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Let's users make new entities in central, which will be really useful in certain cases.

Does this change require updates to user documentation? If so, please file an issue here and include the link below.

no.

Before submitting this PR, please make sure you have:

  • run npm run test and npm run lint and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@lognaturel

This comment was marked as outdated.

Copy link
Member Author

@ktuite ktuite left a comment

Choose a reason for hiding this comment

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

Interactive review with @matthew-white

@ktuite ktuite force-pushed the ktuite/create_entity_2 branch from 6cd315c to ffbbf83 Compare March 10, 2026 16:49
<style lang="scss">
@import '../../assets/scss/variables';

#entity-update, #entity-create {
Copy link
Member Author

Choose a reason for hiding this comment

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

@matthew-white I think you mentioned trying to change this to a .entity-upsert class instead of these IDs. I tried that and the bootstrap table tr borders came back, despite being hidden in the other CSS here. Something about CSS selector specificity. I'm thinking of leaving it like this with the IDS.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, some of the Bootstrap table styles can be kind of overly specific. It shouldn't be too hard to match their specificity though. You can use the element inspector to find the original style, then use the same selector. Instead of tr td, th, it probably needs to be something like tbody tr td, thead tr th. I wouldn't spend more than a couple of minutes on it though. It seems a little funny for the child component to reference the parent component, but it's not a big deal.

Copy link
Member

@matthew-white matthew-white left a comment

Choose a reason for hiding this comment

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

I wrote up some comments during async review, then @ktuite and I discussed the most important comments interactively. I never actually posted the comments though. I think @ktuite has addressed a lot of them already, but I'll go ahead and post the original comments just to preserve the discussion.

Copy link
Member

@matthew-white matthew-white left a comment

Choose a reason for hiding this comment

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

@ktuite and I discussed this PR interactively, then I took a closer look async. I took a look at the code in src/, and it's looking great to me. There are still some open comments above that would be great to address, but nothing big. I had wanted to take a closer look at the code in test/ as well, but I haven't found time yet to do so. I'm going to go ahead and approve, since we did discuss tests interactively.

@ktuite ktuite merged commit 15658f8 into master Mar 13, 2026
10 checks passed
@ktuite ktuite deleted the ktuite/create_entity_2 branch March 13, 2026 22:18
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.

Allow users to create a new Entity in the UI

3 participants