@things-factory/apptool-base 6.1.66 → 6.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export const APPEND_PAGE_TOOL = 'APPEND_PAGE_TOOL'
2
+ export const REMOVE_PAGE_TOOL = 'REMOVE_PAGE_TOOL'
@@ -1,8 +1,10 @@
1
1
  import { store } from '@things-factory/shell'
2
2
  import apptool from './reducers/apptool'
3
+ import pagetool from './reducers/pagetool'
3
4
 
4
5
  export default function bootstrap() {
5
6
  store.addReducers({
6
- apptool
7
+ apptool,
8
+ pagetool
7
9
  })
8
10
  }
package/client/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './actions/apptool'
2
+ export * from './actions/pagetool'
@@ -0,0 +1,31 @@
1
+ import { APPEND_PAGE_TOOL, REMOVE_PAGE_TOOL } from '../actions/pagetool'
2
+
3
+ const INITIAL_STATE = {
4
+ tools: []
5
+ }
6
+
7
+ const pagetool = (state = INITIAL_STATE, action) => {
8
+ switch (action.type) {
9
+ case APPEND_PAGE_TOOL:
10
+ return {
11
+ ...state,
12
+ tools: [
13
+ ...(action.replace
14
+ ? state.tools.filter(tool => tool.name !== action.replace && tool.name !== action.tool.name)
15
+ : state.tools.filter(tool => tool.name !== action.tool.name)),
16
+ action.tool
17
+ ]
18
+ }
19
+
20
+ case REMOVE_PAGE_TOOL:
21
+ return {
22
+ ...state,
23
+ tools: state.tools.filter(tool => tool.name !== action.name)
24
+ }
25
+
26
+ default:
27
+ return state
28
+ }
29
+ }
30
+
31
+ export default pagetool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/apptool-base",
3
- "version": "6.1.66",
3
+ "version": "6.1.78",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,7 +24,7 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/shell": "^6.1.66"
27
+ "@things-factory/shell": "^6.1.78"
28
28
  },
29
- "gitHead": "86447edc189a8432999c6dcfce0e32ee7dbd3e5f"
29
+ "gitHead": "5563e4bc955a4675b9d0190f11bb4eefc8ed55a0"
30
30
  }