From c02a9e10123ce1afd3fdb48d7fcdfc10758fb060 Mon Sep 17 00:00:00 2001 From: Mayel de Borniol Date: Mon, 23 Dec 2024 15:16:52 +0000 Subject: [PATCH] move ui_common hooks to the main JS --- flavours/blog/config/deps_hooks.js | 6 +++--- flavours/classic/config/deps_hooks.js | 6 +++--- flavours/classic/config/runtime.exs | 16 +++++++++++----- flavours/community/config/deps_hooks.js | 6 +++--- flavours/cooperation/config/deps_hooks.js | 6 +++--- flavours/coordination/config/deps_hooks.js | 6 +++--- flavours/open-science/config/hooks.js | 6 +++--- flavours/reflow/config/deps_hooks.js | 6 +++--- flavours/upcycle/config/deps_hooks.js | 6 +++--- 9 files changed, 35 insertions(+), 29 deletions(-) diff --git a/flavours/blog/config/deps_hooks.js b/flavours/blog/config/deps_hooks.js index da338293bcf..43abbfa9215 100644 --- a/flavours/blog/config/deps_hooks.js +++ b/flavours/blog/config/deps_hooks.js @@ -11,8 +11,8 @@ let ExtensionHooks = {}; // import { ResponsiveTabsHooks } from "./../../../deps/bonfire_ui_common/assets/js/responsive_tabs" // import { ThemeHooks } from "./../../../deps/bonfire_ui_common/assets/js/theme" -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" // import { FeedHooks } from "./../../../deps/bonfire_ui_common/assets/js/feed" @@ -35,6 +35,6 @@ import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/toolti import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/classic/config/deps_hooks.js b/flavours/classic/config/deps_hooks.js index aad8a6ddcdd..32bce2c6c34 100644 --- a/flavours/classic/config/deps_hooks.js +++ b/flavours/classic/config/deps_hooks.js @@ -9,9 +9,9 @@ let ExtensionHooks = {}; // import { NotificationsHooks } from "./../../../deps/bonfire_ui_common/assets/js/notifications" // import { ResponsiveTabsHooks } from "./../../../deps/bonfire_ui_common/assets/js/responsive_tabs" // import { ThemeHooks } from "./../../../deps/bonfire_ui_common/assets/js/theme" -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { FeedHooks } from "./../../../deps/bonfire_ui_common/assets/js/feed" // import { InfiniteScrollHooks } from "./../../../deps/bonfire_ui_common/assets/js/infinite_scroll" // import { ImageHooks } from "./../../../deps/bonfire_ui_common/assets/js/image" @@ -31,6 +31,6 @@ import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/toolti // import LiveSelect from "./../../../deps/live_select/assets/js/live_select" import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect) // CopyHooks, TooltipHooks, EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/classic/config/runtime.exs b/flavours/classic/config/runtime.exs index 47f7fee6888..badea73e2a5 100644 --- a/flavours/classic/config/runtime.exs +++ b/flavours/classic/config/runtime.exs @@ -233,14 +233,20 @@ config :bonfire, Oban, {Oban.Plugins.Cron, crontab: [ - #  generate static pages for guests every 10 min - {"*/10 * * * *", Bonfire.UI.Common.StaticGenerator, max_attempts: 3}, {"@daily", ActivityPub.Pruner.PruneDatabaseWorker, max_attempts: 1} ] ++ + if Bonfire.Common.Extend.module_enabled?(Bonfire.UI.Common.StaticGenerator) do + #  generate static pages for guests every X min + interval = if config_env() == :prod, do: 10, else: 60 + IO.puts("Static pages will be generated and cached every #{interval} minutes.") + + [{"*/#{interval} * * * *", Bonfire.UI.Common.StaticGenerator, max_attempts: 3}] + else + IO.puts("Static pages will not be cached") + [] + end ++ if Bonfire.Common.Extend.extension_enabled?(:bonfire_open_science) do - IO.puts( - "Open science publications will be fetched for all users at regular intervals." - ) + IO.puts("Open science publications will be fetched for all users once an hour.") [{"@hourly", Bonfire.OpenScience.APIs}] else diff --git a/flavours/community/config/deps_hooks.js b/flavours/community/config/deps_hooks.js index da338293bcf..43abbfa9215 100644 --- a/flavours/community/config/deps_hooks.js +++ b/flavours/community/config/deps_hooks.js @@ -11,8 +11,8 @@ let ExtensionHooks = {}; // import { ResponsiveTabsHooks } from "./../../../deps/bonfire_ui_common/assets/js/responsive_tabs" // import { ThemeHooks } from "./../../../deps/bonfire_ui_common/assets/js/theme" -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" // import { FeedHooks } from "./../../../deps/bonfire_ui_common/assets/js/feed" @@ -35,6 +35,6 @@ import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/toolti import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/cooperation/config/deps_hooks.js b/flavours/cooperation/config/deps_hooks.js index 787aa34d3e6..de55d87358b 100644 --- a/flavours/cooperation/config/deps_hooks.js +++ b/flavours/cooperation/config/deps_hooks.js @@ -11,8 +11,8 @@ let ExtensionHooks = {}; // import { ResponsiveTabsHooks } from "./../../../deps/bonfire_ui_common/assets/js/responsive_tabs" // import { ThemeHooks } from "./../../../deps/bonfire_ui_common/assets/js/theme" -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" // import { FeedHooks } from "./../../../deps/bonfire_ui_common/assets/js/feed" @@ -31,6 +31,6 @@ import { EncryptHooks } from "./../../../deps/bonfire_encrypt/assets/js/extensio // import LiveSelect from "./../../../deps/live_select/assets/js/live_select" import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect, GeolocateHooks, KanbanHooks, EncryptHooks) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect, GeolocateHooks, KanbanHooks, EncryptHooks) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/coordination/config/deps_hooks.js b/flavours/coordination/config/deps_hooks.js index 787aa34d3e6..de55d87358b 100644 --- a/flavours/coordination/config/deps_hooks.js +++ b/flavours/coordination/config/deps_hooks.js @@ -11,8 +11,8 @@ let ExtensionHooks = {}; // import { ResponsiveTabsHooks } from "./../../../deps/bonfire_ui_common/assets/js/responsive_tabs" // import { ThemeHooks } from "./../../../deps/bonfire_ui_common/assets/js/theme" -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" // import { FeedHooks } from "./../../../deps/bonfire_ui_common/assets/js/feed" @@ -31,6 +31,6 @@ import { EncryptHooks } from "./../../../deps/bonfire_encrypt/assets/js/extensio // import LiveSelect from "./../../../deps/live_select/assets/js/live_select" import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect, GeolocateHooks, KanbanHooks, EncryptHooks) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect, GeolocateHooks, KanbanHooks, EncryptHooks) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/open-science/config/hooks.js b/flavours/open-science/config/hooks.js index a5436ec2849..885c94d127e 100644 --- a/flavours/open-science/config/hooks.js +++ b/flavours/open-science/config/hooks.js @@ -2,12 +2,12 @@ let ExtensionHooks = {}; // TODO: make this more configurable? ie. don't import disabled extensions -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/reflow/config/deps_hooks.js b/flavours/reflow/config/deps_hooks.js index 74c7137f222..6e87aacac24 100644 --- a/flavours/reflow/config/deps_hooks.js +++ b/flavours/reflow/config/deps_hooks.js @@ -4,14 +4,14 @@ let ExtensionHooks = {}; // NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing! // TODO: make this more configurable? ie. don't import disabled extensions -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect, GeolocateHooks) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect, GeolocateHooks) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks } diff --git a/flavours/upcycle/config/deps_hooks.js b/flavours/upcycle/config/deps_hooks.js index 338b138eafc..cca329d5466 100644 --- a/flavours/upcycle/config/deps_hooks.js +++ b/flavours/upcycle/config/deps_hooks.js @@ -4,8 +4,8 @@ let ExtensionHooks = {}; // NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing! // TODO: make this more configurable? ie. don't import disabled extensions -import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" -import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" +// import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy" +// import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip" // import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup" import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js" @@ -13,6 +13,6 @@ import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min. import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension" // import { KanbanHooks } from "./../../../deps/bonfire_ui_kanban/assets/js/extension" -Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect, GeolocateHooks) // EditorCkHooks, EditorQuillHooks +Object.assign(ExtensionHooks, LiveSelect, GeolocateHooks) // EditorCkHooks, EditorQuillHooks export { ExtensionHooks }