Skip to content

Conversation

@shreyashidabral
Copy link

@shreyashidabral shreyashidabral commented Oct 5, 2023

Fixes: T348192

Files Updated

  • components/InputIdentifier.js - Created a new reusable component from existing code for inputting new identifier.

  • components/Books.js - to add a valid Identifier check i.e.

  1. Does not exceed 50 characters in length.
  2. Contains only alphanumeric characters.
    And if identifier is invalid, show appropriate information and ask the user to provide a new valid identifier with the help of InputIdentifier component.
  • utils/helper.js - to feature functions for validating identifiers

@shreyashidabral shreyashidabral changed the title Fixes [T348192]: Add max character limit while creating identifier in Internet Archive Add max character limit while creating identifier in Internet Archive and remove some special characters Fixes [T348192]: Add max character limit while creating identifier in Internet Archive and remove some special characters Oct 5, 2023
@coderwassananmol
Copy link
Owner

@Parthiv-M Can you do a quick review here?

@Parthiv-M
Copy link
Collaborator

Couple of things here

  • Upon clicking the Submit button, it seems to be throwing an error

      error - unhandledRejection: ReferenceError: isAlphanumeric is not defined
      at isTitleValid (BUB2/utils/helper.js:29:25)
      at wikimedia/BUB2/server.js:392:33
      at processTicksAndRejections (internal/process/task_queues.js:95:5)
    
  • I see you have created a new function called generateIdentifier. The task mentions that if the length of the title is more than 50 characters or if it is not alphanumeric, then the user needs to be able to provide a custom identifier.

    The code that was built to handle duplicate identifiers can be reused. You might have to draft it into a separate component and then make the required changes.

@shreyashidabral
Copy link
Author

@Parthiv-M I've made the requested changes.

@coderwassananmol
Copy link
Owner

#187 fixed it. Hence closing this PR.

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