@sanity/data-aspects
Advanced tools
Comparing version 2.21.12-purple-unicorn.1300 to 2.21.12-purple-unicorn.1302
@@ -16,4 +16,4 @@ "use strict"; | ||
var bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset']; | ||
var BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset']; | ||
const bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset']; | ||
const BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset']; | ||
@@ -38,3 +38,3 @@ function isDocumentType(type) { | ||
var hasWarned = false; | ||
let hasWarned = false; | ||
@@ -94,4 +94,4 @@ function warnAboutHiddenTypes() { | ||
getDisplayName(typeName) { | ||
var typeOption = this.config.typeOptions[typeName] || {}; | ||
var type = this.getType(typeName); | ||
const typeOption = this.config.typeOptions[typeName] || {}; | ||
const type = this.getType(typeName); | ||
return typeOption.displayName || type.title || (0, _startCase2.default)(typeName); | ||
@@ -105,3 +105,3 @@ } | ||
getListConstraints(typeName) { | ||
var typeOption = this.config.typeOptions[typeName]; | ||
const typeOption = this.config.typeOptions[typeName]; | ||
@@ -112,3 +112,3 @@ if (!typeOption) { | ||
var constraints = []; | ||
const constraints = []; | ||
@@ -131,8 +131,10 @@ if (typeOption.order) {// prefix order items with . because that's what gql requires | ||
getListQuery(options) { | ||
var typeName = options.typeName, | ||
keyForId = options.keyForId, | ||
keyForDisplayFieldName = options.keyForDisplayFieldName; | ||
var fieldName = this.getItemDisplayField(typeName); | ||
var constraints = this.getListConstraints(typeName); | ||
var selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName); | ||
const { | ||
typeName, | ||
keyForId, | ||
keyForDisplayFieldName | ||
} = options; | ||
const fieldName = this.getItemDisplayField(typeName); | ||
const constraints = this.getListConstraints(typeName); | ||
const selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName); | ||
return "".concat(this.schema.name, ".").concat(typeName, " [").concat(constraints, "] {").concat(selection, "}"); | ||
@@ -139,0 +141,0 @@ } |
import _startCase from "lodash/startCase"; | ||
import config from 'config:@sanity/data-aspects'; | ||
import { generateHelpUrl } from '@sanity/generate-help-url'; | ||
var bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset']; | ||
var BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset']; | ||
const bundledTypeNames = ['geopoint', 'richDate', 'date', 'sanity.imageAsset', 'sanity.fileAsset']; | ||
const BUNDLED_DOC_TYPES = ['sanity.imageAsset', 'sanity.fileAsset']; | ||
@@ -25,3 +25,3 @@ function isDocumentType(type) { | ||
var hasWarned = false; | ||
let hasWarned = false; | ||
@@ -81,4 +81,4 @@ function warnAboutHiddenTypes() { | ||
getDisplayName(typeName) { | ||
var typeOption = this.config.typeOptions[typeName] || {}; | ||
var type = this.getType(typeName); | ||
const typeOption = this.config.typeOptions[typeName] || {}; | ||
const type = this.getType(typeName); | ||
return typeOption.displayName || type.title || _startCase(typeName); | ||
@@ -92,3 +92,3 @@ } | ||
getListConstraints(typeName) { | ||
var typeOption = this.config.typeOptions[typeName]; | ||
const typeOption = this.config.typeOptions[typeName]; | ||
@@ -99,3 +99,3 @@ if (!typeOption) { | ||
var constraints = []; | ||
const constraints = []; | ||
@@ -118,8 +118,10 @@ if (typeOption.order) {// prefix order items with . because that's what gql requires | ||
getListQuery(options) { | ||
var typeName = options.typeName, | ||
keyForId = options.keyForId, | ||
keyForDisplayFieldName = options.keyForDisplayFieldName; | ||
var fieldName = this.getItemDisplayField(typeName); | ||
var constraints = this.getListConstraints(typeName); | ||
var selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName); | ||
const { | ||
typeName, | ||
keyForId, | ||
keyForDisplayFieldName | ||
} = options; | ||
const fieldName = this.getItemDisplayField(typeName); | ||
const constraints = this.getListConstraints(typeName); | ||
const selection = "\"".concat(keyForId, "\": _id, \"").concat(keyForDisplayFieldName, "\": ").concat(fieldName); | ||
return "".concat(this.schema.name, ".").concat(typeName, " [").concat(constraints, "] {").concat(selection, "}"); | ||
@@ -126,0 +128,0 @@ } |
{ | ||
"name": "@sanity/data-aspects", | ||
"version": "2.21.12-purple-unicorn.1300+abdd014728", | ||
"version": "2.21.12-purple-unicorn.1302+847175b7f3", | ||
"description": "Sanity plugin which controls how your data is presented", | ||
@@ -39,3 +39,3 @@ "main": "lib/DataAspectsResolver.js", | ||
"homepage": "https://www.sanity.io/", | ||
"gitHead": "abdd014728981dd514951705252054db61bcd3f4" | ||
"gitHead": "847175b7f3ddc82e4a956ab4e0dbb74a4dff41b8" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
222
1
11212