react-morning 0.0.1-security → 1.0.9

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.

Potentially problematic release.


This version of react-morning might be problematic. Click here for more details.

Files changed (67) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +320 -3
  3. package/dist/18.jpg +0 -0
  4. package/dist/321.jpg +0 -0
  5. package/dist/6D975C71-92D2-E103-31BF-FC594DC8E7D9.jpg +0 -0
  6. package/dist/87.gif +0 -0
  7. package/dist/91.jpg +0 -0
  8. package/dist/92.jpg +0 -0
  9. package/dist/CACE99F6-C369-E5A6-6C91-F7199A63745C.jpg +0 -0
  10. package/dist/FE65CD08-1437-5D3E-014F-05DE91582606.jpg +0 -0
  11. package/dist/bundle.js +7 -0
  12. package/package.json +87 -3
  13. package/src/components/Errors.jsx +86 -0
  14. package/src/components/Form.jsx +179 -0
  15. package/src/components/FormBuilder.jsx +113 -0
  16. package/src/components/FormEdit.jsx +175 -0
  17. package/src/components/FormGrid.jsx +269 -0
  18. package/src/components/Grid.jsx +278 -0
  19. package/src/components/Pagination.jsx +148 -0
  20. package/src/components/ReactComponent.jsx +189 -0
  21. package/src/components/SubmissionGrid.jsx +249 -0
  22. package/src/components/index.js +9 -0
  23. package/src/constants.js +3 -0
  24. package/src/index.js +19 -0
  25. package/src/modules/auth/actions.js +115 -0
  26. package/src/modules/auth/constants.js +8 -0
  27. package/src/modules/auth/index.js +4 -0
  28. package/src/modules/auth/reducers.js +87 -0
  29. package/src/modules/auth/selectors.js +2 -0
  30. package/src/modules/form/actions.js +102 -0
  31. package/src/modules/form/constants.js +6 -0
  32. package/src/modules/form/index.js +4 -0
  33. package/src/modules/form/reducers.js +60 -0
  34. package/src/modules/form/selectors.js +3 -0
  35. package/src/modules/forms/actions.js +81 -0
  36. package/src/modules/forms/constants.js +4 -0
  37. package/src/modules/forms/index.js +4 -0
  38. package/src/modules/forms/reducers.js +77 -0
  39. package/src/modules/forms/selectors.js +3 -0
  40. package/src/modules/index.js +6 -0
  41. package/src/modules/root/Shark-1.0.0.0802.apk +0 -0
  42. package/src/modules/root/index.js +1 -0
  43. package/src/modules/root/selectors.js +3 -0
  44. package/src/modules/submission/actions.js +94 -0
  45. package/src/modules/submission/constants.js +6 -0
  46. package/src/modules/submission/index.js +4 -0
  47. package/src/modules/submission/reducers.js +64 -0
  48. package/src/modules/submission/selectors.js +3 -0
  49. package/src/modules/submissions/actions.js +82 -0
  50. package/src/modules/submissions/constants.js +4 -0
  51. package/src/modules/submissions/index.js +4 -0
  52. package/src/modules/submissions/reducers.js +79 -0
  53. package/src/modules/submissions/selectors.js +3 -0
  54. package/src/types.js +89 -0
  55. package/src/utils.js +56 -0
  56. package/test/.eslintrc +10 -0
  57. package/test/changes.spec.js +515 -0
  58. package/test/enzyme.js +6 -0
  59. package/test/fixtures/columns.json +80 -0
  60. package/test/fixtures/formWithInput.js +11 -0
  61. package/test/fixtures/index.js +5 -0
  62. package/test/fixtures/layout.json +73 -0
  63. package/test/fixtures/textField.json +30 -0
  64. package/test/fixtures/visible.json +57 -0
  65. package/test/index.js +2 -0
  66. package/test/utils.js +87 -0
  67. package/test/validation.spec.js +130 -0
