authscape 1.0.338 → 1.0.342

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/index.js CHANGED
@@ -2257,7 +2257,7 @@ function OEMEditor(_ref) {
2257
2257
  var monaco = (0, _react2.useMonaco)();
2258
2258
  var cssEditorRef = (0, _react.useRef)(null);
2259
2259
  var htmlEditorRef = (0, _react.useRef)(null);
2260
- var _useState = (0, _react.useState)(''),
2260
+ var _useState = (0, _react.useState)(null),
2261
2261
  _useState2 = _slicedToArray(_useState, 2),
2262
2262
  data = _useState2[0],
2263
2263
  setData = _useState2[1];
@@ -2333,10 +2333,9 @@ function OEMEditor(_ref) {
2333
2333
  };
2334
2334
  }();
2335
2335
  (0, _react.useEffect)(function () {
2336
- // if (oEMDomain != null)
2337
- // {
2338
- loadDNSFields(oEMDomain);
2339
- // }
2336
+ if (oEMDomain != null) {
2337
+ loadDNSFields(oEMDomain);
2338
+ }
2340
2339
  }, [oEMDomain]);
2341
2340
  (0, _react.useEffect)(function () {
2342
2341
  if (loadedUser) {
@@ -2353,26 +2352,26 @@ function OEMEditor(_ref) {
2353
2352
  if (response != null && response.status == 200) {
2354
2353
  setFonts(response.data);
2355
2354
  }
2356
- _context2.next = 6;
2357
- return loadDNSFields();
2358
- case 6:
2359
2355
  if (!showAllDomains) {
2360
- _context2.next = 13;
2356
+ _context2.next = 11;
2361
2357
  break;
2362
2358
  }
2363
- _context2.next = 9;
2359
+ _context2.next = 7;
2364
2360
  return apiService().get("/WhiteLabel/GetAllDomains");
2365
- case 9:
2361
+ case 7:
2366
2362
  _response = _context2.sent;
2367
2363
  if (_response != null && _response.status == 200) {
2368
2364
  setOEMDomainList(_response.data);
2365
+ if (_response.data.length > 0) {
2366
+ setOEMDomain(_response.data[0].name);
2367
+ }
2369
2368
  }
2370
- _context2.next = 17;
2371
- break;
2372
- case 13:
2373
2369
  _context2.next = 15;
2370
+ break;
2371
+ case 11:
2372
+ _context2.next = 13;
2374
2373
  return apiService().get("/WhiteLabel/GetAllDomainsUser");
2375
- case 15:
2374
+ case 13:
2376
2375
  _response2 = _context2.sent;
2377
2376
  if (_response2 != null && _response2.status == 200) {
2378
2377
  setOEMDomainList(_response2.data);
@@ -2380,7 +2379,7 @@ function OEMEditor(_ref) {
2380
2379
  setOEMDomain(_response2.data[0].name);
2381
2380
  }
2382
2381
  }
2383
- case 17:
2382
+ case 15:
2384
2383
  case "end":
2385
2384
  return _context2.stop();
2386
2385
  }
@@ -2469,11 +2468,11 @@ function OEMEditor(_ref) {
2469
2468
  }, selectedFont != null && fontUri == null && /*#__PURE__*/_react["default"].createElement("link", {
2470
2469
  href: "https://fonts.googleapis.com/css2?family=" + selectedFont,
2471
2470
  rel: "stylesheet"
2472
- }), oEMDomain != null && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
2471
+ }), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
2473
2472
  sx: {
2474
2473
  paddingTop: 6
2475
2474
  }
2476
- }, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
2475
+ }, oEMDomain != null && /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
2477
2476
  fullWidth: true
2478
2477
  }, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
2479
2478
  id: "demo-simple-select-label"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.338",
