Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/ts-jest-26.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-castellon-jr committed Mar 17, 2021
2 parents 8e5916d + f2413c1 commit 4e58a4e
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 181 deletions.
7 changes: 5 additions & 2 deletions studio/package.json
Expand Up @@ -9,7 +9,8 @@
"scripts": {
"dev": "sanity start",
"start": "sanity start",
"build": "sanity build"
"build": "sanity build",
"deploy": "sanity deploy"
},
"keywords": [
"sanity"
Expand All @@ -30,5 +31,7 @@
"sanity-plugin-mdide": "^1.0.7",
"sanity-plugin-media-library": "^1.0.5"
},
"devDependencies": {}
"devDependencies": {
"@sanity/cli": "^2.6.0"
}
}
39 changes: 23 additions & 16 deletions studio/schemas/documents/rangers.js
Expand Up @@ -11,20 +11,6 @@ export default {
title: "Ranger's Name",
type: "string",
},
{
name: "slug",
title: "Slug",
type: "slug",
options: {
source: (doc) => {
console.log(doc);
const query = `*[_id=="${doc.team._ref}"][0] { season }`;
return sanityClient
.fetch(query)
.then((res) => `${res.season}-${doc.color.title}-ranger`);
},
},
},
{
name: "color",
title: "Ranger's Color",
Expand All @@ -39,7 +25,7 @@ export default {
{ title: "Green", value: "#48bb78" },
{ title: "White", value: "#f7fafc" },
{ title: "Gray", value: "#a0aec0" },
{ title: "Purple", value: "#4299e1" },
{ title: "Purple", value: "#805ad5" },
{ title: "Orange", value: "#f6ad55" },
],
},
Expand All @@ -50,6 +36,25 @@ export default {
type: "reference",
to: [{ type: "team" }],
},
{
name: "slug",
title: "Slug",
type: "slug",
options: {
source: (doc) => {
console.log(doc);
const query = `*[_id=="${doc.team._ref}"][0] { season }`;
return sanityClient
.fetch(query)
.then(
(res) =>
`${res.season}-${doc.color.title}-ranger${
doc.exclusive ? "-ex" : ""
}`
);
},
},
},
{
name: "abilityName",
title: "Ranger's Ability",
Expand Down Expand Up @@ -168,12 +173,14 @@ export default {
title: "name",
color: "color",
team: "team.season",
image: "image",
},
prepare(selection) {
const { title, color, team } = selection;
const { title, color, team, image } = selection;
return {
title: title,
subtitle: `${team} ${color.title} Ranger`,
media: image,
};
},
},
Expand Down

0 comments on commit 4e58a4e

Please sign in to comment.