Skip to content

Commit 2c36516

Browse files
authored
Merge pull request #3916 from fstoe/3247
feat: added setting to disable thumbnail labels
2 parents af09363 + 10b0291 commit 2c36516

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

__tests__/fixtures/config/export.example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@
179179
"thumbnailNavigation": {
180180
"defaultPosition": "far-bottom",
181181
"height": 150,
182-
"width": 100
182+
"width": 100,
183+
"showThumbnailLabels": true
183184
},
184185
"workspace": {
185186
"type": "mosaic"

__tests__/src/components/ThumbnailCanvasGrouping.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function createWrapper(props) {
1818
top: 0,
1919
width: 100,
2020
}}
21+
showThumbnailLabels
2122
{...props}
2223
/>,
2324
);

src/components/ThumbnailCanvasGrouping.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class ThumbnailCanvasGrouping extends PureComponent {
3939
/** */
4040
render() {
4141
const {
42-
index, style, data, currentCanvasId,
42+
index, style, data, currentCanvasId, showThumbnailLabels,
4343
} = this.props;
4444
const {
4545
canvasGroupings, position, height,
@@ -87,7 +87,7 @@ export class ThumbnailCanvasGrouping extends PureComponent {
8787
<IIIFThumbnail
8888
key={canvas.id}
8989
resource={canvas}
90-
labelled
90+
labelled={showThumbnailLabels}
9191
maxHeight={(position === 'far-right') ? style.height - (1.5 * SPACING) : height - (1.5 * SPACING)}
9292
variant="inside"
9393
/>
@@ -103,5 +103,6 @@ ThumbnailCanvasGrouping.propTypes = {
103103
data: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
104104
index: PropTypes.number.isRequired,
105105
setCanvas: PropTypes.func.isRequired,
106+
showThumbnailLabels: PropTypes.bool.isRequired,
106107
style: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
107108
};

src/config/settings.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,16 @@ export default {
515515
defaultPosition: 'off', // Which position for the thumbnail navigation to be be displayed. Other possible values are "far-bottom" or "far-right"
516516
displaySettings: true, // Display the settings for this in WindowTopMenu
517517
height: 130, // height of entire ThumbnailNavigation area when position is "far-bottom"
518+
showThumbnailLabels: true, // Configure if thumbnail labels should be displayed
518519
width: 100, // width of one canvas (doubled for book view) in ThumbnailNavigation area when position is "far-right"
519520
},
520521
workspace: {
521-
draggingEnabled: true,
522522
allowNewWindows: true,
523-
id: uuid(),
524-
isWorkspaceAddVisible: false, // Catalog/Workspace add window feature visible by default
523+
draggingEnabled: true,
525524
exposeModeOn: false, // unused?
526525
height: 5000, // height of the elastic mode's virtual canvas
526+
id: uuid(),
527+
isWorkspaceAddVisible: false, // Catalog/Workspace add window feature visible by default
527528
showZoomControls: true, // Configure if zoom controls should be displayed by default
528529
type: 'mosaic', // Which workspace type to load by default. Other possible values are "elastic". If "mosaic" or "elastic" are not selected no worksapce type will be used.
529530
viewportPosition: { // center coordinates for the elastic mode workspace

src/containers/ThumbnailCanvasGrouping.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { compose } from 'redux';
22
import { connect } from 'react-redux';
33
import { withPlugins } from '../extend/withPlugins';
44
import * as actions from '../state/actions';
5-
import { getCurrentCanvas } from '../state/selectors';
5+
import { getCurrentCanvas, getConfig } from '../state/selectors';
66
import { ThumbnailCanvasGrouping } from '../components/ThumbnailCanvasGrouping';
77

88
/**
@@ -21,6 +21,7 @@ const mapDispatchToProps = (dispatch, { data }) => ({
2121
*/
2222
const mapStateToProps = (state, { data }) => ({
2323
currentCanvasId: (getCurrentCanvas(state, { windowId: data.windowId }) || {}).id,
24+
showThumbnailLabels: getConfig(state).thumbnailNavigation.showThumbnailLabels,
2425
});
2526

2627
const enhance = compose(

0 commit comments

Comments
 (0)