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

Only update language if a field is edited in Edit view and is not empty when saved #1394

Closed
5 tasks done
troughc opened this issue Oct 9, 2024 · 12 comments · Fixed by #1505
Closed
5 tasks done

Only update language if a field is edited in Edit view and is not empty when saved #1394

troughc opened this issue Oct 9, 2024 · 12 comments · Fixed by #1505
Assignees
Labels
enhancement New feature or request To be deployed
Milestone

Comments

@troughc
Copy link
Contributor

troughc commented Oct 9, 2024

Reference user story: #1371

Current behaviour - to be replaced with new behaviour

Events: Publishing an entity creates literals in a language field based on the displayed fallback language when the field was not touched
Events: Saving an event entity does NOT create a literal in a language field based on the fallback language when the field is not touched
Place/Person/Org: Saving an entity creates a literal in a language field based on a displayed fallback language when the field was not touched

New behaviour

  1. Make events, places, persons and orgs all behave the same way when it comes to creating a literal in a language field.
  • Remove the difference between saving and publishing in Events
  • Make Save behave the same across all classes / entity types using Event saving behaviour as the model
  1. Saving (publishing) an entity will only create a literal in a field that a user explicitly touched (edited) and has something in it (a text string). It will not create a literal in a field that is untouched:
  • All entities: Saving an event entity will NOT create a literal in a language field based on the fallback language when the field is NOT touched
  • Events: Publishing an event entity will NOT create a literal in a language field based on the fallback language when the field is NOT touched
  1. Warnings will continue to appear to inform the user that there is content doesn't match the language on the website until all fields have been touched / updated (I believe this continues to work as is, no change)
  2. In Edit view: what happens if the user touches / clicks in a field and deletes the fallback language text that is displayed, but does not replace it with anything (i.e. leaves the field empty)? A literal will not be created, i.e. we will NOT create a literal that is blank upon saving/publishing. Instead, the next time someone views that entity in Edit mode, the fallback language will be displayed.
  3. TO BE DECIDED for Read-only view: I am still debating which approach to take if a fallback language is being displayed because there is no language literal. In the read-only view, should we:
  • Show a field as empty, i.e. stop displaying the fallback language?
  • Display the fallback language in the field and display the language literal tag (this would be a change)?
  • leave it as is
  1. In List views: leave it as is, no change.

Tasks

Preview Give feedback
@troughc troughc added enhancement New feature or request estimate needed Add estimate for planning labels Oct 9, 2024
@troughc
Copy link
Contributor Author

troughc commented Oct 9, 2024

@SyamBabu-M here is another ticket for you. Please go ahead and estimate and start work when you have time.

@saumier
Copy link
Member

saumier commented Oct 9, 2024

@troughc Looks good.

@saumier saumier removed their assignment Oct 9, 2024
@SyamBabu-M
Copy link
Contributor

@troughc @saumier What happens when "dismiss" is pressed in the banner, which indicates there are language fallbacks present?
Currently, pressing dismiss will enable all fallback values to be their active value. And upon saving these values will be saved.

@SyamBabu-M SyamBabu-M assigned troughc and unassigned SyamBabu-M Oct 15, 2024
@SyamBabu-M SyamBabu-M added the question Further information is requested label Oct 15, 2024
@troughc
Copy link
Contributor Author

troughc commented Oct 15, 2024

@troughc @saumier What happens when "dismiss" is pressed in the banner, which indicates there are language fallbacks present?
Currently, pressing dismiss will enable all fallback values to be their active value. And upon saving these values will be saved

@SyamBabu-M 'Dismiss' should not enable the fallback languages to be the active value which is then saved (the fallback languages as the actual values). Dismiss is used by a user to close the banner only.

The big idea/goal is that the user intentionally sets (chooses) the fallback language as the active value. Let me know if you need any further clarification.

@troughc troughc removed the question Further information is requested label Oct 15, 2024
@troughc troughc assigned SyamBabu-M and unassigned troughc Oct 15, 2024
@sahalali sahalali removed the backlog_ label Nov 18, 2024
@troughc troughc added this to the CC 2024.1 milestone Nov 18, 2024
@SyamBabu-M SyamBabu-M removed the estimate needed Add estimate for planning label Nov 20, 2024
@SyamBabu-M SyamBabu-M linked a pull request Dec 5, 2024 that will close this issue
@SyamBabu-M
Copy link
Contributor

