epam / ketcher

Web-based molecule sketcher
https://lifescience.opensource.epam.com/ketcher/demo.html
Apache License 2.0
442 stars 159 forks source link

Allow adding and editing IDT aliases for elements in the library #4870

Open ljubica-milovic opened 2 weeks ago

ljubica-milovic commented 2 weeks ago

Background

Requirements

1. The star should be moved to the top left corner for all elements in the library, like it currently is only for presets. .....1.1. Clicking on the star should still perform the same action. . . 2. The three dots should be added to the top right for all elements in the library (except for peptides and presets), like it currently is for presets. image .....2.1. Preview for hovering over the three dots should be removed. Currently: image .....2.2. Clicking on the three dots for presets should give a menu with the option to add/edit alias: image .....2.3. Clicking on the three dots for non-preset (peptides shouldn't have the three dots) elements in the library should give a menu only with the option to add/edit alias. . . 3. When the user select the option to add/edit alias, the following window should appear: image .....3.1. If there is no current alias, the field should contain "Alias name". .....3.2. If there is a current alias, the field should contain that alias. . . 4. The user should be able to add a string consisting only of lowercase letters, uppercase letters, hyphens, underscores, and slashes (only at the ends of the string). .....4.1. The first character can only be /, 5, i or 3. ..........4.1.1. If the first character is /, the second character can only be 5, i, or 3. .....4.2. The number of characters is limited. ..........4.2.1. If there are no slashes, the character limit is 10. ..........4.2.2. If there is a one slash at the beginning, or a one slash at the end of the string, the character limit is 11. ..........4.2.3. If there are slashes at the beginning and at the end of the string the character limit is 12. . . 5. As the user selects "Add alias" option, Ketcher should check whether that alias already exists in the library (compare the strings without slashes, and not taking into account the cases for letters). .....5.1. If that alias is already in use for some other element in the library, Ketcher should determine the name of that element (monomer/preset). .....5.2. If the alias is already in the library, an error message should be shown bellow the field for entering the IDT alias, and the field should be marked in red: image ..........5.1.1. The message should read: "The alias is already in use for another element in the library: [name]. You can search the library by IDT aliases." ..........5.1.2. [name] should be bold. ..........5.1.3. The "Add alias" option should be disabled. . . 6. As the user selects "Add alias" option, Ketcher should check whether an unresolved monomer with the same alias exists on the canvas (compare the strings without slashes, and not taking into account the cases for letters). .....6.1. If an unresolved monomer with the same alias already exists on the canvas, that monomer should be replaced on the canvas with the monomer/preset to whom the user added/edited the alias. ..........6.1.1. Places of other monomers on the canvas should be adjusted to accommodate the new monomer/preset. ..........6.1.2. If the unresolved monomer had an R1-R2 connection at its R1 attachment point, and the new monomer/preset has an R1 attachment point, after the deletion of the unresolved monomer, the same bond is established. ..........6.1.3. If the unresolved monomer had an R1-R2 connection at its R2 attachment point, and the new monomer/preset has an R2 attachment point, after the deletion of the unresolved monomer, the same bond is established. ..........6.1.4. All other bonds (non R1-R2 bonds) that were present for the unresolved monomer should be removed. .....6.2. Ketcher should determine how many unresolved monomers with the entered IDT alias existed on the canvas. ..........6.1.1. It there was only one unresolved monomer, and no bonds were broken, the user should be notified: "One monomer on the canvas was replaced." ..........6.1.2. If there were multiple unresolved monomers, and no bonds were broken, the user should be notified: "[number] monomers on the canvas were replaced." ..........6.1.3. It there was only one unresolved monomer, and bonds were broken, the user should be notified: "One monomer on the canvas was replaced. Non R1-R2 bonds were broken." ..........6.1.4. If there were multiple unresolved monomers, and bonds were broken, the user should be notified: "[number] monomers on the canvas were replaced. Non R1-R2 bonds were broken." . . 7. As the user selects "Add alias" option, Ketcher should check whether there is a preset with the same subunits and a different IDT alias. .....7.1. If such preset exists, Ketcher should determine the name of that preset. .....7.2. If such preset exists, a message should be shown bellow the field for entering the IDT alias (the field should not be marked in red). ..........7.1.1. The message should read: "A preset with the same subunits and a different name already exists in the library: [name]." ..........7.1.2. [name] should be bold. ..........7.1.3. The "Add alias" option should not be disabled. .....7.3. If the user chooses to save the same preset with a different IDT monomer, that preset should be saved as separate preset (second IDT alias is not added to the already existing preset). . . .....8.1. The IDT alias should be saved without slashes. .....8.2. The IDT alias should be saved in the browser cache. .....8.3. Saving an empty string means that the IDT alias was removed, and that library element no longer has an IDT alias. . . 9. The IDT alias should be visible in the previews for that monomer/preset. . . .....12.1. If the user selects "Duplicate and edit" option for a preset with an IDT alias, the copy shouldn't contain an IDT alias, and an error message should appear after clicking "Save" in the RNA builder. .....12.2. The message should read: "The new preset is saved without an IDT alias."