@configuratorware/configurator-frontendgui 1.49.9 → 1.50.0

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.
Files changed (107) hide show
  1. package/App/Error/ProductionErrorPage/index.js +5 -1
  2. package/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +2 -1
  3. package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +2 -1
  4. package/App/Modules/Creator/Components/Incompatibility/index.js +1 -2
  5. package/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +8 -31
  6. package/App/Modules/Creator/Components/Option/index.js +18 -14
  7. package/App/Modules/Creator/Components/OptionAmount/index.js +11 -7
  8. package/App/Modules/Creator/Components/ProductPart/index.js +20 -25
  9. package/App/Modules/Creator/Components/ProductPartsList/index.js +0 -2
  10. package/App/Modules/Creator/Layouts/DefaultLayout.js +8 -9
  11. package/App/Modules/Designer/Components/AddGalleryImage/index.js +5 -2
  12. package/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +0 -2
  13. package/App/Modules/Designer/Components/Dialog/index.js +1 -3
  14. package/App/Modules/Designer/Components/ImageControlbox/index.js +1 -3
  15. package/App/Reducers/Reducer.js +8 -2
  16. package/App/Screens/Configurator/Components/Confirm/index.js +1 -5
  17. package/App/Screens/Configurator/Components/Error/index.js +0 -3
  18. package/App/Screens/Configurator/Components/FullScreenView/index.js +2 -5
  19. package/App/Screens/Configurator/Components/FullScreenView/index.test.js +1 -1
  20. package/App/Screens/Configurator/Components/PreviewPortal/index.js +23 -28
  21. package/App/Screens/Configurator/Components/Thumbnail/index.js +9 -6
  22. package/App/Screens/Configurator/ThemeProvider.js +7 -4
  23. package/App/Shared/Components/AccessibleButton/AccessibleButton.js +40 -0
  24. package/App/Shared/Components/AlertDialog/index.js +0 -3
  25. package/App/Shared/Components/AmountPrice/index.js +29 -20
  26. package/App/Shared/Components/Analytics/AnalyticsWrapper.js +7 -1
  27. package/App/Shared/Components/AutoFocusDialogContentContainer/AutoFocusDialogContentContainer.js +71 -0
  28. package/App/Shared/Components/BulkNames/index.js +9 -6
  29. package/App/Shared/Components/LoadConfiguration/index.js +0 -2
  30. package/App/Shared/Components/PdfDownload/index.js +0 -2
  31. package/App/Shared/Components/SaveConfiguration/index.js +3 -4
  32. package/App/Shared/Components/SendEmail/index.js +0 -2
  33. package/App/Shared/Components/ToolbarList/index.js +18 -16
  34. package/App/Shared/Hooks/useDialogId.js +19 -0
  35. package/Shared/Components/CustomDialog.js +77 -56
  36. package/package.json +4 -4
  37. package/public/invoke.js +1 -1
  38. package/public/translations/de_DE.json +2 -1
  39. package/public/translations/en_GB.json +2 -1
  40. package/scripts/utils/fileSystem.js +6 -1
  41. package/src/App/Error/ProductionErrorPage/index.js +27 -24
  42. package/src/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +1 -1
  43. package/src/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +1 -1
  44. package/src/App/Modules/Creator/Components/Incompatibility/index.js +1 -2
  45. package/src/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +10 -27
  46. package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +142 -90
  47. package/src/App/Modules/Creator/Components/Option/index.js +30 -14
  48. package/src/App/Modules/Creator/Components/OptionAmount/__snapshots__/index.test.js.snap +31 -18
  49. package/src/App/Modules/Creator/Components/OptionAmount/index.js +7 -2
  50. package/src/App/Modules/Creator/Components/ProductPart/__snapshots__/index.test.js.snap +32 -24
  51. package/src/App/Modules/Creator/Components/ProductPart/index.js +20 -27
  52. package/src/App/Modules/Creator/Components/ProductPartsList/index.js +0 -2
  53. package/src/App/Modules/Creator/Layouts/DefaultLayout.js +12 -13
  54. package/src/App/Modules/Designer/Components/AddGalleryImage/__snapshots__/index.test.jsx.snap +1 -0
  55. package/src/App/Modules/Designer/Components/AddGalleryImage/index.js +4 -1
  56. package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +0 -2
  57. package/src/App/Modules/Designer/Components/Dialog/index.js +1 -1
  58. package/src/App/Modules/Designer/Components/ImageControlbox/index.js +0 -2
  59. package/src/App/Reducers/Reducer.js +7 -0
  60. package/src/App/Screens/Configurator/Components/Confirm/index.js +1 -3
  61. package/src/App/Screens/Configurator/Components/Error/index.js +2 -11
  62. package/src/App/Screens/Configurator/Components/FullScreenView/__snapshots__/index.test.jsx.snap +3 -4
  63. package/src/App/Screens/Configurator/Components/FullScreenView/index.js +17 -17
  64. package/src/App/Screens/Configurator/Components/FullScreenView/index.test.jsx +1 -1
  65. package/src/App/Screens/Configurator/Components/PreviewPortal/index.js +23 -32
  66. package/src/App/Screens/Configurator/Components/Thumbnail/__snapshots__/index.test.jsx.snap +32 -8
  67. package/src/App/Screens/Configurator/Components/Thumbnail/index.js +8 -5
  68. package/src/App/Screens/Configurator/ThemeProvider.js +6 -3
  69. package/src/App/Shared/Components/AccessibleButton/AccessibleButton.js +29 -0
  70. package/src/App/Shared/Components/AlertDialog/index.js +1 -6
  71. package/src/App/Shared/Components/AmountPrice/__snapshots__/index.test.jsx.snap +15 -15
  72. package/src/App/Shared/Components/AmountPrice/index.js +31 -21
  73. package/src/App/Shared/Components/Analytics/AnalyticsWrapper.js +6 -0
  74. package/src/App/Shared/Components/AutoFocusDialogContentContainer/AutoFocusDialogContentContainer.jsx +52 -0
  75. package/src/App/Shared/Components/BulkNames/index.js +11 -6
  76. package/src/App/Shared/Components/LoadConfiguration/index.js +0 -2
  77. package/src/App/Shared/Components/PdfDownload/index.js +0 -2
  78. package/src/App/Shared/Components/SaveConfiguration/index.js +6 -4
  79. package/src/App/Shared/Components/SendEmail/index.js +0 -2
  80. package/src/App/Shared/Components/ToolbarList/__snapshots__/ToolbarList.test.js.snap +44 -20
  81. package/src/App/Shared/Components/ToolbarList/index.js +30 -27
  82. package/src/App/Shared/Hooks/useDialogId.js +11 -0
  83. package/src/Shared/Components/CustomDialog.js +60 -43
  84. package/App/Modules/Creator/Components/LoginForm/Styles.scss +0 -9
  85. package/App/Modules/Creator/Components/LoginForm/index.js +0 -91
  86. package/App/Modules/Creator/Components/SavedConfiguration/Styles.scss +0 -19
  87. package/App/Modules/Creator/Components/SavedConfiguration/index.js +0 -50
  88. package/App/Modules/Creator/Components/ShareConfiguration/Styles.scss +0 -23
  89. package/App/Modules/Creator/Components/ShareConfiguration/index.js +0 -165
  90. package/App/Modules/Creator/Components/StockInformation/index.js +0 -62
  91. package/App/Modules/Creator/Components/StoreConfigurationForm/Styles.scss +0 -5
  92. package/App/Modules/Creator/Components/StoreConfigurationForm/index.js +0 -86
  93. package/App/Modules/Creator/Components/ValidationResult/Styles.scss +0 -45
  94. package/App/Modules/Creator/Components/ValidationResult/index.js +0 -119
  95. package/App/Modules/Creator/Components/index.js +0 -57
  96. package/src/App/Modules/Creator/Components/LoginForm/Styles.scss +0 -9
  97. package/src/App/Modules/Creator/Components/LoginForm/index.js +0 -69
  98. package/src/App/Modules/Creator/Components/SavedConfiguration/Styles.scss +0 -19
  99. package/src/App/Modules/Creator/Components/SavedConfiguration/index.js +0 -37
  100. package/src/App/Modules/Creator/Components/ShareConfiguration/Styles.scss +0 -23
  101. package/src/App/Modules/Creator/Components/ShareConfiguration/index.js +0 -161
  102. package/src/App/Modules/Creator/Components/StockInformation/index.js +0 -39
  103. package/src/App/Modules/Creator/Components/StoreConfigurationForm/Styles.scss +0 -5
  104. package/src/App/Modules/Creator/Components/StoreConfigurationForm/index.js +0 -73
  105. package/src/App/Modules/Creator/Components/ValidationResult/Styles.scss +0 -45
  106. package/src/App/Modules/Creator/Components/ValidationResult/index.js +0 -89
  107. package/src/App/Modules/Creator/Components/index.js +0 -51