3
+ "version": "1.0.342",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,7 +25,7 @@ export function OEMEditor({loadedUser, notification, showAllDomains = false, com
25
25
  const cssEditorRef = useRef(null);
26
26
  const htmlEditorRef = useRef(null);
27
27
 
28
- const [data, setData] = useState('');
28
+ const [data, setData] = useState(null);
29
29
  const [value, setValue] = useState(0);
30
30
  const [fonts, setFonts] = useState([]);
31
31
  const [oEMDomainList, setOEMDomainList] = useState([]);
@@ -66,10 +66,10 @@ export function OEMEditor({loadedUser, notification, showAllDomains = false, com
66
66
 
67
67
  useEffect(() => {
68
68
 
69
- // if (oEMDomain != null)
70
- // {
69
+ if (oEMDomain != null)
70
+ {
71
71
  loadDNSFields(oEMDomain);
72
- // }
72
+ }
73
73
 
74
74
  }, [oEMDomain]);
75
75
 
@@ -86,14 +86,17 @@ export function OEMEditor({loadedUser, notification, showAllDomains = false, com
86
86
  setFonts(response.data);
87
87
  }
88
88
 
89
- await loadDNSFields();
90
-
91
89
  if (showAllDomains)
92
90
  {
93
91
  let response = await apiService().get("/WhiteLabel/GetAllDomains");
94
92
  if (response != null && response.status == 200)
95
93
  {
96
94
  setOEMDomainList(response.data);
95
+
96
+ if (response.data.length > 0)
97
+ {
98
+ setOEMDomain(response.data[0].name);
99
+ }
97
100
  }
98
101
  }
99
102
  else
@@ -183,8 +186,8 @@ export function OEMEditor({loadedUser, notification, showAllDomains = false, com
183
186
  <link href={"https://fonts.googleapis.com/css2?family=" + selectedFont} rel="stylesheet"></link>
184
187
  }
185
188
 
186
- {oEMDomain != null &&
187
189
  <Box sx={{paddingTop:6}}>
190
+ {oEMDomain != null &&
188
191
  <FormControl fullWidth>
189
192
  <InputLabel id="demo-simple-select-label">Website Domain</InputLabel>
190
193
  <Select
@@ -202,8 +205,8 @@ export function OEMEditor({loadedUser, notification, showAllDomains = false, com
202
205
  })}
203
206
  </Select>
204
207
  </FormControl>
208
+ }
205
209
  </Box>
206
- }
207
210
 
208
211
  <Box sx={{ borderBottom: 1, borderColor: 'divider', paddingTop:2 }}>
209
212
  <Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
@@ -239,33 +242,29 @@ export function OEMEditor({loadedUser, notification, showAllDomains = false, com
239
242
  </Box>
240
243
 
241
244
  {dnsFields != null && dnsFields.map((dnsField, index) => {
242
-
243
- return (
244
- <Box key={index}>
245
- <Grid container spacing={2}>
246
- <Grid item xs={3}>
247
- {dnsField.name}
248
- </Grid>
249
- <Grid item xs={9}>
250
-
251
- <ColorPicker name={dnsField.name} defaultColor={dnsField.value} onColorChanged={async (name, hex) => {
252
-
253
- await apiService().post("/WhiteLabel/SetFieldValue", {
254
- id: dnsField.id,
255
- fieldId: dnsField.fieldId,
256
- value: hex
257
- });
245
+ return (
246
+ <Box key={index}>
247
+ <Grid container spacing={2}>
248
+ <Grid item xs={3}>
249
+ {dnsField.name}
250
+ </Grid>
251
+ <Grid item xs={9}>
252
+
253
+ <ColorPicker name={dnsField.name} defaultColor={dnsField.value} onColorChanged={async (name, hex) => {
254
+
255
+ await apiService().post("/WhiteLabel/SetFieldValue", {
256
+ id: dnsField.id,
257
+ fieldId: dnsField.fieldId,
258
+ value: hex
259
+ });
258
260
 
259
- notification(dnsField.name + " Saved");
261
+ notification(dnsField.name + " Saved");
260
262
 
261
- }} />
263
+ }} />
264
+ </Grid>
262
265
  </Grid>
263
- </Grid>
264
- </Box>
265
- )
266
-
267
-
268
-
266
+ </Box>
267
+ )
269
268
  })}
270
269
  </Box>
271
270
  }