sanity-plugin-workflow 1.0.0 → 1.0.2
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.
|
|
3
|
+
"version": "1.0.2",
|
|
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.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@commitlint/cli": "^17.4.4",
|
|
@@ -155,10 +155,8 @@ export default function WorkflowTool(props: WorkflowToolProps) {
|
|
|
155
155
|
// Only the first state should generate an absolute minimum rank
|
|
156
156
|
newOrder = LexoRank.min().toString()
|
|
157
157
|
} else {
|
|
158
|
-
// Otherwise create
|
|
159
|
-
newOrder = LexoRank.
|
|
160
|
-
.between(LexoRank.min())
|
|
161
|
-
.toString()
|
|
158
|
+
// Otherwise create one rank above the minimum
|
|
159
|
+
newOrder = LexoRank.min().genNext().toString()
|
|
162
160
|
}
|
|
163
161
|
} else if (destination.index === 0) {
|
|
164
162
|
// Now first item in order
|
|
@@ -14,10 +14,13 @@ const QUERY = groq`*[_type == "workflow.metadata"]|order(orderRank){
|
|
|
14
14
|
assignees,
|
|
15
15
|
documentId,
|
|
16
16
|
state,
|
|
17
|
-
orderRank
|
|
18
|
-
|
|
17
|
+
orderRank,
|
|
18
|
+
"draftDocumentId": "drafts." + documentId,
|
|
19
|
+
}
|
|
20
|
+
}{
|
|
21
|
+
...,
|
|
19
22
|
...(
|
|
20
|
-
*[_id
|
|
23
|
+
*[_id == ^._metadata.documentId || _id == ^._metadata.draftDocumentId]|order(_updatedAt)[0]{
|
|
21
24
|
_id,
|
|
22
25
|
_type,
|
|
23
26
|
_rev,
|