diff --git a/config/optional/views.view.queue_jobs.yml b/config/optional/views.view.queue_jobs.yml index a7d823e..70858c7 100644 --- a/config/optional/views.view.queue_jobs.yml +++ b/config/optional/views.view.queue_jobs.yml @@ -284,7 +284,7 @@ display: relationship: none group_type: group admin_label: '' - label: 'Queue type' + label: 'Job type' exclude: false alter: alter_text: false @@ -325,8 +325,97 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - plugin_id: standard + plugin_id: advancedqueue_job_type + payload: + id: payload + table: advancedqueue + field: payload + relationship: none + group_type: group + admin_label: '' + label: Payload + 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: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + key: '' + plugin_id: json filters: + type: + id: type + table: advancedqueue + field: type + relationship: none + group_type: group + admin_label: '' + operator: in + value: { } + group: 1 + exposed: true + expose: + operator_id: type_op + label: 'Job type' + description: '' + use_operator: false + operator: type_op + identifier: type + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + plugin_id: in_operator state: id: state table: advancedqueue @@ -412,7 +501,18 @@ display: title: 'Queue jobs' header: { } footer: { } - empty: { } + empty: + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + relationship: none + group_type: group + admin_label: '' + empty: true + tokenize: false + content: 'No jobs found' + plugin_id: text_custom relationships: { } arguments: queue_id: @@ -455,6 +555,10 @@ display: break_phrase: false plugin_id: string display_extenders: { } + filter_groups: + operator: AND + groups: + 1: AND cache_metadata: max-age: 0 contexts: diff --git a/src/Plugin/views/field/Json.php b/src/Plugin/views/field/Json.php index af33984..74cafbf 100644 --- a/src/Plugin/views/field/Json.php +++ b/src/Plugin/views/field/Json.php @@ -40,7 +40,6 @@ class Json extends FieldPluginBase { ':input[name="options[format]"]' => ['value' => 'key'], ], ], - '#required' => TRUE, ]; } @@ -50,13 +49,17 @@ class Json extends FieldPluginBase { public function render(ResultRow $values) { $value = $values->{$this->field_alias}; + $decoded = (array) JsonDecoder::decode($value); if (!empty($this->options['key'])) { - $value = (array) JsonDecoder::decode($value); - if (isset($value[$this->options['key']])) { - return $this->sanitizeValue($value[$this->options['key']]); + if (isset($decoded[$this->options['key']])) { + return $this->sanitizeValue($decoded[$this->options['key']]); } return ''; } + else { + $decoded = (array) JsonDecoder::decode($value); + return $this->sanitizeValue(print_r($decoded, TRUE)); + } return $value; }