Skip to content
Snippets Groups Projects
Commit bcfcca88 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

ISAICP-9282: Don't show reports on collection overview page.

parent 79892bdc
No related branches found
No related tags found
2 merge requests!205Update ephemeral with develop,!204Release 2.1.0
...@@ -119,6 +119,10 @@ Feature: Assessments ...@@ -119,6 +119,10 @@ Feature: Assessments
When I visit "/collection/assessments/manage-content" When I visit "/collection/assessments/manage-content"
Then I should not see "Assessment report" Then I should not see "Assessment report"
# Make sure assessment reports are not leaking in collection overview page.
When I visit "/collection/assessments"
Then I should not see "Assessment report #"
Given I mark all emails as read Given I mark all emails as read
And I am logged in as Regular And I am logged in as Regular
# After approval, the submission cannot be edite anymore. # After approval, the submission cannot be edite anymore.
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
declare(strict_types=1); declare(strict_types=1);
use Drupal\collection\Entity\CollectionInterface;
use Drupal\custom_page\Entity\CustomPageInterface; use Drupal\custom_page\Entity\CustomPageInterface;
use Drupal\joinup_assessment\AssessmentInterface; use Drupal\joinup_assessment\AssessmentInterface;
...@@ -64,3 +65,19 @@ function joinup_assessment_deploy_200100(): void { ...@@ -64,3 +65,19 @@ function joinup_assessment_deploy_200100(): void {
->set('field_paragraphs_body', [$layout, $block]) ->set('field_paragraphs_body', [$layout, $block])
->save(); ->save();
} }
/**
* Update 'Assessments' collection content listing.
*/
function joinup_assessment_deploy_200101(): void {
$collection = \Drupal::getContainer()->get('entity.repository')
->loadEntityByUuid('node', AssessmentInterface::GROUP_UUID);
if (!$collection instanceof CollectionInterface) {
throw new \RuntimeException("Can't load a collection with UUID '" . AssessmentInterface::GROUP_UUID . "'");
}
$listing = $collection->get('listing_content')->getValue();
$listing[0]['value']['query_presets'] = 'entity_bundle|assessment_report|<>';
$collection->set('listing_content', $listing);
$collection->skip_notification = TRUE;
$collection->save();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment