Remove UiMigrationAnnouncement and associated state (#6794)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent 714cf72fc3
commit df17853502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/scripts/controllers/preferences.js
  2. 1
      app/scripts/metamask-controller.js
  3. 1
      development/states/confirm-new-ui.json
  4. 1
      development/states/confirm-sig-requests.json
  5. 1
      development/states/currency-localization.json
  6. 1
      development/states/send-edit.json
  7. 1
      development/states/send-new-ui.json
  8. 1
      development/states/tx-list-items.json
  9. 2
      ui/app/components/app/index.scss
  10. 1
      ui/app/components/app/ui-migration-annoucement/index.js
  11. 22
      ui/app/components/app/ui-migration-annoucement/index.scss
  12. 33
      ui/app/components/app/ui-migration-annoucement/ui-migration-annoucement.component.js
  13. 21
      ui/app/components/app/ui-migration-annoucement/ui-migration-announcement.container.js
  14. 6
      ui/app/ducks/metamask/metamask.js
  15. 2
      ui/app/pages/routes/index.js
  16. 30
      ui/app/store/actions.js

@ -55,7 +55,6 @@ class PreferencesController {
useNativeCurrencyAsPrimaryCurrency: true,
},
completedOnboarding: false,
completedUiMigration: true,
metaMetricsId: null,
metaMetricsSendCount: 0,
}, opts.initState)
@ -613,14 +612,6 @@ class PreferencesController {
return Promise.resolve(true)
}
/**
* Sets the {@code completedUiMigration} state to {@code true}, indicating that the user has completed the UI switch.
*/
completeUiMigration () {
this.store.updateState({ completedUiMigration: true })
return Promise.resolve(true)
}
//
// PRIVATE METHODS
//

@ -454,7 +454,6 @@ module.exports = class MetamaskController extends EventEmitter {
setAccountLabel: nodeify(preferencesController.setAccountLabel, preferencesController),
setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController),
setPreference: nodeify(preferencesController.setPreference, preferencesController),
completeUiMigration: nodeify(preferencesController.completeUiMigration, preferencesController),
completeOnboarding: nodeify(preferencesController.completeOnboarding, preferencesController),
addKnownMethodData: nodeify(preferencesController.addKnownMethodData, preferencesController),

@ -134,7 +134,6 @@
"useNativeCurrencyAsPrimaryCurrency": true,
"showFiatInTestnets": true
},
"completedUiMigration": true,
"frequentRpcListDetail": []
},
"appState": {

@ -157,7 +157,6 @@
"preferences": {
"useNativeCurrencyAsPrimaryCurrency": true
},
"completedUiMigration": true,
"frequentRpcListDetail": []
},
"appState": {

@ -116,7 +116,6 @@
"useNativeCurrencyAsPrimaryCurrency": true,
"showFiatInTestnets": true
},
"completedUiMigration": true,
"frequentRpcListDetail": []
},
"appState": {

@ -138,7 +138,6 @@
"useNativeCurrencyAsPrimaryCurrency": true,
"showFiatInTestnets": true
},
"completedUiMigration": true,
"frequentRpcListDetail": []
},
"appState": {

@ -117,7 +117,6 @@
"useNativeCurrencyAsPrimaryCurrency": true,
"showFiatInTestnets": true
},
"completedUiMigration": true,
"frequentRpcListDetail": []
},
"appState": {

@ -1059,7 +1059,6 @@
"preferences": {
"useNativeCurrencyAsPrimaryCurrency": true
},
"completedUiMigration": true,
"frequentRpcListDetail": []
},
"appState": {

@ -77,5 +77,3 @@
@import 'gas-customization/index';
@import 'gas-customization/gas-price-button-group/index';
@import 'ui-migration-annoucement/index';

@ -1 +0,0 @@
export {default} from './ui-migration-announcement.container'

@ -1,22 +0,0 @@
.ui-migration-announcement {
position: absolute;
z-index: 9999;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
background: $white;
p {
box-sizing: border-box;
padding: 1em;
font-size: 12pt;
}
p:last-of-type {
cursor: pointer;
text-decoration: underline;
font-weight: bold;
}
}

@ -1,33 +0,0 @@
import PropTypes from 'prop-types'
import React, {PureComponent} from 'react'
export default class UiMigrationAnnouncement extends PureComponent {
static contextTypes = {
t: PropTypes.func.isRequired,
}
static defaultProps = {
shouldShowAnnouncement: true,
};
static propTypes = {
onClose: PropTypes.func.isRequired,
shouldShowAnnouncement: PropTypes.bool,
}
render () {
const { t } = this.context
const { onClose, shouldShowAnnouncement } = this.props
if (!shouldShowAnnouncement) {
return null
}
return (
<div className="ui-migration-announcement">
<p>{t('uiMigrationAnnouncement')}</p>
<p onClick={onClose}>{t('close')}</p>
</div>
)
}
}

@ -1,21 +0,0 @@
import { connect } from 'react-redux'
import UiMigrationAnnouncement from './ui-migration-annoucement.component'
import { setCompletedUiMigration } from '../../../store/actions'
const mapStateToProps = (state) => {
const shouldShowAnnouncement = !state.metamask.completedUiMigration
return {
shouldShowAnnouncement,
}
}
const mapDispatchToProps = dispatch => {
return {
onClose () {
dispatch(setCompletedUiMigration())
},
}
}
export default connect(mapStateToProps, mapDispatchToProps)(UiMigrationAnnouncement)

@ -403,12 +403,6 @@ function reduceMetamask (state, action) {
})
}
case actions.COMPLETE_UI_MIGRATION: {
return extend(metamaskState, {
completedUiMigration: true,
})
}
case actions.SET_FIRST_TIME_FLOW_TYPE: {
return extend(metamaskState, {
firstTimeFlowType: action.value,

@ -24,7 +24,6 @@ import Settings from '../settings'
import Authenticated from '../../helpers/higher-order-components/authenticated'
import Initialized from '../../helpers/higher-order-components/initialized'
import Lock from '../lock'
import UiMigrationAnnouncement from '../../components/app/ui-migration-annoucement'
const RestoreVaultPage = require('../keychains/restore-vault').default
const RevealSeedConfirmation = require('../keychains/reveal-seed')
const MobileSyncPage = require('../mobile-sync')
@ -214,7 +213,6 @@ class Routes extends Component {
}
}}
>
<UiMigrationAnnouncement />
<Modal />
<Alert
visible={this.props.alertOpen}

@ -321,11 +321,6 @@ var actions = {
setShowFiatConversionOnTestnetsPreference,
setAutoLogoutTimeLimit,
// Migration of users to new UI
setCompletedUiMigration,
completeUiMigration,
COMPLETE_UI_MIGRATION: 'COMPLETE_UI_MIGRATION',
// Onboarding
setCompletedOnboarding,
completeOnboarding,
@ -2513,31 +2508,6 @@ function completeOnboarding () {
}
}
function setCompletedUiMigration () {
return dispatch => {
dispatch(actions.showLoadingIndication())
return new Promise((resolve, reject) => {
background.completeUiMigration(err => {
dispatch(actions.hideLoadingIndication())
if (err) {
dispatch(actions.displayWarning(err.message))
return reject(err)
}
dispatch(actions.completeUiMigration())
resolve()
})
})
}
}
function completeUiMigration () {
return {
type: actions.COMPLETE_UI_MIGRATION,
}
}
function setNetworkNonce (networkNonce) {
return {
type: actions.SET_NETWORK_NONCE,

Loading…
Cancel
Save