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/lib/index.js
CHANGED
|
@@ -677,7 +677,7 @@ function filterItemsAndSort(items, stateId) {
|
|
|
677
677
|
return aOrderRank.localeCompare(bOrderRank);
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
|
-
const QUERY = groq__default.default(_templateObject || (_templateObject = _taggedTemplateLiteral(["*[_type == \"workflow.metadata\"]|order(orderRank){\n \"_metadata\": {\n _rev,\n assignees,\n documentId,\n state,\n orderRank\n }
|
|
680
|
+
const QUERY = groq__default.default(_templateObject || (_templateObject = _taggedTemplateLiteral(["*[_type == \"workflow.metadata\"]|order(orderRank){\n \"_metadata\": {\n _rev,\n assignees,\n documentId,\n state,\n orderRank,\n \"draftDocumentId\": \"drafts.\" + documentId,\n }\n}{\n ...,\n ...(\n *[_id == ^._metadata.documentId || _id == ^._metadata.draftDocumentId]|order(_updatedAt)[0]{ \n _id, \n _type, \n _rev, \n _updatedAt \n }\n )\n}"])));
|
|
681
681
|
function useWorkflowDocuments(schemaTypes) {
|
|
682
682
|
const toast = ui.useToast();
|
|
683
683
|
const client = sanity.useClient({
|
|
@@ -1835,7 +1835,7 @@ function WorkflowTool(props) {
|
|
|
1835
1835
|
if (destinationStateIndex === 0) {
|
|
1836
1836
|
newOrder = lexorank.LexoRank.min().toString();
|
|
1837
1837
|
} else {
|
|
1838
|
-
newOrder = lexorank.LexoRank.
|
|
1838
|
+
newOrder = lexorank.LexoRank.min().genNext().toString();
|
|
1839
1839
|
}
|
|
1840
1840
|
} else if (destination.index === 0) {
|
|
1841
1841
|
const firstItemOrderRank = (_b2 = (_a2 = [...destinationStateItems].shift()) == null ? void 0 : _a2._metadata) == null ? void 0 : _b2.orderRank;
|