fix: disable features for public beta
This commit is contained in:
@@ -63,8 +63,11 @@ type AccountMenuState = {
|
|||||||
server: string;
|
server: string;
|
||||||
encryptionEnabled: boolean;
|
encryptionEnabled: boolean;
|
||||||
selectedAutoLockInterval: any;
|
selectedAutoLockInterval: any;
|
||||||
|
strictSigninDisabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare const __PUBLIC_BETA__: boolean;
|
||||||
|
|
||||||
class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
||||||
|
|
||||||
public appVersion: string
|
public appVersion: string
|
||||||
@@ -89,8 +92,9 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
|||||||
user: this.application!.getUser(),
|
user: this.application!.getUser(),
|
||||||
formData: {
|
formData: {
|
||||||
mergeLocal: true,
|
mergeLocal: true,
|
||||||
ephemeral: false
|
ephemeral: false,
|
||||||
},
|
},
|
||||||
|
strictSigninDisabled: __PUBLIC_BETA__,
|
||||||
mutable: {}
|
mutable: {}
|
||||||
} as AccountMenuState;
|
} as AccountMenuState;
|
||||||
}
|
}
|
||||||
@@ -331,6 +335,16 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showRegister() {
|
||||||
|
if (__PUBLIC_BETA__) {
|
||||||
|
alertDialog({ text: 'Registration is disabled for this beta version.' });
|
||||||
|
} else {
|
||||||
|
this.setFormDataState({
|
||||||
|
showRegister: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async readFile(file: File): Promise<any> {
|
async readFile(file: File): Promise<any> {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import {
|
|||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { confirmDialog } from '@/services/alertService';
|
import { confirmDialog } from '@/services/alertService';
|
||||||
|
|
||||||
|
declare const __PUBLIC_BETA__: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable before production release.
|
* Disable before production release.
|
||||||
* Anyone who used the beta will still have access to
|
* Anyone who used the beta will still have access to
|
||||||
@@ -139,6 +141,9 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
|
|||||||
|
|
||||||
reloadUpgradeStatus() {
|
reloadUpgradeStatus() {
|
||||||
this.application.checkForSecurityUpdate().then((available) => {
|
this.application.checkForSecurityUpdate().then((available) => {
|
||||||
|
if (__PUBLIC_BETA__) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
dataUpgradeAvailable: available
|
dataUpgradeAvailable: available
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
.sk-button-group.stretch
|
.sk-button-group.stretch
|
||||||
.sk-button.info.featured(ng-click='self.state.formData.showLogin = true')
|
.sk-button.info.featured(ng-click='self.state.formData.showLogin = true')
|
||||||
.sk-label Sign In
|
.sk-label Sign In
|
||||||
.sk-button.info.featured(ng-click='self.state.formData.showRegister = true')
|
.sk-button.info.featured(ng-click='self.showRegister()')
|
||||||
.sk-label Register
|
.sk-label Register
|
||||||
.sk-panel-row.sk-p
|
.sk-panel-row.sk-p
|
||||||
| Standard Notes is free on every platform, and comes
|
| Standard Notes is free on every platform, and comes
|
||||||
@@ -84,11 +84,13 @@
|
|||||||
)
|
)
|
||||||
.sk-horizontal-group.tight
|
.sk-horizontal-group.tight
|
||||||
input.sk-input(
|
input.sk-input(
|
||||||
|
ng-disabled="self.state.strictSigninDisabled"
|
||||||
ng-model='self.state.formData.strictSignin',
|
ng-model='self.state.formData.strictSignin',
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
)
|
)
|
||||||
p.sk-p Use strict sign in
|
p.sk-p(ng-if="!self.state.strictSigninDisabled") Use strict sign in
|
||||||
span
|
p.sk-p(ng-if="self.state.strictSigninDisabled") Strict sign is disabled for this beta version
|
||||||
|
span(ng-if="!self.state.strictSigninDisabled")
|
||||||
a.info(
|
a.info(
|
||||||
href='https://standardnotes.org/help/security',
|
href='https://standardnotes.org/help/security',
|
||||||
rel='noopener',
|
rel='noopener',
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
"watch": "webpack -w --config webpack.dev.js",
|
"watch": "webpack -w --config webpack.dev.js",
|
||||||
"watch:desktop": "webpack -w --config webpack.dev.js --env.platform='desktop'",
|
"watch:desktop": "webpack -w --config webpack.dev.js --env.platform='desktop'",
|
||||||
"bundle": "webpack --config webpack.prod.js && npm run tsc",
|
"bundle": "webpack --config webpack.prod.js && npm run tsc",
|
||||||
"bundle:desktop": "webpack --config webpack.prod.js --env.platform='desktop' && npm run tsc",
|
"bundle:desktop": "webpack --config webpack.prod.js --env.platform='desktop'",
|
||||||
|
"bundle:desktop:beta": "webpack --config webpack.prod.js --env.platform='desktop' --env.public_beta='true'",
|
||||||
"build": "bundle install && npm ci && bundle exec rails assets:precompile && npm run bundle",
|
"build": "bundle install && npm ci && bundle exec rails assets:precompile && npm run bundle",
|
||||||
"submodules": "git submodule update --init --force",
|
"submodules": "git submodule update --init --force",
|
||||||
"lint": "eslint --fix app/assets/javascripts/**/*.js",
|
"lint": "eslint --fix app/assets/javascripts/**/*.js",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ module.exports = (env = {
|
|||||||
__VERSION__: JSON.stringify(require('./package.json').version),
|
__VERSION__: JSON.stringify(require('./package.json').version),
|
||||||
__WEB__: JSON.stringify(env.platform === 'web'),
|
__WEB__: JSON.stringify(env.platform === 'web'),
|
||||||
__DESKTOP__: JSON.stringify(env.platform === 'desktop'),
|
__DESKTOP__: JSON.stringify(env.platform === 'desktop'),
|
||||||
|
__PUBLIC_BETA__: JSON.stringify(env.public_beta === 'true'),
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
// Options similar to the same options in webpackOptions.output
|
// Options similar to the same options in webpackOptions.output
|
||||||
|
|||||||
Reference in New Issue
Block a user