New solution for XWIKI-17588 issue

Hi, I have been trying to solve this issue for a long time.

From what I have analyzed, this piece of code “$ services.localization.render (‘core.tags.list.label’)” responds to the translation of the word “Tags:” in different languages.

I would like to comment on this piece of code when the user is not logged in and there are no tags on that page.

I’d better change the UnitTest testTagsWhenNoEditRightsAndTagPluginAvailableAndNoTags ()
from this


to this

What idea do you have, is it a good idea or is it a bad idea?

Link : Loading...

If the output (html) has changed and the existing test(s) is now broken, then yes, it is now mandatory to update the existing test with the new expected behavior.

I am not sure that the actual proposed change is the good one, but it depends on what you’ve done on the implementation side, while addressing the issue. The expected html code must match the actual one that the vm template produces.

1 Like

@vmassol what idea do you have?
PR : https://github.com/xwiki/xwiki-platform/pull/1579

I’m not sure what you are asking. If you’re asking whether it’s a good idea to update the test when there’s no tag, then ofc it is since that’s the point of the issue and the test must pass! :slight_smile:

Now if you’re asking wether your HTML change is good then I don’t think it is, unless you have a good reason; could you explain why you’d keep the DIV with the class and id if there’s not tag. I mean it could be the right thing to do but it needs explanations.

If I delete DIV with class and ID we will get a possible regression.

an example without DIV when there are no tags

Old PR : XWIKI-17588: Display some text when there's no tag by CatalinStratu · Pull Request #1559 · xwiki/xwiki-platform · GitHub

Could you explain what is the regression? (please always try to be as precise as possible and make it easy for reviewers to understand what you mean). Is it that the “created by” text is moved to the left? The regression is not removing the DIV, it’s that the other part is moved. So either you fix the CSS or we keep the DIV (probably simpler I agree).

BTW I also don’t understand this forum post. What new solution?

By possible regression I mean that the text “created by” the text is moved to the left. To keep “created by” on the right I propose to have DIV even when there are no tags

I think that’s acceptable (in order to have a common and simpler CSS).

The new solution is not to delete DIV when there are no tags, but to delete “core.tags.list.label” when there are no tags because “core.tags.list.label” is the translation of the word “Tags:”. If we do not display “core.tags.list.label” when there are no tags, the user will not see the word “Tags:”

This also refers to the correct performance of the test