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/lib/index.esm.js +3 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/actions/UpdateWorkflow.tsx +2 -2
- package/src/components/WorkflowContext.tsx +1 -1
- package/src/hooks/useWorkflowDocuments.tsx +1 -1
- package/src/hooks/useWorkflowMetadata.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-workflow",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
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.
|
|
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
|
|
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
|
|
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
|