From e7237a0236967278e033547630621a898df615b2 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Tue, 4 Jun 2024 14:02:59 -0700 Subject: [PATCH] Revert "Allow to inject arbitrary components into the (#1499)" This reverts commit b949d45a2353141b3635d7f88b1fdd9cf78fa666. --- .../src/components/layouts/head/mod.rs | 22 +------------------ .../src/components/layouts/head/template.html | 4 ---- .../components/layouts/marketing/base/mod.rs | 11 +--------- pgml-dashboard/src/templates/mod.rs | 11 ---------- 4 files changed, 2 insertions(+), 46 deletions(-) diff --git a/pgml-dashboard/src/components/layouts/head/mod.rs b/pgml-dashboard/src/components/layouts/head/mod.rs index f64e907c7..1111815ad 100644 --- a/pgml-dashboard/src/components/layouts/head/mod.rs +++ b/pgml-dashboard/src/components/layouts/head/mod.rs @@ -1,4 +1,4 @@ -use pgml_components::{component, Component}; +use pgml_components::component; use sailfish::TemplateOnce; #[derive(TemplateOnce, Default, Clone)] @@ -10,7 +10,6 @@ pub struct Head { pub preloads: Vec, pub context: Option, pub canonical: Option, - pub additional_components: Vec, } impl Head { @@ -59,25 +58,6 @@ impl Head { self.context = context.to_owned(); self } - - /// Add a component to ``. - /// - /// This can be anything, e.g. a `")); - /// ``` - /// - pub fn add_component(mut self, component: Component) -> Self { - self.additional_components.push(component); - self - } } component!(Head); diff --git a/pgml-dashboard/src/components/layouts/head/template.html b/pgml-dashboard/src/components/layouts/head/template.html index 823dbb80a..3ad5d44a9 100644 --- a/pgml-dashboard/src/components/layouts/head/template.html +++ b/pgml-dashboard/src/components/layouts/head/template.html @@ -97,8 +97,4 @@ }; <% } %> - - <% for component in additional_components { %> - <%+ component %> - <% } %> diff --git a/pgml-dashboard/src/components/layouts/marketing/base/mod.rs b/pgml-dashboard/src/components/layouts/marketing/base/mod.rs index 15d983756..5d1ee0d36 100644 --- a/pgml-dashboard/src/components/layouts/marketing/base/mod.rs +++ b/pgml-dashboard/src/components/layouts/marketing/base/mod.rs @@ -3,7 +3,7 @@ use crate::components::notifications::marketing::AlertBanner; use crate::guards::Cluster; use crate::models::User; use crate::Notification; -use pgml_components::{component, Component}; +use pgml_components::component; use sailfish::TemplateOnce; use std::fmt; @@ -72,15 +72,6 @@ impl Base { rsp } - /// Add a component to the ``. - /// - /// See [`Head::add_component`](crate::components::layouts::Head::add_component) for more information. - /// - pub fn add_head_component(mut self, component: Component) -> Self { - self.head = self.head.add_component(component); - self - } - pub fn footer(mut self, footer: String) -> Self { self.footer = Some(footer); self diff --git a/pgml-dashboard/src/templates/mod.rs b/pgml-dashboard/src/templates/mod.rs index d6328661e..39a614f85 100644 --- a/pgml-dashboard/src/templates/mod.rs +++ b/pgml-dashboard/src/templates/mod.rs @@ -163,17 +163,6 @@ impl<'a> WebAppBase<'a> { self } - /// Add a component to head (``). - /// - /// # Arguments - /// - /// * `component` - The component to add to the head. - /// - pub fn add_head_component(&mut self, component: Component) -> &mut Self { - self.head = self.head.clone().add_component(component); - self - } - pub fn render(&mut self, template: T) -> String where T: sailfish::TemplateOnce, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy