Compare commits
64 Commits
migration
...
full_respo
Author | SHA1 | Date | |
---|---|---|---|
70b36d9f55 | |||
5fb69e008d | |||
d72e102cc5 | |||
2f1636dfd4 | |||
d170979b42 | |||
5df8c9829a | |||
1733ad128a | |||
f6130faa7c | |||
63fdc0061f | |||
89286d2610 | |||
4d1299387a | |||
8cb32b1b48 | |||
c9edaaf3c4 | |||
5188b01272 | |||
b4ebb1cf3f | |||
e7a773dc0f | |||
5ffacc45ed | |||
1862f2922e | |||
50f76ff0cd | |||
406d215a04 | |||
d553146450 | |||
8964b94b9f | |||
9bae6d15ff | |||
ce1beb7278 | |||
ec6ab0dc7b | |||
88445b4397 | |||
df71378e5f | |||
e0f8b123f9 | |||
fbf509a005 | |||
4894f88c6d | |||
98002d0296 | |||
637b1d9bf0 | |||
b992c1c667 | |||
5ec39a5f0a | |||
8af88af806 | |||
bc48c9e876 | |||
86670565ba | |||
c5c3da9a46 | |||
e29bed914c | |||
a1bff5d4b8 | |||
f89c29a8b9 | |||
1ec8a371b5 | |||
d1e54b72b3 | |||
b7459cf014 | |||
488447fbe1 | |||
d4957ad19a | |||
88f7b8c285 | |||
7e460b9764 | |||
30b2c9267b | |||
ee908b4603 | |||
8dadb8d3a5 | |||
651315c319 | |||
820bfcf85a | |||
596525328c | |||
ee81e5fe18 | |||
c7ce594ee4 | |||
e0bb0d378a | |||
5383719450 | |||
284037ad69 | |||
b6c6851837 | |||
6485e3e27b | |||
72ea56e313 | |||
c767654dc6 | |||
11f6848d59 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,6 +28,7 @@
|
||||
node_modules/
|
||||
|
||||
*.patch
|
||||
~/patches/*.patch
|
||||
/.csslintrc
|
||||
/.eslintrc.json
|
||||
/.ht.router.php
|
||||
|
@ -59,6 +59,16 @@ module.exports = {
|
||||
test: /\.(graphql|gql)$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'graphql-tag/loader'
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
use: {
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
}
|
||||
// {
|
||||
// test: /\.graphql?$/,
|
||||
@ -92,15 +102,6 @@ module.exports = {
|
||||
// name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
// }
|
||||
// }
|
||||
// }, {
|
||||
// test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
// use: {
|
||||
// loader: 'url-loader',
|
||||
// options: {
|
||||
// limit: 10000,
|
||||
// name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// test: /\.css$/,
|
||||
|
@ -12,26 +12,28 @@ module.exports = merge(baseConfig, {
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
// process.env.NODE_ENV !== 'production'
|
||||
// ? 'vue-style-loader'
|
||||
// : MiniCssExtractPlugin.loader,
|
||||
MiniCssExtractPlugin.loader,
|
||||
// 'vue-style-loader',
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: '',
|
||||
},
|
||||
},
|
||||
'css-loader'
|
||||
]
|
||||
}, {
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
// process.env.NODE_ENV !== 'production'
|
||||
// ? 'vue-style-loader'
|
||||
// : MiniCssExtractPlugin.loader,
|
||||
MiniCssExtractPlugin.loader,
|
||||
// 'vue-style-loader',
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: '',
|
||||
},
|
||||
},
|
||||
'css-loader',
|
||||
'sass-loader'
|
||||
]
|
||||
}, {
|
||||
test: /\.(png|jpg|gif)$/,
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
|
@ -13,18 +13,28 @@ module.exports = merge(baseConfig, {
|
||||
{
|
||||
test: /\.css?$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: '',
|
||||
},
|
||||
},
|
||||
'css-loader'
|
||||
]
|
||||
}, {
|
||||
test: /\.scss?$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: '',
|
||||
},
|
||||
},
|
||||
'css-loader',
|
||||
'sass-loader'
|
||||
]
|
||||
}, {
|
||||
test: /\.(png|jpg|gif)$/,
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
|
@ -66,7 +66,9 @@
|
||||
"drupal/payment_commerce": "2.x-dev@dev",
|
||||
"drupal/permissions_filter": "^1.1",
|
||||
"drupal/printable": "^2.0",
|
||||
"drupal/pwa": "^1.5",
|
||||
"drupal/recurring_period": "^1.0",
|
||||
"drupal/redis": "^1.5",
|
||||
"drupal/restui": "^1.16",
|
||||
"drupal/search_api": "^1.19",
|
||||
"drupal/search_api_autocomplete": "^1.2",
|
||||
@ -74,6 +76,7 @@
|
||||
"drupal/search_api_solr": "^4.1",
|
||||
"drupal/select_translation": "^1.x-dev",
|
||||
"drupal/simplenews": "^1.x-dev",
|
||||
"drupal/social_media_links": "^2.8",
|
||||
"drupal/string_translation_ui": "^1.2",
|
||||
"drupal/strings_i18n_json_export": "1.x-dev@dev",
|
||||
"drupal/subrequests": "^2.0",
|
||||
@ -82,7 +85,9 @@
|
||||
"drupal/translate_side_by_side": "^1.x-dev",
|
||||
"drupal/translation_views": "^1.x-dev",
|
||||
"drupal/ultimate_cron": "^2.x-dev",
|
||||
"drupal/unique_content_field_validation": "^1.0",
|
||||
"drupal/url_to_video_filter": "^2.0",
|
||||
"drupal/user_email_verification": "1.x-dev@dev",
|
||||
"drupal/views_conditional": "^1.x-dev",
|
||||
"drupal/views_ef_fieldset": "^1.5",
|
||||
"drush/drush": "^9",
|
||||
@ -154,7 +159,9 @@
|
||||
"patches": {
|
||||
"drupal/core": {
|
||||
"migrate_drupal getsetting on null" : "https://www.drupal.org/files/issues/2019-02-13/migrate_drupal-getsetting_on_null.patch",
|
||||
"language negociation exeption https://www.drupal.org/project/drupal/issues/3134349" : "https://www.drupal.org/files/issues/2020-06-02/3134349-9.patch"
|
||||
"language negociation exeption https://www.drupal.org/project/drupal/issues/3134349" : "https://www.drupal.org/files/issues/2020-06-02/3134349-9.patch",
|
||||
"Cannot save translated nodes after upgrading to 8.8 due to invalid path https://www.drupal.org/project/drupal/issues/3101344":"https://www.drupal.org/files/issues/2021-03-01/3101344-drupal-core-fix-permissions-checking-while-node-translating-64.patch",
|
||||
"ConfigImporter->checkOp() https://www.drupal.org/project/drupal/issues/3198715": "https://www.drupal.org/files/issues/2021-02-16/error-running-config-import-delete-on-null-3198715-3.patch"
|
||||
},
|
||||
"drupal/email_registration": {
|
||||
"allow email login through REST https://www.drupal.org/project/email_registration/issues/2856542": "https://www.drupal.org/files/issues/allow_authentication-2856542-3.patch"
|
||||
@ -175,6 +182,12 @@
|
||||
"drupal/flag_lists": {
|
||||
"make the related_flag id unique https://www.drupal.org/project/flag_lists/issues/3200737": "https://www.drupal.org/files/issues/2021-02-27/hasactions%2Buniqflagid.patch",
|
||||
"check for flag before delete https://www.drupal.org/project/flag_lists/issues/3200997":"https://www.drupal.org/files/issues/2021-03-01/delete-missing-flag_0.patch"
|
||||
},
|
||||
"drupal/graphql": {
|
||||
"Invalid translation language https://github.com/drupal-graphql/graphql/issues/1175": "./patches/graphql-fix-invalid-translation-language.patch"
|
||||
},
|
||||
"drupal/unique_content_field_validation": {
|
||||
"Do not validate against empty fields https://www.drupal.org/project/unique_content_field_validation/issues/3201576": "https://www.drupal.org/files/issues/2021-03-04/unique_validation-empty_field.patch"
|
||||
}
|
||||
},
|
||||
"drupal-scaffold": {
|
||||
|
1104
composer.lock
generated
1104
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -5,4 +5,6 @@ error_handlers:
|
||||
rebuild_theme: false
|
||||
debug_mail_file_format: '%to-%subject-%datetime.mail.txt'
|
||||
debug_mail_directory: 'temporary://devel-mails'
|
||||
devel_dumper: default
|
||||
devel_dumper: kint
|
||||
debug_logfile: 'temporary://drupal_debug.txt'
|
||||
debug_pre: false
|
||||
|
@ -1,3 +1,3 @@
|
||||
enabled: false
|
||||
timeout: null
|
||||
url: ''
|
||||
timeout: 60
|
||||
url: /
|
||||
|
@ -1,3 +1,3 @@
|
||||
enabled: false
|
||||
timeout: null
|
||||
url: ''
|
||||
timeout: 60
|
||||
url: /
|
||||
|
@ -9,7 +9,7 @@ inactivity_message: ''
|
||||
enforce_admin: false
|
||||
jstimer_format: '%hours%:%mins%:%secs%'
|
||||
jstimer_js_load_option: false
|
||||
use_alt_logout_method: false
|
||||
use_alt_logout_method: true
|
||||
use_watchdog: true
|
||||
langcode: fr
|
||||
_core:
|
||||
|
@ -11,7 +11,7 @@ dependencies:
|
||||
id: header
|
||||
theme: materiotheme
|
||||
region: header_right
|
||||
weight: -1
|
||||
weight: -2
|
||||
provider: null
|
||||
plugin: 'menu_block:header'
|
||||
settings:
|
||||
|
@ -9,12 +9,12 @@ dependencies:
|
||||
id: languageswitcher
|
||||
theme: materiotheme
|
||||
region: header_right
|
||||
weight: 0
|
||||
weight: -1
|
||||
provider: null
|
||||
plugin: 'language_block:language_interface'
|
||||
settings:
|
||||
id: 'language_block:language_interface'
|
||||
label: Language
|
||||
label: Langue
|
||||
provider: language
|
||||
label_display: visible
|
||||
visibility: { }
|
||||
|
140
config/sync/block.block.socialmedialinks.yml
Normal file
140
config/sync/block.block.socialmedialinks.yml
Normal file
@ -0,0 +1,140 @@
|
||||
uuid: f3053235-8080-4c5a-b6df-800f3c16eaac
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- context
|
||||
- social_media_links
|
||||
theme:
|
||||
- materiotheme
|
||||
id: socialmedialinks
|
||||
theme: materiotheme
|
||||
region: header_right
|
||||
weight: -5
|
||||
provider: null
|
||||
plugin: social_media_links_block
|
||||
settings:
|
||||
id: social_media_links_block
|
||||
label: 'Social Media Links'
|
||||
provider: social_media_links
|
||||
label_display: '0'
|
||||
platforms:
|
||||
website:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-10'
|
||||
instagram:
|
||||
value: materio_fr
|
||||
description: ''
|
||||
weight: '-9'
|
||||
xing:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-8'
|
||||
contact:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-7'
|
||||
rss:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-6'
|
||||
bitbucket:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-5'
|
||||
vkontakte:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-4'
|
||||
slideshare:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-3'
|
||||
github:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-2'
|
||||
behance:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '-1'
|
||||
vimeo:
|
||||
value: materio
|
||||
description: ''
|
||||
weight: '0'
|
||||
linkedin:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '1'
|
||||
youtube_channel:
|
||||
value: UChKuhMq9rSfLqUmPc9dEgXw
|
||||
description: ''
|
||||
weight: '2'
|
||||
googleplus:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '3'
|
||||
facebook:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '4'
|
||||
drupal:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '5'
|
||||
flickr:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '6'
|
||||
gitlab:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '7'
|
||||
tumblr:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '8'
|
||||
youtube:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '9'
|
||||
pinterest:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '10'
|
||||
email:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '11'
|
||||
twitter:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '12'
|
||||
whatsapp:
|
||||
value: ''
|
||||
description: ''
|
||||
weight: '13'
|
||||
appearance:
|
||||
orientation: h
|
||||
show_name: 0
|
||||
suggestion: ''
|
||||
link_attributes:
|
||||
target: _blank
|
||||
rel: nofollow
|
||||
iconset:
|
||||
style: 'fontawesome:fw'
|
||||
installed_iconsets:
|
||||
fontawesome:
|
||||
examples: ''
|
||||
visibility:
|
||||
view_inclusion:
|
||||
id: view_inclusion
|
||||
negate: null
|
||||
view_inclusion: { }
|
||||
context_mapping: { }
|
||||
request_path_exclusion:
|
||||
id: request_path_exclusion
|
||||
pages: ''
|
||||
negate: null
|
||||
context_mapping: { }
|
@ -10,7 +10,7 @@ dependencies:
|
||||
id: userblock
|
||||
theme: materiotheme
|
||||
region: header_right
|
||||
weight: -2
|
||||
weight: -3
|
||||
provider: null
|
||||
plugin: user_block
|
||||
settings:
|
||||
|
@ -9,12 +9,12 @@ dependencies:
|
||||
id: userlogin
|
||||
theme: materiotheme
|
||||
region: header_right
|
||||
weight: -3
|
||||
weight: -4
|
||||
provider: null
|
||||
plugin: user_login_block
|
||||
settings:
|
||||
id: user_login_block
|
||||
label: 'Member Access'
|
||||
label: 'Accès membre'
|
||||
provider: user
|
||||
label_display: visible
|
||||
visibility: { }
|
||||
|
@ -0,0 +1,20 @@
|
||||
uuid: 4c4d32da-e167-4429-a6a8-e64919f1fd4d
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- commerce_promotion
|
||||
id: commerce_promotion.commerce_promotion.description
|
||||
field_name: description
|
||||
entity_type: commerce_promotion
|
||||
bundle: commerce_promotion
|
||||
label: Description
|
||||
description: 'Additional information about the promotion to show to the customer'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value:
|
||||
-
|
||||
value: ''
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: string_long
|
@ -0,0 +1,18 @@
|
||||
uuid: 12d95ee0-8fd9-4dd7-8646-4bd9b9e7f3ec
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- commerce_promotion
|
||||
id: commerce_promotion.commerce_promotion.display_name
|
||||
field_name: display_name
|
||||
entity_type: commerce_promotion
|
||||
bundle: commerce_promotion
|
||||
label: 'Nom de l''affichage'
|
||||
description: 'If provided, shown on the order instead of "Discount".'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: string
|
@ -0,0 +1,18 @@
|
||||
uuid: 4ff81977-7ace-494e-8561-8780f3621fac
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- commerce_promotion
|
||||
id: commerce_promotion.commerce_promotion.name
|
||||
field_name: name
|
||||
entity_type: commerce_promotion
|
||||
bundle: commerce_promotion
|
||||
label: Nom
|
||||
description: 'The promotion name.'
|
||||
required: true
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: string
|
@ -0,0 +1,20 @@
|
||||
uuid: ac9a43ee-8971-4ee3-9c49-77b678bad732
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- commerce_store.commerce_store_type.online
|
||||
id: commerce_store.online.uid
|
||||
field_name: uid
|
||||
entity_type: commerce_store
|
||||
bundle: online
|
||||
label: Propriétaire
|
||||
description: 'The store owner.'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: 'Drupal\commerce_store\Entity\Store::getDefaultEntityOwner'
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
@ -0,0 +1,20 @@
|
||||
uuid: 707b2946-6937-4a85-8b0f-396f57489133
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- flag_lists
|
||||
id: flag_list_item.flag_list_item.user_id
|
||||
field_name: user_id
|
||||
entity_type: flag_list_item
|
||||
bundle: flag_list_item
|
||||
label: 'Écrit par'
|
||||
description: 'The user ID of author of the Flag list item entity.'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
@ -0,0 +1,20 @@
|
||||
uuid: 836a8431-ec09-4de1-9cd4-817f7f3a3300
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- flag_lists.flagging_collection_type.flagging_collection_type_1
|
||||
id: flagging_collection.flagging_collection_type_1.relatedflag
|
||||
field_name: relatedflag
|
||||
entity_type: flagging_collection
|
||||
bundle: flagging_collection_type_1
|
||||
label: 'Related flag'
|
||||
description: 'The related flag used for for this list'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
@ -0,0 +1,20 @@
|
||||
uuid: 3609dd9c-85eb-4dc4-b4da-e48836e465a5
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- flag_lists.flagging_collection_type.flagging_collection_type_1
|
||||
id: flagging_collection.flagging_collection_type_1.templateflag
|
||||
field_name: templateflag
|
||||
entity_type: flagging_collection
|
||||
bundle: flagging_collection_type_1
|
||||
label: 'Base flag'
|
||||
description: 'The flag list used as base'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
@ -0,0 +1,20 @@
|
||||
uuid: aa598ce7-ab62-4640-9873-67b0fe7c8053
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- flag_lists.flagging_collection_type.flagging_collection_type_1
|
||||
id: flagging_collection.flagging_collection_type_1.user_id
|
||||
field_name: user_id
|
||||
entity_type: flagging_collection
|
||||
bundle: flagging_collection_type_1
|
||||
label: 'Écrit par'
|
||||
description: 'The user ID of author of the Flagging collection entity.'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
@ -11,7 +11,7 @@ bundle: article
|
||||
label: Title
|
||||
description: ''
|
||||
required: true
|
||||
translatable: false
|
||||
translatable: true
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
|
18
config/sync/core.base_field_override.node.note.changed.yml
Normal file
18
config/sync/core.base_field_override.node.note.changed.yml
Normal file
@ -0,0 +1,18 @@
|
||||
uuid: 3b80477e-49b4-4a1d-9165-d85ad36cda6e
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.changed
|
||||
field_name: changed
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: Modifié
|
||||
description: 'Le moment auquel le nœud a été modifié pour la dernière fois.'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: changed
|
18
config/sync/core.base_field_override.node.note.created.yml
Normal file
18
config/sync/core.base_field_override.node.note.created.yml
Normal file
@ -0,0 +1,18 @@
|
||||
uuid: f4eed5e6-7ec6-4991-92be-092087488907
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.created
|
||||
field_name: created
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: 'Écrit le'
|
||||
description: 'L''heure à laquelle le nœud a été créé.'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: created
|
20
config/sync/core.base_field_override.node.note.menu_link.yml
Normal file
20
config/sync/core.base_field_override.node.note.menu_link.yml
Normal file
@ -0,0 +1,20 @@
|
||||
uuid: e5a701d1-82a0-4c3b-8a5f-70e6fe74f236
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.menu_link
|
||||
field_name: menu_link
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: 'Lien du menu'
|
||||
description: 'Lien de menu calculé pour le nœud (disponible uniquement pendant l''enregistrement du nœud).'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
20
config/sync/core.base_field_override.node.note.path.yml
Normal file
20
config/sync/core.base_field_override.node.note.path.yml
Normal file
@ -0,0 +1,20 @@
|
||||
uuid: 70429bd7-83c2-4142-9afd-7038d65737e4
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
module:
|
||||
- path
|
||||
id: node.note.path
|
||||
field_name: path
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: 'Alias d''URL'
|
||||
description: ''
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: path
|
@ -11,7 +11,7 @@ bundle: note
|
||||
label: 'Promu en page d''accueil'
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
translatable: false
|
||||
default_value:
|
||||
-
|
||||
value: 0
|
||||
|
22
config/sync/core.base_field_override.node.note.status.yml
Normal file
22
config/sync/core.base_field_override.node.note.status.yml
Normal file
@ -0,0 +1,22 @@
|
||||
uuid: e0ae92d3-b724-419e-a7ba-d1c4fbe4fdb3
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.status
|
||||
field_name: status
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: Publié
|
||||
description: ''
|
||||
required: false
|
||||
translatable: false
|
||||
default_value:
|
||||
-
|
||||
value: 1
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
on_label: Activé
|
||||
off_label: Désactivé
|
||||
field_type: boolean
|
22
config/sync/core.base_field_override.node.note.sticky.yml
Normal file
22
config/sync/core.base_field_override.node.note.sticky.yml
Normal file
@ -0,0 +1,22 @@
|
||||
uuid: 19fa2240-8974-4c93-91d6-76391f11fb43
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.sticky
|
||||
field_name: sticky
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: 'Epinglé en haut des listes'
|
||||
description: ''
|
||||
required: false
|
||||
translatable: false
|
||||
default_value:
|
||||
-
|
||||
value: 0
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
on_label: Activé
|
||||
off_label: Désactivé
|
||||
field_type: boolean
|
18
config/sync/core.base_field_override.node.note.title.yml
Normal file
18
config/sync/core.base_field_override.node.note.title.yml
Normal file
@ -0,0 +1,18 @@
|
||||
uuid: ed044201-dbd5-4b0f-a092-65eb12e699fc
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.title
|
||||
field_name: title
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: Titre
|
||||
description: ''
|
||||
required: true
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: string
|
20
config/sync/core.base_field_override.node.note.uid.yml
Normal file
20
config/sync/core.base_field_override.node.note.uid.yml
Normal file
@ -0,0 +1,20 @@
|
||||
uuid: c4e1fa5b-1fcc-4a06-bc89-df7f3c5b6257
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
id: node.note.uid
|
||||
field_name: uid
|
||||
entity_type: node
|
||||
bundle: note
|
||||
label: 'Écrit par'
|
||||
description: 'Le nom d''utilisateur de l''auteur du contenu.'
|
||||
required: false
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: 'Drupal\node\Entity\Node::getDefaultEntityOwner'
|
||||
settings:
|
||||
handler: default
|
||||
handler_settings: { }
|
||||
field_type: entity_reference
|
@ -11,7 +11,7 @@ bundle: thematique
|
||||
label: Title
|
||||
description: ''
|
||||
required: true
|
||||
translatable: false
|
||||
translatable: true
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
|
@ -23,7 +23,6 @@ third_party_settings:
|
||||
children:
|
||||
- group_content
|
||||
- group_media
|
||||
- group_internal
|
||||
- group_taxonomy
|
||||
- group_links
|
||||
parent_name: ''
|
||||
@ -93,29 +92,29 @@ third_party_settings:
|
||||
formatter: closed
|
||||
required_fields: true
|
||||
label: Links
|
||||
group_internal:
|
||||
group_sidebar:
|
||||
children:
|
||||
- field_memo
|
||||
- uid
|
||||
- status
|
||||
- langcode
|
||||
- created
|
||||
- flag
|
||||
- promote
|
||||
- sticky
|
||||
- path
|
||||
- url_redirects
|
||||
- field_memo
|
||||
parent_name: group_htabs
|
||||
weight: 21
|
||||
format_type: tab
|
||||
parent_name: ''
|
||||
weight: 20
|
||||
format_type: details_sidebar
|
||||
region: hidden
|
||||
format_settings:
|
||||
description: ''
|
||||
open: true
|
||||
weight: 0
|
||||
required_fields: true
|
||||
id: ''
|
||||
classes: ''
|
||||
description: ''
|
||||
formatter: closed
|
||||
required_fields: true
|
||||
label: Internal
|
||||
label: internal
|
||||
id: node.thematique.default
|
||||
targetEntityType: node
|
||||
bundle: thematique
|
||||
@ -198,10 +197,10 @@ content:
|
||||
third_party_settings: { }
|
||||
langcode:
|
||||
type: language_select
|
||||
weight: 22
|
||||
weight: 0
|
||||
region: content
|
||||
settings:
|
||||
include_locked: true
|
||||
include_locked: false
|
||||
third_party_settings: { }
|
||||
path:
|
||||
type: path
|
||||
@ -238,6 +237,11 @@ content:
|
||||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
translation:
|
||||
weight: 10
|
||||
region: content
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
uid:
|
||||
type: entity_reference_autocomplete
|
||||
weight: 20
|
||||
|
@ -92,6 +92,7 @@ module:
|
||||
image_delta_formatter: 0
|
||||
image_effects: 0
|
||||
imagemagick: 0
|
||||
images_styles_gen: 0
|
||||
inline_entity_form: 0
|
||||
interval: 0
|
||||
jquery_ui: 0
|
||||
@ -143,11 +144,11 @@ module:
|
||||
pathologic: 0
|
||||
pdf_api: 0
|
||||
permissions_filter: 0
|
||||
persistent_login: 0
|
||||
plugin: 0
|
||||
printable: 0
|
||||
printable_pdf: 0
|
||||
profile: 0
|
||||
pwa: 0
|
||||
recurring_period: 0
|
||||
redirect: 0
|
||||
redis: 0
|
||||
@ -163,6 +164,7 @@ module:
|
||||
simplenews: 0
|
||||
smart_trim: 0
|
||||
smtp: 0
|
||||
social_media_links: 0
|
||||
sophron: 0
|
||||
state_machine: 0
|
||||
string_translation_ui: 0
|
||||
@ -182,9 +184,11 @@ module:
|
||||
translation_views: 0
|
||||
typed_data: 0
|
||||
ultimate_cron: 0
|
||||
unique_content_field_validation: 0
|
||||
update: 0
|
||||
url_to_video_filter: 0
|
||||
user: 0
|
||||
user_email_verification: 0
|
||||
video_embed_field: 0
|
||||
video_embed_wysiwyg: 0
|
||||
views_bulk_edit: 0
|
||||
|
@ -1,3 +1,51 @@
|
||||
definitions: { }
|
||||
definitions:
|
||||
editors_menus__materials:
|
||||
weight: -50
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
enabled: true
|
||||
expanded: false
|
||||
editors_menus__articles:
|
||||
weight: -48
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
editors_menus__thesaurus:
|
||||
weight: -47
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
editors_menus__tags:
|
||||
weight: -46
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
editors_menus__assisted_research:
|
||||
weight: -45
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
editors_menus__companies:
|
||||
weight: -44
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
editors_menus__showrooms:
|
||||
weight: -43
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
editors_menus__newsletters:
|
||||
weight: -42
|
||||
menu_name: editors
|
||||
parent: editors_menus.contents
|
||||
expanded: false
|
||||
enabled: true
|
||||
_core:
|
||||
default_config_hash: jdY7AU0tU-QsjmiOw3W8vwpYMb-By--_MSFgbqKUTYM
|
||||
|
@ -10,10 +10,18 @@ extlink_include: ''
|
||||
extlink_class: ext
|
||||
extlink_label: '(link is external)'
|
||||
extlink_img_class: false
|
||||
extlink_css_exclude: ''
|
||||
extlink_css_exclude: .social-media-links--platforms
|
||||
extlink_css_explicit: ''
|
||||
extlink_mailto_class: mailto
|
||||
extlink_mailto_label: '(link sends email)'
|
||||
_core:
|
||||
default_config_hash: rHbHZIIF9TP3H2Vs37uCHz4Gm4phULg0rQ_OKihxJfM
|
||||
extlink_exclude_admin_routes: false
|
||||
extlink_use_external_js_file: false
|
||||
extlink_noreferrer: false
|
||||
extlink_use_font_awesome: false
|
||||
extlink_icon_placement: '0'
|
||||
extlink_font_awesome_classes:
|
||||
links: 'fa fa-external-link'
|
||||
mailto: 'fa fa-envelope-o'
|
||||
whitelisted_domains: { }
|
||||
|
@ -6,6 +6,14 @@ dependencies:
|
||||
- field.storage.node.field_linked_articles
|
||||
- node.type.article
|
||||
- node.type.materiau
|
||||
module:
|
||||
- unique_content_field_validation
|
||||
third_party_settings:
|
||||
unique_content_field_validation:
|
||||
unique: false
|
||||
unique_text: ''
|
||||
unique_multivalue: true
|
||||
unique_multivalue_text: '%value appears more than once in %label'
|
||||
id: node.materiau.field_linked_articles
|
||||
field_name: field_linked_articles
|
||||
entity_type: node
|
||||
|
@ -5,6 +5,14 @@ dependencies:
|
||||
config:
|
||||
- field.storage.node.field_linked_materials
|
||||
- node.type.materiau
|
||||
module:
|
||||
- unique_content_field_validation
|
||||
third_party_settings:
|
||||
unique_content_field_validation:
|
||||
unique: false
|
||||
unique_text: ''
|
||||
unique_multivalue: true
|
||||
unique_multivalue_text: '%value appears more than once in %label'
|
||||
id: node.materiau.field_linked_materials
|
||||
field_name: field_linked_materials
|
||||
entity_type: node
|
||||
|
@ -14,7 +14,7 @@ bundle: thematique
|
||||
label: Body
|
||||
description: ''
|
||||
required: false
|
||||
translatable: false
|
||||
translatable: true
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
|
@ -6,6 +6,14 @@ dependencies:
|
||||
- field.storage.node.field_linked_articles
|
||||
- node.type.article
|
||||
- node.type.thematique
|
||||
module:
|
||||
- unique_content_field_validation
|
||||
third_party_settings:
|
||||
unique_content_field_validation:
|
||||
unique: false
|
||||
unique_text: ''
|
||||
unique_multivalue: true
|
||||
unique_multivalue_text: '%value appears more than once in %label'
|
||||
id: node.thematique.field_linked_articles
|
||||
field_name: field_linked_articles
|
||||
entity_type: node
|
||||
@ -13,7 +21,7 @@ bundle: thematique
|
||||
label: 'Linked Articles'
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
|
@ -6,6 +6,14 @@ dependencies:
|
||||
- field.storage.node.field_linked_materials
|
||||
- node.type.materiau
|
||||
- node.type.thematique
|
||||
module:
|
||||
- unique_content_field_validation
|
||||
third_party_settings:
|
||||
unique_content_field_validation:
|
||||
unique: false
|
||||
unique_text: ''
|
||||
unique_multivalue: true
|
||||
unique_multivalue_text: '%value appears more than once in %label'
|
||||
id: node.thematique.field_linked_materials
|
||||
field_name: field_linked_materials
|
||||
entity_type: node
|
||||
|
@ -12,7 +12,7 @@ bundle: thematique
|
||||
label: Memo
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
|
@ -6,14 +6,7 @@ dependencies:
|
||||
- field.storage.node.field_visuel
|
||||
- node.type.thematique
|
||||
module:
|
||||
- content_translation
|
||||
- image
|
||||
third_party_settings:
|
||||
content_translation:
|
||||
translation_sync:
|
||||
alt: alt
|
||||
title: title
|
||||
file: '0'
|
||||
id: node.thematique.field_visuel
|
||||
field_name: field_visuel
|
||||
entity_type: node
|
||||
@ -21,7 +14,7 @@ bundle: thematique
|
||||
label: Visuel
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
translatable: false
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
|
@ -3,7 +3,11 @@ langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- field_permissions
|
||||
- node
|
||||
third_party_settings:
|
||||
field_permissions:
|
||||
permission_type: public
|
||||
id: node.field_linked_materials
|
||||
field_name: field_linked_materials
|
||||
entity_type: node
|
||||
|
@ -4,6 +4,12 @@ status: true
|
||||
dependencies:
|
||||
module:
|
||||
- commerce_promotion
|
||||
- content_translation
|
||||
third_party_settings:
|
||||
content_translation:
|
||||
enabled: false
|
||||
bundle_settings:
|
||||
untranslatable_fields_hide: '0'
|
||||
id: commerce_promotion.commerce_promotion
|
||||
target_entity_type_id: commerce_promotion
|
||||
target_bundle: commerce_promotion
|
||||
|
@ -0,0 +1,17 @@
|
||||
uuid: 151dd62d-d9cb-4d11-b2d8-ad179a9d22e2
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- content_translation
|
||||
- flag_lists
|
||||
third_party_settings:
|
||||
content_translation:
|
||||
enabled: false
|
||||
bundle_settings:
|
||||
untranslatable_fields_hide: '0'
|
||||
id: flag_list_item.flag_list_item
|
||||
target_entity_type_id: flag_list_item
|
||||
target_bundle: flag_list_item
|
||||
default_langcode: site_default
|
||||
language_alterable: false
|
@ -0,0 +1,18 @@
|
||||
uuid: f4fc9d57-b60e-4b9f-9656-40d6eefa00a9
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- flag_lists.flagging_collection_type.flagging_collection_type_1
|
||||
module:
|
||||
- content_translation
|
||||
third_party_settings:
|
||||
content_translation:
|
||||
enabled: false
|
||||
bundle_settings:
|
||||
untranslatable_fields_hide: '0'
|
||||
id: flagging_collection.flagging_collection_type_1
|
||||
target_entity_type_id: flagging_collection
|
||||
target_bundle: flagging_collection_type_1
|
||||
default_langcode: site_default
|
||||
language_alterable: false
|
@ -4,6 +4,13 @@ status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.note
|
||||
module:
|
||||
- content_translation
|
||||
third_party_settings:
|
||||
content_translation:
|
||||
enabled: false
|
||||
bundle_settings:
|
||||
untranslatable_fields_hide: '0'
|
||||
id: node.note
|
||||
target_entity_type_id: node
|
||||
target_bundle: note
|
||||
|
@ -8,11 +8,11 @@ dependencies:
|
||||
- content_translation
|
||||
third_party_settings:
|
||||
content_translation:
|
||||
enabled: false
|
||||
enabled: true
|
||||
bundle_settings:
|
||||
untranslatable_fields_hide: '0'
|
||||
id: node.thematique
|
||||
target_entity_type_id: node
|
||||
target_bundle: thematique
|
||||
default_langcode: site_default
|
||||
language_alterable: false
|
||||
language_alterable: true
|
||||
|
@ -0,0 +1,11 @@
|
||||
uuid: 49f2849f-c35b-47df-9413-1186158a7662
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- workflow.workflow.migration
|
||||
id: workflow_scheduled_transition.migration
|
||||
target_entity_type_id: workflow_scheduled_transition
|
||||
target_bundle: migration
|
||||
default_langcode: site_default
|
||||
language_alterable: false
|
@ -0,0 +1,11 @@
|
||||
uuid: bd6c1288-c092-42bb-beff-ea48ad36446f
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- workflow.workflow.workflow
|
||||
id: workflow_scheduled_transition.workflow
|
||||
target_entity_type_id: workflow_scheduled_transition
|
||||
target_bundle: workflow
|
||||
default_langcode: site_default
|
||||
language_alterable: false
|
@ -3,8 +3,10 @@ default_config:
|
||||
page_breaker: …
|
||||
pages:
|
||||
prefix_label: Page
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_current_title: 'Page courante'
|
||||
page_title: 'Aller à la page @number'
|
||||
first_title: 'Aller à la première page'
|
||||
@ -19,12 +21,16 @@ default_config:
|
||||
last_reader: 'Dernière page'
|
||||
items:
|
||||
prefix_label: Élément
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_reader: Élément
|
||||
first_reader: 'Premier élément'
|
||||
item_ranges:
|
||||
prefix_label: Éléments
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_reader: Éléments
|
||||
|
@ -1,8 +1,10 @@
|
||||
default_config:
|
||||
tags:
|
||||
pages:
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
first_title: 'Aller à la première page'
|
||||
previous_title: 'Aller à la page précédente'
|
||||
next_title: 'Aller à la page suivante'
|
||||
@ -12,9 +14,13 @@ default_config:
|
||||
next_reader: 'Page suivante'
|
||||
last_reader: 'Dernière page'
|
||||
items:
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
first_reader: 'Premier élément'
|
||||
item_ranges:
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
|
@ -2,8 +2,10 @@ default_config:
|
||||
tags:
|
||||
pages:
|
||||
prefix_label: Page
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_current_title: 'Page courante'
|
||||
first_title: 'Aller à la première page'
|
||||
previous_title: 'Aller à la page précédente'
|
||||
@ -16,6 +18,8 @@ default_config:
|
||||
last_reader: 'Dernière page'
|
||||
items:
|
||||
prefix_label: Élément
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
first_reader: 'Premier élément'
|
||||
|
@ -3,8 +3,10 @@ default_config:
|
||||
page_breaker: …
|
||||
pages:
|
||||
prefix_label: Page
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_current_title: 'Page courante'
|
||||
page_title: 'Aller à la page @number'
|
||||
first_title: 'Aller à la première page'
|
||||
@ -19,12 +21,16 @@ default_config:
|
||||
last_reader: 'Dernière page'
|
||||
items:
|
||||
prefix_label: Élément
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_reader: Élément
|
||||
first_reader: 'Premier élément'
|
||||
item_ranges:
|
||||
prefix_label: Éléments
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_reader: Éléments
|
||||
|
@ -2,8 +2,10 @@ default_config:
|
||||
tags:
|
||||
pages:
|
||||
prefix_label: Page
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_current_title: 'Page courante'
|
||||
page_title: 'Aller à la page @number'
|
||||
first_title: 'Aller à la première page'
|
||||
@ -18,12 +20,16 @@ default_config:
|
||||
last_reader: 'Dernière page'
|
||||
items:
|
||||
prefix_label: Élément
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_reader: Élément
|
||||
first_reader: 'Premier élément'
|
||||
item_ranges:
|
||||
prefix_label: Éléments
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_reader: Éléments
|
||||
|
@ -2,8 +2,10 @@ default_config:
|
||||
tags:
|
||||
pages:
|
||||
prefix_label: Page
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
page_current_title: 'Page courante'
|
||||
first_title: 'Aller à la première page'
|
||||
previous_title: 'Aller à la page précédente'
|
||||
@ -16,10 +18,14 @@ default_config:
|
||||
last_reader: 'Dernière page'
|
||||
items:
|
||||
prefix_label: Élément
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
first_reader: 'Premier élément'
|
||||
item_ranges:
|
||||
prefix_label: Éléments
|
||||
first: «
|
||||
previous: ‹
|
||||
next: ›
|
||||
last: »
|
||||
|
@ -1,2 +0,0 @@
|
||||
login_form:
|
||||
field_label: 'Se souvenir de moi'
|
3
config/sync/language/fr/pwa.config.yml
Normal file
3
config/sync/language/fr/pwa.config.yml
Normal file
@ -0,0 +1,3 @@
|
||||
description: 'L''inspiration par la matière'
|
||||
lang: fr
|
||||
urls_to_cache: "/fr/pricing\r\n/fr/blabla\r\n/fr/base\r\n/fr/showrooms"
|
@ -26,7 +26,7 @@ display:
|
||||
label: 'Identifiant (ID)'
|
||||
separator: ', '
|
||||
label:
|
||||
label: Étiquette
|
||||
label: Libellé
|
||||
type:
|
||||
label: 'Type de licence'
|
||||
separator: ', '
|
||||
|
@ -1,8 +1,10 @@
|
||||
label: 'Eléments de la commande'
|
||||
display:
|
||||
default:
|
||||
display_title: Maître
|
||||
display_options:
|
||||
arguments:
|
||||
order_id:
|
||||
exception:
|
||||
title: Tout
|
||||
exposed_form:
|
||||
options:
|
||||
submit_button: Appliquer
|
||||
@ -23,7 +25,5 @@ display:
|
||||
total_price__number:
|
||||
label: 'Prix total'
|
||||
separator: ', '
|
||||
arguments:
|
||||
order_id:
|
||||
exception:
|
||||
title: Tout
|
||||
display_title: Maître
|
||||
label: 'Eléments de la commande'
|
||||
|
@ -25,6 +25,7 @@ display:
|
||||
commerce_order_bulk_form:
|
||||
action_title: 'Pour cette sélection'
|
||||
order_number:
|
||||
label: '#'
|
||||
separator: ', '
|
||||
placed:
|
||||
label: Date
|
||||
|
@ -13,5 +13,5 @@ type: thematique
|
||||
description: ''
|
||||
help: ''
|
||||
new_revision: true
|
||||
preview_mode: 1
|
||||
preview_mode: 0
|
||||
display_submitted: false
|
||||
|
@ -1,7 +0,0 @@
|
||||
lifetime: 30
|
||||
max_tokens: 0
|
||||
login_form:
|
||||
field_label: 'Remember me'
|
||||
cookie_prefix: PL
|
||||
_core:
|
||||
default_config_hash: ce6WctcNYnaEo3BmHQc_Fmukw7AkPJ137tH5GwPW93w
|
20
config/sync/pwa.config.yml
Normal file
20
config/sync/pwa.config.yml
Normal file
@ -0,0 +1,20 @@
|
||||
site_name: materiO’
|
||||
short_name: materiO’
|
||||
description: 'The material library your projects deserve'
|
||||
start_url: /
|
||||
lang: en
|
||||
theme_color: '#ffffff'
|
||||
background_color: '#ffffff'
|
||||
display: fullscreen
|
||||
default_image: '0'
|
||||
urls_to_cache: "/en/pricing\r\n/en/blabla\r\n/en/base\r\n/en/showrooms"
|
||||
urls_to_exclude: "admin/.*\r\nuser/.*"
|
||||
offline_page: /offline
|
||||
cache_version: '1'
|
||||
cross_origin: false
|
||||
skip_waiting: false
|
||||
_core:
|
||||
default_config_hash: cP1TZQyv1WdET3iepl2QoyOPK7VeO0xHm0lU_FU1Wmc
|
||||
image: /sites/default/files/pwa/PWA-icon.png
|
||||
image_small: /sites/default/files/pwa/PWA-icon.pngcopy.png
|
||||
image_very_small: /sites/default/files/pwa/PWA-icon.pngcopy2.png
|
@ -15,6 +15,7 @@ dependencies:
|
||||
- field.storage.node.field_famille
|
||||
- field.storage.node.field_manufacturer
|
||||
- field.storage.node.field_reference
|
||||
- field.storage.node.field_short_description
|
||||
- field.storage.node.field_tags
|
||||
- field.storage.taxonomy_term.field_synonyms
|
||||
- field.storage.node.field_thesaurus
|
||||
@ -104,6 +105,14 @@ field_settings:
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_reference
|
||||
field_short_description:
|
||||
label: 'Short description'
|
||||
datasource_id: 'entity:node'
|
||||
property_path: field_short_description
|
||||
type: string
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_short_description
|
||||
name:
|
||||
label: 'Manufacturer » Terme de taxonomie » Nom'
|
||||
datasource_id: 'entity:node'
|
||||
@ -234,6 +243,14 @@ field_settings:
|
||||
dependencies:
|
||||
module:
|
||||
- node
|
||||
type:
|
||||
label: 'Type de contenu'
|
||||
datasource_id: 'entity:node'
|
||||
property_path: type
|
||||
type: string
|
||||
dependencies:
|
||||
module:
|
||||
- node
|
||||
uid:
|
||||
label: uid
|
||||
datasource_id: 'entity:node'
|
||||
@ -304,6 +321,7 @@ processor_settings:
|
||||
- country_code_1
|
||||
- field_famille
|
||||
- field_reference
|
||||
- field_short_description
|
||||
- name
|
||||
- name_1
|
||||
- processed
|
||||
@ -312,6 +330,7 @@ processor_settings:
|
||||
- thesaurus_name
|
||||
- thesaurus_synonyms
|
||||
- title
|
||||
- type
|
||||
- uuid
|
||||
title: true
|
||||
alt: true
|
||||
|
@ -1,17 +0,0 @@
|
||||
uuid: ba4b3ab4-c822-45ad-9abf-ff2bebe8effb
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- persistent_login
|
||||
title: 'Default cron handler'
|
||||
id: persistent_login_cron
|
||||
weight: 0
|
||||
module: persistent_login
|
||||
callback: persistent_login_cron
|
||||
scheduler:
|
||||
id: simple
|
||||
launcher:
|
||||
id: serial
|
||||
logger:
|
||||
id: database
|
@ -0,0 +1,29 @@
|
||||
uuid: 08eadfe9-dd95-48db-bf97-7219b2f90604
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- user_email_verification
|
||||
title: 'Default cron handler'
|
||||
id: user_email_verification_cron
|
||||
weight: 0
|
||||
module: user_email_verification
|
||||
callback: user_email_verification_cron
|
||||
scheduler:
|
||||
id: simple
|
||||
configuration:
|
||||
rules:
|
||||
- '* * * * *'
|
||||
launcher:
|
||||
id: serial
|
||||
configuration:
|
||||
timeouts:
|
||||
lock_timeout: 3600
|
||||
launcher:
|
||||
thread: 0
|
||||
logger:
|
||||
id: database
|
||||
configuration:
|
||||
method: '3'
|
||||
expire: 1209600
|
||||
retain: 1000
|
@ -17,7 +17,7 @@ register_pending_approval_admin:
|
||||
body: "[user:display-name] has applied for an account.\r\n\r\n[user:edit-url]"
|
||||
subject: 'Account details for [user:display-name] at [site:name] (pending admin approval)'
|
||||
status_activated:
|
||||
body: "[user:display-name],\r\n\r\nYour account at [site:name] has been activated.\r\n\r\nYou may now log in by clicking this link or copying and pasting it into your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis link can only be used once to log in and will lead you to a page where you can set your password.\r\n\r\nAfter setting your password, you will be able to log in at [site:login-url] in the future using:\r\n\r\nusername: [user:account-name]\r\npassword: Your password\r\n\r\n-- [site:name] team"
|
||||
body: "[user:display-name],\r\n\r\nYour account at [site:name] has been activated.\r\n\r\nYou may now verify your email by clicking this link or copying and pasting it into your browser:\r\n\r\n[user:verify-email]\r\n\r\n-- TO REMOVE --\r\n\r\nYou may now log in by clicking this link or copying and pasting it into your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis link can only be used once to log in and will lead you to a page where you can set your password.\r\n\r\nAfter setting your password, you will be able to log in at [site:login-url] in the future using:\r\n\r\nusername: [user:account-name]\r\npassword: Your password\r\n\r\n-- [site:name] team"
|
||||
subject: 'Account details for [user:display-name] at [site:name] (approved)'
|
||||
status_blocked:
|
||||
body: "[user:display-name],\r\n\r\nYour account on [site:name] has been blocked.\r\n\r\n-- [site:name] team"
|
||||
|
@ -20,6 +20,7 @@ permissions:
|
||||
- 'access site in maintenance mode'
|
||||
- 'access synonyms entity autocomplete'
|
||||
- 'access toolbar'
|
||||
- 'access user profiles'
|
||||
- 'add flag lists'
|
||||
- 'administer commerce_order'
|
||||
- 'administer newsletters'
|
||||
@ -87,6 +88,7 @@ permissions:
|
||||
- 'edit own enregistrement content'
|
||||
- 'edit own flag lists'
|
||||
- 'edit own note content'
|
||||
- 'edit own thematique content'
|
||||
- 'edit terms in assisted_research'
|
||||
- 'edit terms in collectionneurs'
|
||||
- 'edit terms in company'
|
||||
@ -129,6 +131,7 @@ permissions:
|
||||
- 'schedule corpus_documents workflow_transition'
|
||||
- 'schedule generique workflow_transition'
|
||||
- 'send newsletter'
|
||||
- 'translate article node'
|
||||
- 'translate company taxonomy_term'
|
||||
- 'translate enregistrement node'
|
||||
- 'translate entrees taxonomy_term'
|
||||
@ -142,6 +145,7 @@ permissions:
|
||||
- 'translate showroom taxonomy_term'
|
||||
- 'translate static node'
|
||||
- 'translate tags taxonomy_term'
|
||||
- 'translate thematique node'
|
||||
- 'translate thesaurus taxonomy_term'
|
||||
- 'unflag dossier other items'
|
||||
- 'update any commerce_license'
|
||||
|
@ -11,8 +11,8 @@ is_admin: false
|
||||
permissions:
|
||||
- 'access checkout'
|
||||
- 'access content'
|
||||
- 'access devel information'
|
||||
- 'access kint'
|
||||
- 'access pwa'
|
||||
- 'access synonyms entity autocomplete'
|
||||
- 'access webprofiler'
|
||||
- 'create corpus_documents workflow_transition'
|
||||
|
@ -11,10 +11,8 @@ is_admin: false
|
||||
permissions:
|
||||
- 'access checkout'
|
||||
- 'access content'
|
||||
- 'access devel information'
|
||||
- 'access kint'
|
||||
- 'access synonyms entity autocomplete'
|
||||
- 'access user profiles'
|
||||
- 'access webprofiler'
|
||||
- 'add composition entities'
|
||||
- 'add fil entities'
|
||||
|
15
config/sync/user_email_verification.settings.yml
Normal file
15
config/sync/user_email_verification.settings.yml
Normal file
@ -0,0 +1,15 @@
|
||||
skip_roles:
|
||||
translator: translator
|
||||
admin_showroom: admin_showroom
|
||||
admin: admin
|
||||
root: root
|
||||
validate_interval: 604800
|
||||
num_reminders: 2
|
||||
mail_subject: '[site:name]: Email verification'
|
||||
mail_body: 'Verify your Email by following the link: [user:verify-email]'
|
||||
extended_enable: true
|
||||
extended_validate_interval: 1209600
|
||||
extended_mail_subject: '[site:name]: Account blocked, please verify Email address'
|
||||
extended_mail_body: 'Your account is blocked. Your Email may still be verified by following the link: [user:verify-email-extended]'
|
||||
_core:
|
||||
default_config_hash: jMF3rV51ujHssuZyYCHEBAat_VlUArx0IGmGOZzOV8Y
|
@ -2316,7 +2316,7 @@ display:
|
||||
description: ''
|
||||
expanded: false
|
||||
parent: editors_menus.contents
|
||||
weight: 0
|
||||
weight: -2
|
||||
context: '0'
|
||||
menu_name: editors
|
||||
display_description: ''
|
||||
@ -6138,9 +6138,9 @@ display:
|
||||
type: tab
|
||||
title: Thématiques
|
||||
description: ''
|
||||
expanded: false
|
||||
expanded: true
|
||||
parent: editors_menus.contents
|
||||
weight: 0
|
||||
weight: -1
|
||||
context: '0'
|
||||
menu_name: editors
|
||||
display_description: ''
|
||||
|
69
package-lock.json
generated
69
package-lock.json
generated
@ -7074,6 +7074,70 @@
|
||||
"flat-cache": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"file-loader": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
|
||||
"integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"schema-utils": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"dev": true
|
||||
},
|
||||
"emojis-list": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||
"dev": true
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
||||
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
"json5": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz",
|
||||
"integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.6",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
@ -11956,6 +12020,11 @@
|
||||
"resolved": "https://registry.npmjs.org/vue-youtube-embed/-/vue-youtube-embed-2.2.2.tgz",
|
||||
"integrity": "sha512-l/EJuFMRK43AN73N+qxJnN0LB3uPl2xAghmr3dCvODWGCRWGjmGfrHaOtD93fu9J4co+CZLv1KP3akAsldC1aw=="
|
||||
},
|
||||
"vue2-touch-events": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/vue2-touch-events/-/vue2-touch-events-3.2.1.tgz",
|
||||
"integrity": "sha512-6aQz9tofO1yLSudW7ltISC5lTFKEu0rcBuYNLrega1AApYUosPuRZ8iinzJQ4k5nUncDIVB2JPcz9qJDoSyQVw=="
|
||||
},
|
||||
"vuex": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.0.tgz",
|
||||
|
@ -28,6 +28,7 @@
|
||||
"vue-router": "^3.4.9",
|
||||
"vue-vimeo-player": "^0.1.0",
|
||||
"vue-youtube-embed": "^2.2.2",
|
||||
"vue2-touch-events": "^3.2.1",
|
||||
"vuex": "^3.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -54,6 +55,7 @@
|
||||
"eslint-plugin-vue": "^7.1.0",
|
||||
"eslint-plugin-vue-a11y": "0.0.31",
|
||||
"eslint-webpack-plugin": "^2.4.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"graphql": "^15.4.0",
|
||||
"graphql-tag": "^2.11.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
171
patches/graphql-fix-invalid-translation-language.patch
Normal file
171
patches/graphql-fix-invalid-translation-language.patch
Normal file
@ -0,0 +1,171 @@
|
||||
commit fc8cbeca3774ea4dce6c8768b1051144de5f1681
|
||||
Author: bach <bachir@figureslibres.io>
|
||||
Date: Wed Mar 3 17:34:33 2021 +0100
|
||||
|
||||
fixe Invalid translation language
|
||||
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Entity/EntityLoad.php b/src/Plugin/GraphQL/DataProducer/Entity/EntityLoad.php
|
||||
index f83be91..124cd53 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Entity/EntityLoad.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Entity/EntityLoad.php
|
||||
@@ -165,9 +165,11 @@ class EntityLoad extends DataProducerPluginBase implements ContainerFactoryPlugi
|
||||
}
|
||||
|
||||
// Get the correct translation.
|
||||
- if (isset($language) && $language !== $entity->language()->getId() && $entity instanceof TranslatableInterface) {
|
||||
- $entity = $entity->getTranslation($language);
|
||||
- $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language !== $entity->language()->getId() && $entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if($entity->hasTranslation($language)){
|
||||
+ $entity = $entity->getTranslation($language);
|
||||
+ $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Check if the passed user (or current user if none is passed) has access
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadByUuid.php b/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadByUuid.php
|
||||
index 10e2d40..e98b514 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadByUuid.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadByUuid.php
|
||||
@@ -164,9 +164,11 @@ class EntityLoadByUuid extends DataProducerPluginBase implements ContainerFactor
|
||||
}
|
||||
|
||||
// Get the correct translation.
|
||||
- if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface) {
|
||||
- $entity = $entity->getTranslation($language);
|
||||
- $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if($entity->hasTranslation($language)){
|
||||
+ $entity = $entity->getTranslation($language);
|
||||
+ $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Check if the passed user (or current user if none is passed) has access
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadMultiple.php b/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadMultiple.php
|
||||
index 4653aa0..526929b 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadMultiple.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Entity/EntityLoadMultiple.php
|
||||
@@ -168,9 +168,11 @@ class EntityLoadMultiple extends DataProducerPluginBase implements ContainerFact
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (isset($language) && $language !== $entities[$id]->language()->getId() && $entities[$id] instanceof TranslatableInterface) {
|
||||
- $entities[$id] = $entities[$id]->getTranslation($language);
|
||||
- $entities[$id]->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language !== $entities[$id]->language()->getId() && $entities[$id] instanceof TranslatableInterface && $entities[$id]->isTranslatable()) {
|
||||
+ if($entities[$id]->hasTranslation($language)){
|
||||
+ $entities[$id] = $entities[$id]->getTranslation($language);
|
||||
+ $entities[$id]->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
if ($access) {
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Entity/EntityTranslation.php b/src/Plugin/GraphQL/DataProducer/Entity/EntityTranslation.php
|
||||
index 633bdc2..3773a9b 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Entity/EntityTranslation.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Entity/EntityTranslation.php
|
||||
@@ -101,7 +101,7 @@ class EntityTranslation extends DataProducerPluginBase implements ContainerFacto
|
||||
* @return \Drupal\Core\Entity\EntityInterface|null
|
||||
*/
|
||||
public function resolve(EntityInterface $entity, $language, ?bool $access, ?AccountInterface $accessUser, ?string $accessOperation) {
|
||||
- if ($entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if ($entity instanceof TranslatableInterface && $entity->isTranslatable() && $entity->hasTranslation($language)) {
|
||||
$entity = $entity->getTranslation($language);
|
||||
$entity->addCacheContexts(["static:language:{$language}"]);
|
||||
// Check if the passed user (or current user if none is passed) has access
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Field/EntityReference.php b/src/Plugin/GraphQL/DataProducer/Field/EntityReference.php
|
||||
index 2d0a974..1346cd9 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Field/EntityReference.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Field/EntityReference.php
|
||||
@@ -168,9 +168,11 @@ class EntityReference extends DataProducerPluginBase implements ContainerFactory
|
||||
}
|
||||
|
||||
// Get the correct translation.
|
||||
- if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface) {
|
||||
- $entity = $entity->getTranslation($language);
|
||||
- $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if($entity->hasTranslation($language)){
|
||||
+ $entity = $entity->getTranslation($language);
|
||||
+ $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Check if the passed user (or current user if none is passed) has
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceLayoutRevisions.php b/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceLayoutRevisions.php
|
||||
index ddcc2ab..8650a52 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceLayoutRevisions.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceLayoutRevisions.php
|
||||
@@ -174,9 +174,11 @@ class EntityReferenceLayoutRevisions extends DataProducerPluginBase implements C
|
||||
}
|
||||
|
||||
// Get the correct translation.
|
||||
- if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface) {
|
||||
- $entity = $entity->getTranslation($language);
|
||||
- $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if($entity->hasTranslation($language)){
|
||||
+ $entity = $entity->getTranslation($language);
|
||||
+ $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Check if the passed user (or current user if none is passed) has
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceRevisions.php b/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceRevisions.php
|
||||
index 31a1d15..8c950e8 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceRevisions.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Field/EntityReferenceRevisions.php
|
||||
@@ -174,9 +174,11 @@ class EntityReferenceRevisions extends DataProducerPluginBase implements Contain
|
||||
}
|
||||
|
||||
// Get the correct translation.
|
||||
- if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface) {
|
||||
- $entity = $entity->getTranslation($language);
|
||||
- $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if($entity->hasTranslation($language)){
|
||||
+ $entity = $entity->getTranslation($language);
|
||||
+ $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Check if the passed user (or current user if none is passed) has
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Routing/RouteEntity.php b/src/Plugin/GraphQL/DataProducer/Routing/RouteEntity.php
|
||||
index a0c9be6..48678bc 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Routing/RouteEntity.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Routing/RouteEntity.php
|
||||
@@ -125,9 +125,11 @@ class RouteEntity extends DataProducerPluginBase implements ContainerFactoryPlug
|
||||
}
|
||||
|
||||
// Get the correct translation.
|
||||
- if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface) {
|
||||
- $entity = $entity->getTranslation($language);
|
||||
- $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language != $entity->language()->getId() && $entity instanceof TranslatableInterface && $entity->isTranslatable()) {
|
||||
+ if($entity->hasTranslation($language)){
|
||||
+ $entity = $entity->getTranslation($language);
|
||||
+ $entity->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
$access = $entity->access('view', NULL, TRUE);
|
||||
diff --git a/src/Plugin/GraphQL/DataProducer/Taxonomy/TaxonomyLoadTree.php b/src/Plugin/GraphQL/DataProducer/Taxonomy/TaxonomyLoadTree.php
|
||||
index 1bcd624..a23a256 100644
|
||||
--- a/src/Plugin/GraphQL/DataProducer/Taxonomy/TaxonomyLoadTree.php
|
||||
+++ b/src/Plugin/GraphQL/DataProducer/Taxonomy/TaxonomyLoadTree.php
|
||||
@@ -174,9 +174,11 @@ class TaxonomyLoadTree extends DataProducerPluginBase implements ContainerFactor
|
||||
foreach ($entities as $id => $entity) {
|
||||
$context->addCacheableDependency($entities[$id]);
|
||||
|
||||
- if (isset($language) && $language !== $entities[$id]->language()->getId() && $entities[$id] instanceof TranslatableInterface) {
|
||||
- $entities[$id] = $entities[$id]->getTranslation($language);
|
||||
- $entities[$id]->addCacheContexts(["static:language:{$language}"]);
|
||||
+ if (isset($language) && $language !== $entities[$id]->language()->getId() && $entities[$id] instanceof TranslatableInterface && $entities[$id]->isTranslatable()) {
|
||||
+ if($entities[$id]->hasTranslation($language)){
|
||||
+ $entities[$id] = $entities[$id]->getTranslation($language);
|
||||
+ $entities[$id]->addCacheContexts(["static:language:{$language}"]);
|
||||
+ }
|
||||
}
|
||||
|
||||
if ($access) {
|
@ -0,0 +1,8 @@
|
||||
name: 'images_styles_cron_gen'
|
||||
type: module
|
||||
description: 'helpers for progressive decoupling'
|
||||
core: 8.x
|
||||
package: 'custom'
|
||||
# https://www.flocondetoile.fr/blog/generate-programmatically-image-styles-drupal-8
|
||||
# https://www.flocondetoile.fr/blog/using-drupal-8-cron-api-generate-image-styles
|
||||
# https://www.sitepoint.com/drupal-8-queue-api-powerful-manual-and-cron-queueing/
|
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
use Drupal\image\Entity\ImageStyle;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\file\FileInterface;
|
||||
|
||||
// /**
|
||||
// * Implements hook_entity_insert().
|
||||
// * Generate all image styles once an Image is uploaded.
|
||||
// */
|
||||
// function images_styles_gen_entity_insert(EntityInterface $entity) {
|
||||
// /** @var \Drupal\file\Entity\File $entity */
|
||||
// if ($entity instanceof FileInterface) {
|
||||
// $image = \Drupal::service('image.factory')->get($entity->getFileUri());
|
||||
// /** @var \Drupal\Core\Image\Image $image */
|
||||
// if ($image->isValid()) {
|
||||
// $styles = ImageStyle::loadMultiple();
|
||||
// $image_uri = $entity->getFileUri();
|
||||
// /** @var \Drupal\image\Entity\ImageStyle $style */
|
||||
// foreach ($styles as $style) {
|
||||
// $destination = $style->buildUri($image_uri);
|
||||
// $style->createDerivative($image_uri, $destination);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Implements hook_entity_insert().
|
||||
* Queue generation of all image styles once an Image is uploaded.
|
||||
*/
|
||||
// function images_styles_gen_entity_insert(EntityInterface $entity) {
|
||||
// // TODO: IS THIS EVEN WORKING ????
|
||||
// /** @var \Drupal\file\Entity\File $entity */
|
||||
// if ($entity instanceof FileInterface) {
|
||||
// $image = \Drupal::service('image.factory')->get($entity->getFileUri());
|
||||
// /** @var \Drupal\Core\Image\Image $image */
|
||||
// if ($image->isValid()) {
|
||||
// $queue = \Drupal::queue('img_styles_gen');
|
||||
// $item = new \stdClass();
|
||||
// $item->fid = $entity->id();
|
||||
// $queue->createItem($item);
|
||||
// // $data = ['entity' => $entity];
|
||||
// // $queue->createItem($data);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function images_styles_gen_cron_DISABLED(){
|
||||
// $file_storage = \Drupal::entityTypeManager()->getStorage('file');
|
||||
// $query = $file_storage->getQuery()
|
||||
// ->condition('filemime', 'image/%', 'LIKE')
|
||||
// ->accessCheck(TRUE);
|
||||
// $results = $query->execute();
|
||||
//
|
||||
// // $styles_storage = \Drupal::entityTypeManager()->getStorage('image_style');
|
||||
// // $styles = $styles_storage->loadMultiple();
|
||||
//
|
||||
// /** @var QueueFactory $queue_factory */
|
||||
// $queue_factory = \Drupal::service('queue');
|
||||
// /** @var QueueInterface $queue */
|
||||
// $queue = $queue_factory->get('img_styles_gen');
|
||||
//
|
||||
// foreach ($results as $fid) {
|
||||
// $item = new \stdClass();
|
||||
// $item->fid = $fid;
|
||||
// $queue->createItem($item);
|
||||
//
|
||||
// // $queue->createItem(["fid" => $fid]);
|
||||
//
|
||||
//
|
||||
// // /** @var \Drupal\file\FileInterface|null $file*/
|
||||
// // $file_entity = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
|
||||
// // $image = \Drupal::service('image.factory')->get($file_entity->getFileUri());
|
||||
// //
|
||||
// // if ($image->isValid()) {
|
||||
// // $image_uri = $file_entity->getFileUri();
|
||||
// // /** @var \Drupal\image\Entity\ImageStyle $style */
|
||||
// // foreach ($styles as $style) {
|
||||
// // $destination = $style->buildUri($image_uri);
|
||||
// // // if destination exists skip
|
||||
// // if (file_exists($destination)) continue; // skip existing files
|
||||
// //
|
||||
// // $data = [
|
||||
// // 'style' => $style,
|
||||
// // 'image_uri' => $image_uri,
|
||||
// // 'destination' => $destination
|
||||
// // ];
|
||||
// // $queue->createItem($data);
|
||||
// // \Drupal::logger('images_styles_gen')->notice("created queue from $image_uri to $destination");
|
||||
// // }
|
||||
//
|
||||
// // }
|
||||
// }
|
||||
// }
|
@ -0,0 +1,7 @@
|
||||
images_styles_gen.form:
|
||||
path: '/admin/config/media/imgstylesgen'
|
||||
defaults:
|
||||
_form: '\Drupal\images_styles_gen\Form\ImgStylesGenQueueForm'
|
||||
_title: 'Images Styles Generator'
|
||||
requirements:
|
||||
_permission: 'administer site configuration'
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\images_styles_gen;
|
||||
|
||||
|
||||
// use Drupal\node\Entity\Node;
|
||||
|
||||
class CreateImagesStyles {
|
||||
|
||||
public static function createStyles($item, &$context){
|
||||
if (!array_key_exists('progress', $context['sandbox'])) {
|
||||
$context['sandbox']['progress'] = 0;
|
||||
}
|
||||
$context['sandbox']['progress']++;
|
||||
$context['sandbox']['current_file'] = $item->uri;
|
||||
// $message = 'Creating Styles ...';
|
||||
$results = array();
|
||||
|
||||
$results[] = $item->style->createDerivative($item->uri, $item->destination);
|
||||
|
||||
$context['message'] = $item->uri . ' processed.';
|
||||
$context['results'][] = $item->destination;
|
||||
}
|
||||
|
||||
public static function createStylesFinishedCallback($success, $results, $operations) {
|
||||
// The 'success' parameter means no fatal PHP errors were detected. All
|
||||
// other error management should be handled using 'results'.
|
||||
if ($success) {
|
||||
$message = \Drupal::translation()->formatPlural(
|
||||
count($results),
|
||||
'One image processed.', '@count image processed.'
|
||||
);
|
||||
}
|
||||
else {
|
||||
$message = t('Finished with an error.');
|
||||
}
|
||||
drupal_set_message($message);
|
||||
}
|
||||
}
|
@ -0,0 +1,274 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\npq\Form\NodePublisherQueueForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\images_styles_gen\Form;
|
||||
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Queue\QueueFactory;
|
||||
use Drupal\Core\Queue\QueueInterface;
|
||||
use Drupal\Core\Queue\QueueWorkerInterface;
|
||||
use Drupal\Core\Queue\QueueWorkerManagerInterface;
|
||||
use Drupal\Core\Queue\SuspendQueueException;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
class ImgStylesGenQueueForm extends FormBase {
|
||||
|
||||
/**
|
||||
* @var QueueFactory
|
||||
*/
|
||||
protected $queueFactory;
|
||||
|
||||
/**
|
||||
* @var QueueWorkerManagerInterface
|
||||
*/
|
||||
protected $queueManager;
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(QueueFactory $queue, QueueWorkerManagerInterface $queue_manager) {
|
||||
$this->queueFactory = $queue;
|
||||
$this->queueManager = $queue_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('queue'),
|
||||
$container->get('plugin.manager.queue_worker')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}.
|
||||
*/
|
||||
public function getFormId() {
|
||||
return 'images_styles_gen_form';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}.
|
||||
*/
|
||||
public function buildForm(array $form, FormStateInterface $form_state) {
|
||||
|
||||
$styles_storage = \Drupal::entityTypeManager()->getStorage('image_style');
|
||||
|
||||
$content_type_id = $form_state->getValue('node_type');
|
||||
$style_id = $form_state->getValue('style');
|
||||
$batch_size = (int)$form_state->getValue('batch_size');
|
||||
|
||||
$num_rows = 0;
|
||||
if ( $content_type_id && $style_id ) {
|
||||
|
||||
$database = \Drupal::database();
|
||||
$query = $database->select('file_managed', 'fm');
|
||||
$query->join('file_usage', 'fu', 'fm.fid = fu.fid');
|
||||
$query->join('node', 'n', 'fu.id = n.nid');
|
||||
$query
|
||||
->condition('fm.filemime', 'image/%', 'LIKE')
|
||||
->condition('fu.type', 'node')
|
||||
->condition('n.type', $content_type_id)
|
||||
->fields('fm', ['fid', 'uri'])
|
||||
->fields('fu', ['id']);
|
||||
|
||||
$results = $query->execute();
|
||||
|
||||
/** @var \Drupal\image\Entity\ImageStyle $style */
|
||||
$style = $styles_storage->load($style_id);
|
||||
|
||||
foreach ($results as $file) {
|
||||
$destination = $style->buildUri($file->uri);
|
||||
if (file_exists($destination)) continue; // if destination exists skip
|
||||
$num_rows++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// select from content type we'll generate derivatives
|
||||
$contentTypes = \Drupal::service('entity.manager')->
|
||||
getStorage('node_type')->loadMultiple();
|
||||
$contentTypesList = [0 => "please choose a content type"];
|
||||
foreach ($contentTypes as $contentType) {
|
||||
$contentTypesList[$contentType->id()] = $contentType->label();
|
||||
}
|
||||
$form['node_type'] = array(
|
||||
"#type" => "select",
|
||||
"#title" => "Content type",
|
||||
'#options' => $contentTypesList,
|
||||
'#ajax' => [
|
||||
'callback' => '::countAjaxCallback', // don't forget :: when calling a class method.
|
||||
//'callback' => [$this, 'myAjaxCallback'], //alternative notation
|
||||
'disable-refocus' => FALSE, // Or TRUE to prevent re-focusing on the triggering element.
|
||||
'event' => 'change',
|
||||
'wrapper' => 'edit-help-wrapper', // This element is updated with this AJAX callback.
|
||||
'progress' => [
|
||||
'type' => 'throbber',
|
||||
'message' => $this->t('counting entries...'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// select for which style will generate derivatives
|
||||
$styles = $styles_storage->loadMultiple(); //, 'card_full', 'linkedmaterial_card'
|
||||
$stylesList = [0 => "please choose a style"];
|
||||
foreach ($styles as $style) {
|
||||
$stylesList[$style->id()] = $style->label();
|
||||
}
|
||||
$form['style'] = array(
|
||||
"#type" => "select",
|
||||
"#title" => "Images Styles",
|
||||
'#options' => $stylesList,
|
||||
'#ajax' => [
|
||||
'callback' => '::countAjaxCallback', // don't forget :: when calling a class method.
|
||||
//'callback' => [$this, 'myAjaxCallback'], //alternative notation
|
||||
'disable-refocus' => FALSE, // Or TRUE to prevent re-focusing on the triggering element.
|
||||
'event' => 'change',
|
||||
'wrapper' => 'edit-help-wrapper', // This element is updated with this AJAX callback.
|
||||
'progress' => [
|
||||
'type' => 'throbber',
|
||||
'message' => $this->t('counting entries...'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$form['batch_size'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => 'Batch size',
|
||||
'#options' => array(
|
||||
10 => '10',
|
||||
100 => '100',
|
||||
500 => '500',
|
||||
1000 => '1000',
|
||||
50000 => '5000',
|
||||
10000 => '10000',
|
||||
0 => 'no limit'
|
||||
),
|
||||
'#ajax' => [
|
||||
'callback' => '::countAjaxCallback', // don't forget :: when calling a class method.
|
||||
//'callback' => [$this, 'myAjaxCallback'], //alternative notation
|
||||
'disable-refocus' => FALSE, // Or TRUE to prevent re-focusing on the triggering element.
|
||||
'event' => 'change',
|
||||
'wrapper' => 'edit-help-wrapper', // This element is updated with this AJAX callback.
|
||||
'progress' => [
|
||||
'type' => 'throbber',
|
||||
'message' => $this->t('counting entries...'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$form['help-wrapper'] = array(
|
||||
'#type' => 'container'
|
||||
);
|
||||
|
||||
$form['help-wrapper']['help'] = array(
|
||||
'#type' => 'markup',
|
||||
// '#prefix' => '<div>',
|
||||
'#markup' => $this->t('Please choose a content type and a style.'),
|
||||
// '#suffix' => '</div>',
|
||||
'#attributes' => array(
|
||||
'id' => 'help'
|
||||
)
|
||||
);
|
||||
|
||||
if ($num_rows) {
|
||||
if($batch_size == 0){
|
||||
$batch_size = $num_rows;
|
||||
}
|
||||
$form['help-wrapper']['help']['#markup'] = $this->t('Submitting this form will process @batch_size of @number images.', array('@batch_size' => $batch_size, '@number' => $num_rows));
|
||||
// $form['actions']['submit']['#disabled'] = FALSE;
|
||||
// unset($form['actions']['submit']['#attributes']['disabled']);
|
||||
}
|
||||
|
||||
$form['help-wrapper']['num_rows'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => $num_rows,
|
||||
);
|
||||
|
||||
// Actions
|
||||
$form['actions']['#type'] = 'actions';
|
||||
|
||||
$form['actions']['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => $this->t('Create image derivatives'),
|
||||
'#button_type' => 'primary',
|
||||
// '#disabled' => true,
|
||||
'#states' => [
|
||||
//show this submit only if the num rows is not empty
|
||||
'visible' => [
|
||||
//don't mistake :input for the type of field. You'll always use
|
||||
//:input here, no matter whether your source is a select, radio or checkbox element.
|
||||
':input[name="num_rows"]' => ['!value' => 0],
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
// Get the value from example select field and fill
|
||||
// the textbox with the selected text.
|
||||
public function countAjaxCallback(array &$form, FormStateInterface $form_state) {
|
||||
$form['help-wrapper']['#id'] = 'edit-help-wrapper';
|
||||
return $form['help-wrapper'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function submitForm(array &$form, FormStateInterface $form_state) {
|
||||
$content_type_id = $form_state->getValue('node_type');
|
||||
$style_id = $form_state->getValue('style');
|
||||
$batch_size = (int)$form_state->getValue('batch_size');
|
||||
|
||||
$database = \Drupal::database();
|
||||
$query = $database->select('file_managed', 'fm');
|
||||
$query->join('file_usage', 'fu', 'fm.fid = fu.fid');
|
||||
$query->join('node', 'n', 'fu.id = n.nid');
|
||||
$query
|
||||
->condition('fm.filemime', 'image/%', 'LIKE')
|
||||
->condition('fu.type', 'node')
|
||||
->condition('n.type', $content_type_id)
|
||||
->fields('fm', ['fid', 'uri'])
|
||||
->fields('fu', ['id']);
|
||||
|
||||
$results = $query->execute();
|
||||
|
||||
$styles_storage = \Drupal::entityTypeManager()->getStorage('image_style');
|
||||
/** @var \Drupal\image\Entity\ImageStyle $style */
|
||||
$style = $styles_storage->load($style_id);
|
||||
|
||||
$operations = [];
|
||||
foreach ($results as $file) {
|
||||
$destination = $style->buildUri($file->uri);
|
||||
|
||||
if (file_exists($destination)) continue; // skip existing files
|
||||
|
||||
$batch_item = new \stdClass();
|
||||
$batch_item->style = $style;
|
||||
$batch_item->uri = $file->uri;
|
||||
$batch_item->destination = $destination;
|
||||
|
||||
$operations[] = ['\Drupal\images_styles_gen\CreateImagesStyles::createStyles', [$batch_item]];
|
||||
|
||||
if($batch_size && count($operations) >= $batch_size){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$batch = array(
|
||||
'title' => t('Creating images derivatives ...'),
|
||||
'operations' => $operations,
|
||||
'finished' => '\Drupal\images_styles_gen\CreateImagesStyles::createStylesFinishedCallback',
|
||||
);
|
||||
|
||||
batch_set($batch);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
materio_decoupled.path_translation_links:
|
||||
path: 'materio_decoupled/path_translation_links'
|
||||
defaults:
|
||||
_controller: '\Drupal\materio_decoupled\Controller\MaterioDecoupledLanguageLinks::getPathTranslationLinks'
|
||||
_title: 'Path translation links'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
|
||||
materio_decoupled.header_menu_block:
|
||||
path: 'materio_decoupled/ajax/getheadermenu'
|
||||
defaults:
|
||||
_controller: '\Drupal\materio_decoupled\Controller\AjaxHeaderMenuBlock::getBlock'
|
||||
_title: 'Header Menu'
|
||||
requirements:
|
||||
_permission: 'access content'
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\materio_decoupled\Controller;
|
||||
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Drupal\block\Entity\Block;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
// use Drupal\Core\Cache\CacheableJsonResponse;
|
||||
// use Drupal\Core\Cache\CacheableMetadata;
|
||||
// use Drupal\core\render\RenderContext;
|
||||
|
||||
|
||||
/**
|
||||
* Defines a route controller.
|
||||
*/
|
||||
class AjaxHeaderMenuBlock extends ControllerBase {
|
||||
|
||||
private function getBlockDefinition(){
|
||||
// $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// \Drupal::logger('materio_user')->notice($language);
|
||||
$this->bid = "header";
|
||||
$this->block = Block::load($this->bid);
|
||||
$this->block_builded = \Drupal::entityManager()->getViewBuilder('block')->view($this->block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for getBlock request.
|
||||
*/
|
||||
public function getBlock(Request $request) {
|
||||
|
||||
$this->getBlockDefinition();
|
||||
|
||||
$rendered = \Drupal::service('renderer')->renderRoot($this->block_builded);
|
||||
$data = [
|
||||
'rendered' => $rendered,
|
||||
// '#cache' => [
|
||||
// 'max-age' => \Drupal\Core\Cache\Cache::PERMANENT,
|
||||
// 'tags' => [
|
||||
// 'materio_sapi-search_form-cache',
|
||||
// ]
|
||||
// ]
|
||||
];
|
||||
|
||||
$response = new JsonResponse();
|
||||
$response->setData($data);
|
||||
// $response = new CacheableJsonResponse($data);
|
||||
// $response->addCacheableDependency(CacheableMetadata::createFromRenderArray($data));
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\materio_decoupled\Controller;
|
||||
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
/**
|
||||
* Class AjaxHomeController.
|
||||
*/
|
||||
class MaterioDecoupledLanguageLinks extends ControllerBase {
|
||||
|
||||
|
||||
/*
|
||||
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
|
||||
*/
|
||||
protected $languageManager;
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('language_manager')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new MaterioDecoupledLanguageLinks object.
|
||||
*
|
||||
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
|
||||
* The language manager.
|
||||
*/
|
||||
public function __construct(LanguageManagerInterface $language_manager) {
|
||||
$this->languageManager = $language_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* getPathTranslationLinks
|
||||
*
|
||||
* @return string
|
||||
* Return translations links given a path.
|
||||
*/
|
||||
public function getPathTranslationLinks(Request $request) {
|
||||
$post_data = json_decode( $request->getContent(),TRUE);
|
||||
$path = $post_data['path'];
|
||||
$data = [];
|
||||
|
||||
// build the links
|
||||
$url_object = \Drupal::service('path.validator')->getUrlIfValid($path);
|
||||
|
||||
$languages = $this->languageManager->getNativeLanguages();
|
||||
if (!$url_object) {
|
||||
// if path does not exists
|
||||
$data["error"] = "path {$path} is not valid";
|
||||
$route_name = "<front>";
|
||||
$route_parameters = null;
|
||||
}else{
|
||||
$route_name = $url_object->getRouteName();
|
||||
$route_parameters = $url_object->getrouteParameters();
|
||||
}
|
||||
|
||||
foreach ($languages as $key => $language) {
|
||||
$url = Url::fromRoute($route_name, $route_parameters, ["language"=>$language]);
|
||||
$links[$key] = [
|
||||
"title" => $language->get('label'),
|
||||
"url" => $url->toString(),
|
||||
"sys_path" => $url->getInternalPath()
|
||||
];
|
||||
}
|
||||
|
||||
$data["links"] = $links;
|
||||
|
||||
return new JsonResponse($data);
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +1,39 @@
|
||||
scalar Violation
|
||||
|
||||
interface NodeInterface {
|
||||
id: Int!
|
||||
path: String!
|
||||
}
|
||||
|
||||
type Materiau implements NodeInterface {
|
||||
id: Int!
|
||||
uuid: String!
|
||||
title: String!
|
||||
path: String!
|
||||
author: String
|
||||
body: String
|
||||
bundle: String!
|
||||
}
|
||||
|
||||
interface SearchResultInterface {
|
||||
id: Int!
|
||||
uuid: String!
|
||||
title: String!
|
||||
path: String!
|
||||
author: String
|
||||
bundle: String!
|
||||
#
|
||||
short_description: String
|
||||
body: String
|
||||
linked_materials: [Materiau]
|
||||
}
|
||||
|
||||
type Materiau implements NodeInterface & SearchResultInterface{
|
||||
id: Int!
|
||||
uuid: String!
|
||||
title: String!
|
||||
path: String!
|
||||
author: String
|
||||
bundle: String!
|
||||
#
|
||||
short_description: String
|
||||
body: String
|
||||
linked_materials: [Materiau]
|
||||
#
|
||||
linked_articles: [Article]
|
||||
images: [Image]
|
||||
videos: [VideoLink]
|
||||
@ -23,11 +43,29 @@ type Materiau implements NodeInterface {
|
||||
attachments: [Filefield]
|
||||
distributor: [Company]
|
||||
manufacturer: [Company]
|
||||
# famille: String
|
||||
# index: Int
|
||||
reference: String
|
||||
samples: [Sample]
|
||||
note: Note
|
||||
note_id: Int
|
||||
# famille: String
|
||||
# index: Int
|
||||
}
|
||||
|
||||
type Thematique implements NodeInterface & SearchResultInterface {
|
||||
id: Int!
|
||||
uuid: String!
|
||||
title: String!
|
||||
path: String!
|
||||
author: String
|
||||
bundle: String!
|
||||
#
|
||||
short_description: String
|
||||
body: String
|
||||
linked_materials: [Materiau]
|
||||
#
|
||||
images: [Image]
|
||||
tags: [Tag]
|
||||
memo: String
|
||||
}
|
||||
|
||||
type Article implements NodeInterface {
|
||||
@ -36,6 +74,8 @@ type Article implements NodeInterface {
|
||||
title: String!
|
||||
path: String!
|
||||
author: String
|
||||
bundle: String!
|
||||
#
|
||||
body: String
|
||||
linked_materials: [Materiau]
|
||||
images: [Image]
|
||||
@ -48,37 +88,24 @@ type Article implements NodeInterface {
|
||||
memo: String
|
||||
}
|
||||
|
||||
type Thematique implements NodeInterface {
|
||||
id: Int!
|
||||
uuid: String!
|
||||
title: String!
|
||||
path: String!
|
||||
author: String
|
||||
body: String
|
||||
linked_materials: [Materiau]
|
||||
images: [Image]
|
||||
tags: [Tag]
|
||||
memo: String
|
||||
}
|
||||
|
||||
type Note {
|
||||
id: Int!
|
||||
contenu: String
|
||||
target: Int
|
||||
}
|
||||
|
||||
type SearchResult {
|
||||
id: Int!
|
||||
uuid: String!
|
||||
title: String!
|
||||
bundle: String!
|
||||
path: String!
|
||||
short_description: String
|
||||
images: [Image]
|
||||
visuels: [Image]
|
||||
reference: String
|
||||
samples: [Sample]
|
||||
}
|
||||
# type SearchResult {
|
||||
# id: Int!
|
||||
# uuid: String!
|
||||
# title: String!
|
||||
# bundle: String!
|
||||
# path: String!
|
||||
# short_description: String
|
||||
# images: [Image]
|
||||
# visuels: [Image]
|
||||
# reference: String
|
||||
# samples: [Sample]
|
||||
# }
|
||||
|
||||
type Product {
|
||||
id: Int!
|
||||
|
@ -11,7 +11,11 @@ extend type Query {
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
searchresults(ids: [Int], lang: String): [SearchResult]
|
||||
searchresults(ids: [Int], lang: String): [SearchResultInterface]
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
searchresult(id: Int!, lang: String): SearchResultInterface
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\materio_graphql\GraphQL\Response;
|
||||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\graphql\GraphQL\Response\Response;
|
||||
|
||||
/**
|
||||
* Type of response used when an materiau is returned.
|
||||
*/
|
||||
class MateriauResponse extends Response {
|
||||
|
||||
/**
|
||||
* The materiau to be served.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\EntityInterface|null
|
||||
*/
|
||||
protected $materiau;
|
||||
|
||||
/**
|
||||
* Sets the content.
|
||||
*
|
||||
* @param \Drupal\Core\Entity\EntityInterface|null $materiau
|
||||
* The materiau to be served.
|
||||
*/
|
||||
public function setMateriau(?EntityInterface $materiau): void {
|
||||
$this->materiau = $materiau;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the materiau to be served.
|
||||
*
|
||||
* @return \Drupal\Core\Entity\EntityInterface|null
|
||||
* The materiau to be served.
|
||||
*/
|
||||
public function materiau(): ?EntityInterface {
|
||||
return $this->materiau;
|
||||
}
|
||||
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\materio_graphql\Plugin\GraphQL\DataProducer;
|
||||
|
||||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
|
||||
use Drupal\materio_graphql\GraphQL\Response\MateriauResponse;
|
||||
use Drupal\node\Entity\Node;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Creates a new materiau entity.
|
||||
*
|
||||
* @DataProducer(
|
||||
* id = "create_materiau",
|
||||
* name = @Translation("Create Materiau"),
|
||||
* description = @Translation("Creates a new materiau."),
|
||||
* produces = @ContextDefinition("any",
|
||||
* label = @Translation("Materiau")
|
||||
* ),
|
||||
* consumes = {
|
||||
* "data" = @ContextDefinition("any",
|
||||
* label = @Translation("Materiau data")
|
||||
* )
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
class CreateMateriau extends DataProducerPluginBase implements ContainerFactoryPluginInterface {
|
||||
|
||||
/**
|
||||
* The current user.
|
||||
*
|
||||
* @var \Drupal\Core\Session\AccountInterface
|
||||
*/
|
||||
protected $currentUser;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
|
||||
return new static(
|
||||
$configuration,
|
||||
$plugin_id,
|
||||
$plugin_definition,
|
||||
$container->get('current_user')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* CreateMateriau constructor.
|
||||
*
|
||||
* @param array $configuration
|
||||
* A configuration array containing information about the plugin instance.
|
||||
* @param string $plugin_id
|
||||
* The plugin_id for the plugin instance.
|
||||
* @param array $plugin_definition
|
||||
* The plugin implementation definition.
|
||||
* @param \Drupal\Core\Session\AccountInterface $current_user
|
||||
* The current user.
|
||||
*/
|
||||
public function __construct(array $configuration, string $plugin_id, array $plugin_definition, AccountInterface $current_user) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition);
|
||||
$this->currentUser = $current_user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an materiau.
|
||||
*
|
||||
* @param array $data
|
||||
* The submitted values for the materiau.
|
||||
*
|
||||
* @return \Drupal\graphql_composable\GraphQL\Response\MateriauResponse
|
||||
* The newly created materiau.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function resolve(array $data) {
|
||||
$response = new MateriauResponse();
|
||||
if ($this->currentUser->hasPermission("create materiau content")) {
|
||||
$values = [
|
||||
'type' => 'materiau',
|
||||
'title' => $data['title'],
|
||||
'body' => $data['description'],
|
||||
];
|
||||
$node = Node::create($values);
|
||||
$node->save();
|
||||
$response->setMateriau($node);
|
||||
}
|
||||
else {
|
||||
$response->addViolation(
|
||||
$this->t('You do not have permissions to create materiaus.')
|
||||
);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
@ -10,7 +10,7 @@ use GraphQL\Error\Error;
|
||||
/**
|
||||
* @Schema(
|
||||
* id = "materio",
|
||||
* name = "Materio schema",
|
||||
* name = "Materio",
|
||||
* extensions = "materio",
|
||||
* )
|
||||
*/
|
||||
|
@ -99,11 +99,23 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
|
||||
$registry->addFieldResolver('Query', 'route',
|
||||
$builder->compose(
|
||||
$builder->callBack(function($parent, $args){
|
||||
$t="t";
|
||||
return $parent;
|
||||
}),
|
||||
$builder->produce('route_load')
|
||||
->map('path', $builder->fromArgument('path')),
|
||||
$builder->callBack(function($parent, $args){
|
||||
$t="t";
|
||||
return $parent;
|
||||
}),
|
||||
$builder->produce('route_entity')
|
||||
->map('url', $builder->fromParent())
|
||||
->map('language', $builder->fromArgument('lang'))
|
||||
->map('language', $builder->fromArgument('lang')),
|
||||
$builder->callBack(function($parent, $args){
|
||||
$t="t";
|
||||
return $parent;
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
@ -141,6 +153,12 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
->map('entity', $builder->fromParent())
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Materiau', 'bundle',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_bundle')
|
||||
->map('entity', $builder->fromParent())
|
||||
));
|
||||
|
||||
$registry->addFieldResolver('Materiau', 'path',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_url')
|
||||
@ -182,18 +200,66 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
// https://blog.chrismitchellonline.com/posts/custom_graphql_data/
|
||||
|
||||
$registry->addFieldResolver('Materiau', 'linked_materials',
|
||||
// $builder->compose(
|
||||
// $builder->produce('entity_reference')
|
||||
// ->map('entity', $builder->fromParent())
|
||||
// ->map('field', $builder->fromValue('field_linked_materials')))
|
||||
$builder->compose(
|
||||
$builder->produce('entity_reference')
|
||||
->map('entity', $builder->fromParent())
|
||||
->map('field', $builder->fromValue('field_linked_materials'))
|
||||
));
|
||||
$builder->callback(function($parent, $args){
|
||||
$linkedmaterials = $parent->get('field_linked_materials')->getValue();
|
||||
$nids = [];
|
||||
foreach ($linkedmaterials as $key => $value) {
|
||||
$nids[] = $value['target_id'];
|
||||
}
|
||||
$lang = $parent->language()->getId();
|
||||
$test="test";
|
||||
return [
|
||||
"ids" => $nids,
|
||||
"language" => $lang
|
||||
];
|
||||
}),
|
||||
$builder->produce('entity_load_multiple')
|
||||
->map('type', $builder->fromValue('node'))
|
||||
->map('bundles', $builder->fromValue(['materiau']))
|
||||
->map('ids', $builder->callback(function($parent, $args){
|
||||
return $parent['ids'];
|
||||
}))
|
||||
->map('language', $builder->callback(function($parent, $args){
|
||||
return $parent['language'];
|
||||
}))
|
||||
)
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Materiau', 'linked_articles',
|
||||
// $builder->compose(
|
||||
// $builder->produce('entity_reference')
|
||||
// ->map('entity', $builder->fromParent())
|
||||
// ->map('field', $builder->fromValue('field_linked_articles')))
|
||||
$builder->compose(
|
||||
$builder->produce('entity_reference')
|
||||
->map('entity', $builder->fromParent())
|
||||
->map('field', $builder->fromValue('field_linked_articles'))
|
||||
));
|
||||
$builder->callback(function($parent, $args){
|
||||
$linkedmaterials = $parent->get('field_linked_articles')->getValue();
|
||||
$nids = [];
|
||||
foreach ($linkedmaterials as $key => $value) {
|
||||
$nids[] = $value['target_id'];
|
||||
}
|
||||
$lang = $parent->language()->getId();
|
||||
$test="test";
|
||||
return [
|
||||
"ids" => $nids,
|
||||
"language" => $lang
|
||||
];
|
||||
}),
|
||||
$builder->produce('entity_load_multiple')
|
||||
->map('type', $builder->fromValue('node'))
|
||||
->map('bundles', $builder->fromValue(['materiau']))
|
||||
->map('ids', $builder->callback(function($parent, $args){
|
||||
return $parent['ids'];
|
||||
}))
|
||||
->map('language', $builder->callback(function($parent, $args){
|
||||
return $parent['language'];
|
||||
}))
|
||||
)
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Materiau', 'memo',
|
||||
$builder->produce('property_path')
|
||||
@ -299,6 +365,33 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
->map('id', $builder->fromParent())
|
||||
)
|
||||
);
|
||||
$registry->addFieldResolver('Materiau', 'note_id',
|
||||
$builder->compose(
|
||||
$builder->callback(function($parent, $args){
|
||||
// get the current user id
|
||||
$user = \Drupal::currentUser()->id();
|
||||
// get the current material id
|
||||
$target = $parent->id();
|
||||
// query the note for these user AND material (if any)
|
||||
// if null, UI will create it with rest api
|
||||
$entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
$query = $entity_storage->getQuery()
|
||||
->condition('type', 'note')
|
||||
->condition('uid', $user)
|
||||
->condition('field_target', $target)
|
||||
->accessCheck(TRUE);
|
||||
$results = $query->execute();
|
||||
// $test="test";
|
||||
return array_shift($results);
|
||||
}),
|
||||
$builder->produce('entity_load')
|
||||
->map('type', $builder->fromValue('node'))
|
||||
->map('bundle', $builder->fromValue('note'))
|
||||
->map('id', $builder->fromParent()),
|
||||
$builder->produce('entity_id')
|
||||
->map('entity', $builder->fromParent())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// _ _ _
|
||||
@ -319,6 +412,12 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
->map('path', $builder->fromValue('field_contenu.value'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Note', 'bundle',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_bundle')
|
||||
->map('entity', $builder->fromParent())
|
||||
));
|
||||
|
||||
$registry->addFieldResolver('Note', 'target',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
@ -332,6 +431,14 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
// \__ \/ -_) _` | '_/ _| ' \| / -_|_-< || | | _|
|
||||
// |___/\___\__,_|_| \__|_||_|_|_\___/__/\_,_|_|\__|
|
||||
protected function addSearchResult(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
|
||||
// Tell GraphQL how to resolve types of a common interface.
|
||||
$registry->addTypeResolver('SearchResultInterface', function ($value) {
|
||||
switch ($value->bundle()) {
|
||||
case 'materiau': return 'Materiau';
|
||||
case 'thematique': return 'Thematique';
|
||||
}
|
||||
throw new Error('Could not resolve content type.');
|
||||
});
|
||||
|
||||
$registry->addFieldResolver('Query', 'searchresults',
|
||||
$builder->produce('entity_load_multiple')
|
||||
@ -340,68 +447,12 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
->map('language', $builder->fromArgument('lang'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'id',
|
||||
$builder->produce('entity_id')
|
||||
->map('entity', $builder->fromParent())
|
||||
$registry->addFieldResolver('Query', 'searchresult',
|
||||
$builder->produce('entity_load')
|
||||
->map('type', $builder->fromValue('node'))
|
||||
->map('id', $builder->fromArgument('id'))
|
||||
->map('language', $builder->fromArgument('lang'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'bundle',
|
||||
$builder->produce('entity_bundle')
|
||||
->map('entity', $builder->fromParent())
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'uuid',
|
||||
$builder->produce('entity_uuid')
|
||||
->map('entity', $builder->fromParent())
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'path',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_url')
|
||||
->map('entity', $builder->fromParent()),
|
||||
$builder->produce('url_path')
|
||||
->map('url', $builder->fromParent())
|
||||
)
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'title',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_label')
|
||||
->map('entity', $builder->fromParent())
|
||||
));
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'short_description',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
->map('value', $builder->fromParent())
|
||||
->map('path', $builder->fromValue('field_short_description.value'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'images',
|
||||
$builder->produce('entity_reference')
|
||||
->map('entity', $builder->fromParent())
|
||||
->map('field', $builder->fromValue('field_materiau_images'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'visuels',
|
||||
$builder->produce('entity_reference')
|
||||
->map('entity', $builder->fromParent())
|
||||
->map('field', $builder->fromValue('field_visuel'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'reference',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
->map('value', $builder->fromParent())
|
||||
->map('path', $builder->fromValue('field_reference.value'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'samples',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
->map('value', $builder->fromParent())
|
||||
->map('path', $builder->fromValue('field_samples'))
|
||||
);
|
||||
}
|
||||
|
||||
// ___ _
|
||||
@ -454,6 +505,13 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
)
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Article', 'bundle',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_bundle')
|
||||
->map('entity', $builder->fromParent())
|
||||
));
|
||||
|
||||
|
||||
$registry->addFieldResolver('Article', 'title',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_label')
|
||||
@ -575,12 +633,14 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
// |_| |_||_\___|_|_|_\__,_|\__|_\__, |\_,_\___|
|
||||
// |_|
|
||||
protected function addThematique(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
|
||||
$registry->addFieldResolver('Query', 'Thematique',
|
||||
|
||||
$registry->addFieldResolver('Query', 'thematique',
|
||||
$builder->produce('entity_load')
|
||||
->map('type', $builder->fromValue('node'))
|
||||
->map('bundles', $builder->fromValue(['thematique']))
|
||||
// ->map('bundles', $builder->fromValue(['thematique']))
|
||||
->map('id', $builder->fromArgument('id'))
|
||||
);
|
||||
->map('language', $builder->fromArgument('lang'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Thematique', 'id',
|
||||
$builder->produce('entity_id')
|
||||
@ -601,6 +661,12 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
)
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Thematique', 'bundle',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_bundle')
|
||||
->map('entity', $builder->fromParent())
|
||||
));
|
||||
|
||||
$registry->addFieldResolver('Thematique', 'title',
|
||||
$builder->compose(
|
||||
$builder->produce('entity_label')
|
||||
@ -615,6 +681,13 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
->map('entity', $builder->fromParent())
|
||||
));
|
||||
|
||||
$registry->addFieldResolver('Thematique', 'short_description',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
->map('value', $builder->fromParent())
|
||||
->map('path', $builder->fromValue('field_short_description.value'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Thematique', 'body',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
@ -631,9 +704,33 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
// https://github.com/drupal-graphql/graphql/blob/8.x-4.x/doc/SUMMARY.md
|
||||
// https://blog.chrismitchellonline.com/posts/custom_graphql_data/
|
||||
$registry->addFieldResolver('Thematique', 'linked_materials',
|
||||
$builder->produce('entity_reference')
|
||||
->map('entity', $builder->fromParent())
|
||||
->map('field', $builder->fromValue('field_linked_materials'))
|
||||
// $builder->produce('entity_reference')
|
||||
// ->map('entity', $builder->fromParent())
|
||||
// ->map('field', $builder->fromValue('field_linked_materials'))
|
||||
$builder->compose(
|
||||
$builder->callback(function($parent, $args){
|
||||
$linkedmaterials = $parent->get('field_linked_materials')->getValue();
|
||||
$nids = [];
|
||||
foreach ($linkedmaterials as $key => $value) {
|
||||
$nids[] = $value['target_id'];
|
||||
}
|
||||
$lang = $parent->language()->getId();
|
||||
$test="test";
|
||||
return [
|
||||
"ids" => $nids,
|
||||
"language" => $lang
|
||||
];
|
||||
}),
|
||||
$builder->produce('entity_load_multiple')
|
||||
->map('type', $builder->fromValue('node'))
|
||||
->map('bundles', $builder->fromValue(['materiau']))
|
||||
->map('ids', $builder->callback(function($parent, $args){
|
||||
return $parent['ids'];
|
||||
}))
|
||||
->map('language', $builder->callback(function($parent, $args){
|
||||
return $parent['language'];
|
||||
}))
|
||||
)
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('Thematique', 'images',
|
||||
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace Drupal\materio_graphql\Wrappers\Response;
|
||||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\graphql\GraphQL\Response\Response;
|
||||
|
||||
/**
|
||||
* Type of response used when an materiau is returned.
|
||||
*/
|
||||
class MateriauResponse extends Response {
|
||||
|
||||
/**
|
||||
* The materiau to be served.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\EntityInterface|null
|
||||
*/
|
||||
protected $materiau;
|
||||
|
||||
/**
|
||||
* Sets the content.
|
||||
*
|
||||
* @param \Drupal\Core\Entity\EntityInterface|null $materiau
|
||||
* The materiau to be served.
|
||||
*/
|
||||
public function setMateriau(?EntityInterface $materiau): void {
|
||||
$this->materiau = $materiau;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the materiau to be served.
|
||||
*
|
||||
* @return \Drupal\Core\Entity\EntityInterface|null
|
||||
* The materiau to be served.
|
||||
*/
|
||||
public function materiau(): ?EntityInterface {
|
||||
return $this->materiau;
|
||||
}
|
||||
|
||||
}
|
@ -87,7 +87,8 @@ class Base extends ControllerBase {
|
||||
}
|
||||
|
||||
// Restrict the search to specific languages.
|
||||
// $this->query->setLanguages(['de', 'it']);
|
||||
$lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
$this->query->setLanguages([$lang]);
|
||||
|
||||
// Do paging.
|
||||
$this->query->range($this->offset, $this->limit);
|
||||
@ -105,10 +106,12 @@ class Base extends ControllerBase {
|
||||
}
|
||||
|
||||
private function defaultQuery(){
|
||||
$lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
$entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
$this->query = $entity_storage->getQuery()
|
||||
->condition('type', 'materiau')
|
||||
->condition('type', ['materiau', 'thematique'], 'IN')
|
||||
->condition('status', '1')
|
||||
->condition('langcode', $lang)
|
||||
->range($this->offset, $this->limit)
|
||||
->accessCheck(TRUE)
|
||||
->sort('changed', 'DESC');
|
||||
@ -116,7 +119,8 @@ class Base extends ControllerBase {
|
||||
$this->results = $this->query->execute();
|
||||
|
||||
$this->count_query = $entity_storage->getQuery()
|
||||
->condition('type', 'materiau')
|
||||
->condition('type', ['materiau', 'thematique'], 'IN')
|
||||
->condition('langcode', $lang)
|
||||
->accessCheck(TRUE)
|
||||
->condition('status', '1')
|
||||
->count();
|
||||
@ -191,18 +195,17 @@ class Base extends ControllerBase {
|
||||
$nids = [];
|
||||
// Using entityTypeManager
|
||||
// Get a node storage object.
|
||||
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
// $node_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
|
||||
foreach ($this->results as $result) {
|
||||
$lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// $lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// Load a single node.
|
||||
$node = $node_storage->load($result);
|
||||
// $node = $node_storage->load($result);
|
||||
// check if has translation
|
||||
|
||||
if ($node->hasTranslation($lang)) {
|
||||
// $uuids[] = $result->getField('uuid')->getValues()[0];
|
||||
// i used to filter like bellow because of a graphql probleme
|
||||
// if ($node->hasTranslation($lang)) {
|
||||
$nids[] = $result;
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
// $resp['uuids'] = $uuids;
|
||||
|
@ -149,3 +149,52 @@ function materio_user_entity_type_build(array &$entity_types) {
|
||||
// https://drupal.stackexchange.com/a/230547
|
||||
$entity_types['user']->setFormClass('modal', 'Drupal\user\RegisterForm');
|
||||
}
|
||||
|
||||
/*
|
||||
* hook_menu_local_tasks_alter
|
||||
*/
|
||||
function materio_user_menu_local_tasks_alter(&$data, $route_name){
|
||||
$t="t";
|
||||
// remove some tabs on user pages
|
||||
// if (in_array($route_name, ['entity.user.canonical', 'entity.user.edit_form']) ) {
|
||||
if (preg_match('/^entity\.user\./', $route_name)
|
||||
|| in_array($route_name, [
|
||||
'simplenews.newsletter_subscriptions_user',
|
||||
'commerce_order.address_book.overview',
|
||||
'entity.commerce_payment_method.collection',
|
||||
'view.commerce_user_orders.order_page',
|
||||
'view.commerce_user_subscriptions.page_1'
|
||||
])) {
|
||||
unset($data['tabs'][0]['profile.user_page:member']);
|
||||
$data['tabs'][0]['entity.user.edit_form']['#weight'] = -20;
|
||||
$data['tabs'][0]['simplenews.newsletter_subscriptions_user']['#weight'] = -9;
|
||||
}
|
||||
// foreach ($data['tabs'] as $key => $tab) {
|
||||
// if ($key == 'profile.user_page:member') {
|
||||
// unset($data['tabs'][$key]);
|
||||
// }
|
||||
// if ($key == 'entity.user.edit_form') {
|
||||
// $data['tabs'][$key]['#weight'] = -200;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
/*
|
||||
* hook_local_tasks_alter
|
||||
*/
|
||||
// function materio_user_local_tasks_alter(&$local_tasks){
|
||||
// $t="t";
|
||||
// }
|
||||
|
||||
function materio_user_form_alter(array &$form, FormStateInterface $forme_state, $form_id){
|
||||
if ($form_id == 'simplenews_subscriber_account_form') {
|
||||
$user = \Drupal::currentUser();
|
||||
$roles = $user->getRoles();
|
||||
$t="t";
|
||||
if (in_array('adherent', $roles)) {
|
||||
unset($form['subscriptions']['widget']['#options']['companies']);
|
||||
unset($form['subscriptions']['widget']['#options']['test']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
18696
web/themes/custom/materiotheme/assets/dist/main.css
vendored
18696
web/themes/custom/materiotheme/assets/dist/main.css
vendored
File diff suppressed because one or more lines are too long
5884
web/themes/custom/materiotheme/assets/dist/main.js
vendored
5884
web/themes/custom/materiotheme/assets/dist/main.js
vendored
File diff suppressed because one or more lines are too long
BIN
web/themes/custom/materiotheme/assets/dist/static/fonts/materialdesignicons-webfont.0e4e0b3.ttf
vendored
Normal file
BIN
web/themes/custom/materiotheme/assets/dist/static/fonts/materialdesignicons-webfont.0e4e0b3.ttf
vendored
Normal file
Binary file not shown.
BIN
web/themes/custom/materiotheme/assets/dist/static/fonts/materialdesignicons-webfont.53f53f5.eot
vendored
Normal file
BIN
web/themes/custom/materiotheme/assets/dist/static/fonts/materialdesignicons-webfont.53f53f5.eot
vendored
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user