[WMS-55] Create/Edit User
This commit is contained in:
3
plop-templates/Component/Component.component.scss.hbs
Executable file
3
plop-templates/Component/Component.component.scss.hbs
Executable file
@@ -0,0 +1,3 @@
|
||||
.c-{{pascalCase name}} {
|
||||
|
||||
}
|
||||
17
plop-templates/Component/Component.jsx.hbs
Executable file
17
plop-templates/Component/Component.jsx.hbs
Executable file
@@ -0,0 +1,17 @@
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import "./{{pascalCase name}}.component.scss";
|
||||
|
||||
const {{pascalCase name}} = props => {
|
||||
return (
|
||||
<div className="c-{{pascalCase name}}">
|
||||
In Component {{pascalCase name}}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
{{pascalCase name}}.propTypes = {
|
||||
|
||||
};
|
||||
|
||||
export default {{pascalCase name}};
|
||||
8
plop-templates/Component/Component.test.js.hbs
Executable file
8
plop-templates/Component/Component.test.js.hbs
Executable file
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import {{pascalCase name}} from "./{{pascalCase name}}";
|
||||
|
||||
describe("{{pascalCase name}}", () => {
|
||||
it("renders without error", () => {
|
||||
|
||||
});
|
||||
});
|
||||
3
plop-templates/Component/index.js.hbs
Executable file
3
plop-templates/Component/index.js.hbs
Executable file
@@ -0,0 +1,3 @@
|
||||
import {{pascalCase name}} from "./{{pascalCase name}}.jsx";
|
||||
|
||||
export default {{pascalCase name}};
|
||||
17
plop-templates/Page/Page.jsx.hbs
Executable file
17
plop-templates/Page/Page.jsx.hbs
Executable file
@@ -0,0 +1,17 @@
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import "./{{pascalCase name}}.module.scss";
|
||||
|
||||
const {{pascalCase name}} = props => {
|
||||
return (
|
||||
<div className="c-{{pascalCase name}}">
|
||||
In Page {{pascalCase name}}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
{{pascalCase name}}.propTypes = {
|
||||
|
||||
};
|
||||
|
||||
export default {{pascalCase name}};
|
||||
3
plop-templates/Page/Page.module.scss.hbs
Executable file
3
plop-templates/Page/Page.module.scss.hbs
Executable file
@@ -0,0 +1,3 @@
|
||||
.c-{{pascalCase name}} {
|
||||
|
||||
}
|
||||
8
plop-templates/Page/Page.test.js.hbs
Executable file
8
plop-templates/Page/Page.test.js.hbs
Executable file
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import {{pascalCase name}} from "./{{pascalCase name}}";
|
||||
|
||||
describe("{{pascalCase name}}", () => {
|
||||
it("renders without error", () => {
|
||||
|
||||
});
|
||||
});
|
||||
16
plop-templates/Page/actions.js.hbs
Executable file
16
plop-templates/Page/actions.js.hbs
Executable file
@@ -0,0 +1,16 @@
|
||||
export const UPDATE_FORM_VALUES = "UPDATE_{{constantCase name}}_FORM_VALUES"
|
||||
export const UPDATE_FORM_ERRORS = "UPDATE_{{constantCase name}}_FORM_ERRORS"
|
||||
|
||||
export const updateFormValues = (formValues) => {
|
||||
return {
|
||||
type: UPDATE_FORM_VALUES,
|
||||
payload: formValues
|
||||
}
|
||||
}
|
||||
|
||||
export const updateFormErrors = (formErrors) => {
|
||||
return {
|
||||
type: UPDATE_FORM_ERRORS,
|
||||
payload: formErrors
|
||||
}
|
||||
}
|
||||
3
plop-templates/Page/index.js.hbs
Executable file
3
plop-templates/Page/index.js.hbs
Executable file
@@ -0,0 +1,3 @@
|
||||
import {{pascalCase name}} from "./{{pascalCase name}}.jsx";
|
||||
|
||||
export default {{pascalCase name}};
|
||||
16
plop-templates/Page/reducer.js.hbs
Executable file
16
plop-templates/Page/reducer.js.hbs
Executable file
@@ -0,0 +1,16 @@
|
||||
import Immutable from "immutable"
|
||||
import {UPDATE_FORM_ERRORS, UPDATE_FORM_VALUES} from "./actions"
|
||||
|
||||
const initialState = Immutable.Map()
|
||||
|
||||
const reducer = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case UPDATE_FORM_ERRORS:
|
||||
case UPDATE_FORM_VALUES:
|
||||
return state.mergeDeep(action.payload)
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
export default reducer
|
||||
14
plop-templates/Page/selectors.js.hbs
Executable file
14
plop-templates/Page/selectors.js.hbs
Executable file
@@ -0,0 +1,14 @@
|
||||
import {createSelector} from "reselect"
|
||||
import {createGetSelector} from "reselect-immutable-helpers"
|
||||
|
||||
const getData = ({data}) => data
|
||||
|
||||
export const get{{pascalCase name}} = createSelector(
|
||||
getData,
|
||||
(dataState) => {
|
||||
return dataState.pages.{{camelCase name}}
|
||||
}
|
||||
)
|
||||
|
||||
export const getFormErrors = createGetSelector(get{{pascalCase name}}, "formErrors")
|
||||
export const getFormValues = createGetSelector(get{{pascalCase name}}, "formValues")
|
||||
5
plop-templates/hook.js.hbs
Executable file
5
plop-templates/hook.js.hbs
Executable file
@@ -0,0 +1,5 @@
|
||||
const {{camelCase name}} = () => {
|
||||
|
||||
};
|
||||
|
||||
export default {{camelCase name}};
|
||||
5
plop-templates/injectable-index.js.hbs
Executable file
5
plop-templates/injectable-index.js.hbs
Executable file
@@ -0,0 +1,5 @@
|
||||
/* PLOP_INJECT_IMPORT */
|
||||
|
||||
export {
|
||||
/* PLOP_INJECT_EXPORT */
|
||||
}
|
||||
17
plop-templates/service.js.hbs
Executable file
17
plop-templates/service.js.hbs
Executable file
@@ -0,0 +1,17 @@
|
||||
const create{{pascalCase name}} = () => {
|
||||
let examplePrivateVariable = 0
|
||||
|
||||
return {
|
||||
getExamplePrivateVariable: () => {
|
||||
return examplePrivateVariable
|
||||
},
|
||||
setExamplePrivateVariable: (n) => {
|
||||
examplePrivateVariable = n
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const singleton = create{{pascalCase name}}();
|
||||
Object.freeze(singleton);
|
||||
|
||||
export default singleton;
|
||||
Reference in New Issue
Block a user