Compare commits

..

13 Commits

Author SHA1 Message Date
Dmitry Popov
9196b42fc5 chore: add "get_all_systems" API 2024-12-23 12:22:59 +01:00
CI
3f6364c9ea chore: release version v1.31.0
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (push) Has been cancelled
Build / 🛠 Build (1.17, 18.x, 27) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/amd64) (push) Has been cancelled
Build / 🏷 Create Release (push) Has been cancelled
2024-12-20 15:05:20 +00:00
Dmitry Popov
0d11b12282 feat(Core): Show tracking for new users by default. Auto link characters to account fix. Add character loading indicators. 2024-12-20 16:04:31 +01:00
CI
a5020b58f2 chore: release version v1.30.2
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (push) Has been cancelled
Build / 🛠 Build (1.17, 18.x, 27) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/amd64) (push) Has been cancelled
Build / 🏷 Create Release (push) Has been cancelled
2024-12-17 16:31:33 +00:00
Aleksei Chichenkov
f039a74a8f Merge pull request #84 from wanderer-industries/fix-ship-size
fix(Map): Fixed problem with ship size change.
2024-12-17 19:30:56 +03:00
achichenkov
0e6bb7390b fix(Map): Fixed problem with ship size change. 2024-12-17 19:10:26 +03:00
CI
b52b4eecca chore: release version v1.30.1 2024-12-17 12:26:49 +00:00
Aleksei Chichenkov
8186977d1d Merge pull request #83 from wanderer-industries/feat-set-wormhole-size
Feature (Map) - Improved connection size settings and some UI issues
2024-12-17 15:26:20 +03:00
achichenkov
86adcfe4d7 fix(Map): Little rework Signatures header: change System Signatures to Signatures, and show selected system name instead. 2024-12-17 14:32:35 +03:00
Dmitry Popov
ce2dd872c4 fix(Map): update default size of connections 2024-12-17 11:47:05 +01:00
achichenkov
aadc53c90e fix(Map): add ability set the size of wormhole and mark connection with label 2024-12-17 13:33:37 +03:00
CI
cbc1b6b5c8 chore: release version v1.30.0
Some checks are pending
Build / 🚀 Deploy to test env (fly.io) (push) Waiting to run
Build / 🛠 Build (1.17, 18.x, 27) (push) Waiting to run
Build / 🛠 Build Docker Images (linux/amd64) (push) Blocked by required conditions
Build / 🏷 Create Release (push) Blocked by required conditions
2024-12-16 18:49:37 +00:00
Aleksei Chichenkov
1aed7a9232 Merge pull request #82 from wanderer-industries/ui-issues-part-3
UI issues part 3
2024-12-16 21:49:11 +03:00
28 changed files with 1528 additions and 340 deletions

View File

@@ -2,6 +2,58 @@
<!-- changelog -->
## [v1.31.0](https://github.com/wanderer-industries/wanderer/compare/v1.30.2...v1.31.0) (2024-12-20)
### Features:
* Core: Show tracking for new users by default. Auto link characters to account fix. Add character loading indicators.
## [v1.30.2](https://github.com/wanderer-industries/wanderer/compare/v1.30.1...v1.30.2) (2024-12-17)
### Bug Fixes:
* Map: Fixed problem with ship size change.
## [v1.30.1](https://github.com/wanderer-industries/wanderer/compare/v1.30.0...v1.30.1) (2024-12-17)
### Bug Fixes:
* Map: Little rework Signatures header: change System Signatures to Signatures, and show selected system name instead.
* Map: update default size of connections
* Map: add ability set the size of wormhole and mark connection with label
## [v1.30.0](https://github.com/wanderer-industries/wanderer/compare/v1.29.5...v1.30.0) (2024-12-16)
### Features:
* Map: Fixed incorrect wrapping labels of checkboxes in System Signatures, Local and Routes. Also changed dotlan links for k-spacem now it leads to region map before, for wh all stay as it was. Added ability to chane to softer background and remove dots on background of map. Also some small design issues. #2
* Map: Fixed incorrect wrapping labels of checkboxes in System Signatures, Local and Routes. Also changed dotlan links for k-spacem now it leads to region map before, for wh all stay as it was. Added ability to chane to softer background and remove dots on background of map. Also some small design issues.
### Bug Fixes:
* Map: fixed U210, K346 for C4 shattered systems
* Map: fixed U210, K346 for shattered systems. Fixed mass of mediums chains. Fixed size of some capital chains from 3M to 3.3M. Based on https://whtype.info/ data.
* Map: removed unnecessary log
* Map: Uncomment what should not be commented
## [v1.29.5](https://github.com/wanderer-industries/wanderer/compare/v1.29.4...v1.29.5) (2024-12-14)

