Compare commits

...

5 Commits

Author SHA1 Message Date
CI
83801c9063 chore: release version v1.56.1
Some checks are pending
Build / 🚀 Deploy to test env (fly.io) (push) Waiting to run
Build / Manual Approval (push) Blocked by required conditions
Build / 🛠 Build (1.17, 18.x, 27) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/amd64) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/arm64) (push) Blocked by required conditions
Build / merge (push) Blocked by required conditions
Build / 🏷 Create Release (push) Blocked by required conditions
2025-03-18 09:34:32 +00:00
guarzo
0f34350c58 fix: update activity api (#284) 2025-03-18 11:51:29 +04:00
guarzo
1c4c0f0715 fix: qol updates for dev (#283) 2025-03-18 11:50:33 +04:00
Dmitry Popov
3825fc831a refactor: removal of legacy event
Some checks are pending
Build / 🚀 Deploy to test env (fly.io) (push) Waiting to run
Build / Manual Approval (push) Blocked by required conditions
Build / 🛠 Build (1.17, 18.x, 27) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/amd64) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/arm64) (push) Blocked by required conditions
Build / merge (push) Blocked by required conditions
Build / 🏷 Create Release (push) Blocked by required conditions
2025-03-17 22:51:29 +01:00
guarzo
654670cbc8 refactor: removal of legacy event (#277)
Some checks are pending
Build / 🚀 Deploy to test env (fly.io) (push) Waiting to run
Build / Manual Approval (push) Blocked by required conditions
Build / 🛠 Build (1.17, 18.x, 27) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/amd64) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/arm64) (push) Blocked by required conditions
Build / merge (push) Blocked by required conditions
Build / 🏷 Create Release (push) Blocked by required conditions
2025-03-18 00:11:32 +04:00
11 changed files with 100 additions and 74 deletions

View File

@@ -1,6 +1,27 @@
FROM elixir:1.17-otp-27
RUN apt install -yq curl gnupg
# Install OS packages and Node.js (via nodesource),
# plus inotify-tools and yarn
RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
curl \
make \
git \
bash \
build-essential \
ca-certificates \
jq \
vim \
net-tools \
procps \
# Optionally add any other tools you need, e.g. vim, wget...
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y --no-install-recommends nodejs inotify-tools \
&& npm install -g yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt --fix-broken install
RUN mix local.hex --force

View File

@@ -1,20 +1,30 @@
{
"name": "wanderer-dev",
"dockerComposeFile": ["./docker-compose.yml"],
"extensions": [
"jakebecker.elixir-ls",
"JakeBecker.elixir-ls",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],
"customizations": {
"vscode": {
"extensions": [
"jakebecker.elixir-ls",
"JakeBecker.elixir-ls",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],
"settings": {
"editor.formatOnSave": true,
"search.exclude": {
"**/doc": true
},
"elixirLS.dialyzerEnabled": false
}
}
},
"service": "wanderer",
"workspaceFolder": "/app",
"shutdownAction": "stopCompose",
"settings": {
"editor.formatOnSave": true,
"search.exclude": {
"**/doc": true
},
"elixirLS.dialyzerEnabled": false
}
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"networkArgs": ["--add-host=host.docker.internal:host-gateway"]
}
},
"forwardPorts": [4444]
}

View File

@@ -14,15 +14,15 @@ services:
wanderer:
environment:
PORT: 8000
PORT: 4444
DB_HOST: db
WEB_APP_URL: "http://localhost:8000"
WEB_APP_URL: "http://localhost:4444"
ERL_AFLAGS: "-kernel shell_history enabled"
build:
context: .
dockerfile: Dockerfile
ports:
- 8000:8000
- 4444:4444
volumes:
- ..:/app:delegated
- ~/.gitconfig:/root/.gitconfig

View File

