Skip to content

Commit

Permalink
COLUMBIA: Add badges for hinting to viewer where additional resources…
Browse files Browse the repository at this point in the history
… are available

- consolidate selectors where possible
- add license information for forked plugins in monorepo
  • Loading branch information
barmintor committed Apr 23, 2024
1 parent 63fc2f3 commit 3bd27d6
Show file tree
Hide file tree
Showing 26 changed files with 984 additions and 158 deletions.
72 changes: 60 additions & 12 deletions __tests__/fixtures/culPlugins/public-pdf.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@
]
}
},
{
"label": {
"en": [
"Abstract"
]
},
"value": {
"en": [
"In the interview's first session, former Prime Minister and Minister of Industry Mehdi Jomaa recalls watching the events of the Tunisian Revolution unfold from his home in Paris, France, describing it as a \"young and spontaneous\" movement. He details his family's historical involvement, his distancing from politics in his twenties, and his relationship with Tunisia after settling in France for his \u003Cspan class=\"collapse\" id=\"cul_bk3j9kd78h-abstract_ssm-collapse-0\"\u003Estudies and career. Jomaa discusses the post-revolution management of the confiscated assets of the Ben Ali family with two ministers. He describes his chance meeting with Prime Minister Hamadi Jebali and failed negotiations to recruit him as Minister of Industry and Trade before he joined for an eleven-month tenure. He discusses the reaction of his wife and daughter. He describes joining the government as an outsider: he had not joined the professional opposition, did not know anyone in government prior to taking office, and laid very low, refusing media appearances, living within modest means and not announcing himself. He also comments on the search for prime minister and his abstinence from the search.\n\nIn the second session, Jomaa recalls the day of his hiring as prime minister and his plan for Tunisia. He describes the process of recruitment of his cabinet, which also involved getting to know the entire political landscape of Tunisia. He mentions members of an early group who helped him find the necessary individuals and gave him advice. He shares the story of presenting his list of ministers and how politically fraught this moment was. Jomaa addresses the importance of team building. He describes the dynamic he created and encouraged among the ministers. Jomaa frequently used the political strategy of measured risk, leaking ideas through various channels to generate a controllable reaction. He used this strategy when announcing cutting of salaries and to create uncertainty around whether he would run for election. Jomaa then describes his decision-making process, which involved all of the ministers. He describes how after the 2014 Chaambi Mountain attack, he leveraged his popularity to pressure the president to let him take the lead on security reforms. He also discusses strategy for negotiations with the UTTG when refusing to increase salaries or alter the appointments to his cabinet.\n\nIn the third session, Jomaa describes the recruitment process for his ministers. He speaks to succession problems once his mandate ended, which precipitated accusations against him. Jomaa enumerates the successes and failures of his mandate. The former include subsidies, while the latter includes other types of economic policy such as bank reform. Security was a more ambiguous matter. Using the 2014 Chaambi Mountains attack as an opportunity for reform, he bypassed President Moncef Marzouki's prerogative by creating a crisis cell and visiting the Algerian border\u003C/span\u003E \u003Cbutton class=\"btn btn-sm btn-link\" role=\"button\" data-toggle=\"collapse\" data-target=\"#cul_bk3j9kd78h-abstract_ssm-collapse-0\" aria-expanded=\"false\" aria-controls=\"cul_bk3j9kd78h-abstract_ssm-collapse-0\"\u003E\u003Cspan class=\"collapsed\"\u003E» Show more\u003C/span\u003E\u003Cspan class=\"expanded\"\u003E « Show less\u003C/span\u003E\u003C/button\u003E"
]
}
},
{
"label": {
"en": [
Expand Down Expand Up @@ -371,6 +359,66 @@
]
}
]
},
{
"type": "Canvas",
"id": "https://dev.local:3000/iiif/3/presentation/10.7916/n8qs-6964/canvas/10.7916/9sse-m939",
"label": {
"en": [
"audio recording"
]
},
"thumbnail": [
{
"width": 0,
"height": 0,
"type": "Image",
"format": "image/jpeg",
"id": "https://derivativo-1.library.columbia.edu/iiif/2/cul:zpc866t3ps/featured/!256,256/0/native.jpg",
"service": [
{
"id": "https://derivativo-4.library.columbia.edu/iiif/2/cul:zpc866t3ps",
"type": "ImageService2",
"profile": "http://iiif.io/api/image/2/level2.json"
}
]
}
],
"height": 1,
"width": 1,
"items": [
{
"type": "AnnotationPage",
"id": "https://dev.local:3000/iiif/3/presentation/10.7916/n8qs-6964/annotationPage/10.7916/9sse-m939",
"items": [
{
"type": "Annotation",
"motivation": "painting",
"id": "https://dev.local:3000/iiif/3/presentation/10.7916/n8qs-6964/annotation/10.7916/9sse-m939/painting",
"body": {
"type": "Sound",
"format": "audio/mp4",
"id": "https://dev.local:3000/catalog/cul:zpc866t3ps/bytestreams/access/content?download=false&filename=content.mp4",
"service": [
{
"type": "AuthProbeService2",
"service": [],
"id": "https://dev.local:3000/catalog/cul:zpc866t3ps/bytestreams/content/probe"
}
]
},
"target": "https://dev.local:3000/iiif/3/presentation/10.7916/n8qs-6964/canvas/10.7916/9sse-m939"
}
]
}
],
"seeAlso": [
{
"id": "https://dev.local:3000/synchronized/transcript",
"label": { "en": ["View with Synchronized Transcript"] },
"type": "Text"
}
]
}
]
}
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/cul.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
// a resource with a limited-access AV canvas
{ manifestId: 'https://dlc-staging.library.columbia.edu/iiif/3/presentation/10.7916/d8-346v-m088/manifest', provider: 'Columbia community AV canvas examples'},
{ manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843', provider: 'Other Organization' },
]
],
},
[...Mirador.culPlugins.downloadDialogPlugin].concat([...Mirador.culPlugins.viewXmlPlugin]).concat([...Mirador.culPlugins.citationsSidebarPlugin]).concat([...Mirador.culPlugins.videojsPlugin]).concat([...Mirador.culPlugins.canvasRelatedLinksPlugin])
[...Mirador.culPlugins.downloadDialogPlugin].concat([...Mirador.culPlugins.viewXmlPlugin]).concat([...Mirador.culPlugins.citationsSidebarPlugin]).concat([...Mirador.culPlugins.videojsPlugin]).concat([...Mirador.culPlugins.canvasRelatedLinksPlugin]).concat([...Mirador.culPlugins.hintingSideBar])
);
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { WindowSideBarCitationPanel } from '../../../../src/culPlugins/mirador-c
import {
getManifestTitle,
} from '../../../../src/state/selectors/manifests';
import {
getManifestDoi, getManifestProviderNames,
} from '../../../../src/culPlugins/mirador-citations/state/selectors';
import { getManifestDoi } from '../../../../src/culPlugins/state/selectors';
import { getManifestProviderNames } from '../../../../src/culPlugins/mirador-citations/state/selectors';

