diff --git a/src/config/sync/core.entity_form_display.paragraph.note.default.yml b/src/config/sync/core.entity_form_display.paragraph.note.default.yml index 139bc33..20a9305 100644 --- a/src/config/sync/core.entity_form_display.paragraph.note.default.yml +++ b/src/config/sync/core.entity_form_display.paragraph.note.default.yml @@ -5,6 +5,7 @@ dependencies: config: - field.field.paragraph.note.field_note - field.field.paragraph.note.field_numero + - field.field.paragraph.note.field_text_lien - paragraphs.paragraphs_type.note module: - text @@ -28,6 +29,16 @@ content: third_party_settings: { } type: number region: content + field_text_lien: + weight: 2 + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content hidden: created: true status: true diff --git a/src/config/sync/core.entity_view_display.paragraph.note.default.yml b/src/config/sync/core.entity_view_display.paragraph.note.default.yml index 0a0467c..3467672 100644 --- a/src/config/sync/core.entity_view_display.paragraph.note.default.yml +++ b/src/config/sync/core.entity_view_display.paragraph.note.default.yml @@ -5,6 +5,7 @@ dependencies: config: - field.field.paragraph.note.field_note - field.field.paragraph.note.field_numero + - field.field.paragraph.note.field_text_lien - paragraphs.paragraphs_type.note module: - text @@ -29,5 +30,13 @@ content: third_party_settings: { } type: number_integer region: content + field_text_lien: + weight: 2 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content hidden: search_api_excerpt: true diff --git a/src/config/sync/field.field.paragraph.note.field_text_lien.yml b/src/config/sync/field.field.paragraph.note.field_text_lien.yml new file mode 100644 index 0000000..7335926 --- /dev/null +++ b/src/config/sync/field.field.paragraph.note.field_text_lien.yml @@ -0,0 +1,31 @@ +uuid: 5504d452-d5bf-480c-aeab-f73bf81d7db9 +langcode: fr +status: true +dependencies: + config: + - field.storage.paragraph.field_text_lien + - node.type.texte + - node.type.texte_prod + - paragraphs.paragraphs_type.note +id: paragraph.note.field_text_lien +field_name: field_text_lien +entity_type: paragraph +bundle: note +label: 'Text lien' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + texte: texte + texte_prod: texte_prod + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: texte +field_type: entity_reference diff --git a/src/web/modules/custom/enfrancais_graphql/graphql/enfr_extension.base.graphqls b/src/web/modules/custom/enfrancais_graphql/graphql/enfr_extension.base.graphqls index bffc297..b1014e0 100644 --- a/src/web/modules/custom/enfrancais_graphql/graphql/enfr_extension.base.graphqls +++ b/src/web/modules/custom/enfrancais_graphql/graphql/enfr_extension.base.graphqls @@ -115,6 +115,8 @@ interface NoteInterface { type Noteref implements NoteInterface { note: String numero: Int + # + liens: [TextInterface] } type Noteprod implements NoteInterface { diff --git a/src/web/modules/custom/enfrancais_graphql/src/Plugin/GraphQL/SchemaExtension/EnFrSchemaExtension.php b/src/web/modules/custom/enfrancais_graphql/src/Plugin/GraphQL/SchemaExtension/EnFrSchemaExtension.php index 8a27e4d..4f65ae5 100644 --- a/src/web/modules/custom/enfrancais_graphql/src/Plugin/GraphQL/SchemaExtension/EnFrSchemaExtension.php +++ b/src/web/modules/custom/enfrancais_graphql/src/Plugin/GraphQL/SchemaExtension/EnFrSchemaExtension.php @@ -584,6 +584,12 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('field_numero.value')) ); + + $registry->addFieldResolver('Noteprod', 'liens', + $builder->produce('entity_reference') + ->map('entity', $builder->fromParent()) + ->map('field', $builder->fromValue('field_text_lien')) + ); } protected function addNoteProd(ResolverRegistryInterface $registry, ResolverBuilder $builder) {