Skip to content

Commit

Permalink
move ui_common hooks to the main JS
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Dec 23, 2024
1 parent b9e2afb commit c02a9e1
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 29 deletions.
6 changes: 3 additions & 3 deletions flavours/blog/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }
6 changes: 3 additions & 3 deletions flavours/classic/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }
16 changes: 11 additions & 5 deletions flavours/classic/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions flavours/community/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }
6 changes: 3 additions & 3 deletions flavours/cooperation/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }
6 changes: 3 additions & 3 deletions flavours/coordination/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }
6 changes: 3 additions & 3 deletions flavours/open-science/config/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
6 changes: 3 additions & 3 deletions flavours/reflow/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
6 changes: 3 additions & 3 deletions flavours/upcycle/config/deps_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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"
// 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 }

0 comments on commit c02a9e1

Please sign in to comment.