Learn, todo and done 26-30/4/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc, Pattern Libraries Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Todo - Project repo, doc Local Taverna Study how to get DOI for publon review link Done - Project Mint DOI report doc Todo Done Follow up Add-delete-button-#503 At first, I discarded the zii.widgets.CDetailView and recreated the view table using html code <style> table { border-collapse: collapse; width: 100%; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10.3px; } th, td { border: 1px transparent; text-align: left; padding: 3px; } tr:nth-child(odd) { background-color: #E5F1F4; } tr:nth-child(even) { background-color: #f8f8f8; } </style> <table> <tr> <th><?php echo 'ID'; ?></th> <td><?php echo $model->id; ?></td> </tr> <tr> <th><?php echo 'Dataset'; ?> </th> <td><?php echo $model->dataset_id; ?></td> </tr> <tr> <th><?php echo 'File Name'; ?></th> <td><?php echo $model->name; ?></td> </tr> <tr> <th><?php echo 'Location'; ?></th> <td><?php echo $model->location; ?></td> </tr> <tr> <th><?php echo 'Extension'; ?></th> <td><?php echo $model->extension; ?></td> </tr> <tr> <th><?php echo 'Size'; ?></th> <td><?php echo $model->size; ?></td> </tr> <tr> <th><?php echo 'Description'; ?></th> <td><?php echo $model->description; ?></td> </tr> <tr> <th><?php echo 'Release Date'; ?></th> <td><?php echo $model->date_stamp; ?></td> </tr> <tr> <th><?php echo 'File Format'; ?></th> <td><?php echo $model->format_id; ?></td> </tr> <tr> <th><?php echo 'Data Type'; ?></th> <td><?php echo $model->type_id; ?></td> </tr> <tr> <th><?php echo 'Sample'; ?></th> <td><?php echo $name; ?></td> </tr> <?php for ($i = 0; $i < count($attribute_array); $i++) { ?> <tr> <th><?php echo 'File Attribute'; ?></th> <td><?php echo $attribute_array[$i]; ?></td> </tr> <?php } ?> </table> Later, I reverted it because it was not as good as this: <?php $sample_id = FileSample::model()->find('file_id=:file_id', array(':file_id'=>$model->id)); $fileAttributes = FileAttributes::model()->findAll('file_id=:file_id', array(':file_id'=>$model->id)); if(isset($sample_id)) { $sample_name= Sample::model()->find('id=:id',array(':id'=>$sample_id->sample_id)); } $name="Not Set"; if(isset($sample_id)&&isset($sample_name)) { $name=$sample_name->name; } $attributes = array( 'id', 'dataset_id', 'name', 'location', 'extension', 'size', 'description', 'date_stamp', 'format_id', 'type_id', array( 'name'=>'Sample', 'value'=> $name, ) ); if(!empty($fileAttributes)) { foreach ($fileAttributes as $fileAttribute) { array_push($attributes, array('name' => 'FileAttribute', 'value' => $fileAttribute->value)); } } $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=> $attributes )); And after that, I have to pass the behat test using TableNode to assert the File Attribute row and its value Updated PR descriptions for Add-delete-button-#503 and Add-citation-box-#521 AOB Server issues Confirmed with BGI IT team, 192.168.208.43, 192.168.208.73, 192.168.208.74, these 3 servers are owned by Scott 192.168.208.44, IBM 3630 has no any record about its ownership, but Chris H said it was lent to us in 2014 as a short term solution to the storage crisis Requested Delete right in /cngbdb/giga/ files and directories in Tencent Cloud for test purpose Reference ...

April 26, 2021 · 2 min · 415 words · Ken Cho

Learn, todo and done 19-23/4/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Todo - Project repo, doc Local Taverna Done - Project Get DOI from a list of Json return Todo #422 and fix also #272 Try to create pages for Data Type and Dataset Type Done Follow up Add-delete-button-#503 Minor update wordings in behat feature file Separate the file attribute value by comma ,, but Peter suggests better to show 1 file attribute value per each row Add-citation-box-#521 Display dropdown box only for published Dataset Minor update wordings in behat feature file Reference ...

