Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 committed Sep 23, 2023
2 parents 7c8b6e1 + 030fe06 commit 7d754af
Show file tree
Hide file tree
Showing 26 changed files with 6 additions and 286 deletions.
12 changes: 0 additions & 12 deletions lib/atomic_web/live/activity_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,8 @@ defmodule AtomicWeb.ActivityLive.Edit do
def handle_params(%{"id" => id}, _, socket) do
activity = Activities.get_activity!(id, [:speakers])

entries = [
%{
name: gettext("Activities"),
route: Routes.activity_index_path(socket, :index)
},
%{
name: gettext("Edit Activity"),
route: Routes.activity_edit_path(socket, :edit, activity.organization_id, id)
}
]

{:noreply,
socket
|> assign(:breadcrumb_entries, entries)
|> assign(:current_page, :activities)
|> assign(:page_title, gettext("Edit Activity"))
|> assign(:activity, activity)}
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/activity_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,12 @@ defmodule AtomicWeb.ActivityLive.Index do

@impl true
def handle_params(params, _, socket) do
entries = [
%{
name: gettext("Activities"),
route: Routes.activity_index_path(socket, :index)
}
]

activities_with_flop = list_activities(socket, params)

{:noreply,
socket
|> assign(:page_title, gettext("Activities"))
|> assign(:current_page, :activities)
|> assign(:breadcrumb_entries, entries)
|> assign(:current_tab, current_tab(socket, params))
|> assign(:params, params)
|> assign(activities_with_flop)
Expand Down
12 changes: 0 additions & 12 deletions lib/atomic_web/live/activity_live/new.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,9 @@ defmodule AtomicWeb.ActivityLive.New do

@impl true
def handle_params(%{"organization_id" => organization_id}, _, socket) do
entries = [
%{
name: gettext("Activities"),
route: Routes.activity_index_path(socket, :index)
},
%{
name: gettext("New Activity"),
route: Routes.activity_new_path(socket, :new, socket.assigns.current_organization)
}
]

{:noreply,
socket
|> assign(:page_title, gettext("New Activity"))
|> assign(:breadcrumb_entries, entries)
|> assign(:current_page, :activities)
|> assign(:activity, %Activity{organization_id: organization_id})}
end
Expand Down
12 changes: 0 additions & 12 deletions lib/atomic_web/live/activity_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,9 @@ defmodule AtomicWeb.ActivityLive.Show do
def handle_params(%{"id" => id}, _, socket) do
activity = Activities.get_activity!(id, [:speakers, :organization])

entries = [
%{
name: gettext("Activities"),
route: Routes.activity_index_path(socket, :index)
},
%{
name: activity.title,
route: Routes.activity_show_path(socket, :show, id)
}
]

{:noreply,
socket
|> assign(:page_title, "#{activity.title}")
|> assign(:breadcrumb_entries, entries)
|> assign(:current_page, :activities)
|> assign(:activity, %{activity | enrolled: Activities.get_total_enrolled(id)})
|> assign(:enrolled?, maybe_put_enrolled(socket))
Expand Down
14 changes: 1 addition & 13 deletions lib/atomic_web/live/announcement_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,11 @@ defmodule AtomicWeb.AnnouncementLive.Edit do
end

@impl true
def handle_params(%{"organization_id" => organization_id, "id" => id}, _, socket) do
def handle_params(%{"organization_id" => _organization_id, "id" => id}, _, socket) do
announcement = Organizations.get_announcement!(id)

entries = [
%{
name: gettext("Announcements"),
route: Routes.announcement_index_path(socket, :index)
},
%{
name: gettext("Edit Announcements"),
route: Routes.announcement_edit_path(socket, :edit, id, organization_id)
}
]

{:noreply,
socket
|> assign(:breadcrumb_entries, entries)
|> assign(:current_page, :activities)
|> assign(:page_title, gettext("Edit Announcements"))
|> assign(:announcement, announcement)}
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/announcement_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,12 @@ defmodule AtomicWeb.AnnouncementLive.Index do

@impl true
def handle_params(params, _, socket) do
entries = [
%{
name: gettext("Announcements"),
route: Routes.announcement_index_path(socket, :index)
}
]

announcements_with_flop = list_announcements(socket, params)

{:noreply,
socket
|> assign(:page_title, gettext("Announcements"))
|> assign(:current_page, :announcements)
|> assign(:breadcrumb_entries, entries)
|> assign(:current_tab, current_tab(socket, params))
|> assign(:params, params)
|> assign(announcements_with_flop)
Expand Down
12 changes: 0 additions & 12 deletions lib/atomic_web/live/announcement_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,10 @@ defmodule AtomicWeb.AnnouncementLive.Show do
def handle_params(%{"id" => id}, _, socket) do
announcement = Organizations.get_announcement!(id, preloads: [:organization])

entries = [
%{
name: gettext("Announcements"),
route: Routes.announcement_index_path(socket, :index)
},
%{
name: announcement.title,
route: Routes.announcement_show_path(socket, :show, id)
}
]

{:noreply,
socket
|> assign(:page_title, "#{announcement.title}")
|> assign(:current_page, :announcements)
|> assign(:breadcrumb_entries, entries)
|> assign(:announcement, announcement)
|> assign(:has_permissions?, has_permissions?(socket))}
end
Expand Down
9 changes: 0 additions & 9 deletions lib/atomic_web/live/board_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,10 @@ defmodule AtomicWeb.BoardLive.Index do
organization = Organizations.get_organization!(organization_id)
role = Organizations.get_role(socket.assigns.current_user.id, organization_id)

entries = [
%{
name: "#{organization.name}'s #{gettext("Board")}",
route: Routes.board_index_path(socket, :index, organization_id)
}
]

{:noreply,
socket
|> assign(:current_page, :board)
|> assign(:page_title, "#{organization.name}'s #{gettext("Board")}")
|> assign(:breadcrumb_entries, entries)
|> assign(:organization, organization)
|> assign(:board_departments, board_departments)
|> assign(:empty?, Enum.empty?(board_departments))
|> assign(:has_permissions?, has_permissions?(socket, organization_id))
Expand Down
10 changes: 1 addition & 9 deletions lib/atomic_web/live/board_live/new.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,10 @@ defmodule AtomicWeb.BoardLive.New do
end

@impl true
def handle_params(%{"organization_id" => organization_id}, _, socket) do
entries = [
%{
name: gettext("New Board"),
route: Routes.board_new_path(socket, :new, organization_id)
}
]

def handle_params(%{"organization_id" => _organization_id}, _, socket) do
{:noreply,
socket
|> assign(:current_page, :board)
|> assign(:breadcrumb_entries, entries)
|> assign(:page_title, gettext("New Board"))
|> assign(:user_organization, %UserOrganization{})
|> assign(:users, Enum.map(Accounts.list_users(), fn u -> [key: u.email, value: u.id] end))}
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/calendar_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,10 @@ defmodule AtomicWeb.CalendarLive.Show do
def handle_params(params, _, socket) do
mode = default_mode(params)

entries = [
%{
name: gettext("Calendar"),
route: Routes.calendar_show_path(socket, :show)
}
]

{:noreply,
socket
|> assign(:page_title, "Calendar")
|> assign(:current_page, :calendar)
|> assign(:breadcrumb_entries, entries)
|> assign(:params, params)
|> assign(:mode, mode)
|> assign(:activities, list_activities(socket.assigns.timezone, mode, params))}
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/department_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ defmodule AtomicWeb.DepartmentLive.Index do
def handle_params(%{"organization_id" => organization_id}, _, socket) do
organization = Organizations.get_organization!(organization_id)

entries = [
%{
name: "#{organization.name}'s #{gettext("Departments")}",
route: Routes.department_index_path(socket, :index, organization.id)
}
]

departments =
Departments.list_departments_by_organization_id(organization_id, preloads: [:organization])

{:noreply,
socket
|> assign(:page_title, "#{organization.name}'s #{gettext("Departments")}")
|> assign(:current_page, :departments)
|> assign(:breadcrumb_entries, entries)
|> assign(:organization, organization)
|> assign(:departments, departments)
|> assign(:empty?, Enum.empty?(departments))
Expand Down
12 changes: 0 additions & 12 deletions lib/atomic_web/live/department_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,10 @@ defmodule AtomicWeb.DepartmentLive.Show do
organization = Organizations.get_organization!(organization_id)
department = Departments.get_department!(id)

entries = [
%{
name: gettext("Departments"),
route: Routes.department_index_path(socket, :index, organization_id)
},
%{
name: department.name,
route: Routes.department_show_path(socket, :show, organization_id, department.id)
}
]

{:noreply,
socket
|> assign(:current_page, :departments)
|> assign(:page_title, department.name)
|> assign(:breadcrumb_entries, entries)
|> assign(:organization, organization)
|> assign(:department, department)
|> assign(:collaborator, maybe_put_collaborator(socket, department.id))
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/home_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@ defmodule AtomicWeb.HomeLive.Index do

@impl true
def handle_params(_params, _, socket) do
entries = [
%{
name: gettext("Home"),
route: Routes.home_index_path(socket, :index)
}
]

{:noreply,
socket
|> assign(:page_title, gettext("Home"))
|> assign(:breadcrumb_entries, entries)
|> assign(:current_page, :home)}
end
end
12 changes: 0 additions & 12 deletions lib/atomic_web/live/membership_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,10 @@ defmodule AtomicWeb.MembershipLive.Edit do
membership = Organizations.get_membership!(id, [:user, :organization, :created_by])
organization = Organizations.get_organization!(organization_id)

entries = [
%{
name: "#{organization.name}'s #{gettext("Memberships")}",
route: Routes.membership_index_path(socket, :index, organization_id)
},
%{
name: gettext("Edit Membership"),
route: Routes.membership_edit_path(socket, :edit, organization_id, id)
}
]

{:noreply,
socket
|> assign(:page_title, "Edit Membership")
|> assign(:current_page, :memberships)
|> assign(:breadcrumb_entries, entries)
|> assign(:organization, organization)
|> assign(:membership, membership)
|> assign(:current_user, socket.assigns.current_user)
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/membership_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,10 @@ defmodule AtomicWeb.MembershipLive.Index do
def handle_params(%{"organization_id" => organization_id} = params, _, socket) do
organization = Organizations.get_organization!(organization_id)

entries = [
%{
name: "#{organization.name}'s #{gettext("Memberships")}",
route: Routes.membership_index_path(socket, :index, organization_id)
}
]

{:noreply,
socket
|> assign(:page_title, "#{organization.name}'s #{gettext("Memberships")}")
|> assign(:current_page, :memberships)
|> assign(:breadcrumb_entries, entries)
|> assign(:params, params)
|> assign(list_memberships(organization_id, params))}
end
Expand Down
16 changes: 0 additions & 16 deletions lib/atomic_web/live/organization_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,9 @@ defmodule AtomicWeb.OrganizationLive.Edit do
def handle_params(%{"organization_id" => organization_id}, _, socket) do
organization = Organizations.get_organization!(organization_id)

entries = [
%{
name: gettext("Organizations"),
route: Routes.organization_index_path(socket, :index)
},
%{
name: gettext("%{name}", name: organization.name),
route: Routes.organization_show_path(socket, :show, organization_id)
},
%{
name: gettext("Edit"),
route: Routes.organization_edit_path(socket, :edit, organization_id)
}
]

{:noreply,
socket
|> assign(:page_title, organization.name)
|> assign(:breadcrumb_entries, entries)
|> assign(:organization, organization)
|> assign(:current_page, :organizations)}
end
Expand Down
8 changes: 0 additions & 8 deletions lib/atomic_web/live/organization_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@ defmodule AtomicWeb.OrganizationLive.Index do

@impl true
def handle_params(params, _url, socket) do
entries = [
%{
name: gettext("Organizations"),
route: Routes.organization_index_path(socket, :index)
}
]

organizations_with_flop = list_organizations(params)

{:noreply,
socket
|> assign(:page_title, gettext("Organizations"))
|> assign(:current_page, :organizations)
|> assign(:breadcrumb_entries, entries)
|> assign(:params, params)
|> assign(organizations_with_flop)
|> assign(:empty?, Enum.empty?(organizations_with_flop.organizations))
Expand Down
12 changes: 0 additions & 12 deletions lib/atomic_web/live/organization_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,13 @@ defmodule AtomicWeb.OrganizationLive.Show do
def handle_params(%{"organization_id" => organization_id} = _params, _, socket) do
organization = Organizations.get_organization!(organization_id)

entries = [
%{
name: gettext("Organizations"),
route: Routes.organization_index_path(socket, :index)
},
%{
name: organization.name,
route: Routes.organization_show_path(socket, :show, organization_id)
}
]

{:noreply,
socket
|> assign(:page_title, organization.name)
|> assign(:organization, organization)
|> assign(:people, Organizations.list_organizations_members(organization))
|> assign(:breadcrumb_entries, entries)

Check warning on line 24 in lib/atomic_web/live/organization_live/show.ex

View workflow job for this annotation

GitHub Actions / Code Quality (25.x, 1.14.x)

variable "entries" does not exist and is being expanded to "entries()", please use parentheses to remove the ambiguity or change the variable name

Check failure on line 24 in lib/atomic_web/live/organization_live/show.ex

View workflow job for this annotation

GitHub Actions / Code Quality (25.x, 1.14.x)

** (CompileError) lib/atomic_web/live/organization_live/show.ex:24: undefined function entries/0 (expected AtomicWeb.OrganizationLive.Show to define such a function or for it to be imported, but none are available)

Check warning on line 24 in lib/atomic_web/live/organization_live/show.ex

View workflow job for this annotation

GitHub Actions / OTP 25.x / Elixir 1.14.x

variable "entries" does not exist and is being expanded to "entries()", please use parentheses to remove the ambiguity or change the variable name

Check failure on line 24 in lib/atomic_web/live/organization_live/show.ex

View workflow job for this annotation

GitHub Actions / OTP 25.x / Elixir 1.14.x

** (CompileError) lib/atomic_web/live/organization_live/show.ex:24: undefined function entries/0 (expected AtomicWeb.OrganizationLive.Show to define such a function or for it to be imported, but none are available)
|> assign(:current_page, :organizations)
|> assign(:breadcrumb_entries, entries)
|> assign(:organization, organization)
|> assign(:departments, Departments.list_departments_by_organization_id(organization_id))
|> assign(list_activities(organization_id))
Expand Down
Loading

0 comments on commit 7d754af

Please sign in to comment.