#206 Fix the visibility of entries on the overview page
Merged 3 years ago by dustymabe. Opened 3 years ago by gursewak.
Unknown source visFix  into  master

@@ -652,7 +652,7 @@

        searchParams.set('stream', 'stable');

      }

      // switch to specified arch if `arch` parameter is set

-     if (searchParams.has('arch')) {

+     if (searchParams.has('arch') && this.streamData) {

        const architectures = getMember(this.streamData, "architectures");

        let architectureList = Object.keys(architectures);

        // Checking if the value of arch is in the list of arches from streamData

@@ -448,9 +448,9 @@

                              e.preventDefault();

                              Object.entries(build.arches).map(pair => {

                                if(pair[1] == e.target.text)

-                                 document.getElementById(build.id+pair[1]).style.display = 'inline'

+                                 document.getElementById(build.id+pair[1]).hidden = false

                                else

-                                 document.getElementById(build.id+pair[1]).style.display = 'none'

+                                 document.getElementById(build.id+pair[1]).hidden = true

                              });

                              document.getElementById(build.id+"Dropdown").text = e.target.text;

                            }
@@ -683,12 +683,12 @@

              downgradedPkgsHeading = h('p', { class: "mt-3" }, "Downgraded:");

            }

            let downgradedPkgsElements = h('div', { attrs: { hidden: true } }, [downgradedPkgsHeading, h('ul', {}, downgradedPkgsElementsList)]);

-           let rightPaneData = h('div', { attrs: {id: build.id.concat(eachArch), style: "display: inline;" }, class: "col-lg-10 border-bottom mb-5 pb-4" }, 

+           let rightPaneData = h('div', { attrs: {id: build.id+eachArch}, class: "col-lg-10 border-bottom mb-5 pb-4" }, 

              [date, importantPkgsElements, pkgSummaryDiv, totalPkgsElements, addedPkgsElements, removedPkgsElements, upgradedPkgsElements, downgradedPkgsElements]);

            

              // Hiding the information cards of the unselected architectures

            if(eachArch!=selectedArch)

-             rightPaneData.data.attrs.style = "display: none;"

+             rightPaneData.data.attrs.hidden = true

            rightPane.push(rightPaneData)

          });

          let row = h('div', { class: "row" }, [leftPane, rightPane]);

  • Fix the visibility of the cards and removed the usage of inline to avoid console errors
  • Also checked the streamData on whether it is null to avoid console error in coreos-download.js
  • Also checked the steamData on whether it is null to avoid console error in coreos-download.js

steamData -> streamData ?

Pull-Request has been merged by dustymabe

3 years ago