Skip to content
Snippets Groups Projects
Commit 9b5bede1 authored by Jack Reed's avatar Jack Reed
Browse files

make WorkspaceAdd and ControlPanel fit within current mirador window

parent cc853b1e
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ describe('Basic end to end Mirador', () => {
});
it('loads a manifest and displays it', async () => {
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).toClick('#fetchBtn');
await expect(page).toMatchElement('[data-manifestid="http://localhost:5000/api/sn904cj3439"] button');
......
......@@ -18,6 +18,9 @@
width: 800px;
height: 600px;
}
.mirador-app {
border: 2px solid black;
}
</style>
<title>Mirador</title>
</head>
......
......@@ -4,6 +4,7 @@ describe('Mirador Invalid API Response Handler Test', () => {
});
it('breaks Mirador', async () => {
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).toClick('#fetchBtn');
await page.waitFor(1000);
......@@ -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 () => {
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).toClick('#fetchBtn');
......
......@@ -4,6 +4,7 @@ describe('Mirador plugin use', () => {
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins.html');
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).toClick('#fetchBtn');
......
......@@ -4,6 +4,7 @@ describe('Window actions', () => {
});
it('opens a window and closes it', async () => {
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).toClick('#fetchBtn');
......
......@@ -5,6 +5,7 @@ describe('Window Sidebars', () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/');
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).toClick('#fetchBtn');
......
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import AddIcon from '@material-ui/icons/AddSharp';
import ExpandMoreIcon from '@material-ui/icons/ExpandMoreSharp';
import AppBar from '@material-ui/core/AppBar';
......@@ -56,12 +57,21 @@ export class WorkspaceAdd extends React.Component {
<div className={ns('workspace-add')}>
{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 />
{t('addResource')}
</Fab>
<Drawer
className={classNames({
[classes.displayNone]: !addResourcesOpen,
})}
variant="persistent"
anchor="bottom"
open={addResourcesOpen}
......
......@@ -39,6 +39,9 @@ const styles = theme => ({
bottom: theme.spacing.unit * 2,
right: theme.spacing.unit * 2,
},
displayNone: {
display: 'none',
},
typographyBody: {
flexGrow: 1,
fontSize: '1em',
......
......@@ -13,7 +13,6 @@ const styles = theme => ({
},
drawer: {
overflowX: 'hidden',
height: '100%',
},
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment