acdh-oeaw / dhcr-main

Digital Humanities Course Registry Application
https://dhcr.clarin-dariah.eu/
Apache License 2.0
4 stars 0 forks source link

Avoid spaces at the beginning and end of course name #73

Closed patrickakk closed 1 year ago

patrickakk commented 1 year ago

@PixlTracer @IvdL22 @vronk

As discussed today in the meeting: This improves the quality of the metadata. Since those spaces can make a course name look unique although it isn't.

Proposed solution:

patrickakk commented 1 year ago

@IvdL22 @PixlTracer Can you review this?

It could be checked here (in dev): https://dev-dhcr.clarin-dariah.eu/courses/add

When adding a course with leading or trailing spaces, or editing one, you can see that they are automatically removed when saving the course.

This improves the validation and makes sure that only courses with unique names are added, since adding spaces doesn't make a course unique.

Can you change the label to Done when satisfied?

patrickakk commented 1 year ago

Note: I've also created a small tool which removes all the spaces in public shown courses names. This can avoid problems for the contributors when updating courses.

Note for myself: -Run the tool once, when this is in production

IvdL22 commented 1 year ago

@patrickakk I have tested this but the dummy course has been added, not removed. Not sure if I tested properly.

patrickakk commented 1 year ago

@IvdL22

(As explained above:)

When adding a course with leading or trailing spaces, or editing one, you can see that they are automatically removed when saving the course.

Your dummy course has been saved in the dev instance, and I see no spaces in the course name?

The purpose of this changes is that spaces at the beginning or end of a course name are automatically removed. So a course can be added, but just the spaces get removed. That works?

Can you change the label to Done when satisfied?

patrickakk commented 1 year ago

Note for myself: The tool has been run. The leading and trailing spaces are removed from existing public shown courses.

PixlTracer commented 1 year ago

I've tested it with the course name

test kjdflöajsök dfd_ ll

test kjdflöajsök dfd_ ll (and I didn't check the box 'show in the registry') -- please remove, if applicable

great work, thanks patrick! I'll set the label to done

patrickakk commented 1 year ago

Implemented in 2023-05.

(Since the test course is in the dev database, we can leave it there. It will disappear someday when this database is updated with a new copy from production.)