@@ -76,7 +83,9 @@ export const PassageCard = ({ inserted_at, character: char, ship }: PassageCardT
{/*time and class*/}
-
+
+
+
{kgToTons(parseInt(ship.ship_type_info.mass))}
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/PrettySwitchbox/PrettySwitchbox.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/PrettySwitchbox/PrettySwitchbox.tsx
index 68ddffe9..9edd4172 100644
--- a/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/PrettySwitchbox/PrettySwitchbox.tsx
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/MapSettings/components/PrettySwitchbox/PrettySwitchbox.tsx
@@ -1,4 +1,5 @@
import styles from './MapSettings.module.scss';
+
import { WdCheckbox } from '@/hooks/Mapper/components/ui-kit';
interface PrettySwitchboxProps {
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/SignatureSettings.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/SignatureSettings.tsx
index 84bcbb4e..270b5208 100644
--- a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/SignatureSettings.tsx
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/SignatureSettings.tsx
@@ -53,6 +53,7 @@ export const SignatureSettings = ({ systemId, show, onHide, signatureData }: Map
...out,
custom_info: JSON.stringify({
k162Type: values.k162Type,
+ isEOL: values.isEOL,
}),
};
@@ -127,14 +128,17 @@ export const SignatureSettings = ({ systemId, show, onHide, signatureData }: Map
const { linked_system, custom_info, ...rest } = signatureData;
let k162Type = null;
+ let isEOL = false;
if (custom_info) {
const customInfo = JSON.parse(custom_info);
k162Type = customInfo.k162Type;
+ isEOL = customInfo.isEOL;
}
signatureForm.reset({
linked_system: linked_system?.solar_system_id.toString() ?? undefined,
k162Type: k162Type,
+ isEOL: isEOL,
...rest,
});
}, [signatureForm, signatureData]);
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox/SignatureEOLCheckbox.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox/SignatureEOLCheckbox.tsx
new file mode 100644
index 00000000..add3286f
--- /dev/null
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox/SignatureEOLCheckbox.tsx
@@ -0,0 +1,24 @@
+import { InputSwitch } from 'primereact/inputswitch';
+import { Controller, useFormContext } from 'react-hook-form';
+import { SystemSignature } from '@/hooks/Mapper/types';
+
+export interface SignatureEOLCheckboxProps {
+ name: string;
+ defaultValue?: boolean;
+}
+
+export const SignatureEOLCheckbox = ({ name, defaultValue = false }: SignatureEOLCheckboxProps) => {
+ const { control } = useFormContext
();
+
+ return (
+ {
+ return field.onChange(e.value)} />;
+ }}
+ />
+ );
+};
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox/index.ts b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox/index.ts
new file mode 100644
index 00000000..e5af02cd
--- /dev/null
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox/index.ts
@@ -0,0 +1 @@
+export * from './SignatureEOLCheckbox.tsx';
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureGroupContentWormholes.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureGroupContentWormholes.tsx
index d9f92ac8..c7032955 100644
--- a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureGroupContentWormholes.tsx
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureGroupContentWormholes.tsx
@@ -3,6 +3,7 @@ import { SystemSignature } from '@/hooks/Mapper/types';
import { SignatureWormholeTypeSelect } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureWormholeTypeSelect';
import { SignatureK162TypeSelect } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect';
import { SignatureLeadsToSelect } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureLeadsToSelect';
+import { SignatureEOLCheckbox } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureEOLCheckbox';
export const SignatureGroupContentWormholes = () => {
const { watch } = useFormContext();
@@ -26,6 +27,11 @@ export const SignatureGroupContentWormholes = () => {
Leads To:
+
+
>
);
};
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/SignatureK162TypeSelect.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/SignatureK162TypeSelect.tsx
index 4d7ed440..e12fa4cc 100644
--- a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/SignatureK162TypeSelect.tsx
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/SignatureK162TypeSelect.tsx
@@ -3,100 +3,8 @@ import clsx from 'clsx';
import { Controller, useFormContext } from 'react-hook-form';
import { useMemo } from 'react';
import { SystemSignature } from '@/hooks/Mapper/types';
-import { WHClassView } from '@/hooks/Mapper/components/ui-kit';
-
-export const k162Types = [
- {
- label: 'Hi-Sec',
- value: 'hs',
- whClassName: 'A641',
- },
- {
- label: 'Low-Sec',
- value: 'ls',
- whClassName: 'J377',
- },
- {
- label: 'Null-Sec',
- value: 'ns',
- whClassName: 'C248',
- },
- {
- label: 'C1',
- value: 'c1',
- whClassName: 'E004',
- },
- {
- label: 'C2',
- value: 'c2',
- whClassName: 'D382',
- },
- {
- label: 'C3',
- value: 'c3',
- whClassName: 'L477',
- },
- {
- label: 'C4',
- value: 'c4',
- whClassName: 'M001',
- },
- {
- label: 'C5',
- value: 'c5',
- whClassName: 'L614',
- },
- {
- label: 'C6',
- value: 'c6',
- whClassName: 'G008',
- },
- {
- label: 'C13',
- value: 'c13',
- whClassName: 'A009',
- },
- {
- label: 'Thera',
- value: 'thera',
- whClassName: 'F353',
- },
- {
- label: 'Pochven',
- value: 'pochven',
- whClassName: 'F216',
- },
-];
-
-const renderNoValue = () => -Unknown-
;
-
-// @ts-ignore
-export const renderK162Type = (option: {
- label?: string;
- value: string;
- security?: string;
- system_class?: number;
- whClassName?: string;
-}) => {
- if (!option) {
- return renderNoValue();
- }
- const { value, whClassName = '' } = option;
- if (value == null) {
- return renderNoValue();
- }
-
- return (
-
- );
-};
+import { K162_TYPES } from '@/hooks/Mapper/constants.ts';
+import { renderK162Type } from '.';
export interface SignatureK162TypeSelectProps {
name: string;
@@ -107,7 +15,7 @@ export const SignatureK162TypeSelect = ({ name, defaultValue = '' }: SignatureK1
const { control } = useFormContext();
const options = useMemo(() => {
- return [{ value: null }, ...k162Types];
+ return [{ value: null }, ...K162_TYPES];
}, []);
return (
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/index.ts b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/index.ts
index 9c9ff58c..d15d9008 100644
--- a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/index.ts
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/index.ts
@@ -1 +1,2 @@
export * from './SignatureK162TypeSelect.tsx';
+export * from './renderK162Type.tsx';
diff --git a/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/renderK162Type.tsx b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/renderK162Type.tsx
new file mode 100644
index 00000000..6363ebe7
--- /dev/null
+++ b/assets/js/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect/renderK162Type.tsx
@@ -0,0 +1,26 @@
+import { WHClassView } from '@/hooks/Mapper/components/ui-kit';
+import { K162Type } from '@/hooks/Mapper/constants.ts';
+
+const renderNoValue = () => -Unknown-
;
+
+export const renderK162Type = (option: K162Type) => {
+ if (!option) {
+ return renderNoValue();
+ }
+
+ const { value, whClassName = '' } = option;
+ if (value == null) {
+ return renderNoValue();
+ }
+
+ return (
+
+ );
+};
diff --git a/assets/js/hooks/Mapper/constants.ts b/assets/js/hooks/Mapper/constants.ts
index 18f91522..d093e83b 100644
--- a/assets/js/hooks/Mapper/constants.ts
+++ b/assets/js/hooks/Mapper/constants.ts
@@ -65,3 +65,77 @@ export const REGIONS_MAP: Record = {
[Regions.TashMurkon]: Spaces.Amarr,
[Regions.VergeVendor]: Spaces.Gallente,
};
+
+export type K162Type = {
+ label: string;
+ value: string;
+ whClassName: string;
+};
+
+export const K162_TYPES: K162Type[] = [
+ {
+ label: 'Hi-Sec',
+ value: 'hs',
+ whClassName: 'A641',
+ },
+ {
+ label: 'Low-Sec',
+ value: 'ls',
+ whClassName: 'J377',
+ },
+ {
+ label: 'Null-Sec',
+ value: 'ns',
+ whClassName: 'C248',
+ },
+ {
+ label: 'C1',
+ value: 'c1',
+ whClassName: 'E004',
+ },
+ {
+ label: 'C2',
+ value: 'c2',
+ whClassName: 'D382',
+ },
+ {
+ label: 'C3',
+ value: 'c3',
+ whClassName: 'L477',
+ },
+ {
+ label: 'C4',
+ value: 'c4',
+ whClassName: 'M001',
+ },
+ {
+ label: 'C5',
+ value: 'c5',
+ whClassName: 'L614',
+ },
+ {
+ label: 'C6',
+ value: 'c6',
+ whClassName: 'G008',
+ },
+ {
+ label: 'C13',
+ value: 'c13',
+ whClassName: 'A009',
+ },
+ {
+ label: 'Thera',
+ value: 'thera',
+ whClassName: 'F353',
+ },
+ {
+ label: 'Pochven',
+ value: 'pochven',
+ whClassName: 'F216',
+ },
+];
+
+export const K162_TYPES_MAP: { [key: string]: K162Type } = K162_TYPES.reduce(
+ (acc, x) => ({ ...acc, [x.value]: x }),
+ {},
+);
diff --git a/assets/js/hooks/Mapper/helpers/parseSignatureCustomInfo.ts b/assets/js/hooks/Mapper/helpers/parseSignatureCustomInfo.ts
new file mode 100644
index 00000000..0bb2b752
--- /dev/null
+++ b/assets/js/hooks/Mapper/helpers/parseSignatureCustomInfo.ts
@@ -0,0 +1,9 @@
+import { SignatureCustomInfo } from '@/hooks/Mapper/types';
+
+export const parseSignatureCustomInfo = (str: string | undefined): SignatureCustomInfo => {
+ if (str == null || str === '') {
+ return {};
+ }
+
+ return JSON.parse(str);
+};
diff --git a/assets/js/hooks/Mapper/types/signatures.ts b/assets/js/hooks/Mapper/types/signatures.ts
index 78505365..7974f550 100644
--- a/assets/js/hooks/Mapper/types/signatures.ts
+++ b/assets/js/hooks/Mapper/types/signatures.ts
@@ -26,15 +26,20 @@ export type GroupType = {
h: number;
};
+export type SignatureCustomInfo = {
+ k162Type?: string;
+ isEOL?: boolean;
+};
+
export type SystemSignature = {
eve_id: string;
kind: SignatureKind;
name: string;
+ // SignatureCustomInfo
custom_info?: string;
description?: string;
group: SignatureGroup;
type: string;
- k162Type?: string;
linked_system?: SolarSystemStaticInfoRaw;
inserted_at?: string;
updated_at?: string;