-
Extrait:
+
@@ -130,7 +129,25 @@ export default {
model: {
prop: 'article',
},
- props: ['article', 'checkbox', 'checked'],
+ props: {
+ article: {
+ type: Object,
+ default: () => ({}),
+ },
+ checkbox: {
+ type: Boolean,
+
+ default: false,
+ },
+ checked: {
+ type: Boolean,
+ default: false,
+ },
+ showContext: {
+ type: Boolean,
+ default: false,
+ },
+ },
computed: {
pageViewerOptions() {
return {
@@ -166,6 +183,13 @@ export default {
return regionsOverlays.concat(matchesOverlays)
},
+ computedRegionsInArticleFirstPage() {
+ if (this.article.pages.length > 0 && this.article.regions.length > 0) {
+ return this.article.regions.filter(({ pageUid }) => pageUid === this.article.pages[0].uid)
+ }
+
+ return null
+ },
},
methods: {
onRemoveCollection(collection, item) {
diff --git a/src/d3-modules/Timeline.js b/src/d3-modules/Timeline.js
index 9931051e..2c42ab65 100644
--- a/src/d3-modules/Timeline.js
+++ b/src/d3-modules/Timeline.js
@@ -132,10 +132,12 @@ export default class Timeline extends Line {
min instanceof Date ? min : this.brushTimeParse(min),
max instanceof Date ? max : this.brushTimeParse(max),
]
- this.contextBrush.call(this.brush.move, [
- this.dimensions.x.scale(to[0]),
- this.dimensions.x.scale(to[1]),
- ])
+ if (this.contextBrush) {
+ this.contextBrush.call(this.brush.move, [
+ this.dimensions.x.scale(to[0]),
+ this.dimensions.x.scale(to[1]),
+ ])
+ }
}, 150)
}
diff --git a/src/main.js b/src/main.js
index fbc0d8be..fc0c854c 100644
--- a/src/main.js
+++ b/src/main.js
@@ -74,7 +74,7 @@ const reducedTimeoutPromise = ({ ms = 500, service }) =>
new Promise((resolve, reject) => {
let id = setTimeout(() => {
clearTimeout(id)
- reject(`Timed out in ${ms} ms for service: ${service}`)
+ reject(new Error(`Timed out in ${ms} ms for service: ${service}`))
}, ms)
})
@@ -99,13 +99,13 @@ console.info(
Promise.race([
services.app.reAuthenticate(),
- reducedTimeoutPromise({ service: 'app.reAuthenticate' }),
+ reducedTimeoutPromise({ ms: 2000, service: 'app.reAuthenticate' }),
])
.catch(err => {
if (err.code === 401) {
// eslint-disable-next-line
console.debug('[main] Not authenticated (status 401):', err.message)
- if (store.state.user.userData) {
+ if (store.state.user) {
// eslint-disable-next-line
console.debug(
'[main] Authentication failed ... but an user is present in logalStorage. Force logging out.',
diff --git a/src/router/index.js b/src/router/index.js
index 101e2444..db946b7f 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -474,8 +474,23 @@ const router = new Router({
})
router.beforeEach((to, from, next) => {
- console.info('Routing to', to.name, to.path, 'from', from.name, from.path)
+ const pathWithPrefix = String(BASE_URL + to.path).replace(/\/+/g, '/')
+ // console.info('[router/index] Routing \-to : to', to.name, to.path, 'from', from.name, from.path)
Vue.prototype.$renderMetaTags({ title: to.name })
+ // # forward page to matomo analytics using base.URL
+ if (window._paq) {
+ console.info(
+ '[router/index] Matomo tracking \n - path: ',
+ pathWithPrefix,
+ ' \n - title:',
+ to.name,
+ )
+ window._paq.push(['setCustomUrl', pathWithPrefix])
+ window._paq.push(['setDocumentTitle', to.name])
+ window._paq.push(['trackPageView'])
+ } else {
+ console.warn('[router/index] Matomo not loaded')
+ }
// clean yellow alert error messages
store.dispatch('CLEAN_ERROR_MESSAGE')
if (to.name === 'login' && from.name && from.name !== 'login') {
diff --git a/vue.config.js b/vue.config.js
index 899ef482..39d80062 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,6 +1,6 @@
-const readFile = require('fs').readFileSync;
+const readFile = require('fs').readFileSync
-const PackageJsonPath = `${__dirname}/package.json`;
+const PackageJsonPath = `${__dirname}/package.json`
function getVersion() {
try {
@@ -28,7 +28,7 @@ module.exports = {
.type('javascript/auto')
.use('i18n')
.loader('@intlify/vue-i18n-loader')
- .end();
+ .end()
// config.module.rule('ts').use('babel-loader').end();
},
pages: {
@@ -47,10 +47,23 @@ module.exports = {
template: 'public/widget.html',
// output as dist/index.html
filename: 'widget/index.html',
- }
+ },
},
devServer: {
public: 'http://localhost:8080',
+
+ proxy: {
+ '^/api/socket.io': {
+ target: process.env.VUE_APP_MIDDLELAYER_API,
+ ws: true,
+ changeOrigin: true,
+ },
+ '^/api/proxy': {
+ target: process.env.VUE_APP_MIDDLELAYER_API,
+ ws: false,
+ changeOrigin: true,
+ },
+ },
},
- publicPath: getPublicPath()
+ publicPath: getPublicPath(),
}