[BUGFIX] Changelog install tool: Duplicate ids prevent expand 50/55150/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 18 Dec 2017 15:11:55 +0000 (16:11 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 19 Dec 2017 16:14:20 +0000 (17:14 +0100)
Expand / collapse sections need a unique id to be properly
collapsible. The "Changelog documentation viewer" uses the
forge issue number for this, which is not unique.
The patch changes the id to use a prefix per version / section
and the loop interation index.

Change-Id: I350d404c61b989deab34bf517e2890e567cb3172
Resolves: #83376
Release: master, 8.7
Reviewed-on: https://review.typo3.org/55150
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeAnalysis/ListDocumentation.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeAnalysis/PanelItem.html
typo3/sysext/install/Resources/Private/Templates/Action/Ajax/RemoveIgnoredItems.html

index d8ce83f..0e4975c 100644 (file)
                                        <div class="panel-collapse collapse {f:if(condition: '{iterator.isFirst}', then: 'in')}"
                                                         id="version-{iterator.index}" role="tabpanel" data-group-version="{version}">
                                                <div class="panel-body" role="tablist" aria-multiselectable="false">
-                                                       <f:for each="{versionArray}" as="fileArray" key="issueNumber">
+                                                       <f:for each="{versionArray}" as="fileArray" iteration="fileIterator">
 
                                                                <f:render partial="Action/Tool/UpgradeAnalysis/PanelItem" section="Main"
-                                                                                                       arguments="{issueNumber:issueNumber, fileArray:fileArray, version:version}"/>
+                                                                                                       arguments="{id:'file-{iterator.index}-{fileIterator.index}', fileArray:fileArray, version:version}"/>
 
                                                        </f:for>
                                                </div>
@@ -41,9 +41,9 @@
                        </div>
                        <div class="collapse" id="collapseRead" role="tabpanel">
                                <div class="panel-body panel-body-read" role="tablist" aria-multiselectable="false">
-                                       <f:for each="{shownFiles}" as="fileArray" key="issueNumber">
+                                       <f:for each="{shownFiles}" as="fileArray" iteration="fileIterator">
                                                <f:render partial="Action/Tool/UpgradeAnalysis/PanelItem" section="Main"
-                                                                                       arguments="{issueNumber:issueNumber, fileArray:fileArray, version:fileArray.section, read:'true'}"/>
+                                                                                       arguments="{id:'read-{fileIterator.index}', fileArray:fileArray, version:fileArray.section, read:'true'}"/>
                                        </f:for>
                                </div>
                        </div>
index 433db43..61ec5bc 100644 (file)
@@ -1,6 +1,6 @@
 <f:section name="Main">
     <div class="panel panel-rst panel-{fileArray.class} risk-medium upgrade_analysis_item_to_filter item"
-         data-item-tags="{fileArray.tagList}" data-item-version="{version}" id="heading{issueNumber}">
+         data-item-tags="{fileArray.tagList}" data-item-version="{version}" id="heading{id}">
         <div class="panel-heading" role="tab">
             <h3 class="panel-title">
                 <f:if condition="{read}">
                         </a>
                     </f:else>
                 </f:if>
-                <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{issueNumber}" aria-expanded="true" aria-controls="collapse{issueNumber}" class="collapsed">
+                <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}" aria-expanded="true" aria-controls="collapse{issueNumber}" class="collapsed">
                     <span class="caret"></span>
                     <strong>{fileArray.headline}</strong>
                 </a>
             </h3>
         </div>
-        <div id="collapse{issueNumber}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{issueNumber}">
+        <div id="collapse{id}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{id}">
             <pre><f:format.raw>{fileArray.parsedContent}</f:format.raw></pre>
         </div>
     </div>
index ecd7f73..beac9a7 100644 (file)
@@ -1 +1 @@
-<f:render partial="Action/Tool/UpgradeAnalysis/PanelItem" section="Main" arguments="{issueNumber:issueNumber, fileArray:fileArray}" />
+<f:render partial="Action/Tool/UpgradeAnalysis/PanelItem" section="Main" arguments="{id:id, fileArray:fileArray}" />