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

Convert Connected Sites page to modal #8254

Merged
merged 2 commits into from
Mar 30, 2020
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
3 changes: 2 additions & 1 deletion test/e2e/permissions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('MetaMask', function () {
it('shows connected sites', async function () {
await driver.clickElement(By.xpath(`//button[contains(text(), 'Connected Sites')]`))

await driver.findElement(By.css('.connected-sites__title'))
await driver.findElement(By.xpath(`//h2[contains(text(), 'Connected Sites')]`))

const domains = await driver.findClickableElements(By.css('.connected-sites-list__domain'))
assert.equal(domains.length, 1)
Expand Down Expand Up @@ -163,6 +163,7 @@ describe('MetaMask', function () {
await driver.switchToWindow(extension)

await driver.clickElement(By.xpath(`//button[contains(text(), 'Disconnect All')]`))
await driver.clickElement(By.css('.popover-header__close'))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The confirmation modal is the old-style modal and is thus behind the popover. This is a workaround pending the forthcoming redesign.


const disconnectModal = await driver.findElement(By.css('span .modal'))

Expand Down
14 changes: 3 additions & 11 deletions ui/app/pages/connected-sites/connected-sites.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ConnectedSitesList from '../../components/app/connected-sites-list'
import {
DEFAULT_ROUTE,
} from '../../helpers/constants/routes'
import Popover from '../../components/ui/popover/popover.component'

export default class ConnectSites extends Component {
static propTypes = {
Expand All @@ -19,18 +20,9 @@ export default class ConnectSites extends Component {
history,
} = this.props
return (
<div className="connected-sites">
<div className="connected-sites__header">
<div className="connected-sites__title">
{ this.context.t('connectedSites') }
</div>
<div
className="settings-page__close-button"
onClick={() => history.push(DEFAULT_ROUTE)}
/>
</div>
<Popover title={this.context.t('connectedSites')} onClose={() => history.push(DEFAULT_ROUTE)}>
<ConnectedSitesList />
</div>
</Popover>
)
}
}
37 changes: 0 additions & 37 deletions ui/app/pages/connected-sites/index.scss

This file was deleted.

5 changes: 4 additions & 1 deletion ui/app/pages/home/home.component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Media from 'react-media'
import { Redirect } from 'react-router-dom'
import { Redirect, Route } from 'react-router-dom'
import { formatDate } from '../../helpers/utils/util'
import HomeNotification from '../../components/app/home-notification'
import DaiMigrationNotification from '../../components/app/dai-migration-component'
Expand All @@ -10,13 +10,15 @@ import WalletView from '../../components/app/wallet-view'
import TransactionList from '../../components/app/transaction-list'
import TransactionViewBalance from '../../components/app/transaction-view-balance'
import MenuBar from '../../components/app/menu-bar'
import ConnectedSites from '../connected-sites/connected-sites.component'

import {
RESTORE_VAULT_ROUTE,
CONFIRM_TRANSACTION_ROUTE,
CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE,
INITIALIZE_BACKUP_SEED_PHRASE_ROUTE,
CONNECT_ROUTE,
CONNECTED_ROUTE,
} from '../../helpers/constants/routes'

export default class Home extends PureComponent {
Expand Down Expand Up @@ -170,6 +172,7 @@ export default class Home extends PureComponent {

return (
<div className="main-container">
<Route path={CONNECTED_ROUTE} component={ConnectedSites} />
<div className="home__container">
<Media
query="(min-width: 576px)"
Expand Down
2 changes: 0 additions & 2 deletions ui/app/pages/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@
@import 'confirm-approve/index';

@import 'permissions-connect/index';

@import 'connected-sites/index';
5 changes: 1 addition & 4 deletions ui/app/pages/routes/routes.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Authenticated from '../../helpers/higher-order-components/authenticated'
import Initialized from '../../helpers/higher-order-components/initialized'
import Lock from '../lock'
import PermissionsConnect from '../permissions-connect'
import ConnectedSites from '../connected-sites'
import RestoreVaultPage from '../keychains/restore-vault'
import RevealSeedConfirmation from '../keychains/reveal-seed'
import MobileSyncPage from '../mobile-sync'
Expand All @@ -38,7 +37,6 @@ import {
CONFIRM_ADD_TOKEN_ROUTE,
CONFIRM_TRANSACTION_ROUTE,
CONNECT_ROUTE,
CONNECTED_ROUTE,
DEFAULT_ROUTE,
INITIALIZE_ROUTE,
INITIALIZE_UNLOCK_ROUTE,
Expand Down Expand Up @@ -127,8 +125,7 @@ export default class Routes extends Component {
<Authenticated path={CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE} component={ConfirmAddSuggestedTokenPage} exact />
<Authenticated path={NEW_ACCOUNT_ROUTE} component={CreateAccountPage} />
<Authenticated path={`${CONNECT_ROUTE}/:id`} component={PermissionsConnect} />
<Authenticated path={CONNECTED_ROUTE} component={ConnectedSites} exact />
<Authenticated path={DEFAULT_ROUTE} component={Home} exact />
<Authenticated path={DEFAULT_ROUTE} component={Home} />
</Switch>
)

Expand Down