Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/datastore/src/Form/DashboardForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ protected function buildResourceData(array $dist, bool $importable, string $post
[
'data' => [
'#theme' => 'datastore_dashboard_resource_cell',
'#uuid' => $dist['distribution_uuid'],
'#uuid' => $dist['resource_id'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter that the data property is still uuid?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well - depends what "matters" means 😄 . I did change that too at first but it required changing a lot more files, templates etc. I don't feel strongly though, if you think we should change the element/variable name too I can redo.

'#file_name' => basename((string) $dist['source_path']),
'#file_path' => UrlHostTokenResolver::resolve($dist['source_path']),
],
Expand Down
18 changes: 9 additions & 9 deletions modules/datastore/tests/src/Unit/Form/DashboardFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public function testBuildTableRowsWithUnsupportedResourceTypes() {
'distributions' => [
[
'distribution_uuid' => 'dist-1',
'resource_id' => '9ad17d45894f823c6a8e4f6d32b9535g',
'resource_id' => 'resource-1',
'resource_version' => '1679508886',
'fetcher_status' => 'waiting',
'fetcher_percent_done' => 0,
Expand All @@ -436,7 +436,7 @@ public function testBuildTableRowsWithUnsupportedResourceTypes() {
],
[
'distribution_uuid' => 'dist-2',
'resource_id' => '9ad17d45894f823c6a8e4f6d32b9535g',
'resource_id' => 'resource-2',
'resource_version' => '1679508886',
'fetcher_status' => 'waiting',
'fetcher_percent_done' => 0,
Expand Down Expand Up @@ -480,7 +480,7 @@ public function testBuildTableRowsWithUnsupportedResourceTypes() {
$this->assertEquals(2, count($form['table']['#rows']));

// Table uuid for first row is correct.
$this->assertEquals('dist-1', $form['table']['#rows'][0][3]['data']['#uuid']);
$this->assertEquals('resource-1', $form['table']['#rows'][0][3]['data']['#uuid']);
// First row has six columns.
$this->assertEquals(5, count($form['table']['#rows'][0]));
// Rowspan on first two columns.
Expand All @@ -496,8 +496,8 @@ public function testBuildTableRowsWithUnsupportedResourceTypes() {

// The second row has only four columns.
$this->assertEquals(4, count($form['table']['#rows'][1]));
// Table uuid for first second row is correct.
$this->assertEquals('dist-2', $form['table']['#rows'][1][0]['data']['#uuid']);
// Resource ID for first second row is correct.
$this->assertEquals('resource-2', $form['table']['#rows'][1][0]['data']['#uuid']);
// The second row fetch status is correct.
$this->assertEquals('waiting', $form["table"]["#rows"][1][1]["data"]["#status"]);
// The second row fetch class is correct.
Expand Down Expand Up @@ -527,7 +527,7 @@ public function testBuildTableRowsDatasetMultipleDistribution() {
'distributions' => [
[
'distribution_uuid' => 'dist-1',
'resource_id' => '9ad17d45894f823c6a8e4f6d32b9535g',
'resource_id' => 'resource-1',
'resource_version' => '1679508886',
'fetcher_status' => 'waiting',
'fetcher_percent_done' => 0,
Expand All @@ -539,7 +539,7 @@ public function testBuildTableRowsDatasetMultipleDistribution() {
],
[
'distribution_uuid' => 'dist-2',
'resource_id' => '9ad17d45894f823c6a8e4f6d32b9535g',
'resource_id' => 'resource-2',
'resource_version' => '1679508886',
'fetcher_status' => 'done',
'fetcher_percent_done' => 100,
Expand Down Expand Up @@ -585,8 +585,8 @@ public function testBuildTableRowsDatasetMultipleDistribution() {
// The second row has only three columns.
$this->assertEquals(4, count($form['table']['#rows'][1]));

$this->assertEquals('dist-1', $form['table']['#rows'][0][3]['data']['#uuid']);
$this->assertEquals('dist-2', $form['table']['#rows'][1][0]['data']['#uuid']);
$this->assertEquals('resource-1', $form['table']['#rows'][0][3]['data']['#uuid']);
$this->assertEquals('resource-2', $form['table']['#rows'][1][0]['data']['#uuid']);
$this->assertEquals('done', $form['table']['#rows'][0][6]['data']['#status']);
$this->assertEquals(NULL, $form['table']['#rows'][0][6]['data']['#error']);
}
Expand Down