From 7fd3eb8a0e7bb1807c65d5969b3c3a459f87ec86 Mon Sep 17 00:00:00 2001 From: Tommy Petty Date: Fri, 13 Oct 2023 14:30:38 -0400 Subject: [PATCH 1/2] Fix camelCase to kebab-case for resource ids --- .../sanity/src/desk/documentActions/DeleteAction.tsx | 4 ++-- .../desk/documentActions/DiscardChangesAction.tsx | 12 ++++++------ .../src/desk/documentActions/DuplicateAction.tsx | 4 ++-- .../src/desk/documentActions/PublishAction.tsx | 4 ++-- .../src/desk/documentActions/UnpublishAction.tsx | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/sanity/src/desk/documentActions/DeleteAction.tsx b/packages/sanity/src/desk/documentActions/DeleteAction.tsx index e10cc2a505b..c3942ea35eb 100644 --- a/packages/sanity/src/desk/documentActions/DeleteAction.tsx +++ b/packages/sanity/src/desk/documentActions/DeleteAction.tsx @@ -15,8 +15,8 @@ import { } from 'sanity' const DISABLED_REASON_TITLE_KEY = { - NOTHING_TO_DELETE: 'action.delete.disabled.nothingToDelete', - NOT_READY: 'action.delete.disabled.notReady', + NOTHING_TO_DELETE: 'action.delete.disabled.nothing-to-delete', + NOT_READY: 'action.delete.disabled.not-ready', } /** @internal */ diff --git a/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx b/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx index e8f53b49597..7dbe64a4733 100644 --- a/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx +++ b/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx @@ -14,9 +14,9 @@ import { } from 'sanity' const DISABLED_REASON_KEY = { - NO_CHANGES: 'action.discardChanges.disabled.noChanges', - NOT_PUBLISHED: 'action.discardChanges.disabled.notPublished', - NOT_READY: 'action.discardChanges.disabled.notReady', + NO_CHANGES: 'action.discard-changes.disabled.noChanges', + NOT_PUBLISHED: 'action.discard-changes.disabled.not-published', + NOT_READY: 'action.discard-changes.disabled.not-ready', } as const /** @internal */ @@ -54,7 +54,7 @@ export const DiscardChangesAction: DocumentActionComponent = ({ tone: 'critical', onCancel: onComplete, onConfirm: handleConfirm, - message: t('action.discardChanges.confirmDialog.confirm-discard-changes'), + message: t('action.discard-changes.confirmDialog.confirm-discard-changes'), }, [handleConfirm, isConfirmDialogOpen, onComplete, t], ) @@ -68,7 +68,7 @@ export const DiscardChangesAction: DocumentActionComponent = ({ tone: 'critical', icon: ResetIcon, disabled: true, - label: t('action.discardChanges.label'), + label: t('action.discard-changes.label'), title: ( {t('action.publish.alreadyPublished.tooltip', {timeSincePublished})} + return {t('action.publish.already-published.tooltip', {timeSincePublished})} } /** @internal */ @@ -72,7 +72,7 @@ export const PublishAction: DocumentActionComponent = (props) => { const title = publish.disabled ? getDisabledReason(publish.disabled, (published || {})._updatedAt, t) || '' : hasValidationErrors - ? t('action.publish.validationIssues.tooltip') + ? t('action.publish.validation-issues.tooltip') : '' const hasDraft = Boolean(draft) diff --git a/packages/sanity/src/desk/documentActions/UnpublishAction.tsx b/packages/sanity/src/desk/documentActions/UnpublishAction.tsx index 7126125638d..4ab35ca20f1 100644 --- a/packages/sanity/src/desk/documentActions/UnpublishAction.tsx +++ b/packages/sanity/src/desk/documentActions/UnpublishAction.tsx @@ -13,8 +13,8 @@ import { } from 'sanity' const DISABLED_REASON_KEY = { - NOT_PUBLISHED: 'action.unpublish.disabled.notPublished', - NOT_READY: 'action.unpublish.disabled.notReady', + NOT_PUBLISHED: 'action.unpublish.disabled.not-published', + NOT_READY: 'action.unpublish.disabled.not-ready', LIVE_EDIT_ENABLED: 'action.unpublish.disabled.liveEditEnabled', } From 6f07ab05bdbfffc54425c54ec836cdbddb652112 Mon Sep 17 00:00:00 2001 From: Tommy Petty Date: Mon, 16 Oct 2023 07:31:39 -0400 Subject: [PATCH 2/2] fix(i18n): camelCase to kebab-case for resource ids --- .../sanity/src/desk/documentActions/DiscardChangesAction.tsx | 4 ++-- packages/sanity/src/desk/documentActions/UnpublishAction.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx b/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx index 7dbe64a4733..1c3ed610e01 100644 --- a/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx +++ b/packages/sanity/src/desk/documentActions/DiscardChangesAction.tsx @@ -14,7 +14,7 @@ import { } from 'sanity' const DISABLED_REASON_KEY = { - NO_CHANGES: 'action.discard-changes.disabled.noChanges', + NO_CHANGES: 'action.discard-changes.disabled.no-changes', NOT_PUBLISHED: 'action.discard-changes.disabled.not-published', NOT_READY: 'action.discard-changes.disabled.not-ready', } as const @@ -54,7 +54,7 @@ export const DiscardChangesAction: DocumentActionComponent = ({ tone: 'critical', onCancel: onComplete, onConfirm: handleConfirm, - message: t('action.discard-changes.confirmDialog.confirm-discard-changes'), + message: t('action.discard-changes.confirm-dialog.confirm-discard-changes'), }, [handleConfirm, isConfirmDialogOpen, onComplete, t], ) diff --git a/packages/sanity/src/desk/documentActions/UnpublishAction.tsx b/packages/sanity/src/desk/documentActions/UnpublishAction.tsx index 4ab35ca20f1..ca121add560 100644 --- a/packages/sanity/src/desk/documentActions/UnpublishAction.tsx +++ b/packages/sanity/src/desk/documentActions/UnpublishAction.tsx @@ -15,7 +15,7 @@ import { const DISABLED_REASON_KEY = { NOT_PUBLISHED: 'action.unpublish.disabled.not-published', NOT_READY: 'action.unpublish.disabled.not-ready', - LIVE_EDIT_ENABLED: 'action.unpublish.disabled.liveEditEnabled', + LIVE_EDIT_ENABLED: 'action.unpublish.disabled.live-edit-enabled', } /** @internal */