Skip to content

Commit

Permalink
move toggle inside details
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaroise committed Sep 3, 2024
1 parent fe57690 commit 362c272
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 1 addition & 12 deletions studio/schemas/documents/compensations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,7 @@ const compensations = defineType({
title,
titleSlug,
locations,
{
name: "showEstimatedSalary",
title: "Show Estimated Salary",
type: "boolean",
description:
"Toggle this option to show or hide the estimated salary for the locations you've selected. Disable this if the feature isn't ready or if you prefer not to display salary details at this time.",
initialValue: false,
},
defineField({
...compensationDetails,
readOnly: ({ parent }) => !parent?.showEstimatedSalary,
}),
compensationDetails,
defineField({
name: "benefits",
title: "Benefits",
Expand Down
13 changes: 11 additions & 2 deletions studio/schemas/objects/compensationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ export const compensationDetails = defineField({
name: compensationDetailsID,
title: "Compensation Details",
description:
"Add and manage detailed information on compensation elements like salary, bonuses, pensions, and other financial benefits.",
"Add and manage detailed information on compensation elements like estimated salary, bonuses, pensions, and other financial benefits.",
type: "object",
options: {
collapsible: true,
collapsed: true,
collapsed: false,
},
fields: [
{
name: "showEstimatedSalary",
title: "Show Estimated Salary",
type: "boolean",
description:
"Toggle this option to show or hide the estimated salary for the locations you've selected. Disable this if the feature isn't ready or if you prefer not to display salary details at this time.",
initialValue: false,
},
{
name: "replaceMe",
title: "Replace me",
type: "string",
readOnly: ({ parent }) => !parent?.showEstimatedSalary,
},
],
preview: {
Expand Down

0 comments on commit 362c272

Please sign in to comment.