It should be good to have the possibility of creating a REST export when you create a new view in admin/structure/views/add

Actually we can create a Page and a Block but no a REST export.

Comments

pfrenssen’s picture

Assigned: Unassigned » pfrenssen
pfrenssen’s picture

Status: Active » Needs review
StatusFileSize
new9.83 KB
new6.3 KB

Here's an initial implementation. No tests yet.

There are two versions of the patch, one of which is ignoring whitespace changes. I had to indent a block of code, so this makes it a bit easier to review.

Status: Needs review » Needs work

The last submitted patch, 2: 2317085-2-views-quick_rest_export-ignore_whitespace.patch, failed testing.

pfrenssen’s picture

Assigned: pfrenssen » Unassigned
Status: Needs work » Needs review
StatusFileSize
new15.38 KB
new11.86 KB

Added a test. Added a second patch that ignores whitespace again to make it easier to review.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/views_ui/css/views_ui.admin.theme.css
@@ -337,7 +337,8 @@ th.views-ui-operations {
-.form-item-block-create label {
+.form-item-block-create label,
+.form-item-rest-export-create label {
   font-weight: bold;
 }

wow!

pfrenssen’s picture

Issue tags: +Drupalaton 2014
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +TCDrupal 2014
+++ b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
@@ -370,73 +370,113 @@ public function buildForm(array $form, FormStateInterface $form_state) {
+        '#title' => t('REST export settings'),
...
+        '#title' => t('Provide a REST API'),
...
+        '#title' => t('REST API path'),

REST export vs REST API - i think we should be consistent and always call this "REST export" since that chimes with what is already in views.

pfrenssen’s picture

Status: Needs work » Needs review
StatusFileSize
new15.4 KB
new11.87 KB
new2.52 KB

Good point, thanks!

dawehner’s picture

You could argue that it would be nice to use $this->t() instead of t() directly if we partly change this file already.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Manual tests worked fine, I don't consider #9 as a blocker given in which state that file is.

Thank for pieter!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 887eea4 and pushed to 8.0.x. Thanks!

  • alexpott committed 887eea4 on 8.0.x
    Issue #2317085 by pfrenssen | rteijeiro: Added the possibility to create...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.