Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit f7dd006c authored by Emmanuel Raviart's avatar Emmanuel Raviart

Improve GraphQL of "actes législatifs".

parent 6ed19477
Pipeline #100980 passed with stage
in 2 minutes and 16 seconds
This diff is collapsed.
use acteurs::Acteur;
use contexts::Context;
use textes_legislatifs::Document;
#[derive(Clone, Debug, Deserialize, GraphQLObject)]
#[serde(deny_unknown_fields)]
pub struct Chrono {
......@@ -91,7 +95,7 @@ pub struct ListePays {
pub pays_ref: String,
}
#[derive(Clone, Debug, Deserialize, GraphQLObject)]
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Rapporteur {
#[serde(rename = "acteurRef")]
......@@ -102,6 +106,45 @@ pub struct Rapporteur {
pub type_rapporteur: TypeRapporteur,
}
graphql_object!(Rapporteur: Context |&self| {
field acteur(&executor) -> Option<&Acteur> {
let context = &executor.context();
context.get_acteur_at_uid(&self.acteur_ref)
}
field acteur_ref() -> &str {
&self.acteur_ref
}
field etude_plf(&executor) -> Vec<&Document> {
match &self.etude_plf_ref {
None => vec![],
Some(ref etude_plf_ref) => {
let context = &executor.context();
match context.get_document_at_uid(&etude_plf_ref) {
None => vec![],
Some(ref document) => {
// Generate a flat vector from document and its sub-documents (aka divisions),
// because a tree is not adapted to GraphQL.
document.flatten_document()
},
}
},
}
}
field etude_plf_ref() -> Option<&str> {
match &self.etude_plf_ref {
None => None,
Some(ref s) => Some(s.as_str()),
}
}
field type_rapporteur() -> TypeRapporteur {
self.type_rapporteur
}
});
#[derive(Debug, Deserialize, GraphQLObject)]
#[serde(deny_unknown_fields)]
pub struct Theme {
......
......@@ -2,9 +2,10 @@ use actes_legislatifs::{ActeLegislatif, ActesLegislatifs, Initiateur};
use chrono::{Date, FixedOffset};
use commun::{CodeEtLibelle, Indexation, Rapporteur, XmlNamespace};
use contexts::Context;
use organes::Organe;
use serde_utils::map_to_vec;
use std::cmp;
use textes_legislatifs::TextesLegislatifs;
use textes_legislatifs::{Document, TextesLegislatifs};
#[derive(Clone, Copy, Debug, Deserialize, GraphQLEnum)]
pub enum CauseFusionDossier {
......@@ -169,8 +170,15 @@ graphql_object!(DossierLegislatif: Context |&self| {
&self.legislature
}
field plf() -> &Option<Plf> {
&self.plf
field plf() -> Vec<&EtudePlf> {
match &self.plf {
None => vec![],
Some(ref plf) => {
plf.etudes_plf
.iter()
.collect()
},
}
}
field procedure_parlementaire() -> &ProcedureParlementaire {
......@@ -815,7 +823,7 @@ pub struct DossiersLegislatifs {
pub dossiers: Vec<Dossier>,
}
#[derive(Debug, Deserialize, GraphQLObject)]
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct EtudePlf {
#[serde(rename = "missionMinefi")]
......@@ -833,6 +841,61 @@ pub struct EtudePlf {
pub uid: String,
}
graphql_object!(EtudePlf: Context |&self| {
field mission_minefi() -> &Option<Mission> {
&self.mission_minefi
}
field ordre_commission() -> &str {
&self.ordre_commission
}
field ordre_diqs() -> &str {
&self.ordre_diqs
}
field organe(&executor) -> Option<&Organe> {
let context = &executor.context();
context.get_organe_at_uid(&self.organe_ref)
}
field organe_ref() -> &str {
&self.organe_ref
}
field rapporteurs() -> &Vec<Rapporteur> {
&self.rapporteurs
}
field texte_associe(&executor) -> Vec<&Document> {
match &self.texte_associe {
None => vec![],
Some(ref texte_associe_ref) => {
let context = &executor.context();
match context.get_document_at_uid(&texte_associe_ref) {
None => vec![],
Some(ref document) => {
// Generate a flat vector from document and its sub-documents (aka divisions),
// because a tree is not adapted to GraphQL.
document.flatten_document()
},
}
},
}
}
field texte_associe_ref() -> Option<&str> {
match &self.texte_associe {
None => None,
Some(ref s) => Some(s.as_str()),
}
}
field uid() -> &str {
&self.uid
}
});
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Export {
......@@ -858,7 +921,7 @@ pub struct FusionDossier {
pub dossier_absorbant_ref: String,
}
#[derive(Debug, Deserialize, GraphQLObject)]
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Mission {
#[serde(rename = "libelleCourt")]
......@@ -872,6 +935,37 @@ pub struct Mission {
pub type_mission: TypeMission,
}
graphql_object!(Mission: Context |&self| {
field libelle_court() -> Option<&str> {
match &self.libelle_court {
None => None,
Some(ref s) => Some(s.as_str()),
}
}
field libelle_long() -> &str {
&self.libelle_long
}
field missions() -> Vec<&MissionBase> {
match &self.missions {
None => vec![],
Some(ref missions) =>
missions.missions
.iter()
.collect(),
}
}
field type_budget() -> TypeBudget {
self.type_budget
}
field type_mission() -> TypeMission {
self.type_mission
}
});
#[derive(Debug, Deserialize, GraphQLObject)]
#[serde(deny_unknown_fields)]
pub struct MissionBase {
......@@ -892,11 +986,11 @@ pub struct Missions {
pub missions: Vec<MissionBase>,
}
#[derive(Debug, Deserialize, GraphQLObject)]
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Plf {
#[serde(rename = "EtudePLF")]
pub etude_plf: Vec<EtudePlf>,
pub etudes_plf: Vec<EtudePlf>,
}
type ProcedureParlementaire = CodeEtLibelle;
......
......@@ -651,9 +651,9 @@ pub struct Secretariat {
pub secretaire02: Option<String>,
}
/// Vie Mort et Décomposition
#[derive(Clone, Debug, Deserialize, GraphQLObject)]
#[serde(deny_unknown_fields)]
/// Vie Mort et Décomposition
pub struct Vimode {
#[serde(rename = "dateAgrement")]
// TODO: Date<FixedOffset> type is not able to deserialize dates (`YYYY-MM-DD`).
......
use commun::{CycleDeVie, EmptyChoice};
use contexts::Context;
use dossiers_legislatifs::DossierParlementaire;
use serde_utils::{map_to_vec, str_to_bool, str_to_vec};
#[derive(Clone, Debug, Deserialize, GraphQLObject)]
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct DossiersLegislatifsRefs {
#[serde(deserialize_with = "str_to_vec", rename = "dossierRef")]
......@@ -38,8 +39,29 @@ graphql_object!(PodjReunion: Context |&self| {
&self.cycle_de_vie
}
field dossiers_legislatifs_refs() -> &Option<DossiersLegislatifsRefs> {
&self.dossiers_legislatifs_refs
field dossiers_legislatifs(&executor) -> Vec<&DossierParlementaire> {
match &self.dossiers_legislatifs_refs {
None => vec![],
Some(ref dossiers_legislatifs_refs) => {
let context = &executor.context();
dossiers_legislatifs_refs.dossiers_refs
.iter()
.filter_map(|ref dossier_ref| context.get_dossier_parlementaire_at_uid(&dossier_ref))
.collect()
},
}
}
field dossiers_legislatifs_refs() -> Vec<&str> {
match &self.dossiers_legislatifs_refs {
None => vec![],
Some(ref dossiers_legislatifs_refs) => {
dossiers_legislatifs_refs.dossiers_refs
.iter()
.map(|ref dossier_ref| dossier_ref.as_str())
.collect()
},
}
}
field objet() -> &str {
......@@ -106,8 +128,36 @@ graphql_object!(PodjSeanceConfPres: Context |&self| {
}
}
field dossiers_legislatifs_refs() -> &Option<DossiersLegislatifsRefs> {
&self.dossiers_legislatifs_refs
field date_lettre_ministre() -> Option<&str> {
match &self.date_lettre_ministre {
None => None,
Some(ref s) => Some(s.as_str()),
}
}
field dossiers_legislatifs(&executor) -> Vec<&DossierParlementaire> {
match &self.dossiers_legislatifs_refs {
None => vec![],
Some(ref dossiers_legislatifs_refs) => {
let context = &executor.context();
dossiers_legislatifs_refs.dossiers_refs
.iter()
.filter_map(|ref dossier_ref| context.get_dossier_parlementaire_at_uid(&dossier_ref))
.collect()
},
}
}
field dossiers_legislatifs_refs() -> Vec<&str> {
match &self.dossiers_legislatifs_refs {
None => vec![],
Some(ref dossiers_legislatifs_refs) => {
dossiers_legislatifs_refs.dossiers_refs
.iter()
.map(|ref dossier_ref| dossier_ref.as_str())
.collect()
},
}
}
field nature_travaux_odj() -> &str {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment