chore: Add create product link in survey editor (#2937)

This commit is contained in:
Johannes
2024-07-31 16:23:25 +02:00
committed by GitHub
parent b8b7a374a6
commit 98886ff074
4 changed files with 26 additions and 6 deletions

View File

@@ -17,10 +17,17 @@ interface HowToSendCardProps {
localSurvey: TSurvey;
setLocalSurvey: (survey: TSurvey | ((TSurvey: TSurvey) => TSurvey)) => void;
environment: TEnvironment;
organizationId: string;
product: TProduct;
}
export const HowToSendCard = ({ localSurvey, setLocalSurvey, environment, product }: HowToSendCardProps) => {
export const HowToSendCard = ({
localSurvey,
setLocalSurvey,
environment,
product,
organizationId,
}: HowToSendCardProps) => {
const [open, setOpen] = useState(false);
const [appSetupCompleted, setAppSetupCompleted] = useState(false);
const [websiteSetupCompleted, setWebsiteSetupCompleted] = useState(false);
@@ -215,12 +222,18 @@ export const HowToSendCard = ({ localSurvey, setLocalSurvey, environment, produc
</RadioGroup>
</div>
{promotedFeaturesString && (
<div className="mt-2 flex items-center space-x-3 rounded-b-lg border border-slate-200 bg-slate-50/50 px-4 py-2">
<AlertCircleIcon className="h-5 w-5 text-slate-500" />
<div className="text-slate-500">
<div className="mt-2 flex items-center space-x-3 rounded-b-lg border border-slate-200 bg-slate-100 px-4 py-2">
🤓
<div className="ml-2 text-slate-500">
<p className="text-xs">
You can also use Formbricks to run {promotedFeaturesString} surveys. Create a new product for
your {promotedFeaturesString} to use this feature.
You can also use Formbricks to run {promotedFeaturesString} surveys.{" "}
<Link
target="_blank"
href={`/organizations/${organizationId}/products/new/channel`}
className="font-medium underline decoration-slate-400 underline-offset-2">
Create a new product
</Link>{" "}
for your {promotedFeaturesString} to use this feature.
</p>
</div>
</div>

View File

@@ -15,6 +15,7 @@ import { WhenToSendCard } from "./WhenToSendCard";
interface SettingsViewProps {
environment: TEnvironment;
organizationId: string;
localSurvey: TSurvey;
setLocalSurvey: (survey: TSurvey) => void;
actionClasses: TActionClass[];
@@ -29,6 +30,7 @@ interface SettingsViewProps {
export const SettingsView = ({
environment,
organizationId,
localSurvey,
setLocalSurvey,
actionClasses,
@@ -49,6 +51,7 @@ export const SettingsView = ({
setLocalSurvey={setLocalSurvey}
environment={environment}
product={product}
organizationId={organizationId}
/>
{localSurvey.type === "app" ? (

View File

@@ -24,6 +24,7 @@ interface SurveyEditorProps {
survey: TSurvey;
product: TProduct;
environment: TEnvironment;
organizationId: string;
actionClasses: TActionClass[];
attributeClasses: TAttributeClass[];
segments: TSegment[];
@@ -40,6 +41,7 @@ export const SurveyEditor = ({
survey,
product,
environment,
organizationId,
actionClasses,
attributeClasses,
segments,
@@ -185,6 +187,7 @@ export const SurveyEditor = ({
{activeView === "settings" && (
<SettingsView
environment={environment}
organizationId={organizationId}
localSurvey={localSurvey}
setLocalSurvey={setLocalSurvey}
actionClasses={actionClasses}

View File

@@ -80,6 +80,7 @@ const Page = async ({ params }) => {
attributeClasses={attributeClasses}
responseCount={responseCount}
membershipRole={currentUserMembership?.role}
organizationId={organization.id}
colors={SURVEY_BG_COLORS}
segments={segments}
isUserTargetingAllowed={isUserTargetingAllowed}