Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added trial msg #1964

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public static void executeMeta1(Utility utility, User user, HttpServletRequest r
userDetails.append("expired", organization.checkExpirationWithAktoSync());
userDetails.append("hotjarSiteId", organization.getHotjarSiteId());
userDetails.append("planType", organization.getplanType());
userDetails.append("trialMsg", organization.gettrialMsg());
}

if (versions.length > 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2480,6 +2480,7 @@ public static Organization fetchAndSaveFeatureWiseAllowed(Organization organizat
int gracePeriod = organization.getGracePeriod();
String hotjarSiteId = organization.getHotjarSiteId();
String planType = organization.getplanType();
String trialMsg = organization.gettrialMsg();
String organizationId = organization.getId();
/*
* This ensures, we don't fetch feature wise allowed from akto too often.
Expand Down Expand Up @@ -2545,6 +2546,7 @@ public static Organization fetchAndSaveFeatureWiseAllowed(Organization organizat
gracePeriod = OrganizationUtils.fetchOrgGracePeriodFromMetaData(metaData);
hotjarSiteId = OrganizationUtils.fetchHotjarSiteId(metaData);
planType = OrganizationUtils.fetchplanType(metaData);
trialMsg = OrganizationUtils.fetchtrialMsg(metaData);
boolean expired = OrganizationUtils.fetchExpired(metaData);
boolean telemetryEnabled = OrganizationUtils.fetchTelemetryEnabled(metaData);
// setTelemetrySettings(organization, telemetryEnabled);
Expand All @@ -2557,6 +2559,8 @@ public static Organization fetchAndSaveFeatureWiseAllowed(Organization organizat

organization.setplanType(planType);

organization.settrialMsg(trialMsg);

organization.setGracePeriod(gracePeriod);
organization.setFeatureWiseAllowed(featureWiseAllowed);
organization.setExpired(expired);
Expand All @@ -2579,6 +2583,7 @@ public static Organization fetchAndSaveFeatureWiseAllowed(Organization organizat
Updates.set(Organization._EXPIRED, expired),
Updates.set(Organization.HOTJAR_SITE_ID, hotjarSiteId),
Updates.set(Organization.PLAN_TYPE, planType),
Updates.set(Organization.TRIAL_MSG, trialMsg),
Updates.set(Organization.TEST_TELEMETRY_ENABLED, testTelemetryEnabled),
Updates.set(Organization.LAST_FEATURE_MAP_UPDATE, lastFeatureMapUpdate)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ public static String fetchplanType(BasicDBObject additionalMetaData) {
return additionalMetaData.getString("PLAN_TYPE", "");
}

public static String fetchtrialMsg(BasicDBObject additionalMetaData) {
return additionalMetaData.getString("TRIAL_MSG", "");
}

public static boolean fetchTelemetryEnabled(BasicDBObject additionalMetaData) {
return additionalMetaData.getString("ENABLE_TELEMETRY", "NA").equalsIgnoreCase("ENABLED");
}
Expand Down
2 changes: 2 additions & 0 deletions apps/dashboard/web/pages/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@

window.PLAN_TYPE = '${requestScope.planType}'

window.TRIAL_MSG = '${requestScope.trialMsg}'

// Enabling the debug mode flag is useful during implementation,
// but it's recommended you remove it for production

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,18 @@ function Dashboard() {
</VerticalStack>
</div> : null}
{func.checkLocal() && !(location.pathname.includes("test-editor") || location.pathname.includes("settings") || location.pathname.includes("onboarding") || location.pathname.includes("summary")) ?<div className="call-banner">
<Banner hideIcon={true}>
<Banner hideIcon={true}>
<Text variant="headingMd">Need a 1:1 experience?</Text>
<Button plain monochrome onClick={() => {
window.open("https://akto.io/api-security-demo", "_blank")
}}><Text variant="bodyMd">Book a call</Text></Button>
</Banner>
</div> : null}
{window.TRIAL_MSG && !(location.pathname.includes("test-editor") || location.pathname.includes("settings") || location.pathname.includes("onboarding") || location.pathname.includes("summary")) ?<div className="call-banner">
<Banner hideIcon={true}>
<Text variant="bodyMd">{window.TRIAL_MSG}</Text>
</Banner>
</div> : null}
</Frame>
</div>
)
Expand Down
11 changes: 11 additions & 0 deletions libs/dao/src/main/java/com/akto/dto/billing/Organization.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class Organization {
public static final String PLAN_TYPE = "planType";
public String planType = "planType";

public static final String TRIAL_MSG = "trialMsg";
public String trialMsg = "trialMsg";

public static final String TEST_TELEMETRY_ENABLED = "testTelemetryEnabled";
private boolean testTelemetryEnabled;
private int gracePeriod;
Expand Down Expand Up @@ -142,6 +145,14 @@ public void setplanType(String planType) {
this.planType = planType;
}

public String gettrialMsg() {
return trialMsg;
}

public void settrialMsg(String trialMsg) {
this.trialMsg = trialMsg;
}

public int getLastFeatureMapUpdate() {
return lastFeatureMapUpdate;
}
Expand Down
Loading