gatsby-theme-q3 2.3.11 → 2.3.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/CHANGELOG.md +121 -112
  2. package/gatsby-ssr.js +1 -1
  3. package/lib/components/AccountPublicGateway.js +0 -7
  4. package/lib/components/AdminLoader.js +0 -6
  5. package/lib/components/AdminPrivateGateway.js +1 -10
  6. package/lib/components/AdminPublicGateway.js +1 -10
  7. package/lib/components/AdminRouter.js +1 -11
  8. package/lib/components/BlogArchiveTemplate.js +0 -12
  9. package/lib/components/BlogTemplate.js +0 -22
  10. package/lib/components/FormBox.js +0 -6
  11. package/lib/components/FormBoxContent.js +0 -7
  12. package/lib/components/FormBoxNotice.js +0 -7
  13. package/lib/components/IsBrowserReady.js +0 -6
  14. package/lib/components/LocaleBundles.js +0 -6
  15. package/lib/components/PageWrapper.js +0 -9
  16. package/lib/components/PublicTemplate.js +0 -8
  17. package/lib/components/Redirect.js +0 -6
  18. package/lib/components/RedirectToIndex.js +0 -6
  19. package/lib/components/RichText.js +0 -26
  20. package/lib/components/SearchEngine.js +0 -7
  21. package/lib/components/ShareButton.js +0 -16
  22. package/lib/components/Wrapper.js +1 -9
  23. package/lib/components/__tests__/withAuthenticate.test.js +0 -11
  24. package/lib/components/__tests__/withSuccessOp.test.js +0 -7
  25. package/lib/components/index.js +0 -16
  26. package/lib/components/useLocale.js +0 -9
  27. package/lib/components/useSiteMetaData.js +0 -4
  28. package/lib/components/utils.js +0 -11
  29. package/lib/components/withAuthenticate.js +1 -10
  30. package/lib/components/withSuccessOp.js +1 -13
  31. package/lib/pages/404.js +0 -9
  32. package/lib/pages/login.js +0 -14
  33. package/lib/pages/password-change.js +0 -16
  34. package/lib/pages/password-reset.js +0 -12
  35. package/lib/pages/reverify.js +0 -14
  36. package/lib/pages/verify.js +0 -14
  37. package/package.json +2 -2
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _components = require("q3-admin/lib/components");
13
-
14
10
  var _AdminPublicGateway = _interopRequireDefault(require("./AdminPublicGateway"));
15
-
16
11
  var _useSiteMetaData = _interopRequireDefault(require("./useSiteMetaData"));
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  const PublicTemplate = ({
21
14
  children,
22
15
  ...rest
@@ -30,7 +23,6 @@ const PublicTemplate = ({
30
23
  logo: logo
31
24
  }, children));
32
25
  };
33
-
34
26
  PublicTemplate.defaultProps = {
35
27
  children: null
36
28
  };
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _gatsby = require("gatsby");
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  // eslint-disable-next-line
15
11
  const Redirect = ({
16
12
  to
@@ -18,9 +14,7 @@ const Redirect = ({
18
14
  _react.default.useEffect(() => {
19
15
  (0, _gatsby.navigate)(to);
20
16
  }, []);
21
-
22
17
  return null;
23
18
  };
24
-
25
19
  var _default = Redirect;
26
20
  exports.default = _default;
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _Redirect = _interopRequireDefault(require("./Redirect"));
11
-
12
9
  var _useSiteMetaData = _interopRequireDefault(require("./useSiteMetaData"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  const IndexPage = () => /*#__PURE__*/_react.default.createElement(_Redirect.default, {
17
12
  to: (0, _useSiteMetaData.default)().appDirectory
18
13
  });
19
-
20
14
  var _default = IndexPage;
21
15
  exports.default = _default;
@@ -4,45 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.renderRichText = exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _lodash = require("lodash");
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _gatsby = require("gatsby");
15
-
16
11
  var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
17
-
18
12
  var _CardContent = _interopRequireDefault(require("@material-ui/core/CardContent"));
19
-
20
13
  var _Box = _interopRequireDefault(require("@material-ui/core/Box"));
21
-
22
14
  var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
23
-
24
15
  var _List = _interopRequireDefault(require("@material-ui/core/List"));
25
-
26
16
  var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
27
-
28
17
  var _CardActionArea = _interopRequireDefault(require("@material-ui/core/CardActionArea"));
29
-
30
18
  var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
31
-
32
19
  var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));
33
-
34
20
  var _CheckCircle = _interopRequireDefault(require("@material-ui/icons/CheckCircle"));
35
-
36
21
  var _richTextReactRenderer = require("@contentful/rich-text-react-renderer");
37
-
38
22
  var _richTextTypes = require("@contentful/rich-text-types");
39
-
40
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
-
42
24
  const isImage = v => v === 'image';
43
-
44
25
  const getGroup = v => typeof v === 'string' ? v.split('/')[0] : '';
45
-
46
26
  const imageRender = (node, locale) => {
47
27
  const {
48
28
  title,
@@ -58,12 +38,9 @@ const imageRender = (node, locale) => {
58
38
  src: file[locale].url
59
39
  }) : null;
60
40
  };
61
-
62
41
  const renderRichText = (json, locale = 'en-CA', sitemap = {}) => {
63
42
  if (!json || !Object.keys(json).length) return null;
64
-
65
43
  const getFromSitemap = node => (0, _lodash.get)(sitemap, (0, _lodash.get)(node, 'data.target.sys.contentful_id'));
66
-
67
44
  return (0, _richTextReactRenderer.documentToReactComponents)(json, {
68
45
  renderMark: {
69
46
  [_richTextTypes.MARKS.BOLD]: text => /*#__PURE__*/_react.default.createElement("strong", null, text),
@@ -132,9 +109,7 @@ const renderRichText = (json, locale = 'en-CA', sitemap = {}) => {
132
109
  }
133
110
  });
134
111
  };
135
-
136
112
  exports.renderRichText = renderRichText;
137
-
138
113
  const RichText = ({
139
114
  json,
140
115
  locale
@@ -154,7 +129,6 @@ const RichText = ({
154
129
  return acc;
155
130
  }, {})));
156
131
  };
157
-
158
132
  RichText.propTypes = {
159
133
  // eslint-disable-next-line
160
134
  json: _propTypes.default.object,
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _reactHelmet = require("react-helmet");
13
-
14
10
  var _useSiteMetaData = _interopRequireDefault(require("./useSiteMetaData"));
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  const SEO = ({
19
13
  description,
20
14
  lang,
@@ -53,7 +47,6 @@ const SEO = ({
53
47
  }].concat(meta)
54
48
  });
55
49
  };
56
-
57
50
  SEO.defaultProps = {
58
51
  lang: 'en',
59
52
  meta: [],
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
13
-
14
10
  var _q3UiHelpers = require("q3-ui-helpers");
15
-
16
11
  var _reactShare = require("react-share");
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  const EMAIL = 'Email';
21
14
  const FACEBOOK = 'Facebook';
22
15
  const LINKEDIN = 'LinkedIn';
@@ -24,7 +17,6 @@ const TWITTER = 'Twitter';
24
17
  const {
25
18
  isBrowserReady
26
19
  } = _q3UiHelpers.browser;
27
-
28
20
  const getPlatformByName = name => {
29
21
  switch (name) {
30
22
  case FACEBOOK:
@@ -32,25 +24,21 @@ const getPlatformByName = name => {
32
24
  Button: _reactShare.FacebookShareButton,
33
25
  Icon: _reactShare.FacebookIcon
34
26
  };
35
-
36
27
  case EMAIL:
37
28
  return {
38
29
  Button: _reactShare.EmailShareButton,
39
30
  Icon: _reactShare.EmailIcon
40
31
  };
41
-
42
32
  case TWITTER:
43
33
  return {
44
34
  Button: _reactShare.TwitterShareButton,
45
35
  Icon: _reactShare.TwitterIcon
46
36
  };
47
-
48
37
  case LINKEDIN:
49
38
  return {
50
39
  Button: _reactShare.LinkedinShareButton,
51
40
  Icon: _reactShare.LinkedinIcon
52
41
  };
53
-
54
42
  default:
55
43
  return {
56
44
  Button: () => null,
@@ -58,16 +46,13 @@ const getPlatformByName = name => {
58
46
  };
59
47
  }
60
48
  };
61
-
62
49
  const ShareButton = ({
63
50
  platform
64
51
  }) => {
65
52
  const [url, setUrl] = _react.default.useState();
66
-
67
53
  _react.default.useEffect(() => {
68
54
  if (isBrowserReady()) setUrl(window.location.href);
69
55
  }, []);
70
-
71
56
  const {
72
57
  Button,
73
58
  Icon
@@ -84,7 +69,6 @@ const ShareButton = ({
84
69
  round: true
85
70
  }))) : null;
86
71
  };
87
-
88
72
  ShareButton.propTypes = {
89
73
  platform: _propTypes.default.oneOf([FACEBOOK, TWITTER, LINKEDIN, EMAIL]).isRequired
90
74
  };
@@ -4,25 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _axios = _interopRequireDefault(require("axios"));
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _q3UiPermissions = _interopRequireDefault(require("q3-ui-permissions"));
15
-
16
11
  var _LocaleBundles = _interopRequireDefault(require("./LocaleBundles"));
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  /* eslint-disable import/no-extraneous-dependencies */
14
+
21
15
  const setBaseUrlForRest = (baseURL = process.env.GATSBY_APP_BASE_URL || 'http://localhost:9000') => {
22
16
  _axios.default.defaults.baseURL = baseURL;
23
17
  return _axios.default.defaults;
24
18
  };
25
-
26
19
  const Wrapper = ({
27
20
  baseURL,
28
21
  children,
@@ -33,7 +26,6 @@ const Wrapper = ({
33
26
  locale: locale
34
27
  }, /*#__PURE__*/_react.default.createElement(_q3UiPermissions.default, null, children));
35
28
  };
36
-
37
29
  Wrapper.defaultProps = {
38
30
  baseURL: undefined
39
31
  };
@@ -1,17 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _react = _interopRequireDefault(require("react"));
4
-
5
4
  var _router = require("@reach/router");
6
-
7
5
  var _withAuthenticate = _interopRequireDefault(require("../withAuthenticate"));
8
-
9
6
  var _utils = require("../utils");
10
-
11
7
  var _useSiteMetaData = _interopRequireDefault(require("../useSiteMetaData"));
12
-
13
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
9
  jest.mock('@reach/router', () => ({
16
10
  useLocation: jest.fn()
17
11
  }));
@@ -19,20 +13,16 @@ jest.mock('../useSiteMetaData');
19
13
  jest.mock('../utils', () => ({
20
14
  authenticate: jest.fn()
21
15
  }));
22
-
23
16
  const runAuthenticate = () => {
24
17
  const Component = () => /*#__PURE__*/_react.default.createElement("div", null);
25
-
26
18
  const Instance = (0, _withAuthenticate.default)(Component);
27
19
  global.shallow( /*#__PURE__*/_react.default.createElement(Instance, null)).props().authenticate();
28
20
  };
29
-
30
21
  describe('withAuthenticate', () => {
31
22
  it('should redirect to default directory', () => {
32
23
  _useSiteMetaData.default.mockReturnValue({
33
24
  appDirectory: '/app'
34
25
  });
35
-
36
26
  runAuthenticate();
37
27
  expect(_utils.authenticate).toHaveBeenCalledWith(undefined, '/app');
38
28
  });
@@ -42,7 +32,6 @@ describe('withAuthenticate', () => {
42
32
  gatekeeper: '/app/users'
43
33
  }
44
34
  });
45
-
46
35
  runAuthenticate();
47
36
  expect(_utils.authenticate).toHaveBeenCalledWith(undefined, '/app/users');
48
37
  });
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _react = _interopRequireDefault(require("react"));
4
-
5
4
  var _gatsby = require("gatsby");
6
-
7
5
  var _FormBoxNotice = _interopRequireDefault(require("../FormBoxNotice"));
8
-
9
6
  var _withSuccessOp = _interopRequireDefault(require("../withSuccessOp"));
10
-
11
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
8
  jest.mock('gatsby', () => ({
14
9
  navigate: jest.fn(),
15
10
  Link: () => /*#__PURE__*/_react.default.createElement("div", null)
16
11
  }));
17
-
18
12
  const Box = () => /*#__PURE__*/_react.default.createElement("div", null);
19
-
20
13
  const Component = (0, _withSuccessOp.default)(Box, 'testing');
21
14
  describe('withSuccessOp', () => {
22
15
  it('should not render notice', () => {
@@ -87,35 +87,19 @@ Object.defineProperty(exports, "renderRichText", {
87
87
  return _RichText.renderRichText;
88
88
  }
89
89
  });
90
-
91
90
  var _AdminLoader = _interopRequireDefault(require("./AdminLoader"));
92
-
93
91
  var _AdminPrivateGateway = _interopRequireDefault(require("./AdminPrivateGateway"));
94
-
95
92
  var _AdminPublicGateway = _interopRequireDefault(require("./AdminPublicGateway"));
96
-
97
93
  var _AdminRouter = _interopRequireDefault(require("./AdminRouter"));
98
-
99
94
  var _BlogTemplate = _interopRequireDefault(require("./BlogTemplate"));
100
-
101
95
  var _FormBox = _interopRequireDefault(require("./FormBox"));
102
-
103
96
  var _PageWrapper = _interopRequireDefault(require("./PageWrapper"));
104
-
105
97
  var _PublicTemplate = _interopRequireDefault(require("./PublicTemplate"));
106
-
107
98
  var _Redirect = _interopRequireDefault(require("./Redirect"));
108
-
109
99
  var _RedirectToIndex = _interopRequireDefault(require("./RedirectToIndex"));
110
-
111
100
  var _RichText = _interopRequireWildcard(require("./RichText"));
112
-
113
101
  var _SearchEngine = _interopRequireDefault(require("./SearchEngine"));
114
-
115
102
  var _Wrapper = _interopRequireDefault(require("./Wrapper"));
116
-
117
103
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
118
-
119
104
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
120
-
121
105
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -4,28 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _q3UiLocale = require("q3-ui-locale");
11
-
12
9
  var _q3UiPermissions = require("q3-ui-permissions");
13
-
14
10
  var _q3UiRest = require("q3-ui-rest");
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  const useLocale = () => {
19
13
  var _React$useContext, _React$useContext$sta;
20
-
21
14
  const profile = (_React$useContext = _react.default.useContext(_q3UiPermissions.AuthContext)) === null || _React$useContext === void 0 ? void 0 : (_React$useContext$sta = _React$useContext.state) === null || _React$useContext$sta === void 0 ? void 0 : _React$useContext$sta.profile;
22
15
  const lng = profile === null || profile === void 0 ? void 0 : profile.lang;
23
16
  (0, _q3UiRest.useTimezoneInterceptor)(profile === null || profile === void 0 ? void 0 : profile.timezone);
24
-
25
17
  _react.default.useEffect(() => {
26
18
  if (lng && _q3UiLocale.i18n.resolvedLanguage) _q3UiLocale.i18n.changeLanguage(lng);
27
19
  }, [lng]);
28
20
  };
29
-
30
21
  var _default = useLocale;
31
22
  exports.default = _default;
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _lodash = require("lodash");
9
-
10
8
  var _gatsby = require("gatsby");
11
-
12
9
  var _default = () => (0, _lodash.get)((0, _gatsby.useStaticQuery)((0, _gatsby.graphql)`
13
10
  query {
14
11
  site {
@@ -23,5 +20,4 @@ var _default = () => (0, _lodash.get)((0, _gatsby.useStaticQuery)((0, _gatsby.gr
23
20
  }
24
21
  }
25
22
  `), 'site.siteMetadata', {});
26
-
27
23
  exports.default = _default;
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.toOp = exports.hasOp = exports.authenticate = exports.OP = void 0;
7
-
8
7
  var _axios = _interopRequireDefault(require("axios"));
9
-
10
8
  var _gatsby = require("gatsby");
11
-
12
9
  var _q3UiPermissions = require("q3-ui-permissions");
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  const OP = '?op=success';
17
12
  exports.OP = OP;
18
-
19
13
  const authenticate = (credentials, redirectPath = '/') => _axios.default.post('/authenticate', credentials).then(({
20
14
  data
21
15
  }) => {
@@ -23,13 +17,8 @@ const authenticate = (credentials, redirectPath = '/') => _axios.default.post('/
23
17
  window.location.replace(redirectPath);
24
18
  return data;
25
19
  });
26
-
27
20
  exports.authenticate = authenticate;
28
-
29
21
  const hasOp = search => search && search.includes(OP);
30
-
31
22
  exports.hasOp = hasOp;
32
-
33
23
  const toOp = pathname => () => (0, _gatsby.navigate)(`${pathname}${OP}`);
34
-
35
24
  exports.toOp = toOp;
@@ -4,22 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _router = require("@reach/router");
11
-
12
9
  var _useSiteMetaData = _interopRequireDefault(require("./useSiteMetaData"));
13
-
14
10
  var _utils = require("./utils");
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
12
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
20
13
  var _default = Component => props => {
21
14
  var _useLocation, _useLocation$state;
22
-
23
15
  const {
24
16
  appDirectory
25
17
  } = (0, _useSiteMetaData.default)();
@@ -28,5 +20,4 @@ var _default = Component => props => {
28
20
  authenticate: formValues => (0, _utils.authenticate)(formValues, redirectionPath)
29
21
  }));
30
22
  };
31
-
32
23
  exports.default = _default;
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _q3UiLocale = require("q3-ui-locale");
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _gatsby = require("gatsby");
15
-
16
11
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
17
-
18
12
  var _FormBoxNotice = _interopRequireDefault(require("./FormBoxNotice"));
19
-
20
13
  var _utils = require("./utils");
21
-
22
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
-
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
16
  const withSuccessOp = (Component, msg) => {
27
17
  const SuccessOpMessage = props => {
28
18
  const {
@@ -46,7 +36,6 @@ const withSuccessOp = (Component, msg) => {
46
36
  onSuccess: (0, _utils.toOp)(pathname)
47
37
  }));
48
38
  };
49
-
50
39
  SuccessOpMessage.propTypes = {
51
40
  location: _propTypes.default.shape({
52
41
  search: _propTypes.default.string,
@@ -55,6 +44,5 @@ const withSuccessOp = (Component, msg) => {
55
44
  };
56
45
  return SuccessOpMessage;
57
46
  };
58
-
59
47
  var _default = withSuccessOp;
60
48
  exports.default = _default;
package/lib/pages/404.js CHANGED
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _q3UiAssets = _interopRequireDefault(require("q3-ui-assets"));
11
-
12
9
  var _Box = _interopRequireDefault(require("@material-ui/core/Box"));
13
-
14
10
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
15
-
16
11
  var _wrapper = _interopRequireDefault(require("q3-ui/lib/wrapper"));
17
-
18
12
  var _gatsby = require("gatsby");
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  const NotFound = () => /*#__PURE__*/_react.default.createElement(_wrapper.default, {
23
15
  backgroundColor: "transparent"
24
16
  }, /*#__PURE__*/_react.default.createElement(_q3UiAssets.default, {
@@ -35,6 +27,5 @@ const NotFound = () => /*#__PURE__*/_react.default.createElement(_wrapper.defaul
35
27
  size: "large"
36
28
  }, "Go home"))
37
29
  }));
38
-
39
30
  var _default = NotFound;
40
31
  exports.default = _default;
@@ -4,31 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _gatsby = require("gatsby");
11
-
12
9
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
13
-
14
10
  var _q3UiLocale = require("q3-ui-locale");
15
-
16
11
  var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
17
-
18
12
  var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));
19
-
20
13
  var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
21
-
22
14
  var _Box = _interopRequireDefault(require("@material-ui/core/Box"));
23
-
24
15
  var _builders = require("q3-ui-forms/lib/builders");
25
-
26
16
  var _FormBox = _interopRequireDefault(require("../components/FormBox"));
27
-
28
17
  var _withAuthenticate = _interopRequireDefault(require("../components/withAuthenticate"));
29
-
30
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
19
  var _default = (0, _withAuthenticate.default)(({
33
20
  authenticate
34
21
  }) => {
@@ -69,5 +56,4 @@ var _default = (0, _withAuthenticate.default)(({
69
56
  }, t('titles:login'))
70
57
  });
71
58
  });
72
-
73
59
  exports.default = _default;
@@ -4,29 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _queryString = _interopRequireDefault(require("query-string"));
13
-
14
10
  var _lodash = require("lodash");
15
-
16
11
  var _axios = _interopRequireDefault(require("axios"));
17
-
18
12
  var _presets = require("q3-ui-forms/lib/presets");
19
-
20
13
  var _builders = require("q3-ui-forms/lib/builders");
21
-
22
14
  var _FormBoxContent = _interopRequireDefault(require("../components/FormBoxContent"));
23
-
24
15
  var _FormBox = _interopRequireDefault(require("../components/FormBox"));
25
-
26
16
  var _withSuccessOp = _interopRequireDefault(require("../components/withSuccessOp"));
27
-
28
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
18
  const PasswordChange = ({
31
19
  onSuccess,
32
20
  location
@@ -37,7 +25,6 @@ const PasswordChange = ({
37
25
  } = _queryString.default.parse((0, _lodash.get)(location, 'search', ''), {
38
26
  decode: false
39
27
  });
40
-
41
28
  return /*#__PURE__*/_react.default.createElement(_FormBox.default, {
42
29
  renderBottom: /*#__PURE__*/_react.default.createElement(_builders.Form, {
43
30
  onSubmit: passwords => _axios.default.post('/password-change', passwords).then(onSuccess),
@@ -58,14 +45,11 @@ const PasswordChange = ({
58
45
  })
59
46
  });
60
47
  };
61
-
62
48
  PasswordChange.propTypes = {
63
49
  onSuccess: _propTypes.default.func.isRequired,
64
50
  location: _propTypes.default.shape({
65
51
  search: _propTypes.default.string
66
52
  }).isRequired
67
53
  };
68
-
69
54
  var _default = (0, _withSuccessOp.default)(PasswordChange, 'passwordChangeNotice');
70
-
71
55
  exports.default = _default;