resolve-account
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -20,3 +20,3 @@ (function (root, factory) { | ||
var SOURCE = 'library'; | ||
var VERSION = '1.0.17'; | ||
var VERSION = '1.0.18'; | ||
@@ -82,2 +82,4 @@ function ResolveAccount(options) { | ||
// @@@DEVELOPER | ||
// var date = '2024-04-23T00:07:29.183Z'; | ||
// var date = `2024-03-23T00:07:29.183Z`; | ||
// account.plan.id = 'basic'; | ||
@@ -87,7 +89,11 @@ // account.plan.trial = { | ||
// expires: { | ||
// timestamp: new Date('2024-04-23T00:07:29.183Z').toISOString(), | ||
// timestampUNIX: Math.round(new Date('2024-04-23T00:07:29.183Z').getTime() / 1000), | ||
// } | ||
// timestamp: new Date(date).toISOString(), | ||
// timestampUNIX: Math.round(new Date(date).getTime() / 1000), | ||
// }, | ||
// } | ||
// account.plan.status = 'suspended'; | ||
// account.plan.expires = { | ||
// timestamp: new Date(date).toISOString(), | ||
// timestampUNIX: Math.round(new Date(date).getTime() / 1000), | ||
// } | ||
// account.plan.status = 'cancelled'; | ||
@@ -147,2 +153,3 @@ account.plan.limits = account.plan.limits || {}; | ||
var startDate = new Date(account.plan.payment.startDate.timestamp); | ||
var unresolvedPlanId = account.plan.id; | ||
var planIsActive = difference > -1 && account.plan.id !== defaultPlanId; | ||
@@ -330,4 +337,5 @@ var planIsSuspended = account.plan.status === 'suspended'; | ||
// If basic, just show account creation date | ||
if (isBasicPlan) { | ||
if (unresolvedPlanId === defaultPlanId) { | ||
visibleStartDate = accountCreationDate; | ||
billingStatusEl.setAttribute('hidden', true); | ||
} | ||
@@ -337,3 +345,4 @@ var visibleFrequency = account.plan.payment.frequency === 'unknown' ? 'monthly' : account.plan.payment.frequency; | ||
// Update billing UI | ||
billingPlanId.setInnerHTML(splitDashesAndUppercase(account.plan.id)); | ||
// billingPlanId.setInnerHTML(splitDashesAndUppercase(account.plan.id)); | ||
billingPlanId.setInnerHTML(splitDashesAndUppercase(unresolvedPlanId)); // Show unresolved because we want to show what plan they have bought not what the expirattion status resolves to | ||
billingFrequencyEl.setInnerHTML(visibleFrequency); | ||
@@ -352,5 +361,7 @@ billingStatusEl.setInnerHTML(visibleStatus); | ||
})); | ||
billingExpirationDateEl.setInnerHTML(isBasicPlan && daysTillExpire < 366 | ||
? '<i class="fas fa-exclamation-triangle mr-1"></i> Expires in ' + daysTillExpire + ' days ' | ||
: ''); | ||
// billingExpirationDateEl.setInnerHTML(isBasicPlan && daysTillExpire < 366 | ||
billingExpirationDateEl.setInnerHTML('<i class="fas fa-exclamation-triangle mr-1"></i> Expires in ' + daysTillExpire + ' days '); | ||
if (daysTillExpire > 0 && daysTillExpire < 366) { | ||
billingExpirationDateEl.removeAttribute('hidden'); | ||
} | ||
@@ -413,2 +424,3 @@ // Update payment method UI | ||
// Register | ||
@@ -415,0 +427,0 @@ if (environment === 'browser') { |
{ | ||
"name": "resolve-account", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Standardize account JSON structure for projects built under ITW Creative Works", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26485
355