@@ -2,6 +2,17 @@
<!-- changelog -->
## [v1.56.1](https://github.com/wanderer-industries/wanderer/compare/v1.56.0...v1.56.1) (2025-03-18)
### Bug Fixes:
* update activity api (#284)
* qol updates for dev (#283)
## [v1.56.0](https://github.com/wanderer-industries/wanderer/compare/v1.55.2...v1.56.0) (2025-03-17)

View File

@@ -13,18 +13,12 @@ export const useTrackAndFollowHandlers = () => {
* Handle hiding the track and follow dialog
*/
const handleHideTracking = useCallback(() => {
// Send the command to the server first
outCommand({
type: OutCommand.hideTracking,
data: {},
});
// Then update local state to hide the dialog
update(state => ({
...state,
showTrackAndFollow: false,
}));
}, [outCommand, update]);
}, [update]);
/**
* Handle showing the track and follow dialog
@@ -101,7 +95,6 @@ export const useTrackAndFollowHandlers = () => {
[outCommand],
);
/**
* Handle user settings updates
*/

View File

@@ -45,16 +45,9 @@ export const useCommandsActivity = () => {
}));
}, []);
const hideTracking = useCallback(() => {
ref.current.update((state: MapRootData) => ({
...state,
showTrackAndFollow: false,
}));
}, []);
const userSettingsUpdated = useCallback((data: CommandUserSettingsUpdated) => {
emitMapEvent({ name: Commands.userSettingsUpdated, data });
}, []);
return { characterActivityData, trackingCharactersData, userSettingsUpdated, hideActivity, hideTracking };
return { characterActivityData, trackingCharactersData, userSettingsUpdated, hideActivity };
};

View File

@@ -241,7 +241,6 @@ export enum OutCommand {
// Only UI commands
openSettings = 'open_settings',
showActivity = 'show_activity',
hideTracking = 'hide_tracking',
showTracking = 'show_tracking',
getUserSettings = 'get_user_settings',
updateUserSettings = 'update_user_settings',

View File

@@ -691,40 +691,44 @@ defmodule WandererAppWeb.MapAPIController do
}}
]
def character_activity(conn, params) do
with {:ok, map_id} <- Util.fetch_map_id(params),
current_user <- conn.assigns.current_user do
# Get raw activity data from the domain logic
result = WandererApp.Character.Activity.process_character_activity(map_id, current_user)
with {:ok, map_id} <- Util.fetch_map_id(params) do
# Get raw activity data directly from the Map module instead of the Activity processor
raw_activity = WandererApp.Map.get_character_activity(map_id)
# Group activities by user_id and summarize
summarized_result =
result
|> Enum.group_by(fn activity ->
# Get user_id from the character
activity.character.user_id
end)
|> Enum.map(fn {_user_id, user_activities} ->
# Get the most active or followed character for this user
representative_activity =
user_activities
|> Enum.max_by(fn activity ->
activity.passages + activity.connections + activity.signatures
end)
if raw_activity == [] do
# Return empty list if there's no data
[]
else
raw_activity
|> Enum.group_by(fn activity ->
# Get user_id from the character
activity.character.user_id
end)
|> Enum.map(fn {_user_id, user_activities} ->
# Get the most active or followed character for this user
representative_activity =
user_activities
|> Enum.max_by(fn activity ->
activity.passages + activity.connections + activity.signatures
end)
# Sum up all activities for this user
total_passages = Enum.sum(Enum.map(user_activities, & &1.passages))
total_connections = Enum.sum(Enum.map(user_activities, & &1.connections))
total_signatures = Enum.sum(Enum.map(user_activities, & &1.signatures))
# Sum up all activities for this user
total_passages = Enum.sum(Enum.map(user_activities, & &1.passages))
total_connections = Enum.sum(Enum.map(user_activities, & &1.connections))
total_signatures = Enum.sum(Enum.map(user_activities, & &1.signatures))
# Return summarized activity with the mapped character
%{
character: character_to_json(representative_activity.character),
passages: total_passages,
connections: total_connections,
signatures: total_signatures,
timestamp: representative_activity.timestamp
}
end)
# Return summarized activity with the mapped character
%{
character: character_to_json(representative_activity.character),
passages: total_passages,
connections: total_connections,
signatures: total_signatures,
timestamp: representative_activity.timestamp
}
end)
end
json(conn, %{data: summarized_result})
else

View File

@@ -155,10 +155,6 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
{:ok, tracking_data} ->
{:noreply,
socket
|> MapEventHandler.push_map_event(
"show_tracking",
%{}
)
|> MapEventHandler.push_map_event(
"tracking_characters_data",
%{characters: tracking_data}

View File

@@ -29,7 +29,6 @@ defmodule WandererAppWeb.MapEventHandler do
@map_characters_ui_events [
"toggle_track",
"toggle_follow",
"hide_tracking",
"show_tracking",
"getCharacterInfo"
]
@@ -305,12 +304,12 @@ defmodule WandererAppWeb.MapEventHandler do
type,
body
) do
socket
|> Phoenix.LiveView.Utils.push_event("map_event", %{
type: type,
body: body
})
end
socket
|> Phoenix.LiveView.Utils.push_event("map_event", %{
type: type,
body: body
})
end
def push_map_event(socket, _type, _body), do: socket

View File

@@ -3,7 +3,7 @@ defmodule WandererApp.MixProject do
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.56.0"
@version "1.56.1"
def project do
[