import * as CitationProperties from '../../../../src/culPlugins/mirador-citations/state/selectors/citationProperties';

Expand Down
13 changes: 13 additions & 0 deletions src/culPlugins/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2023-2024 Trustees of Columbia University

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
7 changes: 7 additions & 0 deletions src/culPlugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# culPlugins
culPlugins collects forked Mirador 3 plugins:
- mirador-canvaslink
- mirador-downloaddialog
- mirador-hinting-sidebar (which is a fork of the core Mirador sidebar components)

... and a number of Columbia Libraries-developed plugins into a [monorepo](https://en.wikipedia.org/wiki/Monorepo) for deployment. Forked plugins include the original license, with additional copyright statements as appropriate.
2 changes: 2 additions & 0 deletions src/culPlugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import canvasLinkPlugin from './mirador-canvaslink';
import canvasRelatedLinksPlugin from './mirador-canvasRelatedLinks';
import citationsSidebarPlugin from './mirador-citations';
import downloadDialogPlugin from './mirador-downloaddialog';
import hintingSideBar from './mirador-hinting-sidebar';
import videojsPlugin from './mirador-videojs';
import viewXmlPlugin from './mirador-viewXml';

Expand All @@ -10,6 +11,7 @@ export default {
canvasRelatedLinksPlugin,
citationsSidebarPlugin,
downloadDialogPlugin,
hintingSideBar,
videojsPlugin,
viewXmlPlugin,
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ export class CanvasRelatedLinks extends Component {
<Typography
aria-labelledby={`${id}-related ${id}-related-heading`}
id={`${id}-related-heading`}
variant="h6"
component="h5"
variant="h5"
component="h6"
>
{t('links')}
</Typography>
<StyledDl className={classNames(ns('label-value-metadata'))}>
{ renderings && renderings.length > 0 && (
<>
<Typography variant="subtitle3" component="dt">{t('iiif_renderings')}</Typography>
<Typography variant="subtitle2" component="dt">{t('iiif_renderings')}</Typography>
{
renderings.map(rendering => (
<Typography key={rendering.value} variant="body1" component="dd">
Expand All @@ -62,7 +62,7 @@ export class CanvasRelatedLinks extends Component {
)}
{ related && (
<>
<Typography variant="subtitle3" component="dt">{t('iiif_related')}</Typography>
<Typography variant="subtitle2" component="dt">{t('iiif_related')}</Typography>
{
related.map(relatedItem => (
<Typography key={relatedItem.value} variant="body1" component="dd">
Expand All @@ -79,7 +79,7 @@ export class CanvasRelatedLinks extends Component {
)}
{ seeAlso && (
<>
<Typography variant="subtitle3" component="dt">{t('iiif_seeAlso')}</Typography>
<Typography variant="subtitle2" component="dt">{t('iiif_seeAlso')}</Typography>
{
seeAlso.map(seeAlsoItem => (
<Typography key={seeAlsoItem.value} variant="body1" component="dd">
Expand Down
22 changes: 22 additions & 0 deletions src/culPlugins/mirador-canvaslink/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# The MIT License (MIT)

Copyright © 2023-2024 The Trustees of Columbia University
Copyright © 2022-2023 Open Source at the Bayerische Staatsbibliothek

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions src/culPlugins/mirador-canvaslink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# mirador-canvaslink
This plugin was originally forked from https://github.com/dbmdz/mirador-canvaslink under the MIT license.
131 changes: 50 additions & 81 deletions src/culPlugins/mirador-canvaslink/index.js
Original file line number Diff line number Diff line change
@@ -1,84 +1,53 @@
exports.__esModule = true;
exports.default = undefined;
const _actions = require('../../state/actions');
const _selectors = require('../../state/selectors');
const _ShareCanvasLinkDialog = _interopRequireDefault(require('./components/ShareCanvasLinkDialog'));
const _ShareControl = _interopRequireDefault(require('./components/ShareControl'));
const _locales = _interopRequireDefault(require('./locales'));
const _selectors2 = require('./state/selectors');
import { updateWindow } from '../../state/actions';
import {
getCanvases,
getContainerId,
getRights,
getVisibleCanvases,
getWindowManifests,
getWindowViewType,
} from '../../state/selectors';

/** */
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const _default = [{
component: _ShareControl.default,
config: {
translations: _locales.default,
},
/** */
mapDispatchToProps: function mapDispatchToProps(dispatch, _ref) {
const { windowId } = _ref;
return {
/** */
updateConfig: function updateConfig(canvasLink) {
return dispatch((0, _actions.updateWindow)(windowId, {
canvasLink,
}));
},
};
},
/** */
mapStateToProps: function mapStateToProps(state, _ref2) {
const { windowId } = _ref2;
return {
config: (0, _selectors2.getPluginConfig)(state, {
windowId,
}),
containerId: (0, _selectors.getContainerId)(state),
windowViewType: (0, _selectors.getWindowViewType)(state, {
windowId,
}),
};
},
mode: 'add',
target: 'WindowTopBarPluginArea',
}, {
component: _ShareCanvasLinkDialog.default,
config: {
translations: _locales.default,
},
/** */
mapDispatchToProps: function mapDispatchToProps(dispatch, _ref3) {
const { windowId } = _ref3;
return {
/** */
updateConfig: function updateConfig(canvasLink) {
return dispatch((0, _actions.updateWindow)(windowId, {
canvasLink,
}));
},
};
import ShareCanvasLinkDialog from './components/ShareCanvasLinkDialog';
import ShareControl from './components/ShareControl';
import translations from './locales';
import { getPluginConfig } from './state/selectors';

export default [
{
component: ShareControl,
config: {
translations,
},
mapDispatchToProps: (dispatch, { windowId }) => ({
updateConfig: (canvasLink) => dispatch(updateWindow(windowId, { canvasLink })),
}),
mapStateToProps: (state, { windowId }) => ({
config: getPluginConfig(state, { windowId }),
containerId: getContainerId(state),
windowViewType: getWindowViewType(state, { windowId }),
}),
mode: 'add',
target: 'WindowTopBarPluginArea',
},
/** */
mapStateToProps: function mapStateToProps(state, _ref4) {
const { windowId } = _ref4;
return {
config: (0, _selectors2.getPluginConfig)(state, {
windowId,
}),
containerId: (0, _selectors.getContainerId)(state),
manifestId: (0, _selectors.getWindowManifests)(state, {
windowId,
})[0],
rights: (0, _selectors.getRights)(state, {
windowId,
}),
visibleCanvases: (0, _selectors.getVisibleCanvases)(state, {
windowId,
}),
};
{
component: ShareCanvasLinkDialog,
config: {
translations,
},
mapDispatchToProps: (dispatch, { windowId }) => ({
updateConfig: (canvasLink) => dispatch(updateWindow(windowId, { canvasLink })),
}),
mapStateToProps: (state, { windowId }) => ({
canvases: getCanvases(state, { windowId }),
config: getPluginConfig(state, { windowId }),
containerId: getContainerId(state),
manifestId: getWindowManifests(state, { windowId })[0],
rights: getRights(state, { windowId }),
visibleCanvases: getVisibleCanvases(state, { windowId }),
windowViewType: getWindowViewType(state, { windowId }),
}),
mode: 'add',
target: 'Window',
},
mode: 'add',
target: 'Window',
}];
exports.default = _default;
module.exports = exports.default;
];
6 changes: 1 addition & 5 deletions src/culPlugins/mirador-canvaslink/locales.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
exports.__esModule = true;
exports.default = undefined;
const _default = {
export default {
de: {
canvasLink: {
close: 'Schließen',
Expand Down Expand Up @@ -36,5 +34,3 @@ const _default = {
},
},
};
exports.default = _default;
module.exports = exports.default;
Loading

0 comments on commit 3bd27d6

Please sign in to comment.