Skip to content

Commit

Permalink
fix(TitleBlockZen): migrate positiveSentiment fix from kaizen-legacy (#…
Browse files Browse the repository at this point in the history
…4393)

* fix(TitleBlockZen): port over positiveSentiment fix from legacy

* chore(TitleBlockZen): add changeset
  • Loading branch information
mcwinter07 authored Dec 4, 2023
1 parent 02a6069 commit f6f7918
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/green-vans-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/components": patch
---

Add sentimentPositive TitleBlockZen fix from kaizen-legacy
3 changes: 3 additions & 0 deletions packages/components/src/TitleBlockZen/TitleBlockZen.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ describe("<TitleBlockZen />", () => {
["live", "statusLive"],
["closed", "statusClosed"],
["scheduled", "statusClosed"],
["sentimentPositive", "sentimentPositive"],
["default", "default"],
])(
"renders tag with correct text and variant when %s status",
async (status, expectedClassName) => {
Expand All @@ -725,6 +727,7 @@ describe("<TitleBlockZen />", () => {
| "live"
| "scheduled"
| "closed"
| "sentimentPositive"
| "default",
}}
>
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/TitleBlockZen/TitleBlockZen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const renderTag = (surveyStatus: SurveyStatus): JSX.Element | void => {
tagVariant = "statusClosed"
}

if (surveyStatus.status === "sentimentPositive") {
tagVariant = "sentimentPositive"
}

if (surveyStatus.status === "default") {
tagVariant = "default"
}
Expand Down
8 changes: 7 additions & 1 deletion packages/components/src/TitleBlockZen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ export type TextDirection = "ltr" | "rtl"

export type SurveyStatus = {
text: string
status: "draft" | "live" | "scheduled" | "closed" | "default"
status:
| "draft"
| "live"
| "scheduled"
| "closed"
| "sentimentPositive"
| "default"
}

export type TitleBlockBreadcrumbType = {
Expand Down

0 comments on commit f6f7918

Please sign in to comment.