Project

General

Profile

Actions

Patch #9225

closed

Generate project identifier automatically with JavaScript

Added by Jan from Planio www.plan.io over 13 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Category:
UI
Target version:
Start date:
2011-09-11
Due date:
% Done:

0%

Estimated time:

Description

At *Planio Redmine Hosting*, we found that a considerable number of first-time users got stuck while creating their first project. The reason: the project identifier. As it is now, it's not clear what it is for and quite a few of our users tried identifiers starting with a number which yields a validation error that is not specific enough to help them understand that it actually has to start with an a-z character.

This patch attempts to solve the issue by two small improvements:

  1. automatically generate the identifier while the name is typed in
  2. let the user know that the identifier must start with a lower case letter

Appreciate your comments and would love to see this making it into the core - I think it will improve the first time Redmine experience.


Files


Related issues

Related to Redmine - Feature #1458: Project identifier generation ruleClosed2008-06-16

Actions
Related to Redmine - Defect #15950: Project identifier instructions still too ambiguousClosed

Actions
Related to Redmine - Defect #27101: Project identifier model constraint doesn't match with text_project_identifier_info and JS-generated identifiersClosedJean-Philippe Lang

Actions
Actions #1

Updated by Terence Mill over 13 years ago

+1

Actions #2

Updated by Etienne Massip over 13 years ago

There is already a legend (edit: caption?) under the input box that tells Length between 1 and 100 characters. Only lower case letters (a-z), numbers and dashes are allowed?

Why not add an 'auto-generate' AJAX button?

Actions #3

Updated by Jean-Baptiste Barth over 13 years ago

  • Target version set to Candidate for next major release

I personnaly love the "non-intrusive" approach, it would be a really cool addition in the next major release.

Jan: isn't there any standard function to replace special characters in Prototype ? I don't do much Prototype these days...

Actions #4

Updated by Etienne Massip over 13 years ago

I already have an identifier for my project when I create a project in RM, so I should have to remove the proposed id in order to insert mine. What's the point with proposing a name to beginners when you can just check Generate sequential project identifiers in administration?

Also, if you have 2 projects with same generated id (even if I admit that this is very unlikely), you'll need to check DB to append a serial to the name, like my_project2 or whatsoever, thus the need for an AJAX call.

Actions #5

Updated by Jean-Baptiste Barth over 13 years ago

Etienne Massip wrote:

I already have an identifier for my project when I create a project in RM, so I should have to remove the proposed id in order to insert mine.

Not if you fill the identifier first, but well, maybe it could be just a "fallback" identifier (in a hidden field) if you don't fill any identifier before submitting ?

What's the point with proposing a name to beginners when you can just check Generate sequential project identifiers in administration?

Actually, beginners don't know this option, and they don't understand what to put in the "identifier" field. I also have an internal SaaS Redmine hosting and I can say the same thing as Jan, it's a bit confusing new users...

Also, if you have 2 projects with same generated id (even if I admit that this is very unlikely), you'll need to check DB to append a serial to the name, like my_project2 or whatsoever, thus the need for an AJAX call.

It would be too complicated for something "very unlikely", imho.

Tell me what you think about this :
  1. we don't fill project identifier automatically
  2. on form submission, if no project identifier is set, it's auto-generated with Jan's script
  3. there is not step 3

It has a drawback, it could be confusing too because Redmine would do a bit of magick behind the scenes. If we adopt this approach, the fallback identifier could well be generated server-side, not sure what's the best option.

A third option would be to propose the identifier in an alert box before submitting.

Actions #6

Updated by Jan from Planio www.plan.io over 13 years ago

Jean-Baptiste:

Jan: isn't there any standard function to replace special characters in Prototype ? I don't do much Prototype these days...

Holger over at Chili has proposed this: http://lehelk.com/2011/05/06/script-to-remove-diacritics/

Etienne:

What's the point with proposing a name to beginners when you can just check Generate sequential project identifiers in administration?

