From 362c272e0228e658ca83cda57bb1554f2b714bce Mon Sep 17 00:00:00 2001 From: christinaroise Date: Tue, 3 Sep 2024 15:25:40 +0200 Subject: [PATCH] move toggle inside details --- studio/schemas/documents/compensations.ts | 13 +------------ studio/schemas/objects/compensationData.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/studio/schemas/documents/compensations.ts b/studio/schemas/documents/compensations.ts index ccfca3c9c..1e918a0ac 100644 --- a/studio/schemas/documents/compensations.ts +++ b/studio/schemas/documents/compensations.ts @@ -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", diff --git a/studio/schemas/objects/compensationData.ts b/studio/schemas/objects/compensationData.ts index c662ba436..5075545c1 100644 --- a/studio/schemas/objects/compensationData.ts +++ b/studio/schemas/objects/compensationData.ts @@ -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: {