Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Nov 22, 2023
1 parent d8d4984 commit b892a27
Show file tree
Hide file tree
Showing 14 changed files with 261 additions and 147 deletions.
36 changes: 7 additions & 29 deletions lib/Data/ImportExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,42 +1334,20 @@ export default DataImportExport
/**
* @typedef {Record<string, string | undefined>} InstanceRemappings
* @typedef {Record<string, { id: string, label: string, lastUpgradeIndex?: number, oldLabel?: string}>} InstanceAppliedRemappings
*
*
* @typedef {{
* connectionLabels?: Record<string, string>
* connectionIds?: Record<string, string>
* }} FixupReferencesUpdateMaps
*
* @typedef {{
* name: string
* gridSize: import('../Shared/Model/UserConfigModel.js').UserConfigGridSize
* }} ClientPageInfo
*
* @typedef {{
* type: 'page' | 'full' | 'trigger_list'
* instances: Record<string, { label: string, instance_type: string }>
* controls: boolean
* customVariables: boolean
* surfaces: boolean
* triggers: boolean | Record<string, { name: string }>
* oldPageNumber?: number
* page?: ClientPageInfo
* pages?: Record<number, ClientPageInfo>
* }} ClientImportObject
*
* @typedef {{
* buttons: boolean
* customVariables: boolean
* surfaces: boolean
* triggers: boolean
* }} ClientImportSelection
*
*
* @typedef {import('../Shared/Model/ImportExport.js').ClientPageInfo} ClientPageInfo
* @typedef {import('../Shared/Model/ImportExport.js').ClientImportObject} ClientImportObject
* @typedef {import('../Shared/Model/ImportExport.js').ClientImportSelection} ClientImportSelection
* @typedef {import('../Shared/Model/ImportExport.js').ClientExportSelection} ClientExportSelection
* @typedef {import('../Shared/Model/ImportExport.js').ClientResetSelection} ClientResetSelection
*
*
* @typedef {{
* object: import('../Shared/Model/ExportModel.js').ExportFullv4 | import('../Shared/Model/ExportModel.js').ExportPageModelv4
* object: import('../Shared/Model/ExportModel.js').ExportFullv4 | import('../Shared/Model/ExportModel.js').ExportPageModelv4
* timeout: null
* }} ClientPendingImport
*/
24 changes: 24 additions & 0 deletions lib/Shared/Model/ImportExport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ExportFormat } from './ExportFormat.js'
import type { UserConfigGridSize } from './UserConfigModel.js'

export interface ClientResetSelection {
buttons: boolean
Expand All @@ -18,3 +19,26 @@ export interface ClientExportSelection {

format: ExportFormat
}

export interface ClientImportSelection {
buttons: boolean
customVariables: boolean
surfaces: boolean
triggers: boolean
}

export interface ClientPageInfo {
name: string
gridSize: UserConfigGridSize
}
export interface ClientImportObject {
type: 'page' | 'full'
instances: Record<string, { label: string; instance_type: string }>
controls: boolean
customVariables: boolean
surfaces: boolean
triggers: boolean | Record<string, { name: string }>
oldPageNumber?: number
page?: ClientPageInfo
pages?: Record<number, ClientPageInfo>
}
4 changes: 2 additions & 2 deletions webui/src/Buttons/ActionRecorder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,10 @@ function RecorderSession({ sessionId, sessionInfo }: RecorderSessionProps) {
const doActionReorder = useCallback(
(
_dragStepId: string,
_dragSetId: string,
_dragSetId: string | number,
dragIndex: number,
_dropStepId: string,
_dropSetId: string,
_dropSetId: string | number,
dropIndex: number
) => {
socketEmitPromise(socket, 'action-recorder:session:action-reorder', [sessionId, dragIndex, dropIndex]).catch(
Expand Down
Loading

0 comments on commit b892a27

Please sign in to comment.