Project

General

Profile

« Previous | Next » 

Revision 9783f084

Added by Andreas Kohlbecker about 3 years ago

fix #7704 fix #9397 adapting specimen tree and table view to cdmlib improvements for complete root unit display

View differences:

modules/cdm_dataportal/includes/occurrences.inc
111 111
    }
112 112

  
113 113
    if($with_full_details) {
114
        if($derived_unit_dto->citation){
115
            $detail_html .= "<br>".$derived_unit_dto->citation."<br>";
114
        if($derived_unit_dto->summaryLabel){
115
            $detail_html .= "<br>".$derived_unit_dto->summaryLabel."<br>";
116 116

  
117 117
        }
118 118
    }
......
1081 1081
      //summary row
1082 1082
      if($sob_dto->class == "FieldUnitDTO"){
1083 1083
        $rows[] = array(
1084
          'id' => 'derivate_summary' . $rowcount, // summary row id
1085
          'class' => array('summary_row'),
1084 1086
          'data' => array(
1085 1087
            array(
1086 1088
              'data' => $expand_icon . $collapse_icon,
......
1116 1118
                . ($sob_dto->hasCharacterData ? $character_data_icon : ""),
1117 1119
              'class' => array('summary_row_cell', 'summary_row_icon')
1118 1120
            )
1119
          ),
1120
          'id' => 'derivate_summary' . $rowcount, // summary row id
1121
          'class' => array('summary_row'),
1121
          )
1122 1122
        );
1123 1123
      } else {
1124 1124
        $rows[] = array(
1125
          'id' => 'derivate_summary' . $rowcount, // summary row id
1126
          'class' => array('summary_row'),
1125 1127
          'data' => array(
1126 1128
            array(
1127 1129
              'data' => $expand_icon . $collapse_icon,
......
1130 1132
            array(
1131 1133
              'data' => $sob_dto->label,
1132 1134
              'class' => array('summary_row_cell'),
1133
              'colspan' => 7
1135
              'colspan' => 5
1136
            ),
1137
            array(
1138
              'data' => $sob_dto->hasSpecimenScan ? $checked_box_icon : "",
1139
              'class' => array('summary_row_cell', 'summary_row_icon')
1140
            ),
1141
            array(
1142
              'data' => ($sob_dto->hasDna ? $sequence_icon : "") . " "
1143
                . ($sob_dto->hasDetailImage ? $detail_image_icon : "") . " "
1144
                . ($sob_dto->hasCharacterData ? $character_data_icon : ""),
1145
              'class' => array('summary_row_cell', 'summary_row_icon')
1134 1146
            )
1135 1147
          )
1136 1148
        );
......
1138 1150

  
1139 1151
      //assemble field unit details
1140 1152
      $detail_html = "";
1141
      // - citation
1142
      if ($sob_dto->citation) {
1143
        $detail_html .= create_label("Citation") . $sob_dto->citation . "<br>";
1153
      if ($sob_dto->summaryLabel) {
1154
        $detail_html .= create_label("Citation") . $sob_dto->summaryLabel . "<br>";
1144 1155
      }
1145 1156
      //assemble specimen details
1146 1157
      if ($sob_dto->derivatives) {
......
1316 1327
      'collectionCode',
1317 1328
      'derivatives',
1318 1329
      'derivateDataDTO',
1319
      'citation',
1330
      'derivationTreeSummary',
1320 1331
      'specimenIdentifier', // combination like  collection code + accession number
1321 1332
      'mostSignificantIdentifier',
1322 1333
      // -----
src/test/java/eu/etaxonomy/dataportal/selenium/tests/reference/SpecimenTableViewTest.java
97 97
        WebElement specimensTable = p.getDataPortalContent().getElement().findElement(By.cssSelector("#derivate_hierarchy_table"));
98 98

  
99 99
        List<WebElement> rows = specimensTable.findElements(By.cssSelector("tr"));
100
        assertEquals(5, rows.size());
100
        assertEquals(7, rows.size());
101 101
        // expected rows:
102 102
        // 0: header row
103

  
103 104
        // 1: summary row
104 105
        // 2: detail row
105 106
        // 3: summary row
106 107
        // 4: detail row
108
        // 3: summary row
109
        // 4: detail row
107 110

  
108
        // summary row 1
111
        // summary row
109 112
        int rowId = 1;
110 113
        assertTrue(rows.get(rowId).getAttribute("class").contains("summary_row"));
111 114
        List<WebElement> cells = rows.get(rowId).findElements(By.tagName("td"));
115
        assertEquals("(B SP-99999).", cells.get(1).getText());
116
        // cell number 1 has colspan = 5 !!!
117
        assertTrue(cells.get(2).findElement(By.tagName("img")).getAttribute("src")
118
                .endsWith(STEP_DONE_ICON)); // scan
119
        ++rowId;
120

  
121
        ++rowId;
122
        assertTrue(rows.get(rowId).getAttribute("class").contains("summary_row"));
123
        cells = rows.get(rowId).findElements(By.tagName("td"));
112 124
        assertEquals("Germany", cells.get(1).getText());
113 125
        assertEquals("1835-04-02", cells.get(2).getText());
114 126
        assertEquals("", cells.get(3).getText());
115 127
        // all other empty, TODO check if this is correct or if some data is being missed here
116 128

  
117
        // details row 2
118
        rowId = 2;
129
        // details row
130
        ++rowId;
119 131
        assertTrue(rows.get(rowId).getAttribute("class").contains("detail_row"));
120 132
        assertEquals("Should be initially invisible", "none", rows.get(rowId).getCssValue("display"));
121 133
        rows.get(rowId - 1).click();
......
126 138
        assertEquals(1, detailsLines.length);
127 139
        assertEquals("Citation: Germany, Berlin, 2 Apr 1835. (BHUPM 671)", detailsLines[0]);
128 140

  
129
        // summary row 4
130
        rowId = 3;
141
        // summary row
142
        ++rowId;
131 143
        assertTrue(rows.get(rowId).getAttribute("class").contains("summary_row"));
132 144
        cells = rows.get(rowId).findElements(By.tagName("td"));
133 145
        assertEquals("Germany", cells.get(1).getText());
134 146
        assertEquals("2016-03-28", cells.get(2).getText());
135 147
        assertEquals("Ehrenberg, C.G. D047", cells.get(3).getText());
136
        assertEquals("CEDiT, M", cells.get(4).getText());
148
        assertEquals("CEDiT, B(2), M, XKCD", cells.get(4).getText());
137 149
        assertTrue(cells.get(5).findElement(By.tagName("img")).getAttribute("src")
138 150
                .endsWith(STEP_DONE_ICON));
139 151
        assertTrue(cells.get(6).findElement(By.tagName("img")).getAttribute("src")
......
142 154
                .endsWith(DETAIL_IMAGE_DERIVATE_ICON));
143 155

  
144 156

  
145
        // details row 4
146
        rowId = 4;
157
        // details row
158
        ++rowId;
147 159
        assertTrue(rows.get(rowId).getAttribute("class").contains("detail_row"));
148 160
        assertEquals("Should be initially invisible", "none", rows.get(rowId).getCssValue("display"));
149 161
        rows.get(rowId - 1).click();
......
154 166
        BaseElement detailsCell = new BaseElement(cells.get(1));
155 167
        List<LinkElement> linksInDetails = detailsCell.getLinksInElement();
156 168
        assertEquals(9, detailsLines.length);
157
        assertEquals("Citation: Germany, Berlin, alt. 165 m, 52°31'1.2\"N, 13°21'E (WGS84), 28 Mar 2016, Ehrenberg D047. (M M-0289351, CEDiT 2017E68)", detailsLines[0]);
169
        assertEquals("Citation: Germany, Berlin, alt. 165 m, 52°31'1.2\"N, 13°21'E (WGS84), 28 Mar 2016, Ehrenberg D047. (CEDiT 2017E68, B BDNA 99999, B IMG 99999, M M-0289351, XKCD MASKS 2X)", detailsLines[0]);
158 170

  
159 171
        assertEquals("Specimen summary: CEDiT (2017E68)", detailsLines[1]);
160 172
        assertEquals("CEDiT (2017E68)" ,linksInDetails.get(0).getText());
src/test/java/eu/etaxonomy/dataportal/selenium/tests/reference/SpecimensTreeViewTest.java
85 85
        LinkElement link1;
86 86
        // -------------------------------------------------------------------------------------------
87 87
        // Germany, Berlin, 2 Apr 1835.
88
        int row = 0;
88
        int row = 1;
89 89
        summaryRows.get(row).click(); // make the row visible
90 90
        descriptionListContainerElement = detailRows.get(row).findElement(By.cssSelector("div.description_list"));
91 91
        derivateTreeContainer = descriptionListContainerElement.findElement(By.xpath("./parent::li"));
92 92

  
93 93
        dls = detailRows.get(row).findElements(By.cssSelector("div.description_list"));
94 94
        assertEquals(2, dls.size());
95

  
95 96
        dl1 = new DescriptionList(dls.get(0).findElement(By.tagName("dl")));
96 97
        assertEquals("Field Unit", dl1.joinedDescriptionElementText("Record base:"));
97 98
        assertEquals("Germany", dl1.joinedDescriptionElementText("Country:"));
......
139 140
        BaseElement descriptionListContainer;
140 141
        List<LinkElement> specimenTypeDesignationLinks;
141 142
        LinkElement link1;
142
        int row = 1;
143
        int row = 2;
143 144

  
144 145
        // -------------------------------------------------------------------------------------------
145 146
        // Germany, Berlin, alt. 165 m, 52°31'1.2"N, 13°21'E (WGS84), 28 Mar 2016, Ehrenberg D047.
......
150 151
        logger.debug("derivateTreeContainer: " + ElementUtils.webElementTagToMarkup(derivateTreeContainer));
151 152

  
152 153
        dls = detailRows.get(row).findElements(By.cssSelector("div.description_list"));
153
        assertEquals(3, dls.size());
154
        assertEquals(9, dls.size());
154 155
        dl1 = new DescriptionList(dls.get(0).findElement(By.tagName("dl")));
155 156
        assertEquals("2016-03-28", dl1.joinedDescriptionElementText("Date:"));
156 157
        assertEquals("Field Unit", dl1.joinedDescriptionElementText("Record base:"));

Also available in: Unified diff