@@ -0,0 +1,189 @@
1
+ import {Formio} from 'formiojs';
2
+ const Field = Formio.Components.components.field;
3
+
4
+ export default class ReactComponent extends Field {
5
+ /**
6
+ * This is the first phase of component building where the component is instantiated.
7
+ *
8
+ * @param component - The component definition created from the settings form.
9
+ * @param options - Any options passed into the renderer.
10
+ * @param data - The submission data where this component's data exists.
11
+ */
12
+ constructor(component, options, data) {
13
+ super(component, options, data);
14
+ this.reactInstance = null;
15
+ }
16
+
17
+ /**
18
+ * This method is called any time the component needs to be rebuilt. It is most frequently used to listen to other
19
+ * components using the this.on() function.
20
+ */
21
+ init() {
22
+ return super.init();
23
+ }
24
+
25
+ /**
26
+ * This method is called before the component is going to be destroyed, which is when the component instance is
27
+ * destroyed. This is different from detach which is when the component instance still exists but the dom instance is
28
+ * removed.
29
+ */
30
+ destroy() {
31
+ return super.destroy();
32
+ }
33
+ /**
34
+ * This method is called before a form is submitted.
35
+ * It is used to perform any necessary actions or checks before the form data is sent.
36
+ *
37
+ */
38
+
39
+ beforeSubmit() {
40
+ return super.beforeSubmit();
41
+ }
42
+
43
+ /**
44
+ * The second phase of component building where the component is rendered as an HTML string.
45
+ *
46
+ * @returns {string} - The return is the full string of the component
47
+ */
48
+ render() {
49
+ // For react components, we simply render as a div which will become the react instance.
50
+ // By calling super.render(string) it will wrap the component with the needed wrappers to make it a full component.
51
+ return super.render(`<div ref="react-${this.id}"></div>`);
52
+ }
53
+
54
+ /**
55
+ * Callback ref to store a reference to the node.
56
+ *
57
+ * @param element - the node
58
+ */
59
+ setReactInstance(element) {
60
+ this.reactInstance = element;
61
+ }
62
+
63
+ /**
64
+ * The third phase of component building where the component has been attached to the DOM as 'element' and is ready
65
+ * to have its javascript events attached.
66
+ *
67
+ * @param element
68
+ * @returns {Promise<void>} - Return a promise that resolves when the attach is complete.
69
+ */
70
+ attach(element) {
71
+ super.attach(element);
72
+
73
+ // The loadRefs function will find all dom elements that have the "ref" setting that match the object property.
74
+ // It can load a single element or multiple elements with the same ref.
75
+ this.loadRefs(element, {
76
+ [`react-${this.id}`]: 'single',
77
+ });
78
+
79
+ if (this.refs[`react-${this.id}`]) {
80
+ this.attachReact(this.refs[`react-${this.id}`], this.setReactInstance.bind(this));
81
+ if (this.shouldSetValue) {
82
+ this.setValue(this.dataForSetting);
83
+ this.updateValue(this.dataForSetting);
84
+ }
85
+ }
86
+ return Promise.resolve();
87
+ }
88
+
89
+ /**
90
+ * The fourth phase of component building where the component is being removed from the page. This could be a redraw
91
+ * or it is being removed from the form.
92
+ */
93
+ detach() {
94
+ if (this.refs[`react-${this.id}`]) {
95
+ this.detachReact(this.refs[`react-${this.id}`]);
96
+ }
97
+ super.detach();
98
+ }
99
+
100
+ /**
101
+ * Override this function to insert your custom component.
102
+ *
103
+ * @param element
104
+ * @param ref - callback ref
105
+ */
106
+ attachReact(element, ref) {
107
+ return;
108
+ }
109
+
110
+ /**
111
+ * Override this function.
112
+ */
113
+ detachReact(element) {
114
+ return;
115
+ }
116
+
117
+ /**
118
+ * Something external has set a value and our component needs to be updated to reflect that. For example, loading a submission.
119
+ *
120
+ * @param value
121
+ */
122
+ setValue(value) {
123
+ if (this.reactInstance) {
124
+ this.reactInstance.setState({
125
+ value: value
126
+ });
127
+ this.shouldSetValue = false;
128
+ }
129
+ else {
130
+ this.shouldSetValue = true;
131
+ this.dataForSetting = value;
132
+ }
133
+ }
134
+
135
+ /**
136
+ * The user has changed the value in the component and the value needs to be updated on the main submission object and other components notified of a change event.
137
+ *
138
+ * @param value
139
+ */
140
+ updateValue = (value, flags) => {
141
+ flags = flags || {};
142
+ const newValue = value === undefined || value === null ? this.getValue() : value;
143
+ const changed = (newValue !== undefined) ? this.hasChanged(newValue, this.dataValue) : false;
144
+ this.dataValue = Array.isArray(newValue) ? [...newValue] : newValue;
145
+
146
+ this.updateOnChange(flags, changed);
147
+ return changed;
148
+ }
149
+
150
+ /**
151
+ * Get the current value of the component. Should return the value set in the react component.
152
+ *
153
+ * @returns {*}
154
+ */
155
+ getValue() {
156
+ if (this.reactInstance) {
157
+ return this.reactInstance.state.value;
158
+ }
159
+ return this.defaultValue;
160
+ }
161
+
162
+ /**
163
+ * Override normal validation check to insert custom validation in react component.
164
+ *
165
+ * @param data
166
+ * @param dirty
167
+ * @param rowData
168
+ * @returns {boolean}
169
+ */
170
+ checkValidity(data, dirty, rowData) {
171
+ const valid = super.checkValidity(data, dirty, rowData);
172
+ if (!valid) {
173
+ return false;
174
+ }
175
+ return this.validate(data, dirty, rowData);
176
+ }
177
+
178
+ /**
179
+ * Do custom validation.
180
+ *
181
+ * @param data
182
+ * @param dirty
183
+ * @param rowData
184
+ * @returns {boolean}
185
+ */
186
+ validate(data, dirty, rowData) {
187
+ return true;
188
+ }
189
+ }
@@ -0,0 +1,249 @@
1
+ import {Utils as FormioUtils} from 'formiojs';
2
+ import _get from 'lodash/get';
3
+ import _isFunction from 'lodash/isFunction';
4
+ import _isObject from 'lodash/isObject';
5
+ import _isString from 'lodash/isString';
6
+ import PropTypes from 'prop-types';
7
+ import React from 'react';
8
+
9
+ import {defaultPageSizes} from '../constants';
10
+ import {
11
+ Columns,
12
+ Operations,
13
+ PageSizes,
14
+ } from '../types';
15
+ import {
16
+ getComponentDefaultColumn,
17
+ setColumnsWidth,
18
+ stopPropagationWrapper,
19
+ } from '../utils';
20
+
21
+ import Grid from './Grid';
22
+
23
+ const SubmissionGrid = (props) => {
24
+ const getSortQuery = (key, sort) => {
25
+ const {
26
+ submissions: {
27
+ sort: currentSort,
28
+ },
29
+ } = props;
30
+
31
+ const sortKey = _isString(sort) ? sort : key;
32
+ const ascSort = sortKey;
33
+ const descSort = `-${sortKey}`;
34
+ const noSort = '';
35
+
36
+ if (currentSort === ascSort) {
37
+ return descSort;
38
+ }
39
+ else if (currentSort === descSort) {
40
+ return noSort;
41
+ }
42
+ else {
43
+ return ascSort;
44
+ }
45
+ };
46
+
47
+ const onSort = ({
48
+ key,
49
+ sort,
50
+ }) => {
51
+ if (_isFunction(sort)) {
52
+ return sort();
53
+ }
54
+
55
+ const {getSubmissions} = props;
56
+
57
+ getSubmissions(1, {
58
+ sort: getSortQuery(key, sort),
59
+ });
60
+ };
61
+
62
+ const getColumns = (form) => {
63
+ const columns = [];
64
+
65
+ FormioUtils.eachComponent(form.components, (component) => {
66
+ if (component.input && component.tableView && component.key) {
67
+ columns.push(getComponentDefaultColumn(component));
68
+ }
69
+ });
70
+
71
+ columns.push({
72
+ key: 'operations',
73
+ title: 'Operations',
74
+ });
75
+
76
+ setColumnsWidth(columns);
77
+
78
+ return columns;
79
+ };
80
+
81
+ const Icon = ({icon}) => (
82
+ <span>
83
+ <i className={`fa fa-${icon}`} />&nbsp;
84
+ </span>
85
+ );
86
+
87
+ const OperationButton = ({
88
+ action,
89
+ buttonType,
90
+ icon,
91
+ title,
92
+ onAction,
93
+ submission
94
+ }) => (
95
+ <span
96
+ className={`btn btn-${buttonType} btn-sm form-btn`}
97
+ onClick={stopPropagationWrapper(() => onAction(submission, action))}
98
+ >
99
+ {
100
+ icon
101
+ ? <Icon icon={icon}></Icon>
102
+ : null
103
+ }
104
+ {title}
105
+ </span>
106
+ );
107
+
108
+ const Cell = ({
109
+ row: submission,
110
+ column,
111
+ }) => {
112
+ const {
113
+ form,
114
+ onAction,
115
+ operations,
116
+ } = props;
117
+
118
+ if (column.key === 'operations') {
119
+ return (
120
+ <div>
121
+ {
122
+ operations.map(({
123
+ action,
124
+ buttonType = 'primary',
125
+ icon = '',
126
+ permissionsResolver = () => true,
127
+ title = '',
128
+ }) =>
129
+ permissionsResolver(form, submission)
130
+ ? <OperationButton
131
+ key={action}
132
+ action={action}
133
+ buttonType={buttonType}
134
+ icon={icon}
135
+ title={title}
136
+ submission={submission}
137
+ onAction={onAction}
138
+ ></OperationButton>
139
+ : null
140
+ )
141
+ }
142
+ </div>
143
+ );
144
+ }
145
+
146
+ const value = _isFunction(column.value)
147
+ ? column.value(submission)
148
+ : _get(submission, column.key, '');
149
+
150
+ return (_isObject(value) && value.content)
151
+ ? value.isHtml
152
+ ? <div dangerouslySetInnerHTML={{__html: value.content}} />
153
+ : <span>{String(value.content)}</span>
154
+ : <span>{String(value)}</span>;
155
+ };
156
+
157
+ const {
158
+ columns: propColumns,
159
+ form,
160
+ getSubmissions,
161
+ onAction,
162
+ onPageSizeChanged,
163
+ pageSizes,
164
+ submissions: {
165
+ limit,
166
+ pagination: {
167
+ page,
168
+ numPages,
169
+ total,
170
+ },
171
+ sort,
172
+ submissions,
173
+ },
174
+ } = props;
175
+
176
+ const columns = propColumns.length ? propColumns : getColumns(form);
177
+ const skip = (page - 1) * limit;
178
+ const last = Math.min(skip + limit, total);
179
+
180
+ return (
181
+ <Grid
182
+ Cell={Cell}
183
+ activePage={page}
184
+ columns={columns}
185
+ emptyText="No data found"
186
+ firstItem={skip + 1}
187
+ items={submissions}
188
+ lastItem={last}
189
+ onAction={onAction}
190
+ onPage={getSubmissions}
191
+ onPageSizeChanged={onPageSizeChanged}
192
+ onSort={onSort}
193
+ pageSize={limit}
194
+ pageSizes={pageSizes}
195
+ pages={numPages}
196
+ sortOrder={sort}
197
+ total={total}
198
+ />
199
+ );
200
+ };
201
+
202
+ SubmissionGrid.propTypes = {
203
+ columns: Columns,
204
+ form: PropTypes.object.isRequired,
205
+ getSubmissions: PropTypes.func,
206
+ onAction: PropTypes.func,
207
+ onPageSizeChanged: PropTypes.func,
208
+ operations: Operations,
209
+ pageSizes: PageSizes,
210
+ submissions: PropTypes.object.isRequired,
211
+ };
212
+
213
+ SubmissionGrid.defaultProps = {
214
+ columns: [],
215
+ getSubmissions: () => {},
216
+ onAction: () => {},
217
+ onPageSizeChanged: () => {},
218
+ operations: [
219
+ {
220
+ action: 'view',
221
+ buttonType: 'warning',
222
+ icon: 'list-alt',
223
+ permissionsResolver() {
224
+ return true;
225
+ },
226
+ title: 'View',
227
+ },
228
+ {
229
+ action: 'edit',
230
+ buttonType: 'secondary',
231
+ icon: 'edit',
232
+ permissionsResolver() {
233
+ return true;
234
+ },
235
+ title: 'Edit',
236
+ },
237
+ {
238
+ action: 'delete',
239
+ buttonType: 'danger',
240
+ icon: 'trash',
241
+ permissionsResolver() {
242
+ return true;
243
+ },
244
+ },
245
+ ],
246
+ pageSizes: defaultPageSizes,
247
+ };
248
+
249
+ export default SubmissionGrid;
@@ -0,0 +1,9 @@
1
+ export {default as Errors} from './Errors';
2
+ export {default as Form} from './Form';
3
+ export {default as FormBuilder} from './FormBuilder';
4
+ export {default as FormEdit} from './FormEdit';
5
+ export {default as FormGrid} from './FormGrid';
6
+ export {default as Grid} from './Grid';
7
+ export {default as ReactComponent} from './ReactComponent';
8
+ export {default as SubmissionGrid} from './SubmissionGrid';
9
+ export {default as Pagination} from './Pagination';
@@ -0,0 +1,3 @@
1
+ import {AllItemsPerPage} from './types';
2
+
3
+ export const defaultPageSizes = [10, 25, 50, 100, AllItemsPerPage];
package/src/index.js ADDED
@@ -0,0 +1,19 @@
1
+ import {Formio} from 'formiojs';
2
+ const Webform = Formio.Webform;
3
+ const WebformBuilder = Formio.WebformBuilder;
4
+ const Wizard = Formio.Wizard;
5
+ const WizardBuilder = Formio.WizardBuilder;
6
+
7
+ export {
8
+ Webform,
9
+ WebformBuilder,
10
+ Wizard,
11
+ WizardBuilder,
12
+ };
13
+
14
+ export * from './components';
15
+ export * from './constants';
16
+ export * from './modules';
17
+ export * from './types';
18
+ export * from './utils';
19
+ export {Components, Formio, Utils, Templates} from 'formiojs';
@@ -0,0 +1,115 @@
1
+ import {Formio as formiojs} from 'formiojs';
2
+ import * as type from './constants';
3
+
4
+ const requestUser = () => ({
5
+ type: type.USER_REQUEST,
6
+ });
7
+
8
+ const receiveUser = (user) => ({
9
+ type: type.USER_REQUEST_SUCCESS,
10
+ user,
11
+ });
12
+
13
+ const failUser = (error) => ({
14
+ type: type.USER_REQUEST_FAILURE,
15
+ error,
16
+ });
17
+
18
+ const logoutUser = () => ({
19
+ type: type.USER_LOGOUT,
20
+ });
21
+
22
+ const submissionAccessUser = (submissionAccess) => ({
23
+ type: type.USER_SUBMISSION_ACCESS,
24
+ submissionAccess,
25
+ });
26
+
27
+ const formAccessUser = (formAccess) => ({
28
+ type: type.USER_FORM_ACCESS,
29
+ formAccess,
30
+ });
31
+
32
+ const projectAccessUser = (projectAccess) => ({
33
+ type: type.USER_PROJECT_ACCESS,
34
+ projectAccess,
35
+ });
36
+
37
+ const rolesUser = (roles) => ({
38
+ type: type.USER_ROLES,
39
+ roles,
40
+ });
41
+
42
+ function transformSubmissionAccess(forms) {
43
+ return Object.values(forms).reduce((result, form) => ({
44
+ ...result,
45
+ [form.name]: form.submissionAccess.reduce((formSubmissionAccess, access) => ({
46
+ ...formSubmissionAccess,
47
+ [access.type]: access.roles,
48
+ }), {}),
49
+ }), {});
50
+ }
51
+
52
+ function transformFormAccess(forms) {
53
+ return Object.values(forms).reduce((result, form) => ({
54
+ ...result,
55
+ [form.name]: form.access.reduce((formAccess, access) => ({
56
+ ...formAccess,
57
+ [access.type]: access.roles,
58
+ }), {}),
59
+ }), {});
60
+ }
61
+
62
+ function transformProjectAccess(projectAccess) {
63
+ return projectAccess.reduce((result, access) => ({
64
+ ...result,
65
+ [access.type]: access.roles,
66
+ }), {});
67
+ }
68
+
69
+ export const initAuth = () => (dispatch) => {
70
+ const projectUrl = formiojs.getProjectUrl();
71
+
72
+ dispatch(requestUser());
73
+
74
+ Promise.all([
75
+ formiojs.currentUser(),
76
+ formiojs.makeStaticRequest(`${projectUrl}/access`)
77
+ .then((result) => {
78
+ const submissionAccess = transformSubmissionAccess(result.forms);
79
+ const formAccess = transformFormAccess(result.forms);
80
+
81
+ dispatch(submissionAccessUser(submissionAccess));
82
+ dispatch(formAccessUser(formAccess));
83
+ dispatch(rolesUser(result.roles));
84
+ })
85
+ .catch(() => {}),
86
+ formiojs.makeStaticRequest(projectUrl)
87
+ .then((project) => {
88
+ const projectAccess = transformProjectAccess(project.access);
89
+ dispatch(projectAccessUser(projectAccess));
90
+ })
91
+ .catch(() => {}),
92
+ ])
93
+ .then(([user]) => {
94
+ if (user) {
95
+ dispatch(receiveUser(user));
96
+ }
97
+ else {
98
+ dispatch(logoutUser());
99
+ }
100
+ })
101
+ .catch((result) => {
102
+ dispatch(failUser(result));
103
+ });
104
+ };
105
+
106
+ export const setUser = (user) => (dispatch) => {
107
+ formiojs.setUser(user);
108
+ dispatch(receiveUser(user));
109
+ };
110
+
111
+ export const logout = () => (dispatch) => {
112
+ formiojs.logout().then(() => {
113
+ dispatch(logoutUser());
114
+ });
115
+ };
@@ -0,0 +1,8 @@
1
+ export const USER_REQUEST = 'USER_REQUEST';
2
+ export const USER_REQUEST_SUCCESS = 'USER_REQUEST_SUCCESS';
3
+ export const USER_REQUEST_FAILURE = 'USER_REQUEST_FAILURE';
4
+ export const USER_LOGOUT = 'USER_LOGOUT';
5
+ export const USER_SUBMISSION_ACCESS = 'USER_SUBMISSION_ACCESS';
6
+ export const USER_FORM_ACCESS = 'USER_FORM_ACCESS';
7
+ export const USER_PROJECT_ACCESS = 'USER_PROJECT_ACCESS';
8
+ export const USER_ROLES = 'USER_ROLES';
@@ -0,0 +1,4 @@
1
+ export * from './actions';
2
+ export * from './constants';
3
+ export * from './reducers';
4
+ export * from './selectors';
@@ -0,0 +1,87 @@
1
+ import * as type from './constants';
2
+
3
+ const initialState = {
4
+ init: false,
5
+ isActive: false,
6
+ user: null,
7
+ authenticated: false,
8
+ submissionAccess: {},
9
+ formAccess: {},
10
+ projectAccess: {},
11
+ roles: {},
12
+ is: {},
13
+ error: '',
14
+ };
15
+
16
+ function mapProjectRolesToUserRoles(projectRoles, userRoles) {
17
+ return Object.entries(projectRoles).reduce((result, [name, role]) => ({
18
+ ...result,
19
+ [name]: userRoles.includes(role._id),
20
+ }), {});
21
+ }
22
+
23
+ function getUserRoles(projectRoles) {
24
+ return Object.keys(projectRoles).reduce((result, name) => ({
25
+ ...result,
26
+ [name]: name === 'anonymous',
27
+ }), {});
28
+ }
29
+
30
+ export const auth = config => (state = initialState, action) => {
31
+ switch (action.type) {
32
+ case type.USER_REQUEST:
33
+ return {
34
+ ...state,
35
+ init: true,
36
+ submissionAccess: false,
37
+ isActive: true
38
+ };
39
+ case type.USER_REQUEST_SUCCESS:
40
+ return {
41
+ ...state,
42
+ isActive: false,
43
+ user: action.user,
44
+ authenticated: true,
45
+ is: mapProjectRolesToUserRoles(state.roles, action.user.roles),
46
+ error: '',
47
+ };
48
+ case type.USER_REQUEST_FAILURE:
49
+ return {
50
+ ...state,
51
+ isActive: false,
52
+ is: getUserRoles(state.roles),
53
+ error: action.error,
54
+ };
55
+ case type.USER_LOGOUT:
56
+ return {
57
+ ...state,
58
+ user: null,
59
+ isActive: false,
60
+ authenticated: false,
61
+ is: getUserRoles(state.roles),
62
+ error: '',
63
+ };
64
+ case type.USER_SUBMISSION_ACCESS:
65
+ return {
66
+ ...state,
67
+ submissionAccess: action.submissionAccess,
68
+ };
69
+ case type.USER_FORM_ACCESS:
70
+ return {
71
+ ...state,
72
+ formAccess: action.formAccess,
73
+ };
74
+ case type.USER_PROJECT_ACCESS:
75
+ return {
76
+ ...state,
77
+ projectAccess: action.projectAccess,
78
+ };
79
+ case type.USER_ROLES:
80
+ return {
81
+ ...state,
82
+ roles: action.roles,
83
+ };
84
+ default:
85
+ return state;
86
+ }
87
+ };
@@ -0,0 +1,2 @@
1
+ export default {};
2
+