seitime-frappe/cypress/integration
Himanshu 70409a3c7b
fix: set translated text to link field (#15451)
- Fixes [Issue/15324](https://github.com/frappe/frappe/issues/15324)
- When selecting a value for Link Field, the English text was set as link field value.
- This PR aims to fix it by setting the translated text as link field value on selection.

Todo:

- [x] Show translated text in the select dropdown
- [x] Set translated value to Link field on select
- [x] Show original value when link field is in focus
- [x] Add option to toggle this behaviour

### Behaviour

- Link field loses focus: show the translated name.
- Link field is focused
    - If old value is present
        - If options **are** one of [Role, DocType]: show the translated name
        - Else: show the name (untranslated) to enable search in untranslated values
    - Else: show what the user typed (untranslated) to enable search in untranslated values
- Value is selected: link field loses focus

## Demo

### Link to UOM in a custom Item DocType

The UOM names are in english, so the search needs to happen in english. When possible, the translation is displayed.

#### Before

https://user-images.githubusercontent.com/14891507/156415248-e5e80d05-53dc-4ca8-89c7-998986ff6e99.mov

#### After

https://user-images.githubusercontent.com/14891507/156410386-a874430c-f340-43ed-9c3a-92e8d4d50fc9.mov

### Link to DocType in Customize Form

The DocType names get translated before being searched. This is a preexisting hack in the framework for DocType and Role. In this case, we can search in the translations.

#### Before

https://user-images.githubusercontent.com/14891507/156414648-8e505f8c-9dee-4358-8182-3b358c28bb62.mov

#### After

https://user-images.githubusercontent.com/14891507/156411881-c4ca22e1-1397-4e13-9768-5e16b72f8d6d.mov

https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/customize-form/edit?wiki_page_patch=fdafee2715
2022-05-16 13:21:42 +00:00
..
api.js test: Miscellaneous fixes to avoid flaky tests 2021-09-07 19:57:57 +05:30
awesome_bar.js test: Fix cypress tests 2022-04-05 09:55:39 +05:30
control_attach.js test: Added test script for control type "Attach" (#16355) 2022-04-08 13:42:58 +00:00
control_autocomplete.js fix: autocomplete input value if label & value varies 2022-02-13 15:52:04 +05:30
control_barcode.js test: Typing on focused input issue (#16669) 2022-04-19 15:51:03 +05:30
control_data.js test: Fix flaky tests 2022-04-28 19:32:43 +05:30
control_date.js fix: check dates in frappe realm 2022-04-19 16:49:08 +05:30
control_duration.js test: Updated control_duration.js 2021-11-11 12:40:06 +05:30
control_dynamic_link.js fix(test): control_dynamic_link.js 2022-04-28 15:20:29 +05:30
control_float.js test: tests for control: float 2021-09-09 14:26:40 +05:30
control_icon.js test: fixed failing control icon test 2022-01-25 11:37:09 +05:30
control_link.js fix: set translated text to link field (#15451) 2022-05-16 13:21:42 +00:00
control_markdown_editor.js test: flaky markdown editor fix 2022-04-22 16:59:22 +05:30
control_phone.js test: Simplify phone control test 2022-04-14 18:14:55 +05:30
control_rating.js test: fixed failing tests 2021-12-20 18:36:52 +05:30
control_select.js test: Add support for Testing-Library queries within Cypress tests 2021-08-17 19:06:01 +05:30
customize_form.js fix: Do not allow autoname changes to/from autoincrement in customize form 2022-04-28 11:44:33 +05:30
dashboard_chart.js fix: Dashboard Chart to support Child Table Doctype. (#13995) 2021-11-11 15:09:58 +05:30
dashboard_links.js test: failing dashboard_links UI test fix 2022-03-07 19:24:18 +05:30
data_field_form_validation.js fix: Make URL regexp scheme agnostic 2021-05-03 23:23:17 +05:30
datetime.js fix: get timezone in user_info 2022-01-25 16:19:49 +05:30
datetime_field_form_validation.js test: Comment out a flaky test case 2021-09-08 11:49:22 +05:30
depends_on.js chore: add missing semicolon 2022-02-18 13:03:31 +05:30
discussions.js test: fixed based on new ui 2022-03-07 10:50:59 +05:30
file_uploader.js test: Add support for Testing-Library queries within Cypress tests 2021-08-17 19:06:01 +05:30
first_day_of_the_week.js test: Remove unnecessary code 2022-01-06 10:43:04 +05:30
folder_navigation.js test: fixed flaky ui test for folder_navigation 2021-09-29 11:30:49 +05:30
form.js test: fixed flaky test for form, timeline_email 2022-04-22 17:43:20 +05:30
form_tab_break.js test: Add test cases for form tab break 2021-09-21 09:20:44 +05:30
form_tour.js Merge branch 'develop' of https://github.com/frappe/frappe into fix-ui-flaky-tests 2022-05-05 19:28:00 +05:30
grid.js fix: incorrect function path 2022-02-13 20:17:01 +00:00
grid_configuration.js chore: added test case 2021-10-03 23:59:06 +05:30
grid_keyboard_shortcut.js test: Remove unnecessary code 2022-01-06 10:43:04 +05:30
grid_pagination.js test: UI test for editable grid pagination 2021-11-10 12:14:47 +05:30
grid_search.js test: fixed test with multiple filter UI test 2022-03-07 18:47:30 +05:30
kanban.js style: fixed indentation 2022-04-22 17:13:46 +05:30
list_paging.js test: failing list_paging UI test 2022-03-17 11:18:12 +05:30
list_view.js fix(style): add wait for test 2022-02-22 12:51:11 +05:30
list_view_settings.js test: Replace existing queries with Testing-Library queries 2021-08-18 19:11:01 +05:30
login.js test: Replace existing queries with Testing-Library queries 2021-08-18 19:11:01 +05:30
multi_select_dialog.js test: fixed failing multi select dialog test 2022-01-25 12:45:56 +05:30
navigation.js test: Updated navigation.js 2021-11-08 19:26:21 +05:30
number_card.js test: Added UI test 2022-03-10 16:46:39 +05:30
query_report.js test: Updated query_report UI test 2021-11-08 11:48:51 +05:30
recorder.js test: Minor fix 2021-11-02 18:43:58 +05:30
relative_time_filters.js test: Commenting relative_time_filters.js 2021-10-19 19:46:33 +05:30
report_view.js test: failing report_view UI test fix 2022-03-08 15:44:14 +05:30
sidebar.js test: flaky sidebar test due to msgprint 2021-11-01 16:10:36 +05:30
table_multiselect.js fix: set translated text to link field (#15451) 2022-05-16 13:21:42 +00:00
theme_switcher_dialog.js chore: sider issues fixed 2022-04-11 14:45:13 +05:30
timeline.js test: fixed failing tests 2021-11-11 14:52:31 +05:30
timeline_email.js test: fixed flaky test for form, timeline_email 2022-04-22 17:43:20 +05:30
url_data_field.js test: URL Data field Integrations 2021-04-28 14:12:48 +05:30
web_form.js fix(test): web_form.js 2022-03-24 09:21:34 +05:30
workspace.js fix: Workspace Miscellaneous fixes (#16578) 2022-04-22 18:00:44 +05:30
workspace_blocks.js feat: Quick List Block for Workspace (#16887) 2022-05-13 15:34:35 +05:30