Compare commits

...
26 changed files with 119 additions and 81 deletions
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.23.299](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.298](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.297](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.23.297",
"version": "3.23.299",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.46.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.46.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.46.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.46.4",
"version": "3.46.6",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.231](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.230](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.229](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.229",
"version": "1.3.231",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.149.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-16)
### Bug Fixes
* **web:** remove checking for MFA permissions as all users are permitted to MFA ([ea40427](https://github.com/standardnotes/app/commit/ea40427e6715ba75193430fd7d3044e3c960d6ae))
# [2.149.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-14)
### Features
@@ -1035,10 +1035,6 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
}
}
public isMfaFeatureAvailable(): boolean {
return this.mfaService.isMfaFeatureAvailable()
}
public async isMfaActivated(): Promise<boolean> {
return this.mfaService.isMfaActivated()
}
@@ -3,7 +3,6 @@ import { SettingName } from '@standardnotes/settings'
import { SNSettingsService } from '../Settings'
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
import { SNFeaturesService } from '../Features/FeaturesService'
import { FeatureIdentifier } from '@standardnotes/features'
import { AbstractService, InternalEventBusInterface, SignInStrings } from '@standardnotes/services'
export class SNMfaService extends AbstractService {
@@ -47,17 +46,6 @@ export class SNMfaService extends AbstractService {
return await this.settingsService.deleteSetting(SettingName.MfaSecret)
}
isMfaFeatureAvailable(): boolean {
const feature = this.featuresService.getUserFeature(FeatureIdentifier.TwoFactorAuth)
// If the feature is not present in the collection, we don't want to block it
if (feature == undefined) {
return false
}
return feature.no_expire === true || (feature.expires_at ?? 0) > Date.now()
}
override deinit(): void {
;(this.settingsService as unknown) = undefined
;(this.crypto as unknown) = undefined
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.149.0",
"version": "2.149.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.98.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-16)
### Bug Fixes
* **web:** remove checking for MFA permissions as all users are permitted to MFA ([ea40427](https://github.com/standardnotes/app/commit/ea40427e6715ba75193430fd7d3044e3c960d6ae))
## [3.98.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
### Bug Fixes
* **mobile:** show premium modal on iOS ([e962e9c](https://github.com/standardnotes/app/commit/e962e9c7457115100aba0f5d34c949ab2d8b0e23))
# [3.98.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-15)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.98.0",
"version": "3.98.2",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -356,7 +356,7 @@ export class WebApplication extends SNApplication implements WebApplicationInter
return this.getViewControllerManager().featuresController.entitledToFiles
}
showPremiumModal(featureName: FeatureName): void {
showPremiumModal(featureName?: FeatureName): void {
void this.getViewControllerManager().featuresController.showPremiumAlert(featureName)
}
@@ -13,11 +13,19 @@ const UpgradeNow = ({ application, featuresController, subscriptionContoller }:
const shouldShowCTA = !featuresController.hasFolders
const hasAccount = subscriptionContoller.hasAccount
const onClick = () => {
if (application.isNativeIOS()) {
application.showPremiumModal()
} else {
application.openPurchaseFlow()
}
}
return shouldShowCTA ? (
<div className="flex h-full items-center px-2">
<button
className="rounded bg-info py-0.5 px-1.5 text-sm font-bold uppercase text-info-contrast hover:brightness-125 lg:text-xs"
onClick={() => application.openPurchaseFlow()}
onClick={onClick}
>
{hasAccount ? 'Unlock features' : 'Sign up to sync'}
</button>
@@ -14,22 +14,27 @@ const NoSubscriptionBanner = ({
title: string
message: string
className?: string
}) => (
<div className={classNames('grid grid-cols-1 rounded-md border border-border p-4', className)}>
<div className="flex items-center">
<Icon className={classNames('mr-1 -ml-1 h-5 w-5', PremiumFeatureIconClass)} type={PremiumFeatureIconName} />
<h1 className="sk-h3 m-0 text-sm font-semibold">{title}</h1>
}) => {
const onClick = () => {
if (application.isNativeIOS()) {
application.showPremiumModal()
} else {
application.openPurchaseFlow()
}
}
return (
<div className={classNames('grid grid-cols-1 rounded-md border border-border p-4', className)}>
<div className="flex items-center">
<Icon className={classNames('mr-1 -ml-1 h-5 w-5', PremiumFeatureIconClass)} type={PremiumFeatureIconName} />
<h1 className="sk-h3 m-0 text-sm font-semibold">{title}</h1>
</div>
<p className="col-start-1 col-end-3 m-0 mt-1 text-sm">{message}</p>
<Button primary small className="col-start-1 col-end-3 mt-3 justify-self-start uppercase" onClick={onClick}>
Upgrade Features
</Button>
</div>
<p className="col-start-1 col-end-3 m-0 mt-1 text-sm">{message}</p>
<Button
primary
small
className="col-start-1 col-end-3 mt-3 justify-self-start uppercase"
onClick={() => application.openPurchaseFlow()}
>
Upgrade Features
</Button>
</div>
)
)
}
export default NoSubscriptionBanner
@@ -15,7 +15,11 @@ const NoSubscription: FunctionComponent<Props> = ({ application }) => {
const errorMessage = 'There was an error when attempting to redirect you to the subscription page.'
setIsLoadingPurchaseFlow(true)
try {
application.openPurchaseFlow()
if (application.isNativeIOS()) {
application.showPremiumModal()
} else {
application.openPurchaseFlow()
}
} catch (e) {
setPurchaseFlowError(errorMessage)
} finally {
@@ -15,7 +15,11 @@ const NoProSubscription: FunctionComponent<Props> = ({ application }) => {
const errorMessage = 'There was an error when attempting to redirect you to the subscription page.'
setIsLoadingPurchaseFlow(true)
try {
application.openPurchaseFlow()
if (application.isNativeIOS()) {
application.showPremiumModal()
} else {
application.openPurchaseFlow()
}
} catch (e) {
setPurchaseFlowError(errorMessage)
} finally {
@@ -42,12 +42,20 @@ const HelpAndFeedback = ({ application }: { application: WebApplication }) => {
</a>
</Text>
{application.isNativeIOS() && (
<LinkButton
className="mt-3"
label="Privacy Policy"
link="https://standardnotes.com/privacy"
onClick={handleClick}
/>
<>
<LinkButton
className="mt-3"
label="Privacy Policy"
link="https://standardnotes.com/privacy"
onClick={handleClick}
/>
<LinkButton
className="mt-3"
label="Terms of Use"
link="https://www.apple.com/legal/internet-services/itunes/dev/stdeula/"
onClick={handleClick}
/>
</>
)}
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
@@ -81,10 +81,6 @@ export class TwoFactorAuth {
return
}
if (!this.isMfaFeatureAvailable()) {
return
}
this.mfaProvider
.isMfaActivated()
.then(
@@ -110,10 +106,6 @@ export class TwoFactorAuth {
return
}
if (!this.isMfaFeatureAvailable()) {
return
}
if (this._status === 'two-factor-disabled') {
return this.startActivation()
}
@@ -130,8 +122,4 @@ export class TwoFactorAuth {
get status(): TwoFactorStatus | 'fetching' {
return this._status
}
isMfaFeatureAvailable(): boolean {
return this.mfaProvider.isMfaFeatureAvailable()
}
}
@@ -11,17 +11,7 @@ const TwoFactorDescription: FunctionComponent<Props> = ({ auth }) => {
if (!auth.isLoggedIn()) {
return <Text>Sign in or register for an account to configure 2FA.</Text>
}
if (!auth.isMfaFeatureAvailable()) {
return (
<Text>
A paid subscription plan is required to enable 2FA.{' '}
<a target="_blank" href="https://standardnotes.com/features">
Learn more
</a>
.
</Text>
)
}
return <Text>An extra layer of security when logging in to your account.</Text>
}
@@ -9,7 +9,7 @@ type Props = {
}
const TwoFactorSwitch: FunctionComponent<Props> = ({ auth }) => {
if (!(auth.isLoggedIn() && auth.isMfaFeatureAvailable())) {
if (!auth.isLoggedIn()) {
return null
}
@@ -11,9 +11,7 @@ const TwoFactorTitle: FunctionComponent<Props> = ({ auth }) => {
if (!auth.isLoggedIn()) {
return <Title>Two-factor authentication not available</Title>
}
if (!auth.isMfaFeatureAvailable()) {
return <Title>Two-factor authentication not available</Title>
}
return <Title>Two-factor authentication</Title>
}
@@ -8,6 +8,4 @@ export interface MfaProvider {
enableMfa(secret: string, otpToken: string): Promise<void>
disableMfa(): Promise<void>
isMfaFeatureAvailable(): boolean
}
@@ -8,7 +8,7 @@ import { UpgradePrompt } from './Subviews/UpgradePrompt'
type Props = {
application: WebApplication
featureName: FeatureName | string
featureName?: FeatureName | string
hasSubscription: boolean
hasAccount: boolean
onClose: () => void
@@ -13,7 +13,7 @@ export const UpgradePrompt = ({
hasAccount,
onClose,
}: {
featureName: string
featureName?: string
ctaRef: React.RefObject<HTMLButtonElement>
application: WebApplication
hasSubscription: boolean
@@ -52,8 +52,17 @@ export const UpgradePrompt = ({
<div className="mb-1 text-center text-lg font-bold">Enable Advanced Features</div>
</AlertDialogLabel>
<AlertDialogDescription className="mb-2 px-4.5 text-center text-sm text-passive-1">
To take advantage of <span className="font-semibold">{featureName}</span> and other advanced features, upgrade
your current plan.
{featureName && (
<span>
To take advantage of <span className="font-semibold">{featureName}</span> and other advanced features,
upgrade your current plan.
</span>
)}
{!featureName && (
<span>
To take advantage of all the advanced features Standard Notes has to offer, upgrade your current plan.
</span>
)}
{application.isNativeIOS() && (
<div className="mt-2">
<div className="mb-2 font-bold">The Professional Plan costs $99.99/year and includes benefits like</div>
@@ -82,7 +82,7 @@ export class FeaturesController extends AbstractViewController {
}
}
public async showPremiumAlert(featureName: FeatureName | string): Promise<void> {
public async showPremiumAlert(featureName?: FeatureName | string): Promise<void> {
this.premiumAlertFeatureName = featureName
this.premiumAlertType = PremiumFeatureModalType.UpgradePrompt