mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 02:35:42 +00:00
fix(Core): Fixed modals auto-save on Enter.
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
import { Dialog } from 'primereact/dialog';
|
|
||||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
|
||||||
import { useCallback, useRef, useState } from 'react';
|
|
||||||
import { IconField } from 'primereact/iconfield';
|
|
||||||
import { AutoComplete } from 'primereact/autocomplete';
|
|
||||||
import { OutCommand, SearchSystemItem } from '@/hooks/Mapper/types';
|
|
||||||
import { SystemViewStandalone, WdButton, WHClassView, WHEffectView } from '@/hooks/Mapper/components/ui-kit';
|
import { SystemViewStandalone, WdButton, WHClassView, WHEffectView } from '@/hooks/Mapper/components/ui-kit';
|
||||||
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||||
|
import { OutCommand, SearchSystemItem } from '@/hooks/Mapper/types';
|
||||||
|
import { AutoComplete } from 'primereact/autocomplete';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { IconField } from 'primereact/iconfield';
|
||||||
|
import { useCallback, useRef, useState } from 'react';
|
||||||
import classes from './AddSystemDialog.module.scss';
|
import classes from './AddSystemDialog.module.scss';
|
||||||
|
|
||||||
import clsx from 'clsx';
|
|
||||||
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace.ts';
|
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace.ts';
|
||||||
import { sortWHClasses } from '@/hooks/Mapper/helpers';
|
import { sortWHClasses } from '@/hooks/Mapper/helpers';
|
||||||
|
import clsx from 'clsx';
|
||||||
|
|
||||||
export type SearchOnSubmitCallback = (item: SearchSystemItem) => void;
|
export type SearchOnSubmitCallback = (item: SearchSystemItem) => void;
|
||||||
|
|
||||||
@@ -115,6 +115,7 @@ export const AddSystemDialog = ({
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<form onSubmit={handleSubmit}>
|
||||||
<div className="flex flex-col gap-3 px-1.5">
|
<div className="flex flex-col gap-3 px-1.5">
|
||||||
<div className="flex flex-col gap-2 py-3.5">
|
<div className="flex flex-col gap-2 py-3.5">
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
@@ -191,6 +192,7 @@ export const AddSystemDialog = ({
|
|||||||
|
|
||||||
<div className="flex gap-2 justify-end">
|
<div className="flex gap-2 justify-end">
|
||||||
<WdButton
|
<WdButton
|
||||||
|
type="submit"
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
outlined
|
outlined
|
||||||
disabled={!selectedItem || selectedItem.length !== 1}
|
disabled={!selectedItem || selectedItem.length !== 1}
|
||||||
@@ -199,6 +201,7 @@ export const AddSystemDialog = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { InputText } from 'primereact/inputtext';
|
import { TooltipPosition, WdButton, WdImageSize, WdImgButton } from '@/hooks/Mapper/components/ui-kit';
|
||||||
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 { useCallback, useEffect, useRef, useState } from 'react';
|
|
||||||
import { OutCommand } from '@/hooks/Mapper/types';
|
import { OutCommand } from '@/hooks/Mapper/types';
|
||||||
import { IconField } from 'primereact/iconfield';
|
|
||||||
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
|
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
|
||||||
import { TooltipPosition, WdButton, WdImageSize, WdImgButton } from '@/hooks/Mapper/components/ui-kit';
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { IconField } from 'primereact/iconfield';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
interface SystemCustomLabelDialog {
|
interface SystemCustomLabelDialog {
|
||||||
systemId: string;
|
systemId: string;
|
||||||
@@ -125,7 +125,7 @@ export const SystemCustomLabelDialog = ({ systemId, visible, setVisible }: Syste
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-2 justify-end">
|
<div className="flex gap-2 justify-end">
|
||||||
<WdButton onClick={handleSave} outlined size="small" label="Save"></WdButton>
|
<WdButton type="submit" onClick={handleSave} outlined size="small" label="Save"></WdButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { InputTextarea } from 'primereact/inputtextarea';
|
import { SystemView, WdButton } from '@/hooks/Mapper/components/ui-kit';
|
||||||
import { Dialog } from 'primereact/dialog';
|
|
||||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||||
import { useCallback, useRef, useState } from 'react';
|
|
||||||
import { OutCommand } from '@/hooks/Mapper/types';
|
import { OutCommand } from '@/hooks/Mapper/types';
|
||||||
import { PingType } from '@/hooks/Mapper/types/ping.ts';
|
import { PingType } from '@/hooks/Mapper/types/ping.ts';
|
||||||
import { SystemView, WdButton } from '@/hooks/Mapper/components/ui-kit';
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { InputTextarea } from 'primereact/inputtextarea';
|
||||||
|
import { useCallback, useRef, useState } from 'react';
|
||||||
|
|
||||||
const PING_TITLES = {
|
const PING_TITLES = {
|
||||||
[PingType.Rally]: 'RALLY',
|
[PingType.Rally]: 'RALLY',
|
||||||
@@ -62,7 +62,7 @@ export const SystemPingDialog = ({ systemId, type, visible, setVisible }: System
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
visible={visible}
|
visible={visible}
|
||||||
draggable={false}
|
draggable={true}
|
||||||
style={{ width: '450px' }}
|
style={{ width: '450px' }}
|
||||||
onShow={onShow}
|
onShow={onShow}
|
||||||
onHide={() => {
|
onHide={() => {
|
||||||
@@ -91,7 +91,7 @@ export const SystemPingDialog = ({ systemId, type, visible, setVisible }: System
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-2 justify-end">
|
<div className="flex gap-2 justify-end">
|
||||||
<WdButton onClick={handleSave} size="small" severity="danger" label="Ping!" />
|
<WdButton type="submit" onClick={handleSave} size="small" severity="danger" label="Ping!" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Dialog } from 'primereact/dialog';
|
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
||||||
import { useRouteProvider } from '@/hooks/Mapper/components/mapInterface/widgets/RoutesWidget/RoutesProvider.tsx';
|
import { useRouteProvider } from '@/hooks/Mapper/components/mapInterface/widgets/RoutesWidget/RoutesProvider.tsx';
|
||||||
import { PrettySwitchbox } from '@/hooks/Mapper/components/mapRootContent/components/MapSettings/components';
|
import { PrettySwitchbox } from '@/hooks/Mapper/components/mapRootContent/components/MapSettings/components';
|
||||||
import { WdButton } from '@/hooks/Mapper/components/ui-kit';
|
import { WdButton } from '@/hooks/Mapper/components/ui-kit';
|
||||||
import { RoutesType } from '@/hooks/Mapper/mapRootProvider/types.ts';
|
import { RoutesType } from '@/hooks/Mapper/mapRootProvider/types.ts';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
interface RoutesSettingsDialog {
|
interface RoutesSettingsDialog {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user