Skip to content

Commit

Permalink
Issue CollaboraOnline#52: Add view field links test.
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronGilMartinez committed Nov 14, 2024
1 parent 8f137ef commit 3f6e66d
Show file tree
Hide file tree
Showing 4 changed files with 436 additions and 2 deletions.
5 changes: 3 additions & 2 deletions collabora_online.views.inc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/**
* Implements hook_views_data_alter().
*/

function collabora_online_views_data_alter(array &$data) {
function collabora_online_views_data_alter(array &$data): void {
$data['media']['collabora_preview'] = [
'title' => t('Preview operation in collabora'),
'group' => t('Media'),
Expand Down
12 changes: 12 additions & 0 deletions config/schema/collabora_online.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ collabora_online.settings:
allowfullscreen:
type: boolean
label: 'Allow full-screen.'

views.field.media_collabora_preview:
type: views_field
label: 'Collabora preview link'
mapping:
text:
type: label
label: 'Text to display'

views.field.media_collabora_edit:
type: views.field.media_collabora_preview
label: 'Collabora edit link'
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
langcode: en
status: true
dependencies:
module:
- collabora_online
- media
- user
id: test_collabora_links
label: "Test collabora links"
module: views
description: ""
tag: ""
base_table: media_field_data
base_field: mid
display:
default:
id: default
display_title: Default
display_plugin: default
position: 0
display_options:
fields:
name:
id: name
table: media_field_data
field: name
relationship: none
group_type: group
admin_label: ""
entity_type: media
entity_field: media
plugin_id: field
label: ""
exclude: false
alter:
alter_text: false
make_link: false
absolute: false
word_boundary: false
ellipsis: false
strip_tags: false
trim: false
html: false
element_type: ""
element_class: ""
element_label_type: ""
element_label_class: ""
element_label_colon: true
element_wrapper_type: ""
element_wrapper_class: ""
element_default_classes: true
empty: ""
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: true
group_column: value
group_columns: {}
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ", "
field_api_classes: false
collabora_preview:
id: collabora_preview
table: media
field: collabora_preview
relationship: none
group_type: group
admin_label: ""
entity_type: media
plugin_id: media_collabora_preview
label: ""
exclude: false
alter:
alter_text: false
text: ""
make_link: false
path: ""
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ""
rel: ""
link_class: ""
prefix: ""
suffix: ""
target: ""
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ""
more_link_path: ""
strip_tags: false
trim: false
preserve_tags: ""
html: false
element_type: ""
element_class: ""
element_label_type: ""
element_label_class: ""
element_label_colon: false
element_wrapper_type: ""
element_wrapper_class: ""
element_default_classes: true
empty: ""
hide_empty: false
empty_zero: false
hide_alter_empty: true
text: "Preview in Collabora"
collabora_edit:
id: collabora_edit
table: media
field: collabora_edit
relationship: none
group_type: group
admin_label: ""
entity_type: media
plugin_id: media_collabora_edit
label: ""
exclude: false
alter:
alter_text: false
text: ""
make_link: false
path: ""
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ""
rel: ""
link_class: ""
prefix: ""
suffix: ""
target: ""
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ""
more_link_path: ""
strip_tags: false
trim: false
preserve_tags: ""
html: false
element_type: ""
element_class: ""
element_label_type: ""
element_label_class: ""
element_label_colon: false
element_wrapper_type: ""
element_wrapper_class: ""
element_default_classes: true
empty: ""
hide_empty: false
empty_zero: false
hide_alter_empty: true
text: "Edit in Collabora"
pager:
type: mini
options:
offset: 0
pagination_heading_level: h4
items_per_page: 10
total_pages: null
id: 0
tags:
next: ››
previous: ‹‹
expose:
items_per_page: false
items_per_page_label: "Items per page"
items_per_page_options: "5, 10, 25, 50"
items_per_page_options_all: false
items_per_page_options_all_label: "- All -"
offset: false
offset_label: Offset
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: "Sort by"
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
access:
type: perm
options:
perm: "view media"
cache:
type: tag
options: {}
empty: {}
sorts: {}
arguments: {}
filters:
status:
id: status
table: media_field_data
field: status
entity_type: media
entity_field: status
plugin_id: boolean
value: "1"
group: 1
expose:
operator: ""
style:
type: default
options:
grouping: {}
row_class: ""
default_row_class: true
uses_fields: false
row:
type: fields
options:
default_field_elements: true
inline: {}
separator: ""
hide_empty: false
query:
type: views_query
options:
query_comment: ""
disable_sql_rewrite: false
distinct: false
replica: false
query_tags: {}
relationships: {}
header: {}
footer: {}
display_extenders: {}
cache_metadata:
max-age: -1
contexts:
- "languages:language_content"
- "languages:language_interface"
- url.query_args
- user.permissions
tags: {}
page_1:
id: page_1
display_title: Page
display_plugin: page
position: 1
display_options:
display_extenders: {}
path: test_collabora_links
cache_metadata:
max-age: -1
contexts:
- "languages:language_content"
- "languages:language_interface"
- url.query_args
- user.permissions
tags: {}
Loading

0 comments on commit 3f6e66d

Please sign in to comment.