@sis-cc/dotstatsuite-visions 7.17.5 → 7.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,15 @@ import Typography from '@material-ui/core/Typography';
5
5
  import TextareaAutosize from '@material-ui/core/TextareaAutosize';
6
6
  import Grid from '@material-ui/core/Grid';
7
7
  import { makeStyles } from '@material-ui/core/styles';
8
- import { Button } from '../';
8
+ import { Alert, Button } from '../';
9
9
 
10
10
  var useStyles = makeStyles(function (theme) {
11
11
  return {
12
+ error: {
13
+ width: '100%',
14
+ margin: '0px 0px 8px 0px',
15
+ wordBreak: 'break-word'
16
+ },
12
17
  header: {
13
18
  padding: theme.spacing(1, 0),
14
19
  minHeight: 50
@@ -40,6 +45,7 @@ var Query = function Query(_ref) {
40
45
  setCopied = _React$useState2[1];
41
46
 
42
47
  var contentValue = R.pipe(R.find(R.propEq('id', value)), R.prop('value'))(contents);
48
+ var isError = R.pipe(R.find(R.propEq('id', value)), R.propOr(false, 'isError'))(contents);
43
49
 
44
50
  var copyToClipboard = function copyToClipboard() {
45
51
  if (R.has('current')(ref)) {
@@ -115,7 +121,7 @@ var Query = function Query(_ref) {
115
121
  React.createElement(
116
122
  Grid,
117
123
  { item: true, container: true, xs: 12, style: { alignSelf: 'flex-end' }, justifyContent: 'flex-end' },
118
- React.createElement(TextareaAutosize, {
124
+ !isError && React.createElement(TextareaAutosize, {
119
125
  ref: ref,
120
126
  'aria-label': title,
121
127
  className: classes.textarea,
@@ -124,10 +130,16 @@ var Query = function Query(_ref) {
124
130
  readOnly: true,
125
131
  value: contentValue
126
132
  }),
133
+ isError && React.createElement(
134
+ Alert,
135
+ { className: classes.error, severity: 'error', variant: 'filled' },
136
+ contentValue
137
+ ),
127
138
  React.createElement(
128
139
  Button,
129
140
  {
130
141
  'aria-label': labelActionCopy,
142
+ disabled: isError,
131
143
  size: 'small',
132
144
  variant: 'contained',
133
145
  alternative: 'siscc',
@@ -36,6 +36,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
36
36
 
37
37
  var useStyles = (0, _styles.makeStyles)(function (theme) {
38
38
  return {
39
+ error: {
40
+ width: '100%',
41
+ margin: '0px 0px 8px 0px',
42
+ wordBreak: 'break-word'
43
+ },
39
44
  header: {
40
45
  padding: theme.spacing(1, 0),
41
46
  minHeight: 50
@@ -67,6 +72,7 @@ var Query = function Query(_ref) {
67
72
  setCopied = _React$useState2[1];
68
73
 
69
74
  var contentValue = R.pipe(R.find(R.propEq('id', value)), R.prop('value'))(contents);
75
+ var isError = R.pipe(R.find(R.propEq('id', value)), R.propOr(false, 'isError'))(contents);
70
76
 
71
77
  var copyToClipboard = function copyToClipboard() {
72
78
  if (R.has('current')(ref)) {
@@ -142,7 +148,7 @@ var Query = function Query(_ref) {
142
148
  _react2.default.createElement(
143
149
  _Grid2.default,
144
150
  { item: true, container: true, xs: 12, style: { alignSelf: 'flex-end' }, justifyContent: 'flex-end' },
145
- _react2.default.createElement(_TextareaAutosize2.default, {
151
+ !isError && _react2.default.createElement(_TextareaAutosize2.default, {
146
152
  ref: ref,
147
153
  'aria-label': title,
148
154
  className: classes.textarea,
@@ -151,10 +157,16 @@ var Query = function Query(_ref) {
151
157
  readOnly: true,
152
158
  value: contentValue
153
159
  }),
160
+ isError && _react2.default.createElement(
161
+ _.Alert,
162
+ { className: classes.error, severity: 'error', variant: 'filled' },
163
+ contentValue
164
+ ),
154
165
  _react2.default.createElement(
155
166
  _.Button,
156
167
  {
157
168
  'aria-label': labelActionCopy,
169
+ disabled: isError,
158
170
  size: 'small',
159
171
  variant: 'contained',
160
172
  alternative: 'siscc',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "7.17.5",
3
+ "version": "7.17.6",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",