feat(Core): Reverted showing linked signature ID as part of temporary names

This commit is contained in:
Dmitry Popov
2025-06-25 17:51:10 +02:00
parent a2912ba0ff
commit e73ad93920
4 changed files with 38 additions and 22 deletions

View File

@@ -1,19 +1,19 @@
import { getSystemClassStyles } from '@/hooks/Mapper/components/map/helpers'; import { useMemo } from 'react';
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace'; import { MapSolarSystemType } from '../map.types';
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider'; import { NodeProps } from 'reactflow';
import { REGIONS_MAP, Spaces } from '@/hooks/Mapper/constants';
import { sortWHClasses } from '@/hooks/Mapper/helpers';
import { useDoubleClick } from '@/hooks/Mapper/hooks/useDoubleClick';
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider'; import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api'; import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic'; import { useMapState } from '@/hooks/Mapper/components/map/MapProvider';
import { useDoubleClick } from '@/hooks/Mapper/hooks/useDoubleClick';
import { REGIONS_MAP, Spaces } from '@/hooks/Mapper/constants';
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace';
import { getSystemClassStyles } from '@/hooks/Mapper/components/map/helpers';
import { sortWHClasses } from '@/hooks/Mapper/helpers';
import { CharacterTypeRaw, OutCommand, PingType, SystemSignature } from '@/hooks/Mapper/types'; import { CharacterTypeRaw, OutCommand, PingType, SystemSignature } from '@/hooks/Mapper/types';
import { useMemo } from 'react';
import { NodeProps } from 'reactflow';
import { MapSolarSystemType } from '../map.types';
import { LabelInfo, useLabelsInfo } from './useLabelsInfo';
import { useSystemName } from './useSystemName';
import { useUnsplashedSignatures } from './useUnsplashedSignatures'; import { useUnsplashedSignatures } from './useUnsplashedSignatures';
import { useSystemName } from './useSystemName';
import { LabelInfo, useLabelsInfo } from './useLabelsInfo';
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
function getActivityType(count: number): string { function getActivityType(count: number): string {
if (count <= 5) return 'activityNormal'; if (count <= 5) return 'activityNormal';
@@ -117,6 +117,7 @@ export const useSolarSystemNode = (props: NodeProps<MapSolarSystemType>): SolarS
const { isShowUnsplashedSignatures } = interfaceSettings; const { isShowUnsplashedSignatures } = interfaceSettings;
const isTempSystemNameEnabled = useMapGetOption('show_temp_system_name') === 'true'; const isTempSystemNameEnabled = useMapGetOption('show_temp_system_name') === 'true';
const isShowLinkedSigId = useMapGetOption('show_linked_signature_id') === 'true'; const isShowLinkedSigId = useMapGetOption('show_linked_signature_id') === 'true';
const isShowLinkedSigIdTempName = useMapGetOption('show_linked_signature_id_temp_name') === 'true';
const { const {
data: { data: {
@@ -183,6 +184,8 @@ export const useSolarSystemNode = (props: NodeProps<MapSolarSystemType>): SolarS
const { systemName, computedTemporaryName, customName } = useSystemName({ const { systemName, computedTemporaryName, customName } = useSystemName({
isTempSystemNameEnabled, isTempSystemNameEnabled,
temporary_name, temporary_name,
isShowLinkedSigIdTempName,
linkedSigPrefix,
name, name,
systemStaticInfo, systemStaticInfo,
}); });

View File

@@ -4,6 +4,8 @@ import { useMemo } from 'react';
interface UseSystemNameParams { interface UseSystemNameParams {
isTempSystemNameEnabled: boolean; isTempSystemNameEnabled: boolean;
temporary_name?: string | null; temporary_name?: string | null;
isShowLinkedSigIdTempName: boolean;
linkedSigPrefix: string | null;
name?: string | null; name?: string | null;
systemStaticInfo: SolarSystemStaticInfoRaw; systemStaticInfo: SolarSystemStaticInfoRaw;
} }
@@ -11,6 +13,8 @@ interface UseSystemNameParams {
export const useSystemName = ({ export const useSystemName = ({
isTempSystemNameEnabled, isTempSystemNameEnabled,
temporary_name, temporary_name,
isShowLinkedSigIdTempName,
linkedSigPrefix,
name, name,
systemStaticInfo, systemStaticInfo,
}: UseSystemNameParams) => { }: UseSystemNameParams) => {
@@ -21,8 +25,12 @@ export const useSystemName = ({
return ''; return '';
} }
if (isShowLinkedSigIdTempName && linkedSigPrefix) {
return temporary_name ? `${linkedSigPrefix}:${temporary_name}` : `${linkedSigPrefix}:${solar_system_name}`;
}
return temporary_name ?? ''; return temporary_name ?? '';
}, [isTempSystemNameEnabled, temporary_name]); }, [isTempSystemNameEnabled, temporary_name, solar_system_name, isShowLinkedSigIdTempName, linkedSigPrefix]);
const systemName = useMemo(() => { const systemName = useMemo(() => {
if (isTempSystemNameEnabled && computedTemporaryName) { if (isTempSystemNameEnabled && computedTemporaryName) {

View File

@@ -1,16 +1,16 @@
import { TooltipPosition, WdImageSize, WdImgButton } from '@/hooks/Mapper/components/ui-kit'; import { InputText } from 'primereact/inputtext';
import { InputTextarea } from 'primereact/inputtextarea';
import { Dialog } from 'primereact/dialog';
import { getSystemById } from '@/hooks/Mapper/helpers'; import { getSystemById } from '@/hooks/Mapper/helpers';
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider'; import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api'; import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
import { OutCommand } from '@/hooks/Mapper/types';
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
import { Button } from 'primereact/button';
import { Dialog } from 'primereact/dialog';
import { IconField } from 'primereact/iconfield';
import { InputText } from 'primereact/inputtext';
import { InputTextarea } from 'primereact/inputtextarea';
import { useCallback, useEffect, useRef, useState } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react';
import { Button } from 'primereact/button';
import { OutCommand } from '@/hooks/Mapper/types';
import { IconField } from 'primereact/iconfield';
import { TooltipPosition, WdImageSize, WdImgButton } from '@/hooks/Mapper/components/ui-kit';
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
interface SystemSettingsDialog { interface SystemSettingsDialog {
systemId: string; systemId: string;

View File

@@ -413,6 +413,11 @@
field={f[:show_linked_signature_id]} field={f[:show_linked_signature_id]}
label="Show linked signature ID as custom label part" label="Show linked signature ID as custom label part"
/> />
<.input
type="checkbox"
field={f[:show_linked_signature_id_temp_name]}
label="Show linked signature ID as temporary name part"
/>
<.input <.input
type="checkbox" type="checkbox"
field={f[:restrict_offline_showing]} field={f[:restrict_offline_showing]}