summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/api/crud.reducer.js16
-rw-r--r--frontend/views/page/components/tile.handle.js15
2 files changed, 16 insertions, 15 deletions
diff --git a/frontend/api/crud.reducer.js b/frontend/api/crud.reducer.js
index dd1fe48..2a7e4c4 100644
--- a/frontend/api/crud.reducer.js
+++ b/frontend/api/crud.reducer.js
@@ -1,6 +1,6 @@
-import * as types from '../types'
-import { getOrderedIds, getOrderedIdsFromLookup } from '../util'
-import { session } from '../session'
+import * as types from 'app/types'
+import { getOrderedIds, getOrderedIdsFromLookup } from 'app/utils'
+import { session } from 'app/session'
export const crudState = (type, options) => ({
index: {},
@@ -115,14 +115,14 @@ export const crudReducer = (type) => {
...state,
update: action.data,
index: addToIndex(state.index, action.data.res, state.options.sort),
- show: (state.show && state.show.res) ? {
- res: (state.show.res.id === action.data.res.id ? {
+ show: (state.show.res && state.show.res.id === action.data.res.id) ? {
+ res: {
...state.show.res,
...action.data.res,
- } : state.show.res),
- } : {}
+ }
+ } : state.show
}
- case crud_type.index_error:
+ case crud_type.update_error:
return {
...state,
update: { loading: false, error: true },
diff --git a/frontend/views/page/components/tile.handle.js b/frontend/views/page/components/tile.handle.js
index 9212dbb..e91f0b1 100644
--- a/frontend/views/page/components/tile.handle.js
+++ b/frontend/views/page/components/tile.handle.js
@@ -70,13 +70,14 @@ const TileHandle = ({ tile, bounds, box, viewing, onMouseDown, onDoubleClick })
if (viewing && tile.href) {
if (tile.href.indexOf('http') === 0) {
return (
- <div
- className={className}
- style={style}
- onClick={() => window.open(tile.href, '_blank')}
- >
- {content}
- </div>
+ <a href={tile.href} rel='noopener'>
+ <div
+ className={className}
+ style={style}
+ >
+ {content}
+ </div>
+ </a>
)
} else {
return (