@jield/solodb-react-components 1.0.33 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,6 @@ export { default as StepDetails } from '../modules/run/components/run/steps/elem
20
20
  export { default as RunStepChecklist } from '../modules/run/components/step/view/element/runStepChecklist';
21
21
  export { default as RunStepExecuteMinimal } from '../modules/run/components/step/view/runStepExecuteMinimal';
22
22
  export { default as BatchCardElement } from '../modules/run/components/step/view/element/batchCardElement';
23
- export { default as SelectRunWithQrScanner } from '../modules/run/components/shared/qr-scanner/selectRunWithQrScanner';
24
23
  export { default as RunProvider } from '../modules/run/providers/runProvider';
25
24
  export { default as RunStepProvider } from '../modules/run/providers/runStepProvider';
26
25
  export { default as EmphasizedParametersProvider } from '../modules/run/providers/emphasizedParametersProvider';
@@ -1,8 +1,7 @@
1
- import { Requirement, RunStep, RunPart, RunStepPart } from '@jield/solodb-typescript-core';
2
- export default function RequirementStepInList({ requirement, step, parts, stepParts, refetchFn, }: {
1
+ import { Requirement, RunStep, RunPart } from '@jield/solodb-typescript-core';
2
+ export default function RequirementStepInList({ requirement, step, parts, refetchFn, }: {
3
3
  requirement: Requirement;
4
4
  step: RunStep;
5
5
  parts: RunPart[];
6
- stepParts: RunStepPart[];
7
6
  refetchFn: (key: any[]) => void;
8
7
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,8 @@
1
- import { Run, RunStep, RunPart, RunStepPart, Requirement } from '@jield/solodb-typescript-core';
2
- export default function StepInList({ run, step, parts, stepParts, monitoredBy, refetchFn, }: {
1
+ import { Run, RunStep, RunPart, Requirement } from '@jield/solodb-typescript-core';
2
+ export default function StepInList({ run, step, parts, monitoredBy, refetchFn, }: {
3
3
  run: Run;
4
4
  step: RunStep;
5
5
  parts: RunPart[];
6
- stepParts: RunStepPart[];
7
6
  monitoredBy: Requirement | undefined;
8
7
  refetchFn: (key: any[]) => void;
9
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
+ export declare const ACTION_VARIANT: Record<RunStepPartActionEnum, string>;
@@ -1,14 +1,9 @@
1
1
  import { RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
- export interface PartActionsDropdownProps {
3
- availableActions: Set<RunStepPartActionEnum>;
2
+ export interface PartActionsButtonsProps {
3
+ availableActions: {
4
+ id: RunStepPartActionEnum;
5
+ name: string;
6
+ }[];
4
7
  onActionSelected: (action: RunStepPartActionEnum) => void;
5
- showInitAction?: boolean;
6
- onInitSelected?: () => void;
7
8
  }
8
- /**
9
- * Dropdown component for bulk part actions
10
- *
11
- * Renders a dropdown menu with available actions (Start, Finish, Failed, Repair, Testing, Rework)
12
- * and optionally an Init action for production runs.
13
- */
14
- export declare const PartActionsButtons: ({ availableActions, onActionSelected, showInitAction, onInitSelected, }: PartActionsDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export declare const PartActionsButtons: ({ availableActions, onActionSelected }: PartActionsButtonsProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,14 +1,14 @@
1
1
  import { RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
2
  export interface PartActionsDropdownProps {
3
- availableActions: Set<RunStepPartActionEnum>;
3
+ availableActions: {
4
+ id: RunStepPartActionEnum;
5
+ name: string;
6
+ }[];
4
7
  onActionSelected: (action: RunStepPartActionEnum) => void;
5
- showInitAction?: boolean;
6
- onInitSelected?: () => void;
7
8
  }
8
9
  /**
9
- * Dropdown component for bulk part actions
10
+ * Dropdown component for bulk part actions.
10
11
  *
11
- * Renders a dropdown menu with available actions (Start, Finish, Failed, Repair, Testing, Rework)
12
- * and optionally an Init action for production runs.
12
+ * Renders a dropdown menu driven by the server-provided `available_actions` array.
13
13
  */
14
- export declare const PartActionsDropdown: ({ availableActions, onActionSelected, showInitAction, onInitSelected, }: PartActionsDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export declare const PartActionsDropdown: ({ availableActions, onActionSelected }: PartActionsDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { RunStepPartActionEnum, RunStepPart } from '@jield/solodb-typescript-core';
1
+ import { RunStepPart, RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
2
  type Props = {
3
3
  runStepPart: RunStepPart;
4
4
  setRunStepPartAction: ({ runStepPart, runStepPartAction, }: {
@@ -6,5 +6,5 @@ type Props = {
6
6
  runStepPartAction: RunStepPartActionEnum;
7
7
  }) => void;
8
8
  };
9
- declare const RunPartProductionActionsButtons: ({ runStepPart, setRunStepPartAction }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ declare const RunPartProductionActionsButtons: ({ runStepPart, setRunStepPartAction }: Props) => import("react/jsx-runtime").JSX.Element | null;
10
10
  export default RunPartProductionActionsButtons;
@@ -1,4 +1,4 @@
1
- import { RunStepPartActionEnum, RunStepPart } from '@jield/solodb-typescript-core';
1
+ import { RunStepPart, RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
2
  type Props = {
3
3
  runStepPart: RunStepPart;
4
4
  createRunStepPart: () => void;
@@ -7,5 +7,5 @@ type Props = {
7
7
  runStepPartAction: RunStepPartActionEnum;
8
8
  }) => void;
9
9
  };
10
- declare const RunPartProductionActionsDropdown: ({ runStepPart, setRunStepPartAction, createRunStepPart }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ declare const RunPartProductionActionsDropdown: ({ runStepPart, setRunStepPartAction, createRunStepPart, }: Props) => import("react/jsx-runtime").JSX.Element;
11
11
  export default RunPartProductionActionsDropdown;
@@ -1,4 +1,4 @@
1
- import { RunPart, RunStepPart, RunStep } from '@jield/solodb-typescript-core';
1
+ import { RunPart, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
2
2
  type Props = {
3
3
  runPart: RunPart;
4
4
  partIsSelected?: boolean;
@@ -1,7 +1,8 @@
1
- import { Run, RunStep } from '@jield/solodb-typescript-core';
1
+ import { Run, RunStep, RunPart, RunStepPart } from '@jield/solodb-typescript-core';
2
2
  type Props = {
3
3
  run: Run;
4
4
  runStep: RunStep;
5
5
  };
6
6
  declare const RunPartsQrFlow: ({ run, runStep }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const isRunPartFinish: (runStepParts: RunStepPart[], part: RunPart) => boolean;
7
8
  export default RunPartsQrFlow;
@@ -9,12 +9,16 @@ export interface UsePartActionsOptions {
9
9
  }
10
10
  export interface UsePartActionsResult {
11
11
  performActionToSelectedParts: (action: RunStepPartActionEnum) => void;
12
- getAvailableActionsForSelection: () => Set<RunStepPartActionEnum>;
12
+ getAvailableActionsForSelection: () => {
13
+ id: RunStepPartActionEnum;
14
+ name: string;
15
+ }[];
13
16
  }
14
17
  /**
15
- * Hook for managing bulk actions on selected parts
18
+ * Hook for managing bulk actions on selected parts.
16
19
  *
17
- * @param options Configuration object with parts, selection state, and action mappings
18
- * @returns Functions for performing and querying available actions
20
+ * With the new backend architecture, the frontend no longer computes which actions
21
+ * are allowed it reads `runStepPart.available_actions` (server-provided) directly
22
+ * and forwards the chosen action id to `performRunStepPartAction`.
19
23
  */
20
- export declare function usePartActions({ runStep, parts, selectedParts, getRunPart, getRunStepPart, actionsFromScanner, }: UsePartActionsOptions): UsePartActionsResult;
24
+ export declare function usePartActions({ parts, selectedParts, getRunPart, getRunStepPart, actionsFromScanner, }: UsePartActionsOptions): UsePartActionsResult;
@@ -0,0 +1,7 @@
1
+ import { RunPart, RunStepPart } from '@jield/solodb-typescript-core';
2
+ type Props = {
3
+ runStepParts: RunStepPart[];
4
+ runParts: RunPart[];
5
+ };
6
+ export default function useQrPartNotifications({ runStepParts, runParts }: Props): void;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RunStep } from '@jield/solodb-typescript-core';
2
+ export default function isRunStepReadyForProcessing(step: RunStep): boolean;
@@ -1,9 +1,8 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
- import { RunStep, RunStepPart, RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
+ import { RunStep, RunStepPart, RunStepPartState } from '@jield/solodb-typescript-core';
3
3
  type UpdateRunStepPartCacheOptions = {
4
4
  runStepPart: RunStepPart;
5
- action: RunStepPartActionEnum;
6
- latestAction?: RunStepPart["latest_action"] | null;
5
+ latestAction: RunStepPartState;
7
6
  };
8
7
  export declare const updateRunStepPartCache: (queryClient: QueryClient, options: UpdateRunStepPartCacheOptions) => void;
9
8
  export declare const updateRunStepPartCacheByRunStep: (queryClient: QueryClient, runStep: RunStep, options: UpdateRunStepPartCacheOptions) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jield/solodb-react-components",
3
- "version": "1.0.33",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "repository": "jield-webdev/solodb-react-components",
6
6
  "main": "./dist/index.cjs",
@@ -27,7 +27,7 @@
27
27
  "coverage": "vitest run --coverage"
28
28
  },
29
29
  "dependencies": {
30
- "@jield/solodb-typescript-core": "^1.0.24",
30
+ "@jield/solodb-typescript-core": "^1.1.2",
31
31
  "@testing-library/dom": "^10.4.1",
32
32
  "moment": "^2.30.1",
33
33
  "moment-timezone": "^0.6.1",
@@ -1,6 +0,0 @@
1
- import { Run } from '@jield/solodb-typescript-core';
2
- export default function NavigateInRunWithQrScanner({ runsList, setRun, setRunPartLabel, }: {
3
- runsList: Run[];
4
- setRun: (run: Run) => void;
5
- setRunPartLabel?: (label: string) => void;
6
- }): import("react/jsx-runtime").JSX.Element;