Popravi cas revizije pri novem predlogu, popravki view zadnje spremembe,

moderation info form
pull/60/head
Jurij Podgoršek 2024-04-21 19:29:06 +02:00
parent 5c6ad30005
commit f87710cecf
8 changed files with 310 additions and 91 deletions

View File

@ -73,3 +73,11 @@ V modulu [yufu_concept](web/modules/custom/yufu_concept/yufu_concept.info.yml "y
- ob novi publishani revizijami se poslje mail uporabniku, ki jo je naredil.
Funkcionalnost se nahaja v yufu_admin modulu.
# Debugging
Razvojne kontejnerja lahko zlistamo z ukazom `ddev status`
## Mejli
Mailhog za debagiranje vklopimo, kot priporoči zgornji ukaz: `ddev launch -m`

View File

@ -20,6 +20,7 @@
"drupal/cer": "^5.0@beta",
"drupal/config_ignore": "^3.1",
"drupal/content_as_config": "^1.0",
"drupal/content_moderation_info_block": "^2.0@beta",
"drupal/content_moderation_notifications": "^3.6",
"drupal/core-composer-scaffold": "^10.0",
"drupal/core-project-message": "^10.0",
@ -55,6 +56,9 @@
"patches": {
"drupal/restui": {
"#3337894: Get class methods wrong argument.": "https://www.drupal.org/files/issues/2023-06-23/type-error-class-3337894-10.patch"
},
"drupal/content_moderation_info_block": {
"#3185894: State Form Error": "https://www.drupal.org/files/issues/2023-10-11/3185894-state-form-error-12.patch"
}
},
"drupal-scaffold": {

47
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6fdae41d9930b076d636c871454e056b",
"content-hash": "6467965d60acc01165ed81a57e9cf9e9",
"packages": [
{
"name": "asm89/stack-cors",
@ -1726,6 +1726,50 @@
"issues": "https://www.drupal.org/project/issues/content_as_config"
}
},
{
"name": "drupal/content_moderation_info_block",
"version": "2.0.0-beta1",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/content_moderation_info_block.git",
"reference": "2.0.0-beta1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/content_moderation_info_block-2.0.0-beta1.zip",
"reference": "2.0.0-beta1",
"shasum": "ffa5c2bf822414fe5c2287f49b1014861d6effc4"
},
"require": {
"drupal/core": "^9 || ^10"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "2.0.0-beta1",
"datestamp": "1695972016",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "rp7",
"homepage": "https://www.drupal.org/user/219330"
}
],
"description": "Provides a block that displays content moderation related info.",
"homepage": "https://www.drupal.org/project/content_moderation_info_block",
"support": {
"source": "https://git.drupalcode.org/project/content_moderation_info_block"
}
},
{
"name": "drupal/content_moderation_notifications",
"version": "3.6.0",
@ -7486,6 +7530,7 @@
"minimum-stability": "dev",
"stability-flags": {
"drupal/cer": 10,
"drupal/content_moderation_info_block": 10,
"drupal/gin": 5,
"drupal/gin_toolbar": 5,
"drupal/yaml_content": 20

View File

@ -0,0 +1,28 @@
uuid: 882a1fb8-dba5-4370-b1c4-fb8b5d46db4c
langcode: en
status: true
dependencies:
module:
- content_moderation_info_block
theme:
- olivero
id: olivero_moderationinfocontent
theme: olivero
region: content
weight: 0
provider: null
plugin: 'content_moderation_info_block:node'
settings:
id: 'content_moderation_info_block:node'
label: 'Moderation info (Content)'
label_display: visible
provider: content_moderation_info_block
context_mapping:
entity: '@node.node_route_context:node'
changed_date_display: true
author_display: true
latest_revision_display: true
current_state_display: true
change_state_display: true
revision_log_message_input_display: false
visibility: { }

View File

@ -11,7 +11,7 @@ roles:
author: true
site_mail: false
emails: ''
subject: '[YUFU] Changes approved'
subject: '[YUFU] Changes approved: [node:title]'
body:
value: 'Proposed changes to [node:title] ([node:url]) by [node:author:mail] were approved.'
format: plain_text

View File

@ -14,6 +14,7 @@ module:
config_translation: 0
content_as_config: 0
content_moderation: 0
content_moderation_info_block: 0
content_moderation_notifications: 0
contextual: 0
datetime: 0

View File

@ -24,17 +24,17 @@ display:
display_options:
title: 'Zadnje spremembe'
fields:
changed:
id: changed
title:
id: title
table: node_field_revision
field: changed
field: title
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: changed
entity_field: title
plugin_id: field
label: Čas
label: Pojem
exclude: false
alter:
alter_text: false
@ -76,21 +76,9 @@ display:
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: timestamp
type: string
settings:
date_format: medium
custom_date_format: ''
timezone: ''
tooltip:
date_format: ''
custom_date_format: ''
time_diff:
enabled: false
future_format: '@interval hence'
past_format: '@interval ago'
granularity: 2
refresh: 60
description: ''
link_to_entity: true
group_column: value
group_columns: { }
group_rows: true
@ -164,71 +152,6 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
title:
id: title
table: node_field_revision
field: title
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: title
plugin_id: field
label: Pojem
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: false
ellipsis: false
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
click_sort_column: value
type: string
settings:
link_to_entity: false
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
revision_uid:
id: revision_uid
table: node_revision
@ -294,6 +217,215 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
revision_timestamp:
id: revision_timestamp
table: node_revision
field: revision_timestamp
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: revision_timestamp
plugin_id: field
label: 'Revision create time'
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
click_sort_column: value
type: timestamp
settings:
date_format: short
custom_date_format: ''
timezone: ''
tooltip:
date_format: long
custom_date_format: ''
time_diff:
enabled: false
future_format: '@interval hence'
past_format: '@interval ago'
granularity: 2
refresh: 60
description: ''
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
vid_1:
id: vid_1
table: node_field_revision
field: vid
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: vid
plugin_id: field
label: rID
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
click_sort_column: value
type: number_integer
settings:
thousand_separator: ''
prefix_suffix: 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
nid:
id: nid
table: node_field_revision
field: nid
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: nid
plugin_id: field
label: nID
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
click_sort_column: value
type: number_integer
settings:
thousand_separator: ''
prefix_suffix: 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
pager:
type: mini
options:
@ -331,15 +463,15 @@ display:
options: { }
empty: { }
sorts:
changed:
id: changed
table: node_field_revision
field: changed
revision_timestamp:
id: revision_timestamp
table: node_revision
field: revision_timestamp
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: changed
entity_field: revision_timestamp
plugin_id: date
order: DESC
expose:

View File

@ -121,6 +121,7 @@ class AddConcept extends ResourceBase {
// Concept exists - create a new revision.
$concept->setNewRevision(TRUE);
$concept->setRevisionUserId($uid);
$concept->setRevisionCreationTime(\Drupal::time()->getRequestTime());
$concept->set('title', $data['title']);
$concept->set('body', $data['text'] ?? $concept->body->value);
if ($uid) {