View File

@@ -14,9 +14,6 @@ export const useSystemInfo = ({ systemId }: UseSystemInfoProps) => {
const { systems: systemStatics } = useLoadSystemStatic({ systems: [systemId] });
// eslint-disable-next-line no-console
console.log('JOipP', `systemStatics`, systemStatics);
return useMemo(() => {
const staticInfo = systemStatics.get(parseInt(systemId));
const dynamicInfo = getSystemById(systems, systemId);

View File

@@ -6,7 +6,14 @@ import { Edge } from '@reactflow/core/dist/esm/types/edges';
import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeStatus } from '@/hooks/Mapper/types';
import clsx from 'clsx';
import classes from './ContextMenuConnection.module.scss';
import { MASS_STATE_NAMES, MASS_STATE_NAMES_ORDER } from '@/hooks/Mapper/components/map/constants.ts';
import {
MASS_STATE_NAMES,
MASS_STATE_NAMES_ORDER,
SHIP_SIZES_NAMES,
SHIP_SIZES_NAMES_ORDER,
SHIP_SIZES_NAMES_SHORT,
SHIP_SIZES_SIZE,
} from '@/hooks/Mapper/components/map/constants.ts';
export interface ContextMenuConnectionProps {
contextMenuRef: RefObject<ContextMenu>;
@@ -48,10 +55,6 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
icon: PrimeIcons.CLOCK,
command: onChangeTimeState,
},
]
: []),
...(isWormhole
? [
{
label: `Frigate`,
className: clsx({
@@ -60,13 +63,9 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
icon: PrimeIcons.CLOUD,
command: () =>
onChangeShipSizeStatus(
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.normal : ShipSizeStatus.small,
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.large : ShipSizeStatus.small,
),
},
]
: []),
...(isWormhole
? [
{
label: `Save mass`,
className: clsx({
@@ -75,19 +74,40 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
icon: PrimeIcons.LOCK,
command: () => onToggleMassSave(!edge.data?.locked),
},
]
: []),
...(isWormhole && !isFrigateSize
? [
...(!isFrigateSize
? [
{
label: `Mass status`,
icon: PrimeIcons.CHART_PIE,
items: MASS_STATE_NAMES_ORDER.map(x => ({
label: MASS_STATE_NAMES[x],
className: clsx({
[classes.SelectedItem]: edge.data?.mass_status === x,
}),
command: () => onChangeMassState(x),
})),
},
]
: []),
{
label: `Mass status`,
icon: PrimeIcons.CHART_PIE,
items: MASS_STATE_NAMES_ORDER.map(x => ({
label: MASS_STATE_NAMES[x],
label: `Ship Size`,
icon: PrimeIcons.CLOUD,
items: SHIP_SIZES_NAMES_ORDER.map(x => ({
label: (
<div className="grid grid-cols-[20px_120px_1fr_40px] gap-2 items-center">
<div className="text-[12px] font-bold text-stone-400">{SHIP_SIZES_NAMES_SHORT[x]}</div>
<div>{SHIP_SIZES_NAMES[x]}</div>
<div></div>
<div className="flex justify-end whitespace-nowrap text-[12px] font-bold text-stone-500">
{SHIP_SIZES_SIZE[x]} t.
</div>
</div>
) as unknown as string, // TODO my lovely kostyl
className: clsx({
[classes.SelectedItem]: edge.data?.mass_status === x,
[classes.SelectedItem]: edge.data?.ship_size_type === x,
}),
command: () => onChangeMassState(x),
command: () => onChangeShipSizeStatus(x),
})),
},
]
@@ -98,7 +118,7 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
command: onDeleteConnection,
},
];
}, [edge, onChangeTimeState, onDeleteConnection, onChangeMassState, onChangeShipSizeStatus]);
}, [edge, onChangeTimeState, onDeleteConnection, onChangeShipSizeStatus, onToggleMassSave, onChangeMassState]);
return (
<>

View File

@@ -97,14 +97,16 @@ export const useContextMenuConnectionHandlers = () => {
},
});
outCommand({
type: OutCommand.updateConnectionMassStatus,
data: {
source: edge.source,
target: edge.target,
value: MassState.normal,
},
});
if (status === ShipSizeStatus.small) {
outCommand({
type: OutCommand.updateConnectionMassStatus,
data: {
source: edge.source,
target: edge.target,
value: MassState.normal,
},
});
}
}, []);
const onToggleMassSave = useCallback((locked: boolean) => {

View File

@@ -8,6 +8,7 @@ import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeS
import { PrimeIcons } from 'primereact/api';
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider.tsx';
import { SHIP_SIZES_DESCRIPTION, SHIP_SIZES_NAMES_SHORT } from '@/hooks/Mapper/components/map/constants.ts';
const MAP_TRANSLATES: Record<string, string> = {
[Position.Top]: 'translate(-48%, 0%)',
@@ -30,6 +31,14 @@ const MAP_OFFSETS: Record<string, { x: number; y: number }> = {
[Position.Right]: { x: 0, y: 0 },
};
export const SHIP_SIZES_COLORS = {
[ShipSizeStatus.small]: 'bg-indigo-400',
[ShipSizeStatus.medium]: 'bg-cyan-500',
[ShipSizeStatus.large]: '',
[ShipSizeStatus.freight]: 'bg-lime-400',
[ShipSizeStatus.capital]: 'bg-red-400',
};
export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }: EdgeProps<SolarSystemConnection>) => {
const sourceNode = useStore(useCallback(store => store.nodeInternals.get(source), [source]));
const targetNode = useStore(useCallback(store => store.nodeInternals.get(target), [target]));
@@ -137,6 +146,19 @@ export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }:
<span className={clsx(PrimeIcons.LOCK, classes.icon)} />
</WdTooltipWrapper>
)}
{isWormhole && data.ship_size_type !== ShipSizeStatus.large && (
<WdTooltipWrapper
content={SHIP_SIZES_DESCRIPTION[data.ship_size_type]}
className={clsx(
classes.LinkLabel,
'pointer-events-auto rounded opacity-100 cursor-auto text-neutral-900 font-bold',
SHIP_SIZES_COLORS[data.ship_size_type],
)}
>
{SHIP_SIZES_NAMES_SHORT[data.ship_size_type]}
</WdTooltipWrapper>
)}
</div>
</EdgeLabelRenderer>
</>

View File

@@ -1,4 +1,4 @@
import { ConnectionType, MassState } from '@/hooks/Mapper/types';
import { ConnectionType, MassState, ShipSizeStatus } from '@/hooks/Mapper/types';
export enum SOLAR_SYSTEM_CLASS_IDS {
ccp1 = -1,
@@ -727,16 +727,41 @@ export const MASS_STATE_NAMES = {
[MassState.verge]: 'Verge of collapse',
};
// export const SHIP_SIZES_NAMES_ORDER = [
// ShipSizeStatus.small,
// ShipSizeStatus.normal,
// // ShipSizeStatus.large,
// // ShipSizeStatus.capital,
// ];
//
// export const SHIP_SIZES_NAMES = {
// [ShipSizeStatus.small]: 'Frigate',
// [ShipSizeStatus.normal]: 'Normal',
// // [ShipSizeStatus.large]: 'Normal',
// // [ShipSizeStatus.capital]: 'Normal',
// };
export const SHIP_SIZES_NAMES_ORDER = [
ShipSizeStatus.small,
ShipSizeStatus.medium,
ShipSizeStatus.large,
ShipSizeStatus.freight,
ShipSizeStatus.capital,
];
export const SHIP_SIZES_NAMES = {
[ShipSizeStatus.small]: 'Frigate',
[ShipSizeStatus.medium]: 'Medium',
[ShipSizeStatus.large]: 'Normal',
[ShipSizeStatus.freight]: 'Huge',
[ShipSizeStatus.capital]: 'Capital',
};
export const SHIP_SIZES_SIZE = {
[ShipSizeStatus.small]: '5K',
[ShipSizeStatus.medium]: '62K',
[ShipSizeStatus.large]: '375K',
[ShipSizeStatus.freight]: '1M',
[ShipSizeStatus.capital]: '2M',
};
export const SHIP_SIZES_DESCRIPTION = {
[ShipSizeStatus.small]: 'Frigate wormhole - up to Destroyer | 5K t.',
[ShipSizeStatus.medium]: 'Cruise wormhole - up to Battlecruiser | 62K t.',
[ShipSizeStatus.large]: 'Large wormhole - up to Battleship | 375K t.',
[ShipSizeStatus.freight]: 'Huge wormhole - up to Freighter | 1M t.',
[ShipSizeStatus.capital]: 'Capital wormhole - up to Capital | 2M t.',
};
export const SHIP_SIZES_NAMES_SHORT = {
[ShipSizeStatus.small]: 'S',
[ShipSizeStatus.medium]: 'M',
[ShipSizeStatus.large]: 'L',
[ShipSizeStatus.freight]: 'H',
[ShipSizeStatus.capital]: 'XL',
};

View File

@@ -2,25 +2,26 @@ import { Widget } from '@/hooks/Mapper/components/mapInterface/components';
import {
InfoDrawer,
LayoutEventBlocker,
SystemView,
TooltipPosition,
WdImgButton,
WdCheckbox,
WdImgButton,
} from '@/hooks/Mapper/components/ui-kit';
import { SystemSignaturesContent } from './SystemSignaturesContent';
import {
Setting,
SystemSignatureSettingsDialog,
COSMIC_SIGNATURE,
COSMIC_ANOMALY,
COSMIC_SIGNATURE,
DEPLOYABLE,
STRUCTURE,
STARBASE,
SHIP,
DRONE,
Setting,
SHIP,
STARBASE,
STRUCTURE,
SystemSignatureSettingsDialog,
} from './SystemSignatureSettingsDialog';
import { SignatureGroup } from '@/hooks/Mapper/types';
import React, { useCallback, useEffect, useState, useMemo, useRef } from 'react';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { PrimeIcons } from 'primereact/api';
@@ -105,7 +106,14 @@ export const SystemSignatures = () => {
<Widget
label={
<div className="flex justify-between items-center text-xs w-full h-full" ref={ref}>
<div className="flex gap-1 whitespace-nowrap text-ellipsis overflow-hidden">System Signatures</div>
<div className="flex justify-between items-center gap-1">
{!compact && (
<div className="flex whitespace-nowrap text-ellipsis overflow-hidden text-stone-400">
Signatures {isNotSelectedSystem ? '' : 'in'}
</div>
)}
{!isNotSelectedSystem && <SystemView systemId={systemId} className="select-none text-center" hideRegion />}
</div>
<LayoutEventBlocker className="flex gap-2.5">
<WdTooltipWrapper content="Enable Lazy delete">

View File

@@ -58,11 +58,11 @@ const SIGNATURES_CHECKBOXES_PROPS: CheckboxesList = [
const CONNECTIONS_CHECKBOXES_PROPS: CheckboxesList = [
{ prop: UserSettingsRemoteProps.delete_connection_with_sigs, label: 'Delete connections to linked signatures' },
{ prop: InterfaceStoredSettingsProps.isThickConnections, label: 'Thicker connections' },
];
const UI_CHECKBOXES_PROPS: CheckboxesList = [
{ prop: InterfaceStoredSettingsProps.isShowMenu, label: 'Enable compact map menu bar' },
{ prop: InterfaceStoredSettingsProps.isThickConnections, label: 'Thicker connections' },
{ prop: InterfaceStoredSettingsProps.isShowBackgroundPattern, label: 'Show background pattern' },
{ prop: InterfaceStoredSettingsProps.isSoftBackground, label: 'Enable soft background' },
];

View File

@@ -21,9 +21,6 @@ const getPossibleWormholes = (systemStatic: SolarSystemStaticInfoRaw, wormholes:
return x.src.some(x => {
const [group, type] = x.split('-');
// eslint-disable-next-line no-console
console.log('JOipP', `group, type`, group, type);
if (type === 'shattered') {
return systemStatic.is_shattered && group === spawnClassGroup;
}
@@ -32,11 +29,6 @@ const getPossibleWormholes = (systemStatic: SolarSystemStaticInfoRaw, wormholes:
});
});
// eslint-disable-next-line no-console
console.log('JOipP', `possibleWHTypes`, possibleWHTypes);
// debugger;
return {
statics: possibleWHTypes
.filter(x => x.respawn.some(y => y === Respawn.static))

View File

@@ -14,16 +14,12 @@ export enum TimeStatus {
eol,
}
// export enum ShipSizeStatus {
// small, // frigates, destroyers - less than 5K t
// medium, // less than 20K t
// large, // less than 375K t
// capital, // less than 1.8M t
// }
export enum ShipSizeStatus {
small, // frigates, destroyers - less than 5K t
normal,
small = 0, // frigates, destroyers - less than 5K t
medium = 1, // less than 62K t
large = 2, // less than 375K t
freight = 3, // less than 1M t
capital = 4, // less than 1.8M t
}
export type SolarSystemConnection = {

View File

@@ -8,6 +8,7 @@ import CopyToClipboard from './copyToClipboard';
import DownloadJson from './downloadJson';
import NewVersionUpdate from './newVersionUpdate';
import MapAction from './maps/mapAction';
import ShowCharactersAddAlert from './showCharactersAddAlert';
export default {
DownloadJson,
@@ -20,4 +21,5 @@ export default {
Ping,
CopyToClipboard,
NewVersionUpdate,
ShowCharactersAddAlert,
};

View File

@@ -0,0 +1,11 @@
export default {
mounted() {
this.pushEvent('restore_show_characters_add_alert', {
value: localStorage.getItem('wanderer:hide_characters_add_alert') !== 'true',
});
document.getElementById('characters-add-alert-hide')?.addEventListener('click', e => {
localStorage.setItem('wanderer:hide_characters_add_alert', 'true');
});
},
};

View File

@@ -128,11 +128,13 @@ defmodule WandererApp.Api.MapConnection do
allow_nil?(true)
end
# where 0 - Frigate
# where 1 - Medium and Large
# where 2 - Capital
# where 0 - Frigate (small
# where 1 - Medium
# where 2 - Large
# where 3 - Freight
# where 4 - Capital
attribute :ship_size_type, :integer do
default(1)
default(2)
allow_nil?(true)
end

View File

@@ -41,6 +41,10 @@ defmodule WandererApp.Api.MapSystem do
action: :read_by_map_and_solar_system
)
define(:search_by_map,
action: :search_by_map
)
define(:update_name, action: :update_name)
define(:update_description, action: :update_description)
define(:update_locked, action: :update_locked)
@@ -73,6 +77,20 @@ defmodule WandererApp.Api.MapSystem do
filter(expr(map_id == ^arg(:map_id) and visible == true))
end
read :search_by_map do
argument(:map_id, :string, allow_nil?: false)
argument(:text, :string, allow_nil?: false)
filter(
expr(
(map_id == ^arg(:map_id) and
contains(string_downcase(name), string_downcase(^arg(:text)))) or
contains(string_downcase(custom_name), string_downcase(^arg(:text))) or
contains(string_downcase(description), string_downcase(^arg(:text)))
)
)
end
read :read_by_map_and_solar_system do
argument(:map_id, :string, allow_nil?: false)
argument(:solar_system_id, :integer, allow_nil?: false)

View File

@@ -93,13 +93,9 @@ defmodule WandererAppWeb.AuthController do
|> redirect(to: ~p"/")
end
def maybe_update_character_user_id(character, user_id) do
case character.user_id do
nil ->
WandererApp.Api.Character.assign_user!(character, %{user_id: user_id})
_ ->
Logger.debug("character already has user_id")
end
def maybe_update_character_user_id(character, user_id) when not is_nil(user_id) do
WandererApp.Api.Character.assign_user!(character, %{user_id: user_id})
end
def maybe_update_character_user_id(_character, _user_id), do: :ok
end

View File

@@ -28,6 +28,7 @@ defmodule WandererAppWeb.CharactersLive do
{:ok,
socket
|> assign(
show_characters_add_alert: true,
mode: :blocks,
wallet_tracking_enabled?: WandererApp.Env.wallet_tracking_enabled?(),
characters: characters |> Enum.sort_by(& &1.name, :asc) |> Enum.map(&map_ui_character/1),
@@ -45,6 +46,13 @@ defmodule WandererAppWeb.CharactersLive do
{:noreply, apply_action(socket, socket.assigns.live_action, params)}
end
@impl true
def handle_event("restore_show_characters_add_alert", %{"value" => value}, socket) do
{:noreply,
socket
|> assign(show_characters_add_alert: value)}
end
@impl true
def handle_event("authorize", form, socket) do
track_wallet = form |> Map.get("track_wallet", false)

View File

@@ -29,9 +29,45 @@
id="characters-list"
class="w-full h-full col-span-2 lg:col-span-1 p-4 pl-20 pb-20 overflow-auto"
>
<div
:if={@show_characters_add_alert}
role="alert"
class="alert"
id="characters-add-alert"
phx-hook="ShowCharactersAddAlert"
phx-ignore
data-key="show_characters_add_alert"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="h-6 w-6 shrink-0 stroke-current"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
>
</path>
</svg>
<span>
All added characters will be automatically linked to your user account. You can't have same characters linked to several accounts.
</span>
<div>
<button
class="btn btn-sm"
id="characters-add-alert-hide"
phx-click={JS.toggle_class("hidden", to: "#characters-add-alert")}
>
Hide
</button>
</div>
</div>
<div
:if={@mode == :blocks}
class="gap-4 grid grid-cols-1 lg:grid-cols-5 md:grid-cols-3 sm:grid-cols-2 "
class="gap-4 grid grid-cols-1 lg:grid-cols-5 md:grid-cols-3 sm:grid-cols-2 mt-4"
>
<.link patch={~p"/characters/authorize"}>
<div class="card card-side rounded-none h-full items-center hover:text-white bg-gradient-to-l from-stone-950 to-stone-900 transform transition duration-500">
@@ -51,9 +87,24 @@
<div class="absolute left-0 bottom-0 w-full h-30 bg-opacity-60 bg-gray-900">
<h2 class="absolute w-full flex justify-between px-4 left-0 top-10 text-xs">
Corporation:
<span
:if={
is_nil(
character
|> get(
path(:corporation_name),
nil
)
)
}
class="loading loading-dots loading-xs"
/>
<span>
<%= character
|> get(path(:corporation_name), "-") %>
|> get(
path(:corporation_name),
""
) %>
</span>
</h2>
<h2 class="absolute w-full flex justify-between px-4 left-0 top-16 text-xs">
@@ -65,9 +116,21 @@
</h2>
<h2 class="absolute left-0 bottom-12 px-4 text-xs w-full flex justify-between">
Location:
<span
:if={
is_nil(
character
|> get(
path(:location / :solar_system_info / :solar_system_name, :map),
nil
)
)
}
class="loading loading-dots loading-xs"
/>
<span>
<%= character
|> get(path(:location / :solar_system_info / :solar_system_name, :map), "-") %>
|> get(path(:location / :solar_system_info / :solar_system_name, :map), "") %>
</span>
</h2>
<h2
@@ -126,7 +189,7 @@
</div>
</div>
<div :if={@mode == :table} class="flex flex-col gap-4">
<div :if={@mode == :table} class="flex flex-col gap-4 mt-4">
<.link patch={~p"/characters/authorize"}>
<button
type="button"

View File

@@ -66,35 +66,9 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
def handle_ui_event(
"add_character",
_,
%{
assigns: %{
current_user: current_user,
map_id: map_id,
user_permissions: %{track_character: true}
}
} = socket
) do
{:noreply,
socket
|> assign(show_tracking?: true)
|> assign_async(:characters, fn ->
{:ok, map} =
map_id
|> WandererApp.MapRepo.get([:acls])
{:ok, character_settings} =
case WandererApp.MapCharacterSettingsRepo.get_all_by_map(map_id) do
{:ok, settings} -> {:ok, settings}
_ -> {:ok, []}
end
map
|> WandererApp.Maps.load_characters(
character_settings,
current_user.id
)
end)}
end
socket
),
do: {:noreply, socket |> add_character()}
def handle_ui_event(
"add_character",
@@ -222,6 +196,38 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
def handle_ui_event(event, body, socket),
do: MapCoreEventHandler.handle_ui_event(event, body, socket)
def add_character(
%{
assigns: %{
current_user: current_user,
map_id: map_id,
user_permissions: %{track_character: true}
}
} = socket
),
do:
socket
|> assign(show_tracking?: true)
|> assign_async(:characters, fn ->
{:ok, map} =
map_id
|> WandererApp.MapRepo.get([:acls])
{:ok, character_settings} =
case WandererApp.MapCharacterSettingsRepo.get_all_by_map(map_id) do
{:ok, settings} -> {:ok, settings}
_ -> {:ok, []}
end
map
|> WandererApp.Maps.load_characters(
character_settings,
current_user.id
)
end)
def add_character(socket), do: socket
def has_tracked_characters?([]), do: false
def has_tracked_characters?(_user_characters), do: true

View File

@@ -221,8 +221,9 @@ defmodule WandererAppWeb.MapCoreEventHandler do
socket
|> put_flash(
:error,
"You should enable tracking for at least one character."
)}
"You should enable tracking for at least one character!"
)
|> MapCharactersEventHandler.add_character()}
def handle_ui_event(event, body, socket) do
Logger.warning(fn -> "unhandled map ui event: #{event} #{inspect(body)}" end)
@@ -448,23 +449,35 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|> filter_map_characters(user_character_eve_ids, user_permissions, options)
|> Enum.map(&MapCharactersEventHandler.map_ui_character/1)
socket
|> assign(
map_loaded?: true,
map_user_settings: map_user_settings,
user_characters: user_character_eve_ids,
has_tracked_characters?:
MapCharactersEventHandler.has_tracked_characters?(user_character_eve_ids)
)
|> MapEventHandler.push_map_event(
"init",
initial_data
|> Map.put(:characters, map_characters)
)
|> push_event("js-exec", %{
to: "#map-loader",
attr: "data-loaded"
})
has_tracked_characters? =
MapCharactersEventHandler.has_tracked_characters?(user_character_eve_ids)
socket =
socket
|> assign(
map_loaded?: true,
map_user_settings: map_user_settings,
user_characters: user_character_eve_ids,
has_tracked_characters?: has_tracked_characters?
)
|> MapEventHandler.push_map_event(
"init",
initial_data
|> Map.put(:characters, map_characters)
)
|> push_event("js-exec", %{
to: "#map-loader",
attr: "data-loaded"
})
case not has_tracked_characters? && user_permissions.track_character do
true ->
socket
|> MapCharactersEventHandler.add_character()
_ ->
socket
end
end
defp handle_map_start_events(socket, map_id, events) do
@@ -487,10 +500,6 @@ defmodule WandererAppWeb.MapCoreEventHandler do
:empty_tracked_characters ->
socket
|> put_flash(
:info,
"You should enable tracking for at least one character to work with map."
)
:map_character_limit ->
socket
@@ -514,7 +523,7 @@ defmodule WandererAppWeb.MapCoreEventHandler do
%{
systems:
systems
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system, include_static_data?) end),
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system) end),
hubs: hubs,
connections: connections |> Enum.map(&MapEventHandler.map_ui_connection/1),
options: options

View File

@@ -267,6 +267,28 @@ defmodule WandererAppWeb.MapSystemsEventHandler do
{:noreply, socket}
end
def handle_ui_event(
"get_all_systems",
_event,
%{
assigns: %{
map_id: map_id
}
} =
socket
) do
{:ok, systems} = WandererApp.MapSystemRepo.get_all_by_map(map_id)
systems =
systems
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system, false) end)
{:reply,
%{
systems: systems
}, socket}
end
def handle_ui_event(
"get_system_static_infos",
%{"solar_system_ids" => solar_system_ids} = _event,

View File

@@ -41,6 +41,7 @@ defmodule WandererAppWeb.MapEventHandler do
"add_system",
"delete_systems",
"manual_add_system",
"get_all_systems",
"get_system_static_infos",
"update_system_position",
"update_system_positions",
@@ -246,16 +247,23 @@ defmodule WandererAppWeb.MapEventHandler do
status: status,
visible: visible
} = _system,
_include_static_data? \\ true
include_signatures? \\ true
) do
system_static_info = get_system_static_info(solar_system_id)
system_signatures =
system_id
|> WandererAppWeb.MapSignaturesEventHandler.get_system_signatures()
|> Enum.filter(fn signature ->
is_nil(signature.linked_system) && signature.group == "Wormhole"
end)
include_signatures?
|> case do
true ->
system_id
|> WandererAppWeb.MapSignaturesEventHandler.get_system_signatures()
|> Enum.filter(fn signature ->
is_nil(signature.linked_system) && signature.group == "Wormhole"
end)
_ ->
[]
end
%{
id: "#{solar_system_id}",

View File

@@ -6,7 +6,7 @@ defmodule WandererAppWeb.MapLive do
@impl true
def mount(%{"slug" => map_slug} = _params, _session, socket) when is_connected?(socket) do
Process.send_after(self(), %{event: :load_map}, Enum.random(10..500))
Process.send_after(self(), %{event: :load_map}, Enum.random(10..800))
{:ok,
socket
@@ -76,13 +76,15 @@ defmodule WandererAppWeb.MapLive do
def handle_info(:not_all_characters_tracked, %{assigns: %{map_slug: map_slug}} = socket),
do:
{:noreply,
socket
|> put_flash(
:error,
"You should enable tracking for all characters that have access to this map first!"
)
|> push_navigate(to: ~p"/tracking/#{map_slug}")}
WandererAppWeb.MapEventHandler.handle_ui_event(
%{event: "add_character"},
nil,
socket
|> put_flash(
:error,
"You should enable tracking for all characters that have access to this map first!"
)
)
@impl true
def handle_info(info, socket),

View File

@@ -92,12 +92,12 @@
<.modal
:if={assigns |> Map.get(:show_tracking?, false)}
id="map-tracking-modal"
title="Characters tracking"
title="Track Characters"
show
on_cancel={JS.push("hide_tracking")}
>
<.async_result :let={characters} assign={@characters}>
<:loading><span class="loading loading-dots loading-xs" />.</:loading>
<:loading><span class="loading loading-dots loading-xs" /></:loading>
<:failed :let={reason}><%= reason %></:failed>
<.table
@@ -106,7 +106,7 @@
class="h-[400px] !overflow-y-auto"
rows={characters}
>
<:col :let={character} label="Tracked">
<:col :let={character} label="Track">
<label class="flex items-center gap-3">
<input
type="checkbox"

View File

@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
use Mix.Project
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.29.5"
@version "1.31.0"
def project do
[

View File

@@ -755,11 +755,11 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
944,9,Capital Industrial Ship Blueprint,None,1,0,0,0,1
945,9,Industrial Command Ship Blueprint,None,1,0,0,0,1
952,11,Mission Container,0,0,1,0,0,0
954,32,Defensive Subsystem,None,0,0,0,0,1
954,32,Defensive Subsystem,3631,0,0,0,0,1
955,17,Depricated Subsystems,None,0,0,0,0,0
956,32,Offensive Subsystem,None,0,0,0,0,1
957,32,Propulsion Subsystem,None,0,0,0,0,1
958,32,Core Subsystem,None,0,0,0,0,1
956,32,Offensive Subsystem,3641,0,0,0,0,1
957,32,Propulsion Subsystem,3646,0,0,0,0,1
958,32,Core Subsystem,3636,0,0,0,0,1
959,11,Deadspace Sleeper Sleepless Sentinel,0,0,0,0,0,0
960,11,Deadspace Sleeper Awakened Sentinel,0,0,0,0,0,0
961,11,Deadspace Sleeper Emergent Sentinel,0,0,0,0,0,0
@@ -1529,6 +1529,8 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
4811,9,Mercenary Den Blueprint,None,1,0,0,0,1
4820,9,Mutaplasmid Blueprint,None,1,0,0,0,1
4821,17,Atavum,None,1,0,0,0,1
4824,17,Infomorph Systems,None,1,0,0,0,1
4825,2,Local Beacon,None,0,1,0,0,0
350858,350001,Infantry Weapons,None,1,0,0,0,0
351064,350001,Infantry Dropsuits,None,1,0,0,0,0
351121,350001,Infantry Modules,None,1,0,0,0,0
1 groupID categoryID groupName iconID useBasePrice anchored anchorable fittableNonSingleton published
755 944 9 Capital Industrial Ship Blueprint None 1 0 0 0 1
756 945 9 Industrial Command Ship Blueprint None 1 0 0 0 1
757 952 11 Mission Container 0 0 1 0 0 0
758 954 32 Defensive Subsystem None 3631 0 0 0 0 1
759 955 17 Depricated Subsystems None 0 0 0 0 0
760 956 32 Offensive Subsystem None 3641 0 0 0 0 1
761 957 32 Propulsion Subsystem None 3646 0 0 0 0 1
762 958 32 Core Subsystem None 3636 0 0 0 0 1
763 959 11 Deadspace Sleeper Sleepless Sentinel 0 0 0 0 0 0
764 960 11 Deadspace Sleeper Awakened Sentinel 0 0 0 0 0 0
765 961 11 Deadspace Sleeper Emergent Sentinel 0 0 0 0 0 0
1529 4811 9 Mercenary Den Blueprint None 1 0 0 0 1
1530 4820 9 Mutaplasmid Blueprint None 1 0 0 0 1
1531 4821 17 Atavum None 1 0 0 0 1
1532 4824 17 Infomorph Systems None 1 0 0 0 1
1533 4825 2 Local Beacon None 0 1 0 0 0
1534 350858 350001 Infantry Weapons None 1 0 0 0 0
1535 351064 350001 Infantry Dropsuits None 1 0 0 0 0
1536 351121 350001 Infantry Modules None 1 0 0 0 0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
defmodule WandererApp.Repo.Migrations.ShipSize do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
alter table(:map_chain_v1) do
modify :ship_size_type, :bigint, default: 2
end
end
def down do
alter table(:map_chain_v1) do
modify :ship_size_type, :bigint, default: 1
end
end
end

View File

@@ -0,0 +1,178 @@
{
"attributes": [
{
"allow_nil?": false,
"default": "fragment(\"gen_random_uuid()\")",
"generated?": false,
"primary_key?": true,
"references": null,
"size": null,
"source": "id",
"type": "uuid"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "solar_system_source",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "solar_system_target",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "0",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "mass_status",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "0",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "time_status",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "2",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "ship_size_type",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "0",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "type",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "wormhole_type",
"type": "text"
},
{
"allow_nil?": true,
"default": "0",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "count_of_passage",
"type": "bigint"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "locked",
"type": "boolean"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "custom_info",
"type": "text"
},
{
"allow_nil?": false,
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "inserted_at",
"type": "utc_datetime_usec"
},
{
"allow_nil?": false,
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "updated_at",
"type": "utc_datetime_usec"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": {
"deferrable": false,
"destination_attribute": "id",
"destination_attribute_default": null,
"destination_attribute_generated": null,
"index?": false,
"match_type": null,
"match_with": null,
"multitenancy": {
"attribute": null,
"global": null,
"strategy": null
},
"name": "map_chain_v1_map_id_fkey",
"on_delete": null,
"on_update": null,
"primary_key?": true,
"schema": "public",
"table": "maps_v1"
},
"size": null,
"source": "map_id",
"type": "uuid"
}
],
"base_filter": null,
"check_constraints": [],
"custom_indexes": [],
"custom_statements": [],
"has_create_action": true,
"hash": "3495268959E42B3B8D31B5B154B416A5BEF80D57D684375296EA5C1711FE3521",
"identities": [],
"multitenancy": {
"attribute": null,
"global": null,
"strategy": null
},
"repo": "Elixir.WandererApp.Repo",
"schema": null,
"table": "map_chain_v1"
}