diff --git a/app/graphql/api/v2/schema.rb b/app/graphql/api/v2/schema.rb index 93c62ef1e..867a36126 100644 --- a/app/graphql/api/v2/schema.rb +++ b/app/graphql/api/v2/schema.rb @@ -114,7 +114,8 @@ class API::V2::Schema < GraphQL::Schema Types::Champs::Descriptor::TextareaChampDescriptorType, Types::Champs::Descriptor::TextChampDescriptorType, Types::Champs::Descriptor::TitreIdentiteChampDescriptorType, - Types::Champs::Descriptor::YesNoChampDescriptorType + Types::Champs::Descriptor::YesNoChampDescriptorType, + Types::Champs::Descriptor::ExpressionReguliereChampDescriptorType def self.unauthorized_object(error) # Add a top-level error to the response instead of returning nil: diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 0fc35e4f4..0d0ea7a2f 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -2284,6 +2284,34 @@ type ExplicationChampDescriptor implements ChampDescriptor { type: TypeDeChamp! @deprecated(reason: "Utilisez le champ `__typename` à la place.") } +type ExpressionReguliereChampDescriptor implements ChampDescriptor { + """ + Description des champs d’un bloc répétable. + """ + champDescriptors: [ChampDescriptor!] @deprecated(reason: "Utilisez le champ `RepetitionChampDescriptor.champ_descriptors` à la place.") + + """ + Description du champ. + """ + description: String + id: ID! + + """ + Libellé du champ. + """ + label: String! + + """ + Est-ce que le champ est obligatoire ? + """ + required: Boolean! + + """ + Type de la valeur du champ. + """ + type: TypeDeChamp! @deprecated(reason: "Utilisez le champ `__typename` à la place.") +} + type File { byteSize: Int! @deprecated(reason: "Utilisez le champ `byteSizeBigInt` à la place.") byteSizeBigInt: BigInt! @@ -3945,6 +3973,11 @@ enum TypeDeChamp { """ explication + """ + Expression régulière + """ + expression_reguliere + """ Titre de section """ diff --git a/app/graphql/types/champ_descriptor_type.rb b/app/graphql/types/champ_descriptor_type.rb index 3e59bec96..6bc69823d 100644 --- a/app/graphql/types/champ_descriptor_type.rb +++ b/app/graphql/types/champ_descriptor_type.rb @@ -96,6 +96,8 @@ module Types Types::Champs::Descriptor::EpciChampDescriptorType when TypeDeChamp.type_champs.fetch(:cojo) Types::Champs::Descriptor::COJOChampDescriptorType + when TypeDeChamp.type_champs.fetch(:expression_reguliere) + Types::Champs::Descriptor::ExpressionReguliereChampDescriptorType end end end diff --git a/app/graphql/types/champs/descriptor/expression_reguliere_champ_descriptor_type.rb b/app/graphql/types/champs/descriptor/expression_reguliere_champ_descriptor_type.rb new file mode 100644 index 000000000..430c4a00d --- /dev/null +++ b/app/graphql/types/champs/descriptor/expression_reguliere_champ_descriptor_type.rb @@ -0,0 +1,5 @@ +module Types::Champs::Descriptor + class ExpressionReguliereChampDescriptorType < Types::BaseObject + implements Types::ChampDescriptorType + end +end