April 19, 2021 · 1 min · 109 words · Ken Cho

Learn, todo and done 12-6/4/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Todo - Project repo, doc Local Taverna Try to create Publons review column and get the DOI for it Done - Project Local Taverna Parse the crossref json return and get the article DOI Pass in a list of url, and return a list of json Todo #529 #272, #204 Done Add-citation-box-#521 ...

April 12, 2021 · 1 min · 140 words · Ken Cho

Learn, todo and done 29/3-9/4/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Todo - Project repo, doc Done - Project Local Taverna Parse EM spreadsheet and extra information for Content to append column Make API request to crossref prototype Allow getting DOI for Publons review individually Todo Done #529 Add file attribute column in the AdminFile page relate to #272, which is to create tabs on help page for sample attributes and file attributes relate to #204 #422 There are a list of controlled vocabularies in help page, create pages for Dataset Type, File format and Data type relate to #272 Follow up PR Add-delete feature in adminFile page #503 Update scenario content, to make it more concise Change the File Attribute Id to File Attribute Value Notice Easter Holiday 1/4 - 6/4 ...

March 29, 2021 · 1 min · 149 words · Ken Cho

Learn, todo and done 22-26/3/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Todo - Project repo, doc Local Taverna Study Taverna Rest Service Could use beanshell to retrieve webapp Done - Project Update prototype Todo Add-additional-info-to-preview-#428 Pass unit test for FormattedDatasetLinkPreview Try to pass the acceptance test Done Add-delete-button-#457 Update the scenario Update the acceptance implementation to assert the actual attribute id /** * @Then I should see field :arg1 with value :arg2 */ public function iShouldSeeFieldWithValue($arg1, $arg2) { $row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s")', $arg1)); preg_match('/<td>[\d*\s]*<\/td>/', $row->getHtml(), $matches); $search = array("<td>", "</td>"); $actual_attribute_id = str_replace($search,"", $matches[0]); PHPUnit_Framework_Assert::assertEquals($arg2, $actual_attribute_id); } /** * @Then I should see field :arg1 without value :arg2 */ public function iShouldSeeFieldWithoutValue($arg1, $arg2) { $row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s")', $arg1)); preg_match('/<td>[\d*\s]*<\/td>/', $row->getHtml(), $matches); $search = array("<td>", "</td>"); $actual_attribute_id = str_replace($search,"", $matches[0]); PHPUnit_Framework_Assert::assertNotEquals($arg2, $actual_attribute_id); } Fix Undefined variable: attribute_id error by getting the attribute_id from FileAttribute table directly. <?php $sample_id = FileSample::model()->find('file_id=:file_id', array(':file_id'=>$model->id)); $attributes = FileAttributes::model()->findAll('file_id=:file_id', array(':file_id'=>$model->id)); if(isset($sample_id)) { $sample_name= Sample::model()->find('id=:id',array(':id'=>$sample_id->sample_id)); } $name="Not Set"; if(isset($sample_id)&&isset($sample_name)) { $name=$sample_name->name; } $attribute_id = ""; if(!empty($attributes)) { foreach ($attributes as $attribute) { $attribute_id .= $attribute->id . " "; } }else{ $attribute_id = "Not Set"; } $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=>array( 'id', 'dataset_id', 'name', 'location', 'extension', 'size', 'description', 'date_stamp', 'format_id', 'type_id', array( 'name'=>'Sample', 'value'=> $name, ), array( 'name'=>'FileAttributeID', 'value'=>$attribute_id, ) ), )); ?> Retrieve citation detail in text in dataset page Fix the dropdown box position Update the patterned library Reference ...

March 22, 2021 · 2 min · 243 words · Ken Cho