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

fix: add slug for software, projects and news #1340

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Conversation

dmijatovic
Copy link
Contributor

@dmijatovic dmijatovic commented Nov 7, 2024

User cannot create software or project using "add" slug

Closes #1338
Related to #525

Changes proposed in this pull request:

  • Move add software, project and news to add route
  • The slug validation feedback to user is improved. From the moment the user start typing/changing slug until the end of the validation we show "loader" in the slug input indicating "pending" validation process. At the same time the save button is disabled.
  • UNRELATED: Adapted width of custom pages to 1024px for easier reading.

How to test:

  • make start to build and create test data
  • login to RSD
  • create software, try to use "add" as slug. Try using other slugs. Test also used slugs that should return error.
  • create project, try to use "add" slug. Try using other slugs. Test also used slugs that should return error.
  • create news, try to use "add" slug. Try using other slugs. Test also used slugs that should return error.
  • Examine custom pages: About, Terms of service, Cookies etc.

Example cookies page layout

image

PR Checklist:

  • Increase version numbers in docker-compose.yml
  • Link to a GitHub issue
  • Update documentation
  • Tests

@dmijatovic dmijatovic force-pushed the 1338-add-slug branch 3 times, most recently from c23b859 to 3600343 Compare November 8, 2024 11:43
@dmijatovic dmijatovic changed the title fix: reserve add slug as used fix: add slug for software, projects and news Nov 8, 2024
@dmijatovic dmijatovic marked this pull request as ready for review November 8, 2024 15:58
@jmaassen
Copy link
Member

jmaassen commented Nov 11, 2024

Works well, but I seem to have found one small bug?

Sometimes when I add software with a duplicate slug, the warning doesn't appear and the loader keeps on turning. No error is shown:

Screenshot_2024-11-11_11-15-41

As soon as I replaced the name with an unused one, then followed by the used one, the error is shown correctly.

I can reproduce this with both software and projects:

  • click on add software
  • create software called "add"
  • click on add project
  • create project called "add"
  • click on add software
  • create software called "add" (now turns forever)
  • replace "add" by test, but don't save
  • replace "test" by "add" (error is now shown)
  • click on add project
  • create project called "add" (now turns forever)
  • replace "add" by test, but don't save
  • replace "test" by "add" (error is now shown)
  • repeat!

@dmijatovic
Copy link
Contributor Author

@jmaassen Well spotted! I have fixed the error. Can you test again, please?

Copy link
Collaborator

@ewan-escience ewan-escience left a comment

Choose a reason for hiding this comment

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

Works mostly well, but I found one small issue.

When editing the slug on an add page, if I delete the slug character by character, fast enough to not lose the spinner, the spinner will run forever when the slug becomes empty.

In the future, it would be nice if the /add path would show a page with items you can add instead of a 404 page.

Copy link

@dmijatovic
Copy link
Contributor Author

@ewan-escience Great! I fixed your remark. Can you validate, please?

@dmijatovic dmijatovic merged commit d1001ff into main Nov 12, 2024
4 checks passed
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.

It shouldn't be possible to create a software or project page with slug add
3 participants