@sanity/default-layout
Advanced tools
Comparing version 0.99.5 to 0.99.6
@@ -25,4 +25,2 @@ 'use strict'; | ||
var _lodash = require('lodash'); | ||
var _preview = require('part:@sanity/base/preview?'); | ||
@@ -32,2 +30,10 @@ | ||
var _location = require('part:@sanity/base/location'); | ||
var _location2 = _interopRequireDefault(_location); | ||
var _router = require('part:@sanity/base/router'); | ||
var _lodash = require('lodash'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -125,15 +131,9 @@ | ||
_this.handleGoToItem = function (item) { | ||
// TODO Hack for assuming desktool until we have a path resolver | ||
// @TODO Hack for assuming desktool until we have a path resolver | ||
var type = item._type.split('.')[1]; | ||
var id = item._id.split('/').join('.'); | ||
var router = _this.context.router; | ||
var url = ['/desk', type, 'edit', id].join('/'); | ||
router.navigate({ | ||
Desk: { | ||
action: 'edit', | ||
selectedType: type, | ||
selectedDocumentId: id | ||
}, | ||
tool: 'Desk' | ||
}); | ||
_location2.default.actions.navigate(url, { replace: false }); | ||
_this.setState({ | ||
@@ -158,7 +158,11 @@ isOpen: false | ||
if (type && _preview2.default && _schema2.default) { | ||
return _react2.default.createElement(_preview2.default, { | ||
value: item, | ||
style: 'default' // eslint-disable-line | ||
, typeDef: type | ||
}); | ||
return _react2.default.createElement( | ||
_router.IntentLink, | ||
{ intent: 'edit', params: { id: item._id, type: typeName } }, | ||
_react2.default.createElement(_preview2.default, { | ||
value: item, | ||
style: 'default' // eslint-disable-line | ||
, typeDef: type | ||
}) | ||
); | ||
} | ||
@@ -165,0 +169,0 @@ return null; |
{ | ||
"name": "@sanity/default-layout", | ||
"version": "0.99.5", | ||
"version": "0.99.6", | ||
"description": "The default layout components for Sanity", | ||
@@ -31,8 +31,8 @@ "main": "lib/default-layout.js", | ||
"devDependencies": { | ||
"@sanity/base": "^0.99.4", | ||
"@sanity/base": "^0.99.6", | ||
"@sanity/check": "^0.99.0", | ||
"@sanity/cli": "^0.99.4", | ||
"@sanity/components": "^0.99.5", | ||
"@sanity/cli": "^0.99.6", | ||
"@sanity/components": "^0.99.6", | ||
"@sanity/core": "^0.99.5", | ||
"@sanity/form-builder": "^0.99.5", | ||
"@sanity/form-builder": "^0.99.6", | ||
"chai": "^3.5.0", | ||
@@ -39,0 +39,0 @@ "chai-as-promised": "^6.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
318167
7846