weget 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f0fb56fc3fab39bbb4a20e7ce7a4999fe0b30afe2b9107fb089053db5b5fcea
4
- data.tar.gz: d4e61697eeed86c62e08f4960d80b2fedad79f97fdbf9cb108c45a7d7cd65da6
3
+ metadata.gz: df67670dce031a799ac154b3cf1f841c3ddd2cd3147def7d831048ea74a3d5a2
4
+ data.tar.gz: aa820d9fc28fdfe39d1dafb964bef556ea6186cf990969c38ffd756954e13729
5
5
  SHA512:
6
- metadata.gz: a162f73958d2ef163e8cccd755c28af71c0a2160c4293034eea8559d044692408f5ab96f360a73222827f7f88a258ff10461ab5ccf3803c19605962b7dd7b5b2
7
- data.tar.gz: cf980efd69f884b25273e2ace71b324cbc8eb055f708830502f911e95729d221bf77436d139c970427a86af5f22a411e8d0ea8de5d8aa27940dcde763e7a7b0b
6
+ metadata.gz: 3c7477d56f876d897d2bfca94190a083edef81b4747e850f5decd28809c632378b75522a73843b72e86eb8898ebfbb530b86116736370dfefd5888bbb721c56a
7
+ data.tar.gz: d09b450c958a03145c69b8bc4e1ac8823f3935b7d67674afc1468cd3b2f73dc2f46f9552696da09f94a582c46d21c194fad97303a31ca1b11133bf954ea7967f
@@ -0,0 +1 @@
1
+ node_modules/
@@ -0,0 +1,151 @@
1
+ body {
2
+ height: 100%;
3
+ -webkit-tap-highlight-color: transparent;
4
+ background-color: #F8F8F8;
5
+ font-size: 16px;
6
+ font-family: Meiryo,sans-serif;
7
+ }
8
+
9
+ .page__hd {
10
+ padding: 20px;
11
+ }
12
+ .page__bd {
13
+ padding-bottom: 40px;
14
+ }
15
+ .page__bd_spacing {
16
+ padding-left: 15px;
17
+ padding-right: 15px;
18
+ }
19
+
20
+ .page__ft{
21
+ padding-bottom: 10px;
22
+ text-align: center;
23
+ }
24
+
25
+ .page__title {
26
+ text-align: left;
27
+ font-size: 20px;
28
+ font-weight: 400;
29
+ }
30
+
31
+ .page__desc {
32
+ margin-top: 5px;
33
+ color: #888888;
34
+ text-align: left;
35
+ font-size: 14px;
36
+ }
37
+
38
+ .box {
39
+ display: flex;
40
+ }
41
+
42
+ .box-lr {
43
+ flex-direction: row;
44
+ }
45
+
46
+ .box-rl {
47
+ flex-direction: row-reverse;
48
+ }
49
+
50
+ .box-tb {
51
+ flex-direction: column;
52
+ }
53
+
54
+ .box-bt {
55
+ flex-direction: column-reverse;
56
+ }
57
+
58
+ .box-pack-center {
59
+ justify-content: center;
60
+ }
61
+
62
+ .box-pack-start {
63
+ justify-content: flex-start;
64
+ }
65
+
66
+ .box-pack-end {
67
+ justify-content: flex-end;
68
+ }
69
+
70
+ .box-pack-between {
71
+ justify-content: space-between;
72
+ }
73
+
74
+ .box-pack-around {
75
+ justify-content: space-around;
76
+ }
77
+
78
+ .box-align-center {
79
+ align-items: center;
80
+ }
81
+
82
+ .box-align-start {
83
+ align-items: flex-start;
84
+ }
85
+
86
+ .box-align-end {
87
+ align-items: flex-end;
88
+ }
89
+
90
+ .self-align-center {
91
+ align-self: center;
92
+ margin: 0 auto;
93
+ }
94
+
95
+ .self-align-start {
96
+ align-self: flex-start;
97
+ }
98
+
99
+ .self-align-end {
100
+ align-self: flex-end;
101
+ }
102
+
103
+ .self-align-stretch {
104
+ align-self: stretch;
105
+ }
106
+
107
+ .box-wrap {
108
+ flex-wrap: wrap;
109
+ }
110
+
111
+ .box-nowrap {
112
+ flex-wrap: nowrap;
113
+ }
114
+
115
+ .flex {
116
+ flex-grow: 1;
117
+ }
118
+
119
+ .shrink {
120
+ flex-shrink: 1;
121
+ }
122
+
123
+ .bg {
124
+ background-image: linear-gradient(to bottom, #faefe7, #ffcbd7);
125
+ overflow: hidden;
126
+ }
127
+ .brown-color {
128
+ color: #784344;
129
+ }
130
+ .pink-color {
131
+ color: #ff629a;
132
+ }
133
+ .white-color {
134
+ color: #fff;
135
+ }
136
+ .fs24 {
137
+ font-size: 24rpx;
138
+ }
139
+ .fs28 {
140
+ font-size: 28rpx;
141
+ }
142
+ .fs32 {
143
+ font-size: 32rpx;
144
+ }
145
+ .fs36 {
146
+ font-size: 36rpx;
147
+ }
148
+
149
+ .download_icon{
150
+ padding-top: 10px;
151
+ }
@@ -0,0 +1,8 @@
1
+ <head>
2
+ <title>wesales</title>
3
+ <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
4
+ </head>
5
+
6
+ <body>
7
+ <div id="react-target"></div>
8
+ </body>
@@ -0,0 +1,8 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import { render } from 'react-dom';
3
+ import { renderRoutes } from '../imports/startup/client/routes.js';
4
+ import 'weui';
5
+ import 'react-weui/build/packages/react-weui.css';
6
+ Meteor.startup(() => {
7
+ render(renderRoutes(), document.getElementById('react-target'));
8
+ });
@@ -0,0 +1,155 @@
1
+ import { Accounts } from 'meteor/accounts-base'
2
+
3
+ const validateEmail = (email) => {
4
+ var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
5
+ return re.test(String(email).toLowerCase());
6
+ }
7
+
8
+ export const changeInput = (name, value) => ({
9
+ type: 'CHANGE_INPUT',
10
+ name,
11
+ value
12
+ })
13
+
14
+ export const closeToast = () => ({
15
+ type: 'CLOSE_TOAST',
16
+ })
17
+
18
+ export const login = (e) => {
19
+ e.preventDefault();
20
+ return (dispatch, getState) => {
21
+ const state = getState().base
22
+ if (!state.mail || !state.pass) {
23
+ return dispatch({
24
+ type: 'OPEN_TOAST',
25
+ toastIcon: 'warn',
26
+ toastMessage: 'place check mail or pass',
27
+ });
28
+ }
29
+ if (!validateEmail(state.mail)) {
30
+ return dispatch({
31
+ type: 'OPEN_TOAST',
32
+ toastIcon: 'warn',
33
+ toastMessage: 'place check mail',
34
+ });
35
+ }
36
+ return Meteor.loginWithPassword(state.mail, state.pass, (err) => {
37
+ if (err) {
38
+ return dispatch({
39
+ type: 'OPEN_TOAST',
40
+ showToast: true,
41
+ toastIcon: "warn",
42
+ toastMessage: err.reason,
43
+ });
44
+ }
45
+ return dispatch({ type: 'REDIRECT', redirect: "/" })
46
+ });
47
+ };
48
+ }
49
+
50
+ export const forgotPassword = (e) => {
51
+ e.preventDefault();
52
+ return (dispatch, getState) => {
53
+ const state = getState().base
54
+ if (!state.mail) {
55
+ return dispatch({
56
+ type: 'OPEN_TOAST',
57
+ toastIcon: 'warn',
58
+ toastMessage: 'place check mail',
59
+ });
60
+ }
61
+ if (!validateEmail(state.mail)) {
62
+ return dispatch({
63
+ type: 'OPEN_TOAST',
64
+ toastIcon: 'warn',
65
+ toastMessage: 'place check mail',
66
+ });
67
+ }
68
+ return Accounts.forgotPassword({ email: state.mail }, (err) => {
69
+ if (err) {
70
+ return dispatch({
71
+ type: 'OPEN_TOAST',
72
+ showToast: true,
73
+ toastIcon: "warn",
74
+ toastMessage: err.reason,
75
+ });
76
+ }
77
+ return dispatch({ type: 'REDIRECT', redirect: "/success" })
78
+ });
79
+ }
80
+ }
81
+
82
+ export const signup = (e) => {
83
+ e.preventDefault();
84
+ return (dispatch, getState) => {
85
+ const state = getState().base
86
+ if (!state.mail || !state.name || !state.pass) {
87
+ return dispatch({
88
+ type: 'OPEN_TOAST',
89
+ toastIcon: 'warn',
90
+ toastMessage: 'place check name , mail or pass',
91
+ });
92
+ }
93
+ if (!validateEmail(state.mail)) {
94
+ return dispatch({
95
+ type: 'OPEN_TOAST',
96
+ toastIcon: 'warn',
97
+ toastMessage: 'place check mail',
98
+ });
99
+ }
100
+ return Accounts.createUser({ email: state.email, username: state.name, password: state.pass }, (err) => {
101
+ if (err) {
102
+ return dispatch({
103
+ type: 'OPEN_TOAST',
104
+ showToast: true,
105
+ toastIcon: "warn",
106
+ toastMessage: err.reason,
107
+ });
108
+ }
109
+ return dispatch({ type: 'REDIRECT', redirect: "/" })
110
+ });
111
+ }
112
+ }
113
+
114
+ export const resetPassword = (token, e) => {
115
+ e.preventDefault();
116
+ return (dispatch, getState) => {
117
+ const state = getState().base
118
+ console.log(token, state)
119
+ if (!state.pass || !token) {
120
+ return dispatch({
121
+ type: 'OPEN_TOAST',
122
+ toastIcon: 'warn',
123
+ toastMessage: 'place check url or pass',
124
+ });
125
+ }
126
+ return Accounts.resetPassword(token, state.pass, (err) => {
127
+ if (err) {
128
+ return dispatch({
129
+ type: 'OPEN_TOAST',
130
+ showToast: true,
131
+ toastIcon: "warn",
132
+ toastMessage: err.reason,
133
+ });
134
+ }
135
+ return dispatch({ type: 'REDIRECT', redirect: "/" })
136
+ });
137
+ }
138
+ }
139
+
140
+ export const logout = (e) => {
141
+ e.preventDefault();
142
+ return dispatch => {
143
+ return Meteor.logout((err) => {
144
+ if (err) {
145
+ return dispatch({
146
+ type: 'OPEN_TOAST',
147
+ showToast: true,
148
+ toastIcon: "warn",
149
+ toastMessage: err.reason,
150
+ });
151
+ }
152
+ return dispatch({ type: 'REDIRECT', redirect: "/login" })
153
+ });
154
+ };
155
+ }
@@ -0,0 +1,2 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import { Mongo } from 'meteor/mongo';
@@ -0,0 +1 @@
1
+ import { Meteor } from 'meteor/meteor';
@@ -0,0 +1,38 @@
1
+
2
+ const initState = {
3
+ showToast: false,
4
+ toastIcon: "warn",
5
+ toastMessage: "",
6
+ }
7
+
8
+ const base = (state = initState, action) => {
9
+ switch (action.type) {
10
+ case 'CHANGE_INPUT':
11
+ return {
12
+ ...state,
13
+ [action.name]: action.value,
14
+ }
15
+ case 'CLOSE_TOAST':
16
+ return {
17
+ ...state,
18
+ showToast: false
19
+ }
20
+ case 'OPEN_TOAST':
21
+ return {
22
+ ...state,
23
+ showToast: true,
24
+ toastIcon: action.toastIcon,
25
+ toastMessage: action.toastMessage,
26
+ toastRedirect: action.toastRedirect,
27
+ }
28
+ case 'REDIRECT':
29
+ return {
30
+ ...state,
31
+ redirect: action.redirect
32
+ }
33
+ default:
34
+ return state
35
+ }
36
+ }
37
+
38
+ export default base
@@ -0,0 +1,6 @@
1
+ import { combineReducers } from 'redux'
2
+ import base from './base'
3
+
4
+ export default combineReducers({
5
+ base,
6
+ })
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { Router, Route, Switch } from 'react-router-dom';
3
+
4
+ import AppContainer from '../../ui/containers/AppContainer.js';
5
+ import LoginPage from '../../ui/pages/LoginPage.js';
6
+ import SignupPage from '../../ui/pages/SignupPage.js';
7
+ import NotFoundPage from '../../ui/pages/NotFoundPage.js';
8
+ import ResetPasswordPage from '../../ui/pages/ResetPasswordPage.js';
9
+ import ForgotPasswordPage from '../../ui/pages/ForgotPasswordPage.js';
10
+ import ErrorPage from '../../ui/pages/ErrorPage.js';
11
+ import SuccessPage from '../../ui/pages/SuccessPage.js';
12
+ import DemoPage from '../../ui/pages/DemoPage.js';
13
+
14
+ import createBrowserHistory from 'history/createBrowserHistory';
15
+ import { createStore, applyMiddleware } from "redux";
16
+ import { Provider } from 'react-redux'
17
+ import thunk from 'redux-thunk';
18
+ import reducer from '../../reducers'
19
+
20
+ const store = createStore(reducer, applyMiddleware(thunk));
21
+ const browserHistory = createBrowserHistory();
22
+
23
+ export const renderRoutes = () => (
24
+ <Provider store={store}>
25
+ <Router history={browserHistory}>
26
+ <Switch>
27
+ <Route path="/login" component={LoginPage} />
28
+ <Route path="/signup" component={SignupPage} />
29
+ <Route path="/error" component={ErrorPage} />
30
+ <Route path="/success" component={SuccessPage} />
31
+ <Route path="/forgot" component={ForgotPasswordPage} />
32
+ <Route path="/demo" component={DemoPage} />
33
+ <Route path='/reset2-password/:token' component={ResetPasswordPage} />
34
+ <Route path="/" component={AppContainer} />
35
+ <Route component={NotFoundPage} />
36
+ </Switch>
37
+ </Router>
38
+ </Provider>
39
+ );
@@ -0,0 +1,58 @@
1
+ import React from 'react'
2
+ import { withTracker } from 'meteor/react-meteor-data';
3
+ import PropTypes from 'prop-types'
4
+ import { connect } from 'react-redux'
5
+ import { Redirect } from 'react-router-dom'
6
+
7
+ import {
8
+ Grids,
9
+ ButtonArea,
10
+ Button,
11
+ } from 'react-weui';
12
+
13
+ import { logout } from '../../actions'
14
+ import BasePage from '../pages/BasePage'
15
+ import WaitPage from '../pages/WaitPage'
16
+
17
+ const App = ({ logout, ...props }) => {
18
+ console.log(props)
19
+ if (!props.userId) {
20
+ //props.history.push('/login')
21
+ return <Redirect to='/login'/>
22
+ }
23
+ //if (!props.currentUser) return <WaitPage />;
24
+ const data = Array(9).fill({
25
+ icon: <img src="" />,
26
+ label: 'Grid',
27
+ href: 'javascript:;'
28
+ })
29
+ return (
30
+ <BasePage {...props} title="Menu" desc="Menu"
31
+ page={
32
+ <div>
33
+ <Grids data={data} />
34
+ <ButtonArea>
35
+ <Button onClick={logout}>logout</Button>
36
+ </ButtonArea>
37
+ </div>
38
+ }
39
+ />
40
+ );
41
+ }
42
+
43
+ App.propTypes = {
44
+ logout: PropTypes.func.isRequired,
45
+ }
46
+
47
+ const mapDispatchToProps = dispatch => ({
48
+ logout: e => dispatch(logout(e)),
49
+ })
50
+
51
+ export default connect(null, mapDispatchToProps)
52
+ (withTracker((props) => {
53
+ return {
54
+ userId: Meteor.userId(),
55
+ //currentUser: Meteor.user(),
56
+ ...props
57
+ };
58
+ })(App))
@@ -0,0 +1,55 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import { connect } from 'react-redux'
4
+ import {
5
+ Toast,
6
+ Page,
7
+ Footer,
8
+ FooterText
9
+ } from 'react-weui';
10
+ import { Redirect } from 'react-router-dom'
11
+ import { closeToast } from '../../actions'
12
+
13
+ const BasePage = ({ title, desc, toast, page, redirect, ...props }) => {
14
+
15
+ if (redirect) {
16
+ return <Redirect to={redirect} />
17
+ }
18
+
19
+ if (toast.showToast) {
20
+ setTimeout(() => props.dispatch(closeToast()), 1000)
21
+ }
22
+
23
+ return (
24
+ <Page>
25
+ <div className="page__hd">
26
+ <div className="page__title">{title}</div>
27
+ <div className="page__desc">{desc}</div>
28
+ </div>
29
+ {page}
30
+ <Toast icon={toast.toastIcon} show={toast.showToast}>{toast.toastMessage}</Toast>
31
+ <Footer className="weui-footer_fixed-bottom">
32
+ <FooterText>Copyright © 2019 wesales</FooterText>
33
+ </Footer>
34
+ </Page>
35
+ )
36
+ }
37
+
38
+ BasePage.propTypes = {
39
+ title: PropTypes.string.isRequired,
40
+ desc: PropTypes.string.isRequired,
41
+ toast: PropTypes.object.isRequired,
42
+ page: PropTypes.node.isRequired,
43
+ }
44
+
45
+ const mapStateToProps = state => ({
46
+ toast: {
47
+ showToast: state.base.showToast,
48
+ toastIcon: state.base.toastIcon,
49
+ toastMessage: state.base.toastMessage,
50
+ toastRedirect: state.base.toastRedirect
51
+ },
52
+ redirect: state.base.redirect
53
+ })
54
+
55
+ export default connect(mapStateToProps)(BasePage)
@@ -0,0 +1,66 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import { connect } from 'react-redux'
4
+ import { Link } from 'react-router-dom'
5
+
6
+ import {
7
+ Button,
8
+ CellsTips,
9
+ CellHeader,
10
+ CellBody,
11
+ ButtonArea,
12
+ Form,
13
+ FormCell,
14
+ Input,
15
+ Label,
16
+ } from 'react-weui';
17
+
18
+ import { changeInput, login } from '../../actions'
19
+ import BasePage from './BasePage'
20
+
21
+ const DemoPage = ({ changeInput, login, ...props }) => {
22
+ console.log(props)
23
+ return (
24
+ <BasePage title="Demo" desc="Demo"
25
+ page={
26
+ <div>
27
+ <Form>
28
+ <FormCell>
29
+ <CellHeader>
30
+ <Label>mail</Label>
31
+ </CellHeader>
32
+ <CellBody>
33
+ <Input name="mail" onChange={changeInput} type="mail" placeholder="Enter your mail" />
34
+ </CellBody>
35
+ </FormCell>
36
+ <FormCell>
37
+ <CellHeader>
38
+ <Label>Pass</Label>
39
+ </CellHeader>
40
+ <CellBody>
41
+ <Input name="pass" onChange={changeInput} type="password" placeholder="Enter your pass" />
42
+ </CellBody>
43
+ </FormCell>
44
+ </Form>
45
+ <ButtonArea direction="horizontal">
46
+ <Button type="default" onClick={() => props.history.push('/signup')}>signup</Button>
47
+ <Button type="primary" onClick={login}>login</Button>
48
+ </ButtonArea>
49
+ <CellsTips>forgot password <Link to="/forgot">here</Link></CellsTips>
50
+ </div>
51
+ }
52
+ />
53
+ );
54
+ }
55
+
56
+ DemoPage.propTypes = {
57
+ changeInput: PropTypes.func.isRequired,
58
+ login: PropTypes.func.isRequired,
59
+ }
60
+
61
+ const mapDispatchToProps = dispatch => ({
62
+ changeInput: e => dispatch(changeInput(e.target.name, e.target.value)),
63
+ login: e => dispatch(login()),
64
+ })
65
+
66
+ export default connect(null, mapDispatchToProps)(DemoPage)
@@ -0,0 +1,26 @@
1
+ import React, { Component } from 'react';
2
+
3
+ import {
4
+ Msg,
5
+ Page,
6
+ Footer,
7
+ FooterText
8
+ } from 'react-weui';
9
+
10
+ export default class ErrorPage extends Component {
11
+
12
+ render() {
13
+ return (
14
+ <Page>
15
+ <Msg
16
+ type="warn"
17
+ title="Service Error"
18
+ description="異常終了になりました。"
19
+ />
20
+ <Footer className="weui-footer_fixed-bottom">
21
+ <FooterText>Copyright © 2019 wesales</FooterText>
22
+ </Footer>
23
+ </Page>
24
+ );
25
+ }
26
+ }
@@ -0,0 +1,56 @@
1
+ import React from 'react'
2
+ import { Link } from 'react-router-dom'
3
+ import PropTypes from 'prop-types'
4
+ import { connect } from 'react-redux'
5
+
6
+ import {
7
+ Button,
8
+ CellsTips,
9
+ CellHeader,
10
+ CellBody,
11
+ ButtonArea,
12
+ Form,
13
+ FormCell,
14
+ Input,
15
+ Label,
16
+ } from 'react-weui';
17
+
18
+ import { changeInput, forgotPassword } from '../../actions'
19
+ import BasePage from './BasePage'
20
+
21
+ const ForgotPasswordPage = ({ changeInput, forgotPassword, ...props }) => {
22
+ return (
23
+ <BasePage {...props} title="ForgotPassword" desc="ForgotPassword"
24
+ page={
25
+ <div>
26
+ <Form>
27
+ <FormCell>
28
+ <CellHeader>
29
+ <Label>Mail</Label>
30
+ </CellHeader>
31
+ <CellBody>
32
+ <Input name="mail" onChange={changeInput} type="mail" placeholder="Enter your mail" />
33
+ </CellBody>
34
+ </FormCell>
35
+ </Form>
36
+ <ButtonArea direction="horizontal">
37
+ <Button type="primary" onClick={forgotPassword}>send</Button>
38
+ </ButtonArea>
39
+ <CellsTips>Don't have an account? Register <Link to="/signup">signup</Link></CellsTips>
40
+ </div>
41
+ }
42
+ />
43
+ );
44
+ }
45
+
46
+ ForgotPasswordPage.propTypes = {
47
+ changeInput: PropTypes.func.isRequired,
48
+ forgotPassword: PropTypes.func.isRequired,
49
+ }
50
+
51
+ const mapDispatchToProps = dispatch => ({
52
+ changeInput: e => dispatch(changeInput(e.target.name, e.target.value)),
53
+ forgotPassword: e => dispatch(forgotPassword(e)),
54
+ })
55
+
56
+ export default connect(null, mapDispatchToProps)(ForgotPasswordPage)
@@ -0,0 +1,65 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import { connect } from 'react-redux'
4
+ import { Link } from 'react-router-dom'
5
+
6
+ import {
7
+ Button,
8
+ CellsTips,
9
+ CellHeader,
10
+ CellBody,
11
+ ButtonArea,
12
+ Form,
13
+ FormCell,
14
+ Input,
15
+ Label,
16
+ } from 'react-weui';
17
+
18
+ import { changeInput, login } from '../../actions'
19
+ import BasePage from './BasePage'
20
+
21
+ const LoginPage = ({ changeInput, login, ...props }) => {
22
+ return (
23
+ <BasePage {...props} title="Login" desc="Login"
24
+ page={
25
+ <div>
26
+ <Form>
27
+ <FormCell>
28
+ <CellHeader>
29
+ <Label>mail</Label>
30
+ </CellHeader>
31
+ <CellBody>
32
+ <Input name="mail" onChange={changeInput} type="mail" placeholder="Enter your mail" />
33
+ </CellBody>
34
+ </FormCell>
35
+ <FormCell>
36
+ <CellHeader>
37
+ <Label>Pass</Label>
38
+ </CellHeader>
39
+ <CellBody>
40
+ <Input name="pass" onChange={changeInput} type="password" placeholder="Enter your pass" />
41
+ </CellBody>
42
+ </FormCell>
43
+ </Form>
44
+ <ButtonArea direction="horizontal">
45
+ <Button type="default" onClick={() => props.history.push('/signup')}>signup</Button>
46
+ <Button type="primary" onClick={login}>login</Button>
47
+ </ButtonArea>
48
+ <CellsTips>forgot password <Link to="/forgot">here</Link></CellsTips>
49
+ </div>
50
+ }
51
+ />
52
+ );
53
+ }
54
+
55
+ LoginPage.propTypes = {
56
+ changeInput: PropTypes.func.isRequired,
57
+ login: PropTypes.func.isRequired,
58
+ }
59
+
60
+ const mapDispatchToProps = dispatch => ({
61
+ changeInput: e => dispatch(changeInput(e.target.name, e.target.value)),
62
+ login: e => dispatch(login(e)),
63
+ })
64
+
65
+ export default connect(null, mapDispatchToProps)(LoginPage)
@@ -0,0 +1,26 @@
1
+ import React, { Component } from 'react';
2
+
3
+ import {
4
+ Page,
5
+ Msg,
6
+ Footer,
7
+ FooterText
8
+ } from 'react-weui';
9
+
10
+ export default class ErrorPage extends Component {
11
+
12
+ render() {
13
+ return (
14
+ <Page>
15
+ <Msg
16
+ type="warn"
17
+ title="Page not Found"
18
+ description="ページが見つかりません "
19
+ />
20
+ <Footer className="weui-footer_fixed-bottom">
21
+ <FooterText>Copyright © 2019 wesales</FooterText>
22
+ </Footer>
23
+ </Page>
24
+ );
25
+ }
26
+ }
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types'
3
+ import { connect } from 'react-redux'
4
+
5
+ import {
6
+ Form,
7
+ FormCell,
8
+ CellHeader,
9
+ Label,
10
+ CellBody,
11
+ Input,
12
+ ButtonArea,
13
+ Button,
14
+ } from 'react-weui';
15
+
16
+ import { changeInput, resetPassword } from '../../actions'
17
+ import BasePage from './BasePage'
18
+
19
+ const ResetPassWordPage = ({ changeInput, resetPassword, ...props }) => {
20
+ return (
21
+ <BasePage {...props} title="ResetPassWord" desc="ResetPassWord"
22
+ page={
23
+ <div>
24
+ <Form>
25
+ <FormCell>
26
+ <CellHeader>
27
+ <Label>password</Label>
28
+ </CellHeader>
29
+ <CellBody>
30
+ <Input name="pass" onChange={changeInput} type="password" placeholder="新パスワード" />
31
+ </CellBody>
32
+ </FormCell>
33
+ </Form>
34
+ <ButtonArea direction="horizontal">
35
+ <Button type="primary" onClick={(e) => resetPassword(props.match.params.token, e)}>リセット</Button>
36
+ </ButtonArea>
37
+ </div>
38
+ }
39
+ />
40
+ );
41
+ }
42
+
43
+ ResetPassWordPage.propTypes = {
44
+ changeInput: PropTypes.func.isRequired,
45
+ resetPassword: PropTypes.func.isRequired,
46
+ }
47
+
48
+ const mapDispatchToProps = dispatch => ({
49
+ changeInput: e => dispatch(changeInput(e.target.name, e.target.value)),
50
+ resetPassword: (token, e) => dispatch(resetPassword(token, e)),
51
+ })
52
+
53
+ export default connect(null, mapDispatchToProps)(ResetPassWordPage)
@@ -0,0 +1,72 @@
1
+ import React from 'react';
2
+ import { Link } from 'react-router-dom';
3
+ import PropTypes from 'prop-types'
4
+ import { connect } from 'react-redux'
5
+
6
+ import {
7
+ Button,
8
+ CellsTips,
9
+ CellHeader,
10
+ CellBody,
11
+ ButtonArea,
12
+ Form,
13
+ FormCell,
14
+ Input,
15
+ Label,
16
+ } from 'react-weui';
17
+
18
+ import { changeInput, signup } from '../../actions'
19
+ import BasePage from './BasePage'
20
+
21
+ const SignupPage = ({ changeInput, signup, ...props }) => {
22
+ return (
23
+ <BasePage {...props} title="Signup" desc="Signup"
24
+ page={
25
+ <div>
26
+ <Form>
27
+ <FormCell>
28
+ <CellHeader>
29
+ <Label>Name</Label>
30
+ </CellHeader>
31
+ <CellBody>
32
+ <Input name="name" onChange={changeInput} type="name" placeholder="Enter your name" />
33
+ </CellBody>
34
+ </FormCell>
35
+ <FormCell>
36
+ <CellHeader>
37
+ <Label>Mail</Label>
38
+ </CellHeader>
39
+ <CellBody>
40
+ <Input name="mail" onChange={changeInput} type="mail" placeholder="Enter your mail" />
41
+ </CellBody>
42
+ </FormCell>
43
+ <FormCell>
44
+ <CellHeader>
45
+ <Label>Pass</Label>
46
+ </CellHeader>
47
+ <CellBody>
48
+ <Input name="pass" onChange={changeInput} type="password" placeholder="Enter your pass" />
49
+ </CellBody>
50
+ </FormCell>
51
+ </Form>
52
+ <ButtonArea direction="horizontal">
53
+ <Button type="primary" onClick={signup}>signup</Button>
54
+ </ButtonArea>
55
+ <CellsTips> Already have an account? Login <Link to="/login">here</Link></CellsTips>
56
+ </div>
57
+ }
58
+ />
59
+ );
60
+ }
61
+
62
+ SignupPage.propTypes = {
63
+ changeInput: PropTypes.func.isRequired,
64
+ signup: PropTypes.func.isRequired,
65
+ }
66
+
67
+ const mapDispatchToProps = dispatch => ({
68
+ changeInput: e => dispatch(changeInput(e.target.name, e.target.value)),
69
+ signup: e => dispatch(signup(e)),
70
+ })
71
+
72
+ export default connect(null, mapDispatchToProps)(SignupPage)
@@ -0,0 +1,26 @@
1
+ import React, { Component } from 'react';
2
+
3
+ import {
4
+ Msg,
5
+ Page,
6
+ Footer,
7
+ FooterText
8
+ } from 'react-weui';
9
+
10
+ export default class SuccessPage extends Component {
11
+
12
+ render() {
13
+ return (
14
+ <Page>
15
+ <Msg
16
+ type="success"
17
+ title="Suucess"
18
+ description="正常終了になりました。"
19
+ />
20
+ <Footer className="weui-footer_fixed-bottom">
21
+ <FooterText>Copyright © 2019 wesales</FooterText>
22
+ </Footer>
23
+ </Page>
24
+ );
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ import React, { Component } from 'react';
2
+
3
+ import {
4
+ Msg,
5
+ Page,
6
+ Footer,
7
+ FooterText
8
+ } from 'react-weui';
9
+
10
+ export default class SuccessPage extends Component {
11
+
12
+ render() {
13
+ return (
14
+ <Page>
15
+ <Msg
16
+ type="success"
17
+ title="Suucess"
18
+ description="正常終了になりました。"
19
+ />
20
+ <Footer className="weui-footer_fixed-bottom">
21
+ <FooterText>Copyright © 2019 wesales</FooterText>
22
+ </Footer>
23
+ </Page>
24
+ );
25
+ }
26
+ }
@@ -0,0 +1,14 @@
1
+ export HTTP_PROXY=http://japan%5cU635630:zcc19851223@xproxy.nttdata.co.jp:8080
2
+ export HTTPS_PROXY=http://japan%5cU635630:zcc19851223@xproxy.nttdata.co.jp:8080
3
+ export HOME=/mnt/sda1/var/lib/docker/sales
4
+ export PATH=$PATH:$HOME/.meteor
5
+ export NODE_TLS_REJECT_UNAUTHORIZED=0
6
+ export ROOT_URL=http://192.168.99.100:3000
7
+ export MAIL_URL="smtp://watanaber:ryota%40258@mdx.mediax.gr.jp:25/"
8
+
9
+
10
+ ln -s /c/Users/shou/git/wesales/package.json /mnt/sda1/var/lib/docker/sales/wesales/package.json
11
+ ln -s /c/Users/shou/git/wesales/tests /mnt/sda1/var/lib/docker/sales/wesales/tests
12
+ ln -s /c/Users/shou/git/wesales/server /mnt/sda1/var/lib/docker/sales/wesales/server
13
+ ln -s /c/Users/shou/git/wesales/client /mnt/sda1/var/lib/docker/sales/wesales/client
14
+ ln -s /c/Users/shou/git/wesales/imports /mnt/sda1/var/lib/docker/sales/wesales/imports
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "wesales",
3
+ "private": true,
4
+ "scripts": {
5
+ "start": "meteor run",
6
+ "test": "meteor test --once --driver-package meteortesting:mocha",
7
+ "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
8
+ "visualize": "meteor --production --extra-packages bundle-visualizer"
9
+ },
10
+ "dependencies": {
11
+ "@babel/runtime": "^7.1.5",
12
+ "history": "^4.7.2",
13
+ "meteor-node-stubs": "^0.4.1",
14
+ "prop-types": "^15.6.2",
15
+ "react": "^16.5.0",
16
+ "react-dom": "^16.5.0",
17
+ "react-redux": "^6.0.0",
18
+ "react-router-dom": "^4.3.1",
19
+ "react-weui": "^1.1.3",
20
+ "redux": "^4.0.1",
21
+ "redux-thunk": "^2.3.0",
22
+ "weui": "^1.1.3"
23
+ },
24
+ "meteor": {
25
+ "mainModule": {
26
+ "client": "client/main.jsx",
27
+ "server": "server/main.js"
28
+ },
29
+ "testModule": "tests/main.js"
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import { Accounts } from 'meteor/accounts-base';
3
+ import '../imports/api/collection.js';
4
+ import '../imports/api/users'
5
+
6
+ Accounts.emailTemplates.siteName = "jenkins";
7
+ Accounts.emailTemplates.from = "jenkins@mediax.gr.jp";
8
+ Accounts.emailTemplates.resetPassword = {
9
+ subject(user) {
10
+ return "(demo)パスワードリセット";
11
+ },
12
+ text(user, url) {
13
+ url = url.replace('\#\/reset-password', 'reset-password')
14
+ const mess = `以下のリンクをクリックするとパスワードリセット画面に飛びます。
15
+ (注意)このメールに返信は行わないようお願いします。
16
+
17
+ `; // end
18
+ return (mess + url);
19
+ }
20
+ }
21
+
22
+ let now = new Date()
23
+ let opt = { year: '2-digit', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', weekday: 'short' }
24
+ let wareki = now.toLocaleDateString("ja-JP-u-ca-japanese", opt)
25
+ console.log("*****datetime-test*****")
26
+ console.log(wareki)
27
+ console.log("*****datetime-test*****")
28
+
29
+ Meteor.startup(() => {
30
+
31
+ });
@@ -0,0 +1,20 @@
1
+ import assert from "assert";
2
+
3
+ describe("wesales", function () {
4
+ it("package.json has correct name", async function () {
5
+ const { name } = await import("../package.json");
6
+ assert.strictEqual(name, "wesales");
7
+ });
8
+
9
+ if (Meteor.isClient) {
10
+ it("client is not server", function () {
11
+ assert.strictEqual(Meteor.isServer, false);
12
+ });
13
+ }
14
+
15
+ if (Meteor.isServer) {
16
+ it("server is not client", function () {
17
+ assert.strictEqual(Meteor.isClient, false);
18
+ });
19
+ }
20
+ });
@@ -1,3 +1,3 @@
1
1
  module Weget
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - shouaya
@@ -58,6 +58,31 @@ files:
58
58
  - lib/weget/crawler.rb
59
59
  - lib/weget/lib.rb
60
60
  - lib/weget/list.txt
61
+ - lib/weget/react/.gitignore
62
+ - lib/weget/react/client/main.css
63
+ - lib/weget/react/client/main.html
64
+ - lib/weget/react/client/main.jsx
65
+ - lib/weget/react/imports/actions/index.js
66
+ - lib/weget/react/imports/api/collection.js
67
+ - lib/weget/react/imports/api/users.js
68
+ - lib/weget/react/imports/reducers/base.js
69
+ - lib/weget/react/imports/reducers/index.js
70
+ - lib/weget/react/imports/startup/client/routes.js
71
+ - lib/weget/react/imports/ui/containers/AppContainer.js
72
+ - lib/weget/react/imports/ui/pages/BasePage.js
73
+ - lib/weget/react/imports/ui/pages/DemoPage.js
74
+ - lib/weget/react/imports/ui/pages/ErrorPage.js
75
+ - lib/weget/react/imports/ui/pages/ForgotPasswordPage.js
76
+ - lib/weget/react/imports/ui/pages/LoginPage.js
77
+ - lib/weget/react/imports/ui/pages/NotFoundPage.js
78
+ - lib/weget/react/imports/ui/pages/ResetPasswordPage.js
79
+ - lib/weget/react/imports/ui/pages/SignupPage.js
80
+ - lib/weget/react/imports/ui/pages/SuccessPage.js
81
+ - lib/weget/react/imports/ui/pages/WaitPage.js
82
+ - lib/weget/react/memo.txt
83
+ - lib/weget/react/package.json
84
+ - lib/weget/react/server/main.js
85
+ - lib/weget/react/tests/main.js
61
86
  - lib/weget/test.rb
62
87
  - lib/weget/version.rb
63
88
  - weget.gemspec