fix: handle condition of free validation warning message

This commit is contained in:
RaktimaNXG
2024-03-29 17:51:59 +05:30
parent 881ac12b03
commit de26c2d719
7 changed files with 52 additions and 41 deletions
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { themeColor } from "../../constant/const";
import { isEnableSubscription, themeColor } from "../../constant/const";
import ModalUi from "../../primitives/ModalUi";
import { radioButtonWidget } from "../../constant/Utils";
import PremiumAlertHeader from "../../primitives/PremiumAlertHeader";
@@ -254,7 +254,7 @@ function DropdownWidgetOption(props) {
>
Minimun check
</label>
{!props.isSubscribe && <Upgrade />}
{!props.isSubscribe && isEnableSubscription && <Upgrade />}
<input
required
defaultValue={0}
@@ -264,7 +264,7 @@ function DropdownWidgetOption(props) {
setMinCount(count);
}}
className={
props.isSubscribe
props.isSubscribe || !isEnableSubscription
? "drodown-input"
: "disabled drodown-input"
}
@@ -287,7 +287,7 @@ function DropdownWidgetOption(props) {
setMaxCount(count);
}}
className={
props.isSubscribe
props.isSubscribe || !isEnableSubscription
? "drodown-input"
: "disabled drodown-input"
}
@@ -402,13 +402,15 @@ function DropdownWidgetOption(props) {
</div>
)}
</div>
{props.type === "checkbox" && !props.isSignYourself && (
<PremiumAlertHeader
message={
"Field validations are free in beta, this feature will incur a fee later."
}
/>
)}
{props.type === "checkbox" &&
!props.isSignYourself &&
!isEnableSubscription && (
<PremiumAlertHeader
message={
"Field validations are free in beta, this feature will incur a fee later."
}
/>
)}
<div
className={`${
props.type === "checkbox" && !props.isSignYourself
@@ -5,6 +5,7 @@ import RegexParser from "regex-parser";
import { textInputWidget } from "../../constant/Utils";
import PremiumAlertHeader from "../../primitives/PremiumAlertHeader";
import Upgrade from "../../primitives/Upgrade";
import { isEnableSubscription } from "../../constant/const";
const WidgetNameModal = (props) => {
const [formdata, setFormdata] = useState({
@@ -101,13 +102,14 @@ const WidgetNameModal = (props) => {
title={"Widget info"}
>
{(props.defaultdata?.type === textInputWidget ||
props.widgetName === textInputWidget) && (
<PremiumAlertHeader
message={
"Field validations are free in beta, this feature will incur a fee later."
}
/>
)}
props.widgetName === textInputWidget) &&
!isEnableSubscription && (
<PremiumAlertHeader
message={
"Field validations are free in beta, this feature will incur a fee later."
}
/>
)}
<form
onSubmit={handleSubmit}
className={`${
@@ -136,14 +138,18 @@ const WidgetNameModal = (props) => {
<div className="form-section">
<label
htmlFor="textvalidate"
className="disabled"
className={
!props.isSubscribe && isEnableSubscription && "disabled"
}
style={{ fontSize: 13 }}
>
Validation
</label>
{!props.isSubscribe && <Upgrade />}
{!props.isSubscribe && isEnableSubscription && <Upgrade />}
<div
className="disabled"
className={
!props.isSubscribe && isEnableSubscription && "disabled"
}
style={{
display: "flex",
flexDirection: "row",
+1 -1
View File
@@ -26,7 +26,7 @@ export async function checkIsSubscribed() {
const user = await Parse.Cloud.run("getUserDetails", {
email: jsonSender[0].Email
});
const freeplan = user?.get("Plan") && user?.get("Plan").plan_code;
const freeplan = user?.get("Plan") && user?.get("Plan")?.plan_code;
const billingDate =
user?.get("Next_billing_date") && user?.get("Next_billing_date");
if (freeplan === "freeplan") {
+5 -5
View File
@@ -125,10 +125,10 @@ function GenerateToken() {
</div>
) : (
<div className="bg-white flex flex-col justify-center shadow rounded">
<PremiumAlertHeader />
{!isEnableSubscription && <PremiumAlertHeader />}
<h1
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "ml-4 mt-3 mb-2 font-semibold"
: "ml-4 mt-3 mb-2 font-semibold text-gray-300"
}
@@ -140,11 +140,11 @@ function GenerateToken() {
}
iconColor={!isSubscribe && "gray"}
/>
{!isSubscribe && <Upgrade />}
{!isSubscribe && isEnableSubscription && <Upgrade />}
</h1>
<ul
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "w-full flex flex-col p-2 text-sm "
: "w-full flex flex-col p-2 text-sm opacity-20 pointer-events-none"
}
@@ -164,7 +164,7 @@ function GenerateToken() {
</ul>
<div
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "flex flex-col md:flex-row items-center justify-center gap-2 pb-4"
: "flex flex-col md:flex-row items-center justify-center gap-2 pb-4 opacity-40 pointer-events-none"
}
+10 -8
View File
@@ -276,7 +276,7 @@ function UserProfile() {
<div className="flex justify-between items-center py-2">
<span
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "font-semibold"
: "font-semibold text-gray-300"
}
@@ -288,11 +288,11 @@ function UserProfile() {
}
isSubscribe={isSubscribe}
/>{" "}
{!isSubscribe && <Upgrade />}
{!isSubscribe && isEnableSubscription && <Upgrade />}
</span>{" "}
<label
className={
!isSubscribe
!isSubscribe || isEnableSubscription
? "relative inline-flex items-center mb-0 pointer-events-none opacity-50"
: `${
editmode ? "cursor-pointer" : ""
@@ -310,11 +310,13 @@ function UserProfile() {
<div className="w-9 h-5 bg-gray-200 peer-focus:outline-none peer-focus:ring-1 peer-focus:ring-black rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all dark:border-black peer-checked:bg-blue-600"></div>
</label>
</div>
<PremiumAlertHeader
message={
"Disable documentId is free in beta, this feature will incur a fee later."
}
/>
{!isEnableSubscription && (
<PremiumAlertHeader
message={
"Disable documentId is free in beta, this feature will incur a fee later."
}
/>
)}
</li>
</ul>
<div className="flex justify-center pt-2 pb-3 md:pt-3 md:pb-4">
+5 -5
View File
@@ -109,10 +109,10 @@ function Webhook() {
</div>
) : (
<div className="bg-white flex flex-col justify-center shadow rounded">
<PremiumAlertHeader />
{!isEnableSubscription && <PremiumAlertHeader />}
<h1
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "ml-4 mt-3 mb-2 font-semibold"
: "ml-4 mt-3 mb-2 font-semibold text-gray-300"
}
@@ -122,11 +122,11 @@ function Webhook() {
url={"https://docs.opensignlabs.com/docs/API-docs/get-webhook"}
isSubscribe={isSubscribe}
/>
{!isSubscribe && <Upgrade />}
{!isSubscribe && isEnableSubscription && <Upgrade />}
</h1>
<ul
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "w-full flex flex-col p-2 text-sm "
: "w-full flex flex-col p-2 text-sm opacity-20 pointer-events-none"
}
@@ -142,7 +142,7 @@ function Webhook() {
</ul>
<div
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "flex flex-col md:flex-row items-center justify-center gap-2 pb-4"
: "flex flex-col md:flex-row items-center justify-center gap-2 pb-4 opacity-40 pointer-events-none"
}
+2 -1
View File
@@ -1,12 +1,13 @@
import React from "react";
import { Tooltip as ReactTooltip } from "react-tooltip";
import { openInNewTab } from "../constant/Utils";
import { isEnableSubscription } from "../constant/const";
const Tooltip = ({ id, message, url, iconColor, isSubscribe }) =>
url ? (
<button
onClick={() => openInNewTab(url)}
className={
isSubscribe
isSubscribe || !isEnableSubscription
? "text-center"
: "text-center opacity-20 pointer-events-none"
}