diff --git a/panopoly_test.info b/panopoly_test.info index 36fc560..f943cf5 100644 --- a/panopoly_test.info +++ b/panopoly_test.info @@ -92,6 +92,7 @@ features[variable][] = panelizer_node:panopoly_test_landing_page_default features[variable][] = panelizer_node:panopoly_test_page:page_manager_selection features[variable][] = panelizer_node:panopoly_test_page_allowed_layouts_default features[variable][] = panelizer_node:panopoly_test_page_allowed_types_default +features[views_view][] = panopoly_test_magic_allow_settings features[views_view][] = panopoly_test_magic_display_type features[views_view][] = panopoly_test_magic_view_modes features_exclude[dependencies][panopoly_pages] = panopoly_pages diff --git a/panopoly_test.views_default.inc b/panopoly_test.views_default.inc index dd09a40..e66a906 100644 --- a/panopoly_test.views_default.inc +++ b/panopoly_test.views_default.inc @@ -11,6 +11,74 @@ function panopoly_test_views_default_views() { $export = array(); $view = new view(); + $view->name = 'panopoly_test_magic_allow_settings'; + $view->description = ''; + $view->tag = 'default'; + $view->base_table = 'node'; + $view->human_name = 'Magic Allow Settings'; + $view->core = 7; + $view->api_version = '3.0'; + $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ + + /* Display: Master */ + $handler = $view->new_display('default', 'Master', 'default'); + $handler->display->display_options['use_more_always'] = TRUE; + $handler->display->display_options['access']['type'] = 'perm'; + $handler->display->display_options['cache']['type'] = 'none'; + $handler->display->display_options['query']['type'] = 'views_query'; + $handler->display->display_options['exposed_form']['type'] = 'basic'; + $handler->display->display_options['pager']['type'] = 'none'; + $handler->display->display_options['pager']['options']['offset'] = '0'; + $handler->display->display_options['style_plugin'] = 'default'; + $handler->display->display_options['row_plugin'] = 'fields'; + /* Field: Content: Title */ + $handler->display->display_options['fields']['title']['id'] = 'title'; + $handler->display->display_options['fields']['title']['table'] = 'node'; + $handler->display->display_options['fields']['title']['field'] = 'title'; + $handler->display->display_options['fields']['title']['label'] = ''; + $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE; + $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE; + /* Field: Content: Body */ + $handler->display->display_options['fields']['body']['id'] = 'body'; + $handler->display->display_options['fields']['body']['table'] = 'field_data_body'; + $handler->display->display_options['fields']['body']['field'] = 'body'; + /* Field: Field: Primary Image */ + $handler->display->display_options['fields']['field_featured_image']['id'] = 'field_featured_image'; + $handler->display->display_options['fields']['field_featured_image']['table'] = 'field_data_field_featured_image'; + $handler->display->display_options['fields']['field_featured_image']['field'] = 'field_featured_image'; + $handler->display->display_options['fields']['field_featured_image']['click_sort_column'] = 'fid'; + $handler->display->display_options['fields']['field_featured_image']['settings'] = array( + 'image_style' => '', + 'image_link' => '', + ); + /* Sort criterion: Content: Post date */ + $handler->display->display_options['sorts']['created']['id'] = 'created'; + $handler->display->display_options['sorts']['created']['table'] = 'node'; + $handler->display->display_options['sorts']['created']['field'] = 'created'; + $handler->display->display_options['sorts']['created']['order'] = 'DESC'; + /* Filter criterion: Content: Published */ + $handler->display->display_options['filters']['status']['id'] = 'status'; + $handler->display->display_options['filters']['status']['table'] = 'node'; + $handler->display->display_options['filters']['status']['field'] = 'status'; + $handler->display->display_options['filters']['status']['value'] = 1; + $handler->display->display_options['filters']['status']['group'] = 1; + $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE; + + /* Display: Allow settings */ + $handler = $view->new_display('panel_pane', 'Allow settings', 'panel_pane_1'); + $handler->display->display_options['allow']['use_pager'] = 'use_pager'; + $handler->display->display_options['allow']['items_per_page'] = 'items_per_page'; + $handler->display->display_options['allow']['offset'] = 'offset'; + $handler->display->display_options['allow']['link_to_view'] = 0; + $handler->display->display_options['allow']['more_link'] = 'more_link'; + $handler->display->display_options['allow']['path_override'] = 0; + $handler->display->display_options['allow']['title_override'] = 0; + $handler->display->display_options['allow']['exposed_form'] = 0; + $handler->display->display_options['allow']['fields_override'] = 0; + $handler->display->display_options['allow']['panopoly_magic_display_type'] = 0; + $export['panopoly_test_magic_allow_settings'] = $view; + + $view = new view(); $view->name = 'panopoly_test_magic_display_type'; $view->description = ''; $view->tag = 'default'; @@ -87,7 +155,6 @@ function panopoly_test_views_default_views() { $handler->display->display_options['allow']['panopoly_magic_display_type'] = 0; $export['panopoly_test_magic_display_type'] = $view; - $view = new view(); $view->name = 'panopoly_test_magic_view_modes'; $view->description = ''; diff --git a/tests/features/allow_settings.feature b/tests/features/allow_settings.feature new file mode 100644 index 0000000..6ac6fa3 --- /dev/null +++ b/tests/features/allow_settings.feature @@ -0,0 +1,21 @@ +Feature: Views content panes allow settings + In order to customize views content panes + As a site administrator + I need to enable pager and more link options for views content panes. + + @api @javascript @panopoly_magic + Scenario: Make sure that pager and more link settings are reflected correctly + Given I am logged in as a user with the "administrator" role + And I am viewing a landing page + When I customize this page with the Panels IPE + And I click "Add new pane" + And I click "View panes" in the "CTools modal" region + And I click "View: Magic Allow Settings: Allow settings" in the "CTools modal" region + Then I should see "Configure new View: Magic Allow Settings: Allow settings" + And I should see "Provide a \"more\" link" + And I should see "Use pager" + When I check "Provide a \"more\" link" + Then I should see "more" in the "Live preview" region + And I check "Use pager" + Then I should see "next ›" in the "Live preview" region + And I should see "last ›" in the "Live preview" region