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

Ban overwriting of UUIDs on new product creation, modify "edit metadata" modal design #499

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

gordlin
Copy link
Member

@gordlin gordlin commented Jan 3, 2025

Related Item(s)

Issue #445

Changes

  • [FEATURE] Changes the This UUID already exists warning on the Create New Storylines Product page into an error, and block the user from continuing until they choose another one.
  • [REFACTOR] Makes some minor changes to the Edit Metadata modal. (See comment)
    • Moves "Done" button to header
    • Makes header sticky
    • Adds bottom border to header for visual separation

Testing

Steps:

  1. Open the Create New Storylines Product page.
  2. Enter the UUID of an already existing product (e.g. 00000000-0000-0000-0000-000000000000). See the red error that pops up instead of the previous orange warning.
  3. Scroll to the bottom of the page. Notice the Next button is grayed out. The user must change the UUID to one that doesn't conflict with an existing product in order to continue.
  4. Change the UUID to a new, unique one. The error disappears, and the Next button can be clicked.
  5. Once in the editor, click Edit Project Metadata and play with the modified metadata modal.

This change is Reviewable

@gordlin gordlin added the PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review. label Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

Your demo site is ready! 🚀 Visit it here: https://ramp4-pcar4.github.io/storylines-editor/prevent-uuid-overwrite

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

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

I've found that if you enter a UUID that is currently in use and then quickly click "Next" before the "in use" warning pops up, you can still overwrite a product. Maybe we also need to disable the "Next" button while the check is in progress?

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gordlin)

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from bcf94ca to fedaeb1 Compare January 6, 2025 17:05
Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Good idea, Donethanks!

Also disabled the "Next" button when the UUID field is blank.

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @RyanCoulsonCA)

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

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

Looks good! One more quick thing (should've included this in my original review, sorry): when renaming, we show this little spinner next to the "Rename" button while the UUID is being checked:
image.png

I'm thinking it would probably be beneficial to include this spinner next to the UUID input box while it's checking the UUID just so that the user knows that something is happening and isn't confused about why the "Next" button is disabled.

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @gordlin)

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from fedaeb1 to 248733d Compare January 7, 2025 16:38
Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Donethanks! Also added a spinner to the "Next" button itself to indicate we're loading the editor (although it only seems to show up sometimes, and is frozen when it does appear).

In addition, made some minor modification to the edit metadata modal:

  • Moved "Done" button to header
  • Made header sticky
  • Added bottom border to header for visual separation

image.png

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @RyanCoulsonCA)

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from 248733d to 53c6979 Compare January 7, 2025 16:50
Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Managed to fix the "Next" button spinner "only showing up sometimes" by adding a slightly longer setTimeout delay. It's still frozen (no spinning), though.

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @RyanCoulsonCA)

@gordlin gordlin changed the title Ban overwriting of UUIDs on new product creation Ban overwriting of UUIDs on new product creation, modify "edit metadata" modal design Jan 7, 2025
@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from 53c6979 to 0c2ccd4 Compare January 7, 2025 17:01
Copy link
Member

@IshavSohal IshavSohal left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @gordlin and @RyanCoulsonCA)


a discussion (no related file):
I noticed that when you remove the UUID provided, the spinner will spin forever, and the Next button remains disabled forever. Entering a new UUID doesn't seem to fix it.

Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @IshavSohal and @RyanCoulsonCA)


a discussion (no related file):

Previously, IshavSohal (Ishav Sohal) wrote…

I noticed that when you remove the UUID provided, the spinner will spin forever, and the Next button remains disabled forever. Entering a new UUID doesn't seem to fix it.

Donethanks! Also added an error message when the UUID field on the Create New Storylines Product page is left blank:

image.png

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from 0c2ccd4 to db4c8d5 Compare January 9, 2025 21:57
Copy link
Member

@mohsin-r mohsin-r left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @IshavSohal)

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch 2 times, most recently from 28db7d9 to a0bc6d9 Compare January 10, 2025 17:46
Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @IshavSohal, @mohsin-r, and @RyanCoulsonCA)


a discussion (no related file):
Rebased with main. No functional changes.

Copy link
Member

@yileifeng yileifeng left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @IshavSohal, @mohsin-r, and @RyanCoulsonCA)

Copy link
Member

@IshavSohal IshavSohal left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mohsin-r, @RyanCoulsonCA, and @yileifeng)

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

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

Changes to metadata modal look great 👍

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gordlin, @IshavSohal, @mohsin-r, and @yileifeng)


src/components/metadata-editor.vue line 1767 at r5 (raw file):

        // Needed in order to show the loading spinner at all
        // Although it shows, it's still frozen (since app's really just lagging until editor's in)
        setTimeout(() => {

This is good for now, but I think we should create an issue to look in to removing all of the setTimeout calls we've added to the project for UI purposes recently. I could be totally wrong but I feel like there's got to be a better solution considering Vue is reactive? May just require a bit of investigation.

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from a0bc6d9 to 6de69fd Compare January 14, 2025 21:06
Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @IshavSohal, @mohsin-r, @RyanCoulsonCA, and @yileifeng)


a discussion (no related file):
Rebased with main, resolved merge conflicts.

Some of the recent commits to main seem to have broken the existing UUID checking functionality. I think the problem involves the /check/:id API endpoint, which isn't detecting existing UUIDs as existing (I used the 00000000-0000-0000-0000-000000000000 product), and so the UUID inputs weren't showing the "Product already exists" error. I've rolled back a few lines of checkUUID() so it uses the previous /retrieve/:id/:lang endpoint, and checking seems to work now.

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @gordlin, @IshavSohal, @mohsin-r, and @yileifeng)


a discussion (no related file):

Previously, gordlin (Gordon Lin) wrote…

Rebased with main, resolved merge conflicts.

Some of the recent commits to main seem to have broken the existing UUID checking functionality. I think the problem involves the /check/:id API endpoint, which isn't detecting existing UUIDs as existing (I used the 00000000-0000-0000-0000-000000000000 product), and so the UUID inputs weren't showing the "Product already exists" error. I've rolled back a few lines of checkUUID() so it uses the previous /retrieve/:id/:lang endpoint, and checking seems to work now.

That's interesting... the /check/ endpoint seems to be working for me after pulling the latest changes. Is anyone else experiencing this?

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from 6de69fd to f7f3517 Compare January 15, 2025 21:54
Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @IshavSohal, @mohsin-r, @RyanCoulsonCA, and @yileifeng)


a discussion (no related file):

Previously, RyanCoulsonCA (Ryan Coulson) wrote…

That's interesting... the /check/ endpoint seems to be working for me after pulling the latest changes. Is anyone else experiencing this?

Surprisingly it does seem to work now, despite not working yesterday. I've changed it back.

If anyone notices any problems with the "UUID already exists" error not showing up in the rename or new product inputs, please let me know ASAP.

Copy link
Member

@szczz szczz left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gordlin, @IshavSohal, @mohsin-r, @RyanCoulsonCA, and @yileifeng)


a discussion (no related file):

Previously, gordlin (Gordon Lin) wrote…

Surprisingly it does seem to work now, despite not working yesterday. I've changed it back.

If anyone notices any problems with the "UUID already exists" error not showing up in the rename or new product inputs, please let me know ASAP.

Worked great for me.

Copy link
Member

@yileifeng yileifeng left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gordlin, @IshavSohal, @mohsin-r, @RyanCoulsonCA, and @szczz)


a discussion (no related file):

Previously, szczz (Matt Szczerba) wrote…

Worked great for me.

WOMM


src/components/metadata-editor.vue line 1767 at r5 (raw file):

Previously, RyanCoulsonCA (Ryan Coulson) wrote…

This is good for now, but I think we should create an issue to look in to removing all of the setTimeout calls we've added to the project for UI purposes recently. I could be totally wrong but I feel like there's got to be a better solution considering Vue is reactive? May just require a bit of investigation.

#515

@gordlin gordlin force-pushed the prevent-uuid-overwrite branch from f7f3517 to 7f91ccd Compare January 20, 2025 16:24
Copy link
Member

@szczz szczz left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r8, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @IshavSohal, @mohsin-r, @RyanCoulsonCA, and @yileifeng)

@szczz szczz merged commit f3f3548 into ramp4-pcar4:main Jan 20, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants