Skip to content

Commit

Permalink
Next/dev (#430)
Browse files Browse the repository at this point in the history
Includes releases for:
- Rank summer school pilot
- Port d3i sprint 2
  • Loading branch information
mellelieuwes committed Jun 27, 2023
1 parent 8389ffc commit d35d896
Show file tree
Hide file tree
Showing 326 changed files with 7,731 additions and 3,852 deletions.
4 changes: 3 additions & 1 deletion core/.dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[
# Nothing to see here
# https://github.com/phoenixframework/phoenix/issues/5437
{"systems/benchmark/export_controller.ex", :no_return},
{"systems/benchmark/export_controller.ex", :call}
]
4 changes: 4 additions & 0 deletions core/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
}
}

[x-cloak] {
display: none !important;
}

.max-lines-1 {
overflow: hidden;
display: -webkit-box;
Expand Down
37 changes: 23 additions & 14 deletions core/assets/js/side_panel.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
const maxBottomMargin = 41;
const maxBottomMargin = 62;

export const SidePanel = {
mounted() {
this.startRect = this.el.getBoundingClientRect();
this.parent = document.getElementById(this.el.dataset.parent);
this.panel = this.el.getElementsByClassName("panel")[0];
this.panel.style = `height: 0px;`;
this.el.classList.remove("relative");
this.el.classList.add("absolute");

this.make_absolute();
this.updateFrame();

window.addEventListener("tab-activated", (event) => {
this.updateFrame();
});

window.addEventListener("scroll", (event) => {
this.updateFrame();
});
Expand All @@ -18,28 +20,35 @@ export const SidePanel = {
this.updateFrame();
});
},
make_absolute() {
this.el.classList.remove("relative");
this.el.classList.add("absolute");
},
updated() {
this.make_absolute();
this.updateFrame();
},

updateFrame() {
this.updateHeight();
this.updatePosition();
},
updateHeight() {
const scrollDelta =
const bottomMarginDelta = Math.min(
maxBottomMargin,
document.documentElement.scrollHeight -
window.innerHeight -
window.scrollY;
const bottomMargin =
maxBottomMargin - Math.min(maxBottomMargin, scrollDelta);
window.scrollY -
window.innerHeight
);
const bottomMargin = maxBottomMargin - bottomMarginDelta;

const topDelta = Math.max(0, this.startRect.y - window.scrollY);
const height = Math.max(0, window.innerHeight - topDelta - bottomMargin);
const height =
window.innerHeight -
(this.parent.getBoundingClientRect().top + bottomMargin);
this.panel.style = `height: ${height}px;`;
},
updatePosition() {
const top = Math.max(this.startRect.y, window.scrollY);
const top =
Math.max(0, this.parent.getBoundingClientRect().top) + window.scrollY;
this.el.style = `top: ${top}px; right: 0px`;
},
};
2 changes: 1 addition & 1 deletion core/assets/js/tabbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const Tabbar = {
var isVisible = tab.id === nextTabId;
setVisible(tab, isVisible);
if (isVisible) {
tab.dispatchEvent(new Event("tab-activated"));
tab.dispatchEvent(new Event("tab-activated", { bubbles: true}));
}
});

Expand Down
Binary file removed core/assets/static/images/email-header-welcome.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions core/assets/static/images/icons/arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions core/assets/static/images/icons/arrow_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions core/assets/static/images/icons/chevron_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions core/assets/static/images/icons/chevron_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions core/assets/static/images/icons/clipboard_primary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions core/assets/static/images/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions core/assets/static/images/icons/delete_red.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions core/assets/static/images/icons/export.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions core/assets/static/images/icons/more_horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions core/assets/static/images/icons/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions core/assets/static/images/icons/next_wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions core/assets/static/images/icons/remove.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions core/assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,27 @@ module.exports = {
"17px": "17px",
"18px": "18px",
"19px": "19px",
"22px": "22px",
"30px": "30px",
"48px": "48px",
"44px": "44px",
"60px": "60px",
"64px": "64px",
"84px": "84px",
"200px": "200px",
"224px": "224px",
"248px": "248px",
15: "60x",
30: "120px",
34: "136px",
35: "140px",
border: "2px",
"action_menu-width": "180px",
"tablet-menu-width": "72px",
"desktop-menu-width": "296px",
"mobile-menu-width": "256px",
"platform-footer-height": "62px",
"desktop-menu-bottom-padding": "54px",
sidepadding: "64px",
"navbar-height": "90px",
"dialog-width": "320px",
Expand Down Expand Up @@ -114,6 +121,7 @@ module.exports = {
"topbar-sm": "96px",
"topbar-lg": "128px",
footer: "48px",
"platform-footer": "62px",
"footer-sm": "64px",
"footer-lg": "96px",
header1: "100px",
Expand All @@ -134,6 +142,7 @@ module.exports = {
"image-preview-circle-sm": "150px",
"campaign-banner": "224px",
"button-sm": "14px",
"file-selector": "96px",
},
fontFamily: {
title0: ["Finador-Black", "sans-serif"],
Expand All @@ -148,9 +157,13 @@ module.exports = {
link: ["Finador-Medium", "sans-serif"],
subhead: ["Finador-Medium", "sans-serif"],
button: ["Finador-Bold", "sans-serif"],
footnote: ["Finador-Medium", "sans-serif"],
intro: ["Finador-Medium", "sans-serif"],
label: ["Finador-Bold", "sans-serif"],
body: ["Finador-Light", "sans-serif"],
hint: ["Finador-LightOblique", "sans-serif"],
tablehead: ["Finador-Bold", "sans-serif"],
tablerow: ["Finador-Regular", "sans-serif"],
},
fontSize: {
title0: ["64px", "68px"],
Expand All @@ -168,6 +181,7 @@ module.exports = {
labelsmall: ["14px", "14px"],
button: ["18px", "18px"],
buttonsmall: ["16px", "16px"],
footnote: ["16px", "30px"],
intro: ["20px", "30px"],
introdesktop: ["24px", "36px"],
bodylarge: ["24px", "36px"],
Expand All @@ -176,6 +190,9 @@ module.exports = {
bodylinklarge: ["24px", "36px"],
bodylinkmedium: ["30px", "30px"],
link: ["16px", "24px"],
hint: ["20px", "24px"],
tablehead: ["14px", "16px"],
tablerow: ["14px", "16px"],
},
minWidth: {
"1/2": "50%",
Expand Down
6 changes: 3 additions & 3 deletions core/bundles/link/bundle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ defmodule Link.Bundle do
quote do
scope "/", Link do
pipe_through([:browser, :redirect_if_user_is_authenticated])
get("/user/signin", User.SessionController, :new)
post("/user/signin", User.SessionController, :create)
get("/user/session", User.SessionController, :new)
post("/user/session", User.SessionController, :create)
end

scope "/", Link do
pipe_through([:browser])
delete("/user/signout", User.SessionController, :delete)
delete("/user/session", User.SessionController, :delete)
end

scope "/", Link do
Expand Down
6 changes: 3 additions & 3 deletions core/bundles/link/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ config :core,
stripped_menu_builder: Link.Layouts.Stripped.MenuBuilder

config :core, CoreWeb.UserAuth,
researcher_signed_in_page: Link.Console.Page,
participant_signed_in_page: Link.Console.Page,
participant_onboarding_page: Link.Onboarding.WizardPage
researcher_signed_in_page: "/console",
participant_signed_in_page: "/console",
participant_onboarding_page: "/onboarding"

config :core, :features,
sign_in_with_apple: false,
Expand Down
19 changes: 5 additions & 14 deletions core/bundles/link/lib/console/page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,25 @@ defmodule Link.Console.Page do
alias Frameworks.Pixel.Text
alias Systems.NextAction

def mount(_params, _session, %{assigns: %{current_user: user}} = socket) do
def mount(_params, _session, %{assigns: %{current_user: user} = assigns} = socket) do
preload = Campaign.Model.preload_graph(:full)

next_best_action = NextAction.Public.next_best_action(url_resolver(socket), user)
next_best_action = NextAction.Public.next_best_action(user)

wallets =
Budget.Public.list_wallets(user)
|> filter_wallets()
|> Enum.map(&Budget.WalletViewBuilder.view_model(&1, user, url_resolver(socket)))
|> Enum.map(&Budget.WalletViewBuilder.view_model(&1, user))

contributions =
user
|> Campaign.Public.list_subject_campaigns(preload: preload)
|> Enum.map(
&ViewModelBuilder.view_model(&1, {__MODULE__, :contribution}, user, url_resolver(socket))
)
|> Enum.map(&ViewModelBuilder.view_model(&1, {__MODULE__, :contribution}, assigns))

content_items =
user
|> Campaign.Public.list_owned_campaigns(preload: preload)
|> Enum.map(
&ViewModelBuilder.view_model(&1, {__MODULE__, :content}, user, url_resolver(socket))
)
|> Enum.map(&ViewModelBuilder.view_model(&1, {__MODULE__, :content}, assigns))

socket =
socket
Expand All @@ -65,11 +61,6 @@ defmodule Link.Console.Page do
{:noreply, socket}
end

# data(wallets, :any)
# data(contributions, :any)
# data(content_items, :any)
# data(current_user, :any)
# data(next_best_action, :any)
@impl true
def render(assigns) do
~H"""
Expand Down
4 changes: 2 additions & 2 deletions core/bundles/link/lib/layouts/stripped/menu_builder.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Link.Layouts.Stripped.MenuBuilder do
@home_flags [
desktop_navbar: [:wide],
mobile_menu: [:wide]
mobile_menu: [:narrow]
]

@item_flags [
Expand All @@ -15,5 +15,5 @@ defmodule Link.Layouts.Stripped.MenuBuilder do
use CoreWeb.Menu.Builder, home: :link

@impl true
def can_access?(_user, _id), do: true
def include_map(_user), do: %{}
end
12 changes: 6 additions & 6 deletions core/bundles/link/lib/layouts/website/menu_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ defmodule Link.Layouts.Website.MenuBuilder do
]

@secondary [
desktop_navbar: [:signin, :signout, :language],
mobile_menu: [:language, :signin, :signout],
desktop_navbar: [:signin, :profile, :language],
mobile_menu: [:language, :signin, :profile],
mobile_navbar: [:menu]
]

use CoreWeb.Menu.Builder, home: :link
alias Core.Authorization

@impl true
def can_access?(user, :console), do: Authorization.can_access?(user, Link.Console.Page)

@impl true
def can_access?(_user, _id), do: true
def include_map(user),
do: %{
console: Authorization.can_access?(user, Link.Console.Page)
}
end
Loading

0 comments on commit d35d896

Please sign in to comment.