richardlawley opened a new issue #3385: UI Translate code removes same-level 
content
URL: https://github.com/apache/cloudstack/issues/3385
 
 
   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete 
the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   UI
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master 
branch.
   -->
   
   ~~~
   4.11.2
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, 
advanced networking, etc.  N/A otherwise
   -->
   N/A
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   N/A
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   The UI code replaces `<translate key="blah"/>` with the localised content.  
However, the translate code incorrectly removes content at the same level, for 
example the Zone Names on the capacity list of the dashboard:
   
   ```
   <div class="label">
       <translate key="label.zone"/>: <span data-list-item="zoneName"></span>
   </div>
   ```
   
   This results in the dashboard not showing the Zone name.  This also affects 
the "Optional" label in VM creation from a VPC on the Network step.
   
   This is because the `$.find('translate[key]')` code is not treating 
translate as a valid self-closing tag.  This problem doesn't affect cases where 
there is no non-tag content at the same level, which is why it hasn't been 
picked up yet.
   
   Other known cases:
   * Instance Wizard - VPC Select Network tier - optional label not shown
   * Instance Wizard - Step 8 (Review) - Name and Group do not show Optional 
Label
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal 
test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   View the Dashboard
   Observe that the Capacities do not list zone names
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   Zone Names should be displayed in Capacity list
   
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   
![image](https://user-images.githubusercontent.com/1608083/59103002-8f26f100-8925-11e9-87d3-9a4344ca7523.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to