@steedos/webapp 2.2.18 → 2.2.21
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.
- package/package.json +4 -4
- package/lib/action_types/errors.js +0 -13
- package/lib/action_types/errors.js.map +0 -1
- package/lib/action_types/general.js +0 -38
- package/lib/action_types/general.js.map +0 -1
- package/lib/action_types/index.js +0 -15
- package/lib/action_types/index.js.map +0 -1
- package/lib/action_types/spaces.js +0 -26
- package/lib/action_types/spaces.js.map +0 -1
- package/lib/action_types/users.js +0 -51
- package/lib/action_types/users.js.map +0 -1
- package/lib/actions/errors.js +0 -111
- package/lib/actions/errors.js.map +0 -1
- package/lib/actions/general.js +0 -64
- package/lib/actions/general.js.map +0 -1
- package/lib/actions/global_actions.js +0 -215
- package/lib/actions/global_actions.js.map +0 -1
- package/lib/actions/helpers.js +0 -228
- package/lib/actions/helpers.js.map +0 -1
- package/lib/actions/i18n.js +0 -55
- package/lib/actions/i18n.js.map +0 -1
- package/lib/actions/requests.js +0 -13
- package/lib/actions/requests.js.map +0 -1
- package/lib/actions/root.js +0 -135
- package/lib/actions/root.js.map +0 -1
- package/lib/actions/settings.js +0 -72
- package/lib/actions/settings.js.map +0 -1
- package/lib/actions/spaces.js +0 -159
- package/lib/actions/spaces.js.map +0 -1
- package/lib/actions/users.js +0 -386
- package/lib/actions/users.js.map +0 -1
- package/lib/client/accounts.events.js +0 -37
- package/lib/client/accounts.events.js.map +0 -1
- package/lib/client/client4.js +0 -507
- package/lib/client/client4.js.map +0 -1
- package/lib/client/fetch_etag.js +0 -35
- package/lib/client/fetch_etag.js.map +0 -1
- package/lib/client/i18n.js +0 -17
- package/lib/client/i18n.js.map +0 -1
- package/lib/client/index.js +0 -31
- package/lib/client/index.js.map +0 -1
- package/lib/client/signup.events.js +0 -76
- package/lib/client/signup.events.js.map +0 -1
- package/lib/components/Background.js +0 -49
- package/lib/components/Background.js.map +0 -1
- package/lib/components/Card.js +0 -115
- package/lib/components/Card.js.map +0 -1
- package/lib/components/FormError.js +0 -129
- package/lib/components/FormError.js.map +0 -1
- package/lib/components/GlobalMessage.js +0 -94
- package/lib/components/GlobalMessage.js.map +0 -1
- package/lib/components/Initialized.js +0 -85
- package/lib/components/Initialized.js.map +0 -1
- package/lib/components/InputPassword.js +0 -70
- package/lib/components/InputPassword.js.map +0 -1
- package/lib/components/Loading.js +0 -84
- package/lib/components/Loading.js.map +0 -1
- package/lib/components/LocalizedInput.js +0 -39
- package/lib/components/LocalizedInput.js.map +0 -1
- package/lib/components/LoggedIn.js +0 -82
- package/lib/components/LoggedIn.js.map +0 -1
- package/lib/components/Logo.js +0 -42
- package/lib/components/Logo.js.map +0 -1
- package/lib/components/Navbar.js +0 -130
- package/lib/components/Navbar.js.map +0 -1
- package/lib/components/ResetPassword.js +0 -160
- package/lib/components/ResetPassword.js.map +0 -1
- package/lib/components/amis.js +0 -14
- package/lib/components/amis.js.map +0 -1
- package/lib/components/countdown.js +0 -83
- package/lib/components/countdown.js.map +0 -1
- package/lib/components/index.js +0 -19
- package/lib/components/index.js.map +0 -1
- package/lib/components/intl_provider/index.js +0 -28
- package/lib/components/intl_provider/index.js.map +0 -1
- package/lib/components/intl_provider/intl_provider.js +0 -97
- package/lib/components/intl_provider/intl_provider.js.map +0 -1
- package/lib/exports.js +0 -21
- package/lib/exports.js.map +0 -1
- package/lib/i18n/en.json +0 -104
- package/lib/i18n/i18n.js +0 -62
- package/lib/i18n/i18n.js.map +0 -1
- package/lib/i18n/zh-CN.json +0 -126
- package/lib/index.js +0 -18
- package/lib/index.js.map +0 -1
- package/lib/pages/CreateTenant.js +0 -176
- package/lib/pages/CreateTenant.js.map +0 -1
- package/lib/pages/Home.js +0 -153
- package/lib/pages/Home.js.map +0 -1
- package/lib/pages/Init.js +0 -174
- package/lib/pages/Init.js.map +0 -1
- package/lib/pages/Login.js +0 -432
- package/lib/pages/Login.js.map +0 -1
- package/lib/pages/Logout.js +0 -78
- package/lib/pages/Logout.js.map +0 -1
- package/lib/pages/Preference.js +0 -148
- package/lib/pages/Preference.js.map +0 -1
- package/lib/pages/SelectSpace.js +0 -123
- package/lib/pages/SelectSpace.js.map +0 -1
- package/lib/pages/Signup.js +0 -435
- package/lib/pages/Signup.js.map +0 -1
- package/lib/pages/VerifyEmail.js +0 -308
- package/lib/pages/VerifyEmail.js.map +0 -1
- package/lib/pages/VerifyMobile.js +0 -308
- package/lib/pages/VerifyMobile.js.map +0 -1
- package/lib/pages/index.js +0 -19
- package/lib/pages/index.js.map +0 -1
- package/lib/pages/updatePassword.js +0 -203
- package/lib/pages/updatePassword.js.map +0 -1
- package/lib/reducers/entities/general.js +0 -69
- package/lib/reducers/entities/general.js.map +0 -1
- package/lib/reducers/entities/index.js +0 -15
- package/lib/reducers/entities/index.js.map +0 -1
- package/lib/reducers/entities/spaces.js +0 -32
- package/lib/reducers/entities/spaces.js.map +0 -1
- package/lib/reducers/entities/users.js +0 -73
- package/lib/reducers/entities/users.js.map +0 -1
- package/lib/reducers/i18n.js +0 -34
- package/lib/reducers/i18n.js.map +0 -1
- package/lib/reducers/index.js +0 -17
- package/lib/reducers/index.js.map +0 -1
- package/lib/reducers/requests.js +0 -13
- package/lib/reducers/requests.js.map +0 -1
- package/lib/reducers/settings.js +0 -14
- package/lib/reducers/settings.js.map +0 -1
- package/lib/root.js +0 -152
- package/lib/root.js.map +0 -1
- package/lib/selectors/entities/spaces.js +0 -28
- package/lib/selectors/entities/spaces.js.map +0 -1
- package/lib/selectors/entities/users.js +0 -16
- package/lib/selectors/entities/users.js.map +0 -1
- package/lib/selectors/i18n.js +0 -48
- package/lib/selectors/i18n.js.map +0 -1
- package/lib/selectors/index.js +0 -36
- package/lib/selectors/index.js.map +0 -1
- package/lib/selectors/settings.js +0 -9
- package/lib/selectors/settings.js.map +0 -1
- package/lib/stores/initial_state.js +0 -30
- package/lib/stores/initial_state.js.map +0 -1
- package/lib/stores/local_storage_store.js +0 -78
- package/lib/stores/local_storage_store.js.map +0 -1
- package/lib/stores/redux_store.js +0 -99
- package/lib/stores/redux_store.js.map +0 -1
- package/lib/types/actions.js +0 -19
- package/lib/types/actions.js.map +0 -1
- package/lib/types/client4.js +0 -3
- package/lib/types/client4.js.map +0 -1
- package/lib/types/errors.js +0 -3
- package/lib/types/errors.js.map +0 -1
- package/lib/types/general.js +0 -4
- package/lib/types/general.js.map +0 -1
- package/lib/types/spaces.js +0 -3
- package/lib/types/spaces.js.map +0 -1
- package/lib/types/store.js +0 -3
- package/lib/types/store.js.map +0 -1
- package/lib/types/users.js +0 -3
- package/lib/types/users.js.map +0 -1
- package/lib/types/utilities.js +0 -3
- package/lib/types/utilities.js.map +0 -1
- package/lib/utils/hash_history.js +0 -6
- package/lib/utils/hash_history.js.map +0 -1
- package/lib/utils/helpers.js +0 -20
- package/lib/utils/helpers.js.map +0 -1
- package/lib/utils/key_mirror.js +0 -35
- package/lib/utils/key_mirror.js.map +0 -1
- package/lib/utils/sentry.js +0 -50
- package/lib/utils/sentry.js.map +0 -1
- package/lib/utils/utils.js +0 -106
- package/lib/utils/utils.js.map +0 -1
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (_) try {
|
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
|
-
};
|
|
75
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
var react_1 = __importDefault(require("react"));
|
|
77
|
-
var redux_1 = require("redux");
|
|
78
|
-
var react_intl_1 = require("react-intl");
|
|
79
|
-
var react_redux_1 = require("react-redux");
|
|
80
|
-
var selectors_1 = require("../selectors");
|
|
81
|
-
var LocalizedInput_1 = __importDefault(require("../components/LocalizedInput"));
|
|
82
|
-
var spaces_1 = require("../actions/spaces");
|
|
83
|
-
var Logo_1 = __importDefault(require("../components/Logo"));
|
|
84
|
-
var Card_1 = __importDefault(require("../components/Card"));
|
|
85
|
-
var GlobalAction = __importStar(require("../actions/global_actions"));
|
|
86
|
-
var users_1 = require("../selectors/entities/users");
|
|
87
|
-
var CreateTenant = /** @class */ (function (_super) {
|
|
88
|
-
__extends(CreateTenant, _super);
|
|
89
|
-
function CreateTenant(props, context) {
|
|
90
|
-
var _this = _super.call(this, props, context) || this;
|
|
91
|
-
_this.handleNameChange = function (e) {
|
|
92
|
-
_this.setState({
|
|
93
|
-
name: e.target.value,
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
_this.onSubmit = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
97
|
-
var _this = this;
|
|
98
|
-
return __generator(this, function (_a) {
|
|
99
|
-
this.setState({ serverError: null, loading: true });
|
|
100
|
-
e.preventDefault();
|
|
101
|
-
this.props.actions.createSpace(this.state.name).then(function (_a) {
|
|
102
|
-
var data = _a.data;
|
|
103
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
104
|
-
return __generator(this, function (_b) {
|
|
105
|
-
console.log(data);
|
|
106
|
-
// if (error) {
|
|
107
|
-
// this.setState({
|
|
108
|
-
// serverError: (
|
|
109
|
-
// <FormattedMessage
|
|
110
|
-
// id={error.message}
|
|
111
|
-
// />
|
|
112
|
-
// ),
|
|
113
|
-
// });
|
|
114
|
-
// return;
|
|
115
|
-
// }
|
|
116
|
-
if (data)
|
|
117
|
-
this.selectSpace(data);
|
|
118
|
-
return [2 /*return*/];
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
return [2 /*return*/];
|
|
123
|
-
});
|
|
124
|
-
}); };
|
|
125
|
-
_this.selectSpace = function (space) {
|
|
126
|
-
if (space && space._id) {
|
|
127
|
-
_this.props.actions.selectSpace(space._id);
|
|
128
|
-
var currentUser = _this.props.currentUser;
|
|
129
|
-
var tenant = _this.props.tenant;
|
|
130
|
-
var location_1 = _this.props.location;
|
|
131
|
-
GlobalAction.finishSignin(currentUser, tenant, location_1);
|
|
132
|
-
// hashHistory.push(`/home/${space._id}`)
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
_this.state = {
|
|
136
|
-
name: ''
|
|
137
|
-
};
|
|
138
|
-
return _this;
|
|
139
|
-
}
|
|
140
|
-
CreateTenant.prototype.render = function () {
|
|
141
|
-
return (react_1.default.createElement(Card_1.default, null,
|
|
142
|
-
react_1.default.createElement(Logo_1.default, null),
|
|
143
|
-
react_1.default.createElement("h2", { className: "my-2 text-left text-2xl leading-9 font-extrabold text-gray-900" },
|
|
144
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: 'accounts.title.createTenant', defaultMessage: 'Create Team' })),
|
|
145
|
-
react_1.default.createElement("div", { class: "mt-2 max-w-xl text-sm leading-5 text-gray-500" },
|
|
146
|
-
react_1.default.createElement("p", null,
|
|
147
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: 'accounts.create_tenant_description', defaultMessage: 'Create a new team and invite your colleagues to join.' }))),
|
|
148
|
-
react_1.default.createElement("form", { onSubmit: this.onSubmit, className: "mt-4" },
|
|
149
|
-
react_1.default.createElement("div", { className: "rounded-md shadow-sm my-2" },
|
|
150
|
-
react_1.default.createElement("div", null,
|
|
151
|
-
react_1.default.createElement(LocalizedInput_1.default, { id: "name", name: "name", value: this.state.name, className: "appearance-none rounded-none relative block w-full px-3 py-2 border-b border-gray-500 bg-blue-50 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5", placeholder: { id: 'accounts.tenant_name', defaultMessage: 'Team Name' }, onChange: this.handleNameChange }))),
|
|
152
|
-
react_1.default.createElement("div", { className: "mt-6 flex justify-end" },
|
|
153
|
-
react_1.default.createElement("button", { type: "submit", className: "group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out" },
|
|
154
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: 'accounts.submit', defaultMessage: 'Submit' }))))));
|
|
155
|
-
};
|
|
156
|
-
;
|
|
157
|
-
return CreateTenant;
|
|
158
|
-
}(react_1.default.PureComponent));
|
|
159
|
-
;
|
|
160
|
-
function mapStateToProps(state) {
|
|
161
|
-
return {
|
|
162
|
-
currentUser: (0, users_1.getCurrentUser)(state),
|
|
163
|
-
settings: (0, selectors_1.getSettings)(state),
|
|
164
|
-
tenant: (0, selectors_1.getTenant)(state)
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
function mapDispatchToProps(dispatch) {
|
|
168
|
-
return {
|
|
169
|
-
actions: (0, redux_1.bindActionCreators)({
|
|
170
|
-
createSpace: spaces_1.createSpace,
|
|
171
|
-
selectSpace: spaces_1.selectSpace,
|
|
172
|
-
}, dispatch),
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
exports.default = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(CreateTenant);
|
|
176
|
-
//# sourceMappingURL=CreateTenant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateTenant.js","sourceRoot":"","sources":["../../src/pages/CreateTenant.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAmD;AACnD,+BAAgE;AAGhE,yCAAuD;AACvD,2CAAsC;AACtC,0CAAsD;AACt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AA2B,eAAK,CAAC,aAAa,GAsG7C;AAAA,CAAC;AAGF,SAAS,eAAe,CAAC,KAAK;IAC5B,OAAO;QACL,WAAW,EAAE,IAAA,sBAAc,EAAC,KAAK,CAAC;QAClC,QAAQ,EAAE,IAAA,uBAAW,EAAC,KAAK,CAAC;QAC5B,MAAM,EAAE,IAAA,qBAAS,EAAC,KAAK,CAAC;KACzB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAQ;IAClC,OAAO;QACH,OAAO,EAAE,IAAA,0BAAkB,EAAC;YACxB,WAAW,sBAAA;YACX,WAAW,sBAAA;SACd,EAAE,QAAQ,CAAC;KACf,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,qBAAO,EAAC,eAAe,EAAC,kBAAkB,CAAC,CAAC,YAAY,CAAC,CAAC"}
|
package/lib/pages/Home.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
var react_1 = __importDefault(require("react"));
|
|
58
|
-
var redux_1 = require("redux");
|
|
59
|
-
var react_redux_1 = require("react-redux");
|
|
60
|
-
var selectors_1 = require("../selectors");
|
|
61
|
-
var users_1 = require("../selectors/entities/users");
|
|
62
|
-
var spaces_1 = require("../selectors/entities/spaces");
|
|
63
|
-
var Navbar_1 = __importDefault(require("../components/Navbar"));
|
|
64
|
-
var spaces_2 = require("../actions/spaces");
|
|
65
|
-
var hash_history_1 = require("../utils/hash_history");
|
|
66
|
-
var local_storage_store_1 = __importDefault(require("../stores/local_storage_store"));
|
|
67
|
-
var Home = /** @class */ (function (_super) {
|
|
68
|
-
__extends(Home, _super);
|
|
69
|
-
function Home(props, context) {
|
|
70
|
-
var _this = _super.call(this, props, context) || this;
|
|
71
|
-
_this.goHome = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
72
|
-
return __generator(this, function (_a) {
|
|
73
|
-
this.props.actions.goSpaceHome(this.props.location);
|
|
74
|
-
return [2 /*return*/];
|
|
75
|
-
});
|
|
76
|
-
}); };
|
|
77
|
-
return _this;
|
|
78
|
-
}
|
|
79
|
-
Home.prototype.componentDidMount = function () {
|
|
80
|
-
var _this = this;
|
|
81
|
-
var previousSpaceId = local_storage_store_1.default.getPreviousSpaceId();
|
|
82
|
-
var paramSpaceId = (this.props.match && this.props.match.params) ? this.props.match.params.spaceId : null;
|
|
83
|
-
var _a = this.props, currentSpaceId = _a.currentSpaceId, settingsTenantId = _a.settingsTenantId;
|
|
84
|
-
var spaceId = paramSpaceId ? paramSpaceId : currentSpaceId ? currentSpaceId : (previousSpaceId && previousSpaceId !== 'null') ? previousSpaceId : settingsTenantId;
|
|
85
|
-
if (spaceId) {
|
|
86
|
-
this.props.actions.selectSpace(spaceId).then(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
87
|
-
return __generator(this, function (_a) {
|
|
88
|
-
if (result) {
|
|
89
|
-
if (result.data == false) {
|
|
90
|
-
hash_history_1.hashHistory.push({
|
|
91
|
-
pathname: '/select-space',
|
|
92
|
-
search: this.props.location.search
|
|
93
|
-
});
|
|
94
|
-
return [2 /*return*/];
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.goHome();
|
|
98
|
-
return [2 /*return*/];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return [2 /*return*/];
|
|
102
|
-
});
|
|
103
|
-
}); });
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
hash_history_1.hashHistory.push({
|
|
107
|
-
pathname: '/select-space',
|
|
108
|
-
search: this.props.location.search
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
if (process.env.NODE_ENV == 'production')
|
|
112
|
-
if (this.props.currentUser && this.props.currentSpace)
|
|
113
|
-
this.goHome();
|
|
114
|
-
};
|
|
115
|
-
Home.prototype.render = function () {
|
|
116
|
-
if (process.env.NODE_ENV == 'production')
|
|
117
|
-
return null;
|
|
118
|
-
var _a = this.props, currentUser = _a.currentUser, currentSpace = _a.currentSpace;
|
|
119
|
-
if (!currentUser || !currentSpace) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
return (react_1.default.createElement("div", null,
|
|
123
|
-
react_1.default.createElement(Navbar_1.default, { user: currentUser }),
|
|
124
|
-
react_1.default.createElement("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-6 border-b border-gray-200 md:flex md:items-center md:justify-between" },
|
|
125
|
-
react_1.default.createElement("div", { className: "flex-1 min-w-0" },
|
|
126
|
-
react_1.default.createElement("h2", { className: "text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:leading-9 sm:truncate" }, this.props.currentSpace && this.props.currentSpace.name)),
|
|
127
|
-
react_1.default.createElement("div", { className: "mt-4 flex md:mt-0 md:ml-4" },
|
|
128
|
-
react_1.default.createElement("span", { className: "shadow-sm rounded-md" },
|
|
129
|
-
react_1.default.createElement("button", { type: "button", className: "inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-700 active:bg-blue-700 transition duration-150 ease-in-out", onClick: this.goHome }, "\u8FDB\u5165\u9996\u9875"))))));
|
|
130
|
-
};
|
|
131
|
-
return Home;
|
|
132
|
-
}(react_1.default.PureComponent));
|
|
133
|
-
;
|
|
134
|
-
function mapStateToProps(state) {
|
|
135
|
-
return {
|
|
136
|
-
currentUser: (0, users_1.getCurrentUser)(state),
|
|
137
|
-
currentSpace: (0, spaces_1.getCurrentSpace)(state),
|
|
138
|
-
currentSpaceId: (0, spaces_1.getCurrentSpaceId)(state),
|
|
139
|
-
tenant: (0, selectors_1.getTenant)(state),
|
|
140
|
-
settings: (0, selectors_1.getSettings)(state),
|
|
141
|
-
settingsTenantId: (0, selectors_1.getSettingsTenantId)(state)
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function mapDispatchToProps(dispatch) {
|
|
145
|
-
return {
|
|
146
|
-
actions: (0, redux_1.bindActionCreators)({
|
|
147
|
-
selectSpace: spaces_2.selectSpace,
|
|
148
|
-
goSpaceHome: spaces_2.goSpaceHome,
|
|
149
|
-
}, dispatch),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
exports.default = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(Home);
|
|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,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CACrD,CACD;gBACN,uCAAK,SAAS,EAAC,2BAA2B;oBAMxC,wCAAM,SAAS,EAAC,sBAAsB;wBACpC,0CAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,0QAA0Q,EACxS,OAAO,EAAE,IAAI,CAAC,MAAM,+BAEb,CACJ,CACH,CACF,CAoDM,CACP,CAAC;IACJ,CAAC;IACH,WAAC;AAAD,CAAC,AAlID,CAAmB,eAAK,CAAC,aAAa,GAkIrC;AAAA,CAAC;AAEF,SAAS,eAAe,CAAC,KAAK;IAC5B,OAAO;QACL,WAAW,EAAE,IAAA,sBAAc,EAAC,KAAK,CAAC;QAClC,YAAY,EAAE,IAAA,wBAAe,EAAC,KAAK,CAAC;QACpC,cAAc,EAAE,IAAA,0BAAiB,EAAC,KAAK,CAAC;QACxC,MAAM,EAAE,IAAA,qBAAS,EAAC,KAAK,CAAC;QACxB,QAAQ,EAAE,IAAA,uBAAW,EAAC,KAAK,CAAC;QAC5B,gBAAgB,EAAE,IAAA,+BAAmB,EAAC,KAAK,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAQ;IAClC,OAAO;QACH,OAAO,EAAE,IAAA,0BAAkB,EAAC;YACxB,WAAW,sBAAA;YACX,WAAW,sBAAA;SACd,EAAE,QAAQ,CAAC;KACf,CAAC;AACJ,CAAC;AACD,kBAAe,IAAA,qBAAO,EAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC"}
|
package/lib/pages/Init.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
var react_1 = __importDefault(require("react"));
|
|
58
|
-
var react_intl_1 = require("react-intl");
|
|
59
|
-
var react_redux_1 = require("react-redux");
|
|
60
|
-
var selectors_1 = require("../selectors");
|
|
61
|
-
var FormError_1 = __importDefault(require("../components/FormError"));
|
|
62
|
-
var Card_1 = __importDefault(require("../components/Card"));
|
|
63
|
-
var Logo_1 = __importDefault(require("../components/Logo"));
|
|
64
|
-
var Background_1 = __importDefault(require("../components/Background"));
|
|
65
|
-
var LocalizedInput_1 = __importDefault(require("../components/LocalizedInput"));
|
|
66
|
-
var redux_1 = require("redux");
|
|
67
|
-
var root_1 = require("../actions/root");
|
|
68
|
-
var Backdrop_1 = __importDefault(require("@material-ui/core/Backdrop"));
|
|
69
|
-
var CircularProgress_1 = __importDefault(require("@material-ui/core/CircularProgress"));
|
|
70
|
-
var Init = /** @class */ (function (_super) {
|
|
71
|
-
__extends(Init, _super);
|
|
72
|
-
function Init(props, context) {
|
|
73
|
-
var _this = _super.call(this, props, context) || this;
|
|
74
|
-
_this.handleInitParamsChange = function (e) {
|
|
75
|
-
_this.setState({
|
|
76
|
-
initParams: e.target.value,
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
_this.goConsoleServer = function () {
|
|
80
|
-
window.open(_this.props.settings.serverInitInfo.cloud_url);
|
|
81
|
-
};
|
|
82
|
-
_this.goHelpServer = function () {
|
|
83
|
-
window.open(_this.props.settings.serverInitInfo.help_url);
|
|
84
|
-
};
|
|
85
|
-
_this.onSubmit = function (e) {
|
|
86
|
-
_this.setState({ serverError: null, loading: true });
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
_this.setState({ error: null });
|
|
89
|
-
var initParams = _this.state.initParams;
|
|
90
|
-
if (!initParams || !initParams.trim()) {
|
|
91
|
-
_this.setState({
|
|
92
|
-
loading: false,
|
|
93
|
-
serverError: '请填写初始化参数',
|
|
94
|
-
});
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
var params = initParams.trim().split('\n');
|
|
98
|
-
if (params.length != 2) {
|
|
99
|
-
_this.setState({
|
|
100
|
-
loading: false,
|
|
101
|
-
serverError: '无效的初始化参数',
|
|
102
|
-
});
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
var spaceId = params[0];
|
|
106
|
-
var apiKey = params[1];
|
|
107
|
-
_this.props.actions.initServer(spaceId, apiKey).then(function (_a) {
|
|
108
|
-
var error = _a.error, _next = _a._next;
|
|
109
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
110
|
-
return __generator(this, function (_b) {
|
|
111
|
-
if (error) {
|
|
112
|
-
this.setState({
|
|
113
|
-
loading: false,
|
|
114
|
-
serverError: error,
|
|
115
|
-
});
|
|
116
|
-
return [2 /*return*/];
|
|
117
|
-
}
|
|
118
|
-
this.props.history.push({
|
|
119
|
-
pathname: "/login",
|
|
120
|
-
search: this.props.location.search
|
|
121
|
-
});
|
|
122
|
-
return [2 /*return*/];
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
_this.state = {
|
|
128
|
-
initParams: '',
|
|
129
|
-
serverError: '',
|
|
130
|
-
loading: false
|
|
131
|
-
};
|
|
132
|
-
return _this;
|
|
133
|
-
}
|
|
134
|
-
Init.prototype.componentDidMount = function () {
|
|
135
|
-
};
|
|
136
|
-
Init.prototype.render = function () {
|
|
137
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
138
|
-
react_1.default.createElement(Backdrop_1.default, { style: { zIndex: 1 }, open: this.state.loading },
|
|
139
|
-
react_1.default.createElement(CircularProgress_1.default, null)),
|
|
140
|
-
react_1.default.createElement(Background_1.default, null),
|
|
141
|
-
react_1.default.createElement(Card_1.default, null,
|
|
142
|
-
react_1.default.createElement(Logo_1.default, null),
|
|
143
|
-
react_1.default.createElement("h2", { className: "mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900" },
|
|
144
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: 'accounts.server_init', defaultMessage: '\u6FC0\u6D3B\u534E\u708E\u9B54\u65B9' })),
|
|
145
|
-
react_1.default.createElement("form", { onSubmit: this.onSubmit, className: "mt-4", autoCapitalize: "none" },
|
|
146
|
-
react_1.default.createElement("div", { className: "rounded-md shadow-sm my-2" },
|
|
147
|
-
react_1.default.createElement("div", { className: "-mt-px" },
|
|
148
|
-
react_1.default.createElement(LocalizedInput_1.default, { type: "textarea", id: "init_params", name: "init_params", rows: '4', autocomplete: "\u8BF7\u8F93\u5165\u6FC0\u6D3B\u53C2\u6570", value: this.state.initParams, className: "appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5", placeholder: { id: 'accounts.init_params', defaultMessage: '请输入激活参数' }, onChange: this.handleInitParamsChange }))),
|
|
149
|
-
this.state.serverError && react_1.default.createElement(FormError_1.default, { error: this.state.serverError }),
|
|
150
|
-
react_1.default.createElement("div", { className: "text-sm leading-5 my-4" },
|
|
151
|
-
react_1.default.createElement("button", { type: "button", onClick: this.goHelpServer, className: "font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150" },
|
|
152
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: 'accounts.get_init_params', defaultMessage: '\u5E2E\u52A9' }))),
|
|
153
|
-
react_1.default.createElement("div", { className: "mt-6 flex justify-end" },
|
|
154
|
-
react_1.default.createElement("button", { type: "submit", className: "rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out" },
|
|
155
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: 'accounts.submit', defaultMessage: 'Submit' })))))));
|
|
156
|
-
};
|
|
157
|
-
;
|
|
158
|
-
return Init;
|
|
159
|
-
}(react_1.default.PureComponent));
|
|
160
|
-
;
|
|
161
|
-
function mapStateToProps(state) {
|
|
162
|
-
return {
|
|
163
|
-
settings: (0, selectors_1.getSettings)(state),
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function mapDispatchToProps(dispatch) {
|
|
167
|
-
return {
|
|
168
|
-
actions: (0, redux_1.bindActionCreators)({
|
|
169
|
-
initServer: root_1.initServer
|
|
170
|
-
}, dispatch),
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
exports.default = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(Init);
|
|
174
|
-
//# sourceMappingURL=Init.js.map
|
package/lib/pages/Init.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Init.js","sourceRoot":"","sources":["../../src/pages/Init.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,yCAA8C;AAC9C,2CAAsC;AACtC,0CAA2C;AAC3C,sEAAgD;AAChD,4DAAsC;AACtC,4DAAsC;AACtC,wEAAkD;AAClD,gFAA0D;AAC1D,+BAAgE;AAGhE,wCAA6C;AAG7C,wEAAkD;AAClD,wFAAkE;AAGlE;IAAmB,wBAAmB;IAGpC,cAAY,KAAK,EAAE,OAAO;QAA1B,YACE,kBAAM,KAAK,EAAE,OAAO,CAAC,SAOtB;QAMD,4BAAsB,GAAG,UAAC,CAAC;YACzB,KAAI,CAAC,QAAQ,CAAC;gBACZ,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK;aAC3B,CAAC,CAAC;QACL,CAAC,CAAA;QAED,qBAAe,GAAG;YAChB,MAAM,CAAC,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;QAC3D,CAAC,CAAA;QAED,kBAAY,GAAG;YACb,MAAM,CAAC,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;QAC1D,CAAC,CAAA;QAED,cAAQ,GAAG,UAAC,CAAC;YACX,KAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACpD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,KAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAE/B,IAAM,UAAU,GAAG,KAAI,CAAC,KA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