sanity-plugin-workflow 1.0.0-beta.11 → 1.0.0-beta.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-workflow",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "description": "A demonstration of a custom content publishing workflow using Sanity.",
5
5
  "keywords": [
6
6
  "sanity",
@@ -58,7 +58,7 @@
58
58
  "groq": "^3.3.1",
59
59
  "lexorank": "^1.0.5",
60
60
  "react-fast-compare": "^3.2.1",
61
- "sanity-plugin-utils": "^1.6.0"
61
+ "sanity-plugin-utils": "^1.6.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@commitlint/cli": "^17.4.4",
@@ -80,7 +80,7 @@ export function UpdateWorkflow(props: DocumentActionProps, actionState: State) {
80
80
  actionState?.roles?.length !== 0
81
81
 
82
82
  const actionStateIsAValidTransition =
83
- currentState?.id && currentState.transitions.length
83
+ currentState?.id && currentState?.transitions?.length
84
84
  ? // If the Current State limits transitions to specific States
85
85
  // Check that the Action State is in Current State's transitions array
86
86
  currentState.transitions.includes(actionState.id)
@@ -90,7 +90,7 @@ export function UpdateWorkflow(props: DocumentActionProps, actionState: State) {
90
90
  const userAssignmentCanUpdateState = actionState.requireAssignment
91
91
  ? // If the Action State requires assigned users
92
92
  // Check the current user ID is in the assignees array
93
- currentUser && assignees.length && assignees.includes(currentUser.id)
93
+ currentUser && assignees?.length && assignees.includes(currentUser.id)
94
94
  : // Otherwise this isn't a problem
95
95
  true
96
96
 
@@ -9,7 +9,7 @@ import {KeyedMetadata, WorkflowConfig} from '../types'
9
9
  export type WorkflowContextValue = Required<WorkflowConfig> & {
10
10
  data: KeyedMetadata
11
11
  loading: boolean
12
- error: boolean
12
+ error: boolean | unknown | ProgressEvent
13
13
  ids: string[]
14
14
  addId: (id: string) => void
15
15
  removeId: (id: string) => void
@@ -30,7 +30,7 @@ type WorkflowDocuments = {
30
30
  workflowData: {
31
31
  data: SanityDocumentWithMetadata[]
32
32
  loading: boolean
33
- error: boolean
33
+ error: boolean | unknown | ProgressEvent
34
34
  }
35
35
  operations: {
36
36
  move: (
@@ -12,7 +12,7 @@ import {KeyedMetadata, Metadata} from '../types'
12
12
  export function useWorkflowMetadata(ids: string[]): {
13
13
  data: KeyedMetadata
14
14
  loading: boolean
15
- error: boolean
15
+ error: boolean | unknown | ProgressEvent
16
16
  } {
17
17
  const {
18
18
  data: rawData,