I strongly agree with Jean-Baptiste: first timers never find this.

Also, if you have 2 projects with same generated id (even if I admit that this is very unlikely), you'll need to check DB to append a serial to the name, like my_project2 or whatsoever, thus the need for an AJAX call.

Should you chose a name that generates the same identifier it will most likely be the same name as another project. Simply for that reason, validation will jump in. For those rare cases, I'd say we don't need ajax here. If we had Ajax, it would only be used to add a "2" or something at the end which usually looks ugly and would (without explanation) prompt users to remove it yielding the same validation problem.

Jean-Baptiste:

Tell me what you think about this :

  1. we don't fill project identifier automatically
  2. on form submission, if no project identifier is set, it's auto-generated with Jan's script

I think that's even more confusing, especially since the identifier cannot be changed afterwards. As they end up in almost every link to project items, that could be an unfortunate situation for some (I have had this feedback).

Actually, I like my initial approach much better:

  • while you type a name, the identifier gets filled in in real time, so you will definitely notice it
  • if you chose to set/change the identifier yourself, changing the name afterwards will not update the identifier, so it is non-intrusive

After all, our approach was modeled a bit after how Wordpress does it with permalinks. And: If they do it, can it be wrong? :-D

Actions #7

Updated by Etienne Massip over 13 years ago

Jan from Planio www.plan.io wrote:

Etienne:

What's the point with proposing a name to beginners when you can just check Generate sequential project identifiers in administration?

I strongly agree with Jean-Baptiste: first timers never find this.

Of course, since this is an Administration option, but Systems integrator/Administrator knows well this option and he will check it since he also knows that its Project managers are mostly newcomers.

Also, if you have 2 projects with same generated id (even if I admit that this is very unlikely), you'll need to check DB to append a serial to the name, like my_project2 or whatsoever, thus the need for an AJAX call.

What about:
  • changing administration option Generate sequential project identifiers to By default, generate project identifiers
  • adding a checkbox Generate project identifier in the project creation screen which default state is set according to above administration option
  • unchecking the checkbox will enable and empty the Identifier input box, thus allowing you to input your own project id
  • if checked, identifier will be generated (being generated from project name can be another administration option) after validation (as it is now) so we can be sure that it is not a (unlikely but still possible) duplicate.

So, beginners don't have to worry about finding a project identifier and people like me will quickly uncheck the checkbox and input their own?

Actions #8

Updated by Etienne Massip over 13 years ago

I feel like you didn't like this idea :D

Actions #9

Updated by Jan from Planio www.plan.io over 13 years ago

sorry for the delay - I understand the general concern you have about generating sequential identifiers. I have uploaded a new patch which - in my opinion - solves your problem without adding more complexity to the settings. the simple change is:

should the identifier field already be filled (with the auto-generated value e.g.), entering a name will not override it.

on a sidenote, I have also included Holgers hint about diacritics.

Actions #10

Updated by Terence Mill about 12 years ago

I thinh tjis i overruled by actual implentation and useless so far

Actions #11

Updated by Daniel Felix almost 12 years ago

Terence Mill wrote:

I thinh tjis i overruled by actual implentation and useless so far

Well, I don't think so. As I see, the identifier is still some input field. This patch would be good for newcomer. Maybe this is just my opinion. But each thing, which mades a system more intuitive, is a good thing. ;-)

Actions #12

Updated by Jean-Philippe Lang almost 12 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next major release to 2.3.0
Patch committed in r11129 with a few changes:
  • moved the js code to a separate script
  • ported it to JQuery
  • removed global variables

Thanks.

Actions #13

Updated by Go MAEDA about 10 years ago

  • Related to Defect #15950: Project identifier instructions still too ambiguous added
Actions #14

Updated by Mischa The Evil about 7 years ago

  • Related to Defect #27101: Project identifier model constraint doesn't match with text_project_identifier_info and JS-generated identifiers added
Actions

Also available in: Atom PDF