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

Learn, todo and done 15-19/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 link Todo Add-additional-info-to-preview-#428 Pass unit test for FormattedDatasetLinkPreview Try to pass the acceptance test Done BlockerRetrieve citation detail in text in dataset page Fix Text cross browser performance problem by changing it to <a></a> tag Pass the behat test by triggering onClick event. /** * @When /^I click "([^"]*)"$/ * To trigger onclick event */ public function iClick($arg1) { $element = $this->minkContext->getSession()->getPage()->find('css', "a[id='$arg1']" ); $element->click(); } Add-delete-button-#457 When press Save, it will return `Non-type error' To fix it by changing FindByAttribute to FindByPk in AdminFileController Add File Attribute Id row in adminFile/view/id to visualize <?php $sample_id = FileSample::model()->find('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)); $attributes = FileAttributes::model()->findAll('file_id=:file_id', array(':file_id'=>$sample_id->file_id)); } $name="Not Set"; if(isset($sample_id)&&isset($sample_name)) { $name=$sample_name->name; } if(isset($sample_id)&&isset($attributes)) { $attribute_id = ""; foreach ($attributes as $attribute) { $attribute_id .= $attribute->id." "; } } $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, ) ), )); ?> Show all file attributes, if more than one, into that row Implement two acceptance tests I should see field with value and I should see field without value /** * @Then I should see field :arg1 with value :arg2 */ public function iShouldSeeFieldWithValue($arg1, $arg2) { PHPUnit_Framework_Assert::assertNotNull( $row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s""$s")', $arg1, $arg2)) ); } /** * @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""$s")', $arg1, $arg2)); $value = preg_match('/<td>\d*\s<\/td>/', $row->getHtml()); PHPUnit_Framework_Assert::assertEquals(0, $value); } Reference ...

March 15, 2021 · 2 min · 284 words · Ken Cho

Learn, todo and done 8-12/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 Use REST service to return DOI Taverna image make the Dockerfile working Done - Project Mint DOI Interface/Prototype Todo Done Add-additional-info-to-preview-#428 Pass the unit tests for the StoredDataLinksPreview and CachedDatasetLinksPreview Retrieve citation detail in text in dataset page Dropdown Text display differently, cross browser performance problem. Reference

March 8, 2021 · 1 min · 73 words · Ken Cho