Skip to content
Snippets Groups Projects
Unverified Commit b4461cc4 authored by Chris Beer's avatar Chris Beer Committed by GitHub
Browse files

Merge pull request #1997 from ProjectMirador/1975-scroll

Fix scrolling issues in window
parents df616ce5 8c1c093b
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ describe('Basic end to end Mirador', () => { ...@@ -8,6 +8,7 @@ describe('Basic end to end Mirador', () => {
}); });
it('loads a manifest and displays it', async () => { it('loads a manifest and displays it', async () => {
await expect(page).toClick('#addBtn'); await expect(page).toClick('#addBtn');
await expect(page).toClick('.mirador-add-resource-button');
await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/sn904cj3439'); await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/sn904cj3439');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
await expect(page).toMatchElement('[data-manifestid="http://localhost:5000/api/sn904cj3439"] button'); await expect(page).toMatchElement('[data-manifestid="http://localhost:5000/api/sn904cj3439"] button');
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
width: 800px; width: 800px;
height: 600px; height: 600px;
} }
.mirador-app {
border: 2px solid black;
}
</style> </style>
<title>Mirador</title> <title>Mirador</title>
</head> </head>
......
...@@ -4,6 +4,7 @@ describe('Mirador Invalid API Response Handler Test', () => { ...@@ -4,6 +4,7 @@ describe('Mirador Invalid API Response Handler Test', () => {
}); });
it('breaks Mirador', async () => { it('breaks Mirador', async () => {
await expect(page).toClick('#addBtn'); await expect(page).toClick('#addBtn');
await expect(page).toClick('.mirador-add-resource-button');
await expect(page).toFill('#manifestURL', 'http://localhost:5000/invalid'); await expect(page).toFill('#manifestURL', 'http://localhost:5000/invalid');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
await page.waitFor(1000); await page.waitFor(1000);
...@@ -17,6 +18,7 @@ describe('Mirador Invalid API Response Handler Test', () => { ...@@ -17,6 +18,7 @@ describe('Mirador Invalid API Response Handler Test', () => {
it('renders an error message when a manifest cannot be loaded (and allows it to be dismissed)', async () => { it('renders an error message when a manifest cannot be loaded (and allows it to be dismissed)', async () => {
await expect(page).toClick('#addBtn'); await expect(page).toClick('#addBtn');
await expect(page).toClick('.mirador-add-resource-button');
await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/broken'); await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/broken');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
......
...@@ -4,6 +4,7 @@ describe('Mirador plugin use', () => { ...@@ -4,6 +4,7 @@ describe('Mirador plugin use', () => {
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins.html');
await expect(page).toClick('#addBtn'); await expect(page).toClick('#addBtn');
await expect(page).toClick('.mirador-add-resource-button');
await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/sn904cj3439'); await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/sn904cj3439');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
......
...@@ -4,6 +4,7 @@ describe('Window actions', () => { ...@@ -4,6 +4,7 @@ describe('Window actions', () => {
}); });
it('opens a window and closes it', async () => { it('opens a window and closes it', async () => {
await expect(page).toClick('#addBtn'); await expect(page).toClick('#addBtn');
await expect(page).toClick('.mirador-add-resource-button');
await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/sn904cj3439'); await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/sn904cj3439');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
......
...@@ -5,6 +5,7 @@ describe('Window Sidebars', () => { ...@@ -5,6 +5,7 @@ describe('Window Sidebars', () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/');
await expect(page).toClick('#addBtn'); await expect(page).toClick('#addBtn');
await expect(page).toClick('.mirador-add-resource-button');
await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/001'); await expect(page).toFill('#manifestURL', 'http://localhost:5000/api/001');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
......
import React from 'react'; import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import { MuiThemeProvider } from '@material-ui/core/styles'; import { MuiThemeProvider } from '@material-ui/core/styles';
import Fullscreen from 'react-fullscreen-crossbrowser'; import Fullscreen from 'react-full-screen';
import WorkspaceControlPanel from '../../../src/containers/WorkspaceControlPanel'; import WorkspaceControlPanel from '../../../src/containers/WorkspaceControlPanel';
import Workspace from '../../../src/containers/Workspace'; import Workspace from '../../../src/containers/Workspace';
import WorkspaceAdd from '../../../src/containers/WorkspaceAdd'; import WorkspaceAdd from '../../../src/containers/WorkspaceAdd';
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
import Fullscreen from 'react-fullscreen-crossbrowser'; import Fullscreen from 'react-full-screen';
import { I18nextProvider } from 'react-i18next'; import { I18nextProvider } from 'react-i18next';
import WorkspaceControlPanel from '../containers/WorkspaceControlPanel'; import WorkspaceControlPanel from '../containers/WorkspaceControlPanel';
import Workspace from '../containers/Workspace'; import Workspace from '../containers/Workspace';
......
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames';
import AddIcon from '@material-ui/icons/AddSharp'; import AddIcon from '@material-ui/icons/AddSharp';
import ExpandMoreIcon from '@material-ui/icons/ExpandMoreSharp'; import ExpandMoreIcon from '@material-ui/icons/ExpandMoreSharp';
import AppBar from '@material-ui/core/AppBar'; import AppBar from '@material-ui/core/AppBar';
...@@ -56,12 +57,21 @@ export class WorkspaceAdd extends React.Component { ...@@ -56,12 +57,21 @@ export class WorkspaceAdd extends React.Component {
<div className={ns('workspace-add')}> <div className={ns('workspace-add')}>
{manifestList} {manifestList}
<Fab variant="extended" disabled={addResourcesOpen} className={classes.fab} color="secondary" onClick={() => (this.setAddResourcesVisibility(true))}> <Fab
variant="extended"
disabled={addResourcesOpen}
className={classNames(classes.fab, ns('add-resource-button'))}
color="secondary"
onClick={() => (this.setAddResourcesVisibility(true))}
>
<AddIcon /> <AddIcon />
{t('addResource')} {t('addResource')}
</Fab> </Fab>
<Drawer <Drawer
className={classNames({
[classes.displayNone]: !addResourcesOpen,
})}
variant="persistent" variant="persistent"
anchor="bottom" anchor="bottom"
open={addResourcesOpen} open={addResourcesOpen}
......
...@@ -39,6 +39,9 @@ const styles = theme => ({ ...@@ -39,6 +39,9 @@ const styles = theme => ({
bottom: theme.spacing.unit * 2, bottom: theme.spacing.unit * 2,
right: theme.spacing.unit * 2, right: theme.spacing.unit * 2,
}, },
displayNone: {
display: 'none',
},
typographyBody: { typographyBody: {
flexGrow: 1, flexGrow: 1,
fontSize: '1em', fontSize: '1em',
......
...@@ -13,7 +13,6 @@ const styles = theme => ({ ...@@ -13,7 +13,6 @@ const styles = theme => ({
}, },
drawer: { drawer: {
overflowX: 'hidden', overflowX: 'hidden',
height: '100%',
}, },
}); });
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
box-sizing: border-box; box-sizing: border-box;
left: 0; left: 0;
margin: 0; margin: 0;
overflow: scroll;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment