Conversation
Show a different tooltip for different head publish statuses
packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx
Outdated
Show resolved
Hide resolved
packages/visual-editor/src/internal/utils/getPublishTooltipMessageFromHeadDeployStatus.ts
Show resolved
Hide resolved
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughReplaces the boolean deploymentInProgress with a new HeadDeployStatus union ("RUNNING" | "INACTIVE" | "FAILED" | "ACTIVE") on TemplateMetadata and initializes it. Components (InternalThemeEditor, ThemeHeader, LayoutHeader) and their props updated to use headDeployStatus; publish gating now checks history length or headDeployStatus !== "ACTIVE" and derives tooltip text via a new getPublishTooltipMessageFromHeadDeployStatus utility. Adds localized publishBlocked messages deploymentFailed and deploymentInactive across many platform locales. Sequence Diagram(s)sequenceDiagram
participant User as User
participant ThemeHeader as ThemeHeader
participant TemplateMetadata as TemplateMetadata
participant TooltipUtil as getPublishTooltipMessageFromHeadDeployStatus
participant PublishService as PublishService
User->>ThemeHeader: Click "Publish"
ThemeHeader->>TemplateMetadata: Read headDeployStatus & history
alt history length == 1 or headDeployStatus != "ACTIVE"
ThemeHeader->>TooltipUtil: getPublishTooltipMessageFromHeadDeployStatus(headDeployStatus)
TooltipUtil-->>ThemeHeader: localized tooltip (RUNNING/FAILED/INACTIVE) or undefined
ThemeHeader-->>User: show disabled publish + tooltip
else
ThemeHeader->>PublishService: initiate publish
PublishService-->>ThemeHeader: publish result
ThemeHeader-->>User: show publish result / errors
end
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx (1)
39-52: Consider destructuringheadDeployStatusfor consistency.The
headDeployStatusprop is accessed viaprops.headDeployStatus(lines 144, 147) while all other props are destructured. For consistency, consider adding it to the destructuring block.♻️ Suggested refactor
const { isDevMode, setThemeHistories, onPublishTheme, themeConfig, themeHistories, clearThemeHistory, puckInitialHistory, clearLocalChangesModalOpen, setClearLocalChangesModalOpen, totalEntityCount, localDev, + headDeployStatus, } = props;Then update the usages:
const publishDisabled = - themeHistories?.histories?.length === 1 || - props.headDeployStatus !== "ACTIVE"; + themeHistories?.histories?.length === 1 || headDeployStatus !== "ACTIVE"; const publishTooltipMessage = getPublishTooltipMessageFromHeadDeployStatus( - props.headDeployStatus + headDeployStatus );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx` around lines 39 - 52, The component ThemeHeader currently reads props.headDeployStatus directly while all other props are destructured; update the destructuring in the ThemeHeader function to include headDeployStatus alongside isDevMode, setThemeHistories, onPublishTheme, etc., and then replace any remaining usages of props.headDeployStatus (e.g., where headDeployStatus is referenced at the current call sites) with the newly destructured headDeployStatus variable to keep prop access consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/visual-editor/locales/platform/et/visual-editor.json`:
- Around line 553-554: Update the Estonian translations for the publish-blocked
keys: change "deploymentFailed" to a fully Estonian sentence (e.g., "Avaldamine
on keelatud, sest viimane juurutus nurjus. Parandage probleemid ja proovige
uuesti") instead of the mixed-language text, and populate the empty
"deploymentInactive" key with an appropriate Estonian message (e.g., "Avaldamine
on keelatud, sest viimane juurutus on inaktiivne"). Make these edits for the
keys "deploymentFailed" and "deploymentInactive" in the visual-editor.json
locale file.
In `@packages/visual-editor/locales/platform/lt/visual-editor.json`:
- Around line 563-565: The three localized keys deploymentFailed,
deploymentInactive and deploymentInProgress are inconsistent:
deploymentInProgress uses “Atnaujinimas išjungtas…” while the others use
“Paskelbimas išjungtas…”. Update the value for deploymentInProgress to use the
same “Paskelbimas išjungtas…” phrasing so all publishBlocked messages are
uniform, keeping the rest of the sentence identical to the current translation
style.
In `@packages/visual-editor/locales/platform/sv/visual-editor.json`:
- Around line 553-555: The Swedish strings are inconsistent: "deploymentFailed"
uses "implementeringen" while "deploymentInactive" and "deploymentInProgress"
use "distributionen"; update the "deploymentFailed" value to match the others
(use "distributionen") so all three keys—deploymentFailed, deploymentInactive,
deploymentInProgress—use the same term for deployment for consistency in the UI.
---
Nitpick comments:
In `@packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx`:
- Around line 39-52: The component ThemeHeader currently reads
props.headDeployStatus directly while all other props are destructured; update
the destructuring in the ThemeHeader function to include headDeployStatus
alongside isDevMode, setThemeHistories, onPublishTheme, etc., and then replace
any remaining usages of props.headDeployStatus (e.g., where headDeployStatus is
referenced at the current call sites) with the newly destructured
headDeployStatus variable to keep prop access consistent.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (30)
packages/visual-editor/locales/platform/cs/visual-editor.jsonpackages/visual-editor/locales/platform/da/visual-editor.jsonpackages/visual-editor/locales/platform/de/visual-editor.jsonpackages/visual-editor/locales/platform/en-GB/visual-editor.jsonpackages/visual-editor/locales/platform/en/visual-editor.jsonpackages/visual-editor/locales/platform/es/visual-editor.jsonpackages/visual-editor/locales/platform/et/visual-editor.jsonpackages/visual-editor/locales/platform/fi/visual-editor.jsonpackages/visual-editor/locales/platform/fr/visual-editor.jsonpackages/visual-editor/locales/platform/hr/visual-editor.jsonpackages/visual-editor/locales/platform/hu/visual-editor.jsonpackages/visual-editor/locales/platform/it/visual-editor.jsonpackages/visual-editor/locales/platform/ja/visual-editor.jsonpackages/visual-editor/locales/platform/lt/visual-editor.jsonpackages/visual-editor/locales/platform/lv/visual-editor.jsonpackages/visual-editor/locales/platform/nb/visual-editor.jsonpackages/visual-editor/locales/platform/nl/visual-editor.jsonpackages/visual-editor/locales/platform/pl/visual-editor.jsonpackages/visual-editor/locales/platform/pt/visual-editor.jsonpackages/visual-editor/locales/platform/ro/visual-editor.jsonpackages/visual-editor/locales/platform/sk/visual-editor.jsonpackages/visual-editor/locales/platform/sv/visual-editor.jsonpackages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/locales/platform/zh-TW/visual-editor.jsonpackages/visual-editor/locales/platform/zh/visual-editor.jsonpackages/visual-editor/src/internal/components/InternalThemeEditor.tsxpackages/visual-editor/src/internal/puck/components/LayoutHeader.tsxpackages/visual-editor/src/internal/puck/components/ThemeHeader.tsxpackages/visual-editor/src/internal/types/templateMetadata.tspackages/visual-editor/src/internal/utils/getPublishTooltipMessageFromHeadDeployStatus.ts
Show a different error message depending on the head deploy state
This replaces "deployInProgress" in template metadata
Dependent on this change: https://gerrit.yext.com/c/alpha/+/322590