@dev-aravind Please do a round of peer review.

@SyamBabu-M SyamBabu-M assigned dev-aravind and unassigned SyamBabu-M Dec 5, 2024
@dev-aravind
Copy link
Contributor

@SyamBabu-M This looks good to me but the regression tests for places is failing. Please look into this. You can find the screenshots here.

@dev-aravind dev-aravind assigned SyamBabu-M and unassigned dev-aravind Dec 5, 2024
@SyamBabu-M SyamBabu-M removed a link to a pull request Dec 5, 2024
@SyamBabu-M SyamBabu-M linked a pull request Dec 6, 2024 that will close this issue
@SyamBabu-M
Copy link
Contributor

@troughc Please test this in staging

@SyamBabu-M SyamBabu-M assigned troughc and unassigned SyamBabu-M Dec 6, 2024
@troughc
Copy link
Contributor Author

troughc commented Dec 9, 2024

Tested starting with Events.

1. Saving (publishing) an entity will only create a literal in a field that a user explicitly touched (edited) and has something in it (a text string). It will not create a literal in a field that is untouched: PLEASE CHECK

It looks like it is partially working.
However, I have had some inconsistent results that I would like you to check into.
First, in the Description field.
For this test event, I entered a English and French description. Then I went back in, after publishing, and the Description field didn't have literal tags displayed for japanese and korean (even though I don't think I touched them).

I tried it again in this event:
This time, the description field worked as expected after saving and after publishing (PASSED). So maybe it was user error? But i would appreciate it if. you could test again, to see if you see anything not working.

2. the fallback language in the read-only page is not the same as the fallback language in the Edit page for both test events.

In read only, it looks like it is FRENCH
In Edit view: it is ENGLISH.

I think this is because I changed the order of languages in settings before creating my events. I change the order from having FRENCH first to haviing ENGLISH first (which changed the fallback language from French to English).
So, the expected behaviour is that the fallback langauge is the same in REad only as in Edit view; and that the fallback language in my specific example is ENGLISH (the first language in the list in settings).

wrong fallback language in read only

Image

right fallback language in edit view

Image

3. Tested in Organizations with 2freres

To set it up, I removed the text from the Name and the Description fields.
The name field works as expected (the fallback language was displayed into the empty fields); and the entity saved correctly (no new language literal was created).
The Description field behaved differntly - the fields were left empty (no fallback language was displayed into the empty fields) and it saved with them blank (in read-only view and in edit view).

Image

@troughc troughc assigned SyamBabu-M and unassigned troughc Dec 9, 2024
@SyamBabu-M
Copy link
Contributor

  1. the fallback language in the read-only page is not the same as the fallback language in the Edit page for both test events.

I have not changed anything on the read-only pages as this was not within the scope of this ticket. Should we address this issue before this goes live? Or we can work on that as a separate issue.

  1. Saving (publishing) an entity will only create a literal in a field that a user explicitly touched (edited) and has something in it (a text string). It will not create a literal in a field that is untouched: PLEASE CHECK

This is an issue with tesx editor. I'll fix this asap.

@SyamBabu-M SyamBabu-M linked a pull request Dec 11, 2024 that will close this issue
@SyamBabu-M
Copy link
Contributor

SyamBabu-M commented Dec 11, 2024

@troughc I have fixed the bug with editors unusual behavior. please test this in the linked PR.

@troughc
Copy link
Contributor Author

troughc commented Dec 11, 2024

Tested the text editor behaviour: PASSED.
@SyamBabu-M I will create an issue for the read only page. We may also use this opportunity to add the language literal tag to read-only pages as well, when a fallback language is being used (displayed) in lieu of a missing text string.

@troughc
Copy link
Contributor Author

troughc commented Dec 11, 2024

@SyamBabu-M I just found a minor bug - the ticketing fields in the Edit view are not displaying fallback languages and the literal tag when they are empty. See this event

Example: empty field in Japanese

Screenshot 2024-12-11 at 1 47 00 PM

@SyamBabu-M This is a minor bug so please decide if you want to deploy this update as is or fix this first. Either way, I will add this minor bug to the other ticket I am creating. Please remove the to be deployed Label if you do not want to deploy it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request To be deployed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants