How to add/update structures?}>
- In game, select one or more structures in D-Scan and press Ctrl+C,
+ In game, select one or more structures in D-Scan and then
- then click on this widget and press Ctrl+V
+ use the blue add structure data button
How to add a timer?}>
- In game, select a structure with an active timer, right click to copy, and then use the
+ In game, select a structure with an active timer, right click to copy, and then
blue
- add timer button
+ use the blue add structure data button
),
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemStructures/SystemStructuresDialog/SystemStructuresDialog.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemStructures/SystemStructuresDialog/SystemStructuresDialog.tsx
index 9a4d2dca..81f334b4 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemStructures/SystemStructuresDialog/SystemStructuresDialog.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemStructures/SystemStructuresDialog/SystemStructuresDialog.tsx
@@ -2,6 +2,7 @@ import React, { useEffect, useState, useCallback } from 'react';
import { Dialog } from 'primereact/dialog';
import { Button } from 'primereact/button';
import { AutoComplete } from 'primereact/autocomplete';
+import { Calendar } from 'primereact/calendar';
import clsx from 'clsx';
import { StructureItem, StructureStatus, statusesRequiringTimer, formatToISO } from '../helpers';
@@ -53,7 +54,9 @@ export const SystemStructuresDialog: React.FC = ({
// If user typed more text but we have partial match in prevResults
if (newQuery.startsWith(prevQuery) && prevResults.length > 0) {
- const filtered = prevResults.filter(item => item.label.toLowerCase().includes(newQuery.toLowerCase()));
+ const filtered = prevResults.filter(item =>
+ item.label.toLowerCase().includes(newQuery.toLowerCase()),
+ );
setOwnerSuggestions(filtered);
return;
}
@@ -74,12 +77,18 @@ export const SystemStructuresDialog: React.FC = ({
[prevQuery, prevResults, outCommand],
);
- const handleChange = (field: keyof StructureItem, val: string) => {
+ const handleChange = (field: keyof StructureItem, val: string | Date) => {
// If we want to forbid changing structureTypeId or structureType from the dialog, do so here:
if (field === 'structureTypeId' || field === 'structureType') return;
setEditData(prev => {
if (!prev) return null;
+
+ // If this is the endTime (Date from Calendar), we store as ISO or string:
+ if (field === 'endTime' && val instanceof Date) {
+ return { ...prev, endTime: val.toISOString() };
+ }
+
return { ...prev, [field]: val };
});
};
@@ -87,7 +96,9 @@ export const SystemStructuresDialog: React.FC = ({
// when user picks a corp from auto-complete
const handleSelectOwner = (selected: { label: string; value: string }) => {
setOwnerInput(selected.label);
- setEditData(prev => (prev ? { ...prev, ownerName: selected.label, ownerId: selected.value } : null));
+ setEditData(prev =>
+ prev ? { ...prev, ownerName: selected.label, ownerId: selected.value } : null,
+ );
};
const handleStatusChange = (val: string) => {
@@ -107,7 +118,7 @@ export const SystemStructuresDialog: React.FC = ({
if (!statusesRequiringTimer.includes(editData.status)) {
editData.endTime = '';
} else if (editData.endTime) {
- // convert to full ISO
+ // convert to full ISO if not already
editData.endTime = formatToISO(editData.endTime);
}
@@ -146,7 +157,11 @@ export const SystemStructuresDialog: React.FC = ({