@@ -70,8 +70,6 @@ class PdfDownload extends React.Component {
70
70
  <CustomDialog
71
71
  open={show}
72
72
  onClose={onClose}
73
- aria-labelledby="alert-dialog-title"
74
- aria-describedby="alert-dialog-description"
75
73
  dialogTitle={t('pdfDownloadDialog.title')}
76
74
  onCancel={onClose}
77
75
  >
@@ -12,6 +12,7 @@ import MainButton from 'Shared/Components/MainButton';
12
12
  import CustomDialog from 'Shared/Components/CustomDialog';
13
13
  import PropTypes from 'prop-types';
14
14
  import Tooltip from '@material-ui/core/Tooltip';
15
+ import AccessibleButton from '../AccessibleButton/AccessibleButton';
15
16
 
16
17
  const styles = theme => ({
17
18
  dialogTitleRoot: {
@@ -126,6 +127,7 @@ class SaveConfiguration extends React.Component {
126
127
  }
127
128
  }
128
129
  };
130
+
129
131
  render() {
130
132
  const {
131
133
  classes,
@@ -145,8 +147,6 @@ class SaveConfiguration extends React.Component {
145
147
  <CustomDialog
146
148
  open={show}
147
149
  onClose={onClose}
148
- aria-labelledby="alert-dialog-title"
149
- aria-describedby="alert-dialog-description"
150
150
  onCancel={onClose}
151
151
  dialogTitle={t('saveConfiguration.dialogTitle')}
152
152
  >
@@ -197,10 +197,12 @@ class SaveConfiguration extends React.Component {
197
197
  <b>{code}</b>
198
198
  {IconCopyShareUrl && (
199
199
  <Tooltip title={t('saveConfiguration.copyConfigurationLink')}>
200
- <IconCopyShareUrl
200
+ <AccessibleButton
201
201
  className={classes.copyShareUrlIcon}
202
202
  onClick={() => this.onCopyShareUrl(shareUrl)}
203
- />
203
+ >
204
+ <IconCopyShareUrl />
205
+ </AccessibleButton>
204
206
  </Tooltip>
205
207
  )}
206
208
  </div>
@@ -47,8 +47,6 @@ const SendEmail = props => {
47
47
  <CustomDialog
48
48
  open={show}
49
49
  onClose={onClose}
50
- aria-labelledby="alert-dialog-title"
51
- aria-describedby="alert-dialog-description"
52
50
  dialogTitle={t('sendEmailDialog.title')}
53
51
  onCancel={onClose}
54
52
  >
@@ -4,29 +4,53 @@ exports[`Shared/Components/ToolbarList the rendered component contains the custo
4
4
  <div
5
5
  class="ToolbarList-root-2 custom-css-tools"
6
6
  >
7
- <span
8
- aria-hidden="true"
9
- class="material-icons MuiIcon-root ToolbarList-iconHover-1"
7
+ <button
8
+ class="MuiButtonBase-root AccessibleButton-root-7"
9
+ tabindex="0"
10
+ type="button"
10
11
  >
11
- save
12
- </span>
13
- <span
14
- aria-hidden="true"
15
- class="material-icons MuiIcon-root ToolbarList-iconHover-1"
12
+ <span
13
+ aria-hidden="true"
14
+ class="material-icons MuiIcon-root ToolbarList-iconHover-1"
15
+ >
16
+ save
17
+ </span>
18
+ </button>
19
+ <button
20
+ class="MuiButtonBase-root AccessibleButton-root-7"
21
+ tabindex="0"
22
+ type="button"
16
23
  >
17
- mail
18
- </span>
19
- <span
20
- aria-hidden="true"
21
- class="material-icons MuiIcon-root ToolbarList-iconHover-1"
24
+ <span
25
+ aria-hidden="true"
26
+ class="material-icons MuiIcon-root ToolbarList-iconHover-1"
27
+ >
28
+ mail
29
+ </span>
30
+ </button>
31
+ <button
32
+ class="MuiButtonBase-root AccessibleButton-root-7"
33
+ tabindex="0"
34
+ type="button"
22
35
  >
23
- picture_as_pdf
24
- </span>
25
- <span
26
- aria-hidden="true"
27
- class="material-icons MuiIcon-root ToolbarList-iconHover-1"
36
+ <span
37
+ aria-hidden="true"
38
+ class="material-icons MuiIcon-root ToolbarList-iconHover-1"
39
+ >
40
+ picture_as_pdf
41
+ </span>
42
+ </button>
43
+ <button
44
+ class="MuiButtonBase-root AccessibleButton-root-7"
45
+ tabindex="0"
46
+ type="button"
28
47
  >
29
- help
30
- </span>
48
+ <span
49
+ aria-hidden="true"
50
+ class="material-icons MuiIcon-root ToolbarList-iconHover-1"
51
+ >
52
+ help
53
+ </span>
54
+ </button>
31
55
  </div>
32
56
  `;
@@ -10,6 +10,7 @@ import Menu from '@material-ui/core/Menu';
10
10
  import AnalyticsWrapper from '../Analytics/AnalyticsWrapper';
11
11
  import customClassName from 'App/Utils/customClassName';
12
12
  import { t } from 'Framework/i18n';
13
+ import AccessibleButton from '../AccessibleButton/AccessibleButton';
13
14
 
14
15
  const styles = theme => ({
15
16
  iconHover: {
@@ -86,14 +87,15 @@ class ToolbarList extends React.Component {
86
87
  {tools.map(tool => {
87
88
  return (
88
89
  <AnalyticsWrapper key={tool.key} targetId={tool.key}>
89
- <Icon
90
- title={tool.title && t(tool.title)}
91
- key={tool.key}
92
- className={classes.iconHover}
93
- onClick={tool.function}
94
- >
95
- {tool.identifier}
96
- </Icon>
90
+ <AccessibleButton onClick={tool.function}>
91
+ <Icon
92
+ title={tool.title && t(tool.title)}
93
+ key={tool.key}
94
+ className={classes.iconHover}
95
+ >
96
+ {tool.identifier}
97
+ </Icon>
98
+ </AccessibleButton>
97
99
  </AnalyticsWrapper>
98
100
  );
99
101
  })}
@@ -104,6 +106,7 @@ class ToolbarList extends React.Component {
104
106
  <IconButton
105
107
  aria-label="Menu"
106
108
  aria-haspopup="true"
109
+ aria-controls="toolbar-menu"
107
110
  classes={{
108
111
  root: classes.ToolbarButton,
109
112
  label: classes.ToolbarIconButton,
@@ -113,13 +116,14 @@ class ToolbarList extends React.Component {
113
116
  <Icon>{toolbarMobileIcon}</Icon>
114
117
  </IconButton>
115
118
  <Menu
116
- id="long-menu"
119
+ id="toolbar-menu"
117
120
  anchorEl={anchorEl}
118
121
  open={open}
119
122
  getContentAnchorEl={null}
120
123
  anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
121
124
  transformOrigin={{ vertical: 'top', horizontal: 'center' }}
122
125
  onClose={this.handleClose}
126
+ keepMounted
123
127
  PaperProps={{
124
128
  style: {
125
129
  maxHeight: ITEM_HEIGHT * 4.5,
@@ -129,25 +133,24 @@ class ToolbarList extends React.Component {
129
133
  >
130
134
  {tools &&
131
135
  tools.map(tool => (
132
- <MenuItem
133
- className={classes.MenuItemOption}
134
- key={tool.key}
135
- onClick={this.handleClose}
136
- >
137
- <AnalyticsWrapper key={tool.key} targetId={tool.key}>
138
- <div
139
- style={{ display: 'flex', width: '100%' }}
140
- onClick={tool.function}
141
- >
142
- <Icon key={tool.key} className={classes.iconHover}>
143
- {tool.identifier}
144
- </Icon>
145
- <div className={classes.toolTitle}>
146
- {tool.title && t(tool.title)}
147
- </div>
136
+ <AnalyticsWrapper key={tool.key} targetId={tool.key}>
137
+ <AccessibleButton
138
+ component={MenuItem}
139
+ className={classes.MenuItemOption}
140
+ key={tool.key}
141
+ onClick={evt => {
142
+ tool.function(evt);
143
+ this.handleClose();
144
+ }}
145
+ >
146
+ <Icon key={tool.key} className={classes.iconHover}>
147
+ {tool.identifier}
148
+ </Icon>
149
+ <div className={classes.toolTitle}>
150
+ {tool.title && t(tool.title)}
148
151
  </div>
149
- </AnalyticsWrapper>
150
- </MenuItem>
152
+ </AccessibleButton>
153
+ </AnalyticsWrapper>
151
154
  ))}
152
155
  </Menu>
153
156
  </div>
@@ -0,0 +1,11 @@
1
+ import { useMemo } from 'react';
2
+ import uuidv4 from 'uuid/v4';
3
+
4
+ export const useDialogId = () => {
5
+ const dialogId = useMemo(() => uuidv4(), []);
6
+ const dialogTitleId = `dialog-title-${dialogId}`;
7
+ return {
8
+ dialogId,
9
+ dialogTitleId,
10
+ };
11
+ };
@@ -4,6 +4,9 @@ import withWidth from '@material-ui/core/withWidth';
4
4
  import Dialog from '@material-ui/core/Dialog';
5
5
  import DialogTitle from '@material-ui/core/DialogTitle';
6
6
  import Icon from '@material-ui/core/Icon';
7
+ import IconButton from '@material-ui/core/IconButton';
8
+ import AutoFocusDialogContentContainer from '../../App/Shared/Components/AutoFocusDialogContentContainer/AutoFocusDialogContentContainer';
9
+ import { useDialogId } from '../../App/Shared/Hooks/useDialogId';
7
10
 
8
11
  export const customDialogStyle = theme => {
9
12
  const {
@@ -21,17 +24,25 @@ export const customDialogStyle = theme => {
21
24
  maxWidth: 720,
22
25
  },
23
26
  '& .MuiDialogTitle-root': {
24
- paddingTop: 20,
25
- paddingBottom: 15,
26
- '& p, h2': {
27
+ paddingTop: theme.spacing(2),
28
+ paddingBottom: theme.spacing(2),
29
+ '& .MuiTypography-root': {
27
30
  fontSize: 24,
28
31
  fontWeight: 'bold',
29
32
  letterSpacing: 'normal',
30
- marginRight: 28,
33
+ display: 'flex',
34
+ justifyContent: 'space-between',
35
+ alignItems: 'center',
31
36
  },
32
37
  },
33
38
  '& .MuiDialogActions-root': {
34
39
  paddingBottom: 24,
40
+
41
+ '& .MuiButton-root': {
42
+ height: 40,
43
+ textTransform: 'none',
44
+ minWidth: 140,
45
+ },
35
46
  },
36
47
  '& .MuiDialogTitle-root, .MuiDialogContent-root, .MuiDialogActions-root': {
37
48
  paddingLeft: smallScreen.centeredDialogPadding,
@@ -42,45 +53,47 @@ export const customDialogStyle = theme => {
42
53
  },
43
54
  },
44
55
  },
45
- '& .MuiButton-root': {
46
- height: 40,
47
- textTransform: 'none',
48
- minWidth: 140,
49
- },
50
- },
51
- stickyDialog: {
52
- '& .MuiDialog-container': {
53
- '& .MuiDialogTitle-root': {
54
- paddingTop: 25,
55
- paddingBottom: 8,
56
- },
57
- },
58
- '& .MuiButton-root': {
59
- width: '100%',
60
- height: 56,
61
- minWidth: 64,
62
- },
63
56
  },
64
- closeIcon: {
65
- position: 'absolute',
66
- right: 28,
67
- top: 28,
57
+ };
58
+ };
68
59
 
69
- [theme.breakpoints.down('xs')]: {
70
- right: 20,
71
- top: 30,
72
- },
60
+ const customDialogHeaderStyle = theme => ({
61
+ closeButton: {
62
+ marginLeft: 'auto',
63
+ marginRight: theme.spacing(1),
64
+ marginTop: theme.spacing(1),
65
+ },
66
+ dialogHeader: {
67
+ display: 'flex',
68
+ alignItems: 'start',
69
+ },
70
+ dialogTitle: {
71
+ flex: 1,
72
+ },
73
+ });
73
74
 
74
- '&:hover': {
75
- cursor: 'pointer',
76
- },
77
- },
78
- };
75
+ export const CustomDialogHeader = withStyles(customDialogHeaderStyle, { name: 'CustomDialogHeader' })(
76
+ ({ classes, dialogTitle, dialogTitleId, onClose, children }) => (
77
+ <div className={classes.dialogHeader}>
78
+ <DialogTitle className={classes.dialogTitle} id={dialogTitleId}>
79
+ {dialogTitle}
80
+ </DialogTitle>
81
+ {children}
82
+ <IconButton onClick={onClose} className={classes.closeButton}>
83
+ <CustomDialogHeader.IconComponent />
84
+ </IconButton>
85
+ </div>
86
+ )
87
+ );
88
+ CustomDialogHeader.IconComponent = function CloseIcon() {
89
+ return <Icon>close</Icon>;
79
90
  };
80
91
 
81
- export default withWidth({ initialWidth: 'xl' })(
92
+ export const CustomDialog = withWidth({ initialWidth: 'xl' })(
82
93
  withStyles(customDialogStyle, { name: 'CustomDialog' })(
83
94
  ({ className, classes, width, dialogTitle, onCancel, children, fullScreen, ...props }) => {
95
+ const { open } = props;
96
+ const { dialogTitleId } = useDialogId();
84
97
  return (
85
98
  <Dialog
86
99
  maxWidth={width === 'md' || width === 'lg' || width === 'xl' ? 'md' : 'sm'}
@@ -91,17 +104,21 @@ export default withWidth({ initialWidth: 'xl' })(
91
104
  }}
92
105
  className={className + ' ' + (width === 'xs' ? classes.stickyDialog : '')}
93
106
  fullScreen={fullScreen}
107
+ aria-labelledby={dialogTitleId}
94
108
  {...props}
95
109
  >
96
- <DialogTitle id="alert-dialog-title">
97
- {dialogTitle}
98
- <Icon className={classes.closeIcon} onClick={onCancel}>
99
- close
100
- </Icon>
101
- </DialogTitle>
102
- {children}
110
+ <CustomDialog.DialogHeaderComponent
111
+ dialogTitle={dialogTitle}
112
+ dialogTitleId={dialogTitleId}
113
+ onClose={onCancel}
114
+ />
115
+ <AutoFocusDialogContentContainer open={open}>{children}</AutoFocusDialogContentContainer>
103
116
  </Dialog>
104
117
  );
105
118
  }
106
119
  )
107
120
  );
121
+
122
+ CustomDialog.DialogHeaderComponent = CustomDialogHeader;
123
+
124
+ export default CustomDialog;
@@ -1,9 +0,0 @@
1
- .loginform {
2
- &.hide {
3
- display: none;
4
- }
5
-
6
- .loginform-error {
7
- clear: both;
8
- }
9
- }
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = exports.LoginForm = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _i18n = require("../../../../../Framework/i18n");
9
- require("./Styles.scss");
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
18
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
20
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
26
- var LoginForm = exports.LoginForm = /*#__PURE__*/function (_React$Component) {
27
- _inherits(LoginForm, _React$Component);
28
- var _super = _createSuper(LoginForm);
29
- function LoginForm() {
30
- var _this;
31
- _classCallCheck(this, LoginForm);
32
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
- args[_key] = arguments[_key];
34
- }
35
- _this = _super.call.apply(_super, [this].concat(args));
36
- _defineProperty(_assertThisInitialized(_this), "onLogin", function (e) {
37
- e.preventDefault();
38
- _this.props.onLogin(_this.usernameInput.value, _this.passwordInput.value);
39
- });
40
- return _this;
41
- }
42
- _createClass(LoginForm, [{
43
- key: "componentDidMount",
44
- value: function componentDidMount() {
45
- // catch the click events within the error container
46
- this.errorContainer.addEventListener('click', function (e) {
47
- e.preventDefault();
48
- e.target.href && window.open(e.target.href);
49
- });
50
- }
51
- }, {
52
- key: "render",
53
- value: function render() {
54
- var _this2 = this;
55
- var _this$props = this.props,
56
- show = _this$props.show,
57
- profile = _this$props.profile;
58
- return /*#__PURE__*/_react["default"].createElement("div", {
59
- className: 'loginform' + (show ? ' show' : ' hide')
60
- }, /*#__PURE__*/_react["default"].createElement("div", null, this.t('loginForm.infoText')), /*#__PURE__*/_react["default"].createElement("form", {
61
- onSubmit: this.onLogin
62
- }, /*#__PURE__*/_react["default"].createElement("input", {
63
- type: "text",
64
- ref: function ref(el) {
65
- return _this2.usernameInput = el;
66
- },
67
- placeholder: this.t('loginForm.username')
68
- }), /*#__PURE__*/_react["default"].createElement("input", {
69
- type: "password",
70
- ref: function ref(el) {
71
- return _this2.passwordInput = el;
72
- },
73
- placeholder: this.t('loginForm.password')
74
- }), /*#__PURE__*/_react["default"].createElement("button", {
75
- type: "submit",
76
- className: "primary-button loginform-loginButton"
77
- }, this.t('loginForm.loginButton'))), /*#__PURE__*/_react["default"].createElement("div", {
78
- ref: function ref(el) {
79
- return _this2.errorContainer = el;
80
- }
81
- }, profile.error && /*#__PURE__*/_react["default"].createElement("div", {
82
- className: "loginform-error",
83
- dangerouslySetInnerHTML: {
84
- __html: profile.error instanceof Object ? JSON.stringify(profile.error) : profile.error
85
- }
86
- })));
87
- }
88
- }]);
89
- return LoginForm;
90
- }(_react["default"].Component);
91
- var _default = exports["default"] = (0, _i18n.translateComponent)(LoginForm);
@@ -1,19 +0,0 @@
1
- @media screen {
2
- .savedconfiguration {
3
- display: none;
4
- }
5
- }
6
-
7
- @media print {
8
- .savedconfiguration {
9
- padding-top: 30px;
10
-
11
- .savedconfiguration-code {
12
- font-size: 26px;
13
- font-weight: bold;
14
- }
15
- .savedconfiguration-link {
16
- font-weight: bold;
17
- }
18
- }
19
- }
@@ -1,50 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- require("./Styles.scss");
10
- var _get = _interopRequireDefault(require("lodash/get"));
11
- var _i18n = require("../../../../../Framework/i18n");
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
16
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
18
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
19
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
20
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
22
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
23
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
- var SavedConfiguration = /*#__PURE__*/function (_React$Component) {
27
- _inherits(SavedConfiguration, _React$Component);
28
- var _super = _createSuper(SavedConfiguration);
29
- function SavedConfiguration() {
30
- _classCallCheck(this, SavedConfiguration);
31
- return _super.apply(this, arguments);
32
- }
33
- _createClass(SavedConfiguration, [{
34
- key: "render",
35
- value: function render() {
36
- var savedconfiguration = this.props.savedconfiguration;
37
- var code = (0, _get["default"])(savedconfiguration, 'code', false);
38
- var link = (0, _get["default"])(savedconfiguration, 'shareLink', false);
39
- return /*#__PURE__*/_react["default"].createElement("div", {
40
- className: "savedconfiguration"
41
- }, code && /*#__PURE__*/_react["default"].createElement("div", null, (0, _i18n.T)('savedConfiguration.code'), " ", /*#__PURE__*/_react["default"].createElement("span", {
42
- className: "savedconfiguration-code"
43
- }, code)), link && /*#__PURE__*/_react["default"].createElement("div", null, (0, _i18n.T)('savedConfiguration.sharingLink'), ' ', /*#__PURE__*/_react["default"].createElement("span", {
44
- className: "savedconfiguration-link"
45
- }, link)));
46
- }
47
- }]);
48
- return SavedConfiguration;
49
- }(_react["default"].Component);
50
- var _default = exports["default"] = SavedConfiguration;
@@ -1,23 +0,0 @@
1
- .shareconfiguration {
2
-
3
- .shareconfiguration-link {
4
- padding: 10px 0;
5
- text-align: center;
6
- font-weight: bold;
7
- display: block;
8
- }
9
-
10
- .shareconfiguration-media {
11
- text-align: center;
12
- font-size: 2em;
13
-
14
- a {
15
- padding: 0 15px;
16
- }
17
- }
18
-
19
- .hidden-email-share-iframe {
20
- visibility: hidden;
21
- position: absolute;
22
- }
23
- }