@ebubekirylmaz/link-test 1.2.44 → 1.2.46

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 (121) hide show
  1. package/package.json +13 -6
  2. package/src/Platform.jsx +14 -15
  3. package/src/assets/illustrations/avatar-shape.jsx +6 -7
  4. package/src/assets/illustrations/booking-illustration.jsx +4 -14
  5. package/src/assets/illustrations/check-in-illustration.jsx +4 -10
  6. package/src/assets/illustrations/check-out-illustration.jsx +4 -3
  7. package/src/assets/illustrations/coming-soon-illustration.jsx +4 -17
  8. package/src/assets/illustrations/forbidden-illustration.jsx +4 -12
  9. package/src/assets/illustrations/maintenance-illustration.jsx +4 -24
  10. package/src/assets/illustrations/motivation-illustration.jsx +4 -9
  11. package/src/assets/illustrations/order-complete-illustration.jsx +4 -12
  12. package/src/assets/illustrations/page-not-found-illustration.jsx +4 -9
  13. package/src/assets/illustrations/seo-illustration.jsx +4 -16
  14. package/src/assets/illustrations/sever-error-illustration.jsx +4 -21
  15. package/src/assets/illustrations/upgrade-storage-illustration.jsx +4 -20
  16. package/src/assets/illustrations/upload-illustration.jsx +4 -81
  17. package/src/components/NucleoidLoginForm/NucleoidLoginForm.jsx +1 -0
  18. package/src/components/TopNavBar/TopNavBar.jsx +6 -2
  19. package/src/components/file-thumbnail/file-thumbnail.jsx +5 -6
  20. package/src/components/nav-section/horizontal/nav-section-horizontal.jsx +5 -6
  21. package/src/components/settings/drawer/layout-options.jsx +5 -4
  22. package/src/components/settings/drawer/presets-options.jsx +6 -5
  23. package/src/components/settings/drawer/settings-drawer.jsx +7 -4
  24. package/src/components/settings/drawer/stretch-options.jsx +5 -5
  25. package/src/config/schemas.js +1 -0
  26. package/src/context/Context.js +98 -0
  27. package/src/context/reducer.js +590 -10
  28. package/src/hooks/index.js +2 -1
  29. package/src/hooks/use-beta.js +8 -0
  30. package/src/layouts/DashboardLayout/header.jsx +5 -4
  31. package/src/layouts/DashboardLayout/nav-mini.jsx +5 -7
  32. package/src/layouts/DashboardLayout/nav-vertical.jsx +11 -11
  33. package/src/layouts/FullScreenLayout/FullScreenLayout.jsx +5 -1
  34. package/src/layouts/FullScreenLayout/nav-vertical.jsx +11 -11
  35. package/src/layouts/MainLayout/footer.jsx +7 -7
  36. package/src/layouts/MainLayout/header.jsx +3 -2
  37. package/src/layouts/MainLayout/nav/desktop/nav-list.jsx +8 -8
  38. package/src/layouts/MainLayout/nav/mobile/index.jsx +7 -6
  39. package/src/layouts/auth/classic.jsx +6 -6
  40. package/src/layouts/auth/modern.jsx +7 -6
  41. package/src/layouts/common/ProjectBar/index.jsx +13 -11
  42. package/src/layouts/common/account-popover.jsx +1 -2
  43. package/src/layouts/common/header-sim.jsx +3 -2
  44. package/src/layouts/common/header-simple.jsx +6 -3
  45. package/src/layouts/common/notifications-popover/index.jsx +18 -13
  46. package/src/layouts/common/notifications-popover/notification-item.jsx +28 -16
  47. package/src/lib/APIDialogAction/APIDialogAction.jsx +109 -0
  48. package/src/lib/APIDialogAction/index.js +1 -0
  49. package/src/lib/APIDialogAction/styles.js +6 -0
  50. package/src/lib/APIParams/APIParams.jsx +57 -0
  51. package/src/lib/APIParams/index.js +1 -0
  52. package/src/lib/APIPath/APIPath.jsx +82 -0
  53. package/src/lib/APIPath/index.js +1 -0
  54. package/src/lib/APIPath/styles.js +19 -0
  55. package/src/lib/APITree/APITree.jsx +411 -0
  56. package/src/lib/APITree/Arrow.jsx +21 -0
  57. package/src/lib/APITree/DeleteMethodDialog.jsx +41 -0
  58. package/src/lib/APITree/index.js +1 -0
  59. package/src/lib/APITree/styles.js +19 -0
  60. package/src/lib/APITypes/APITypes.jsx +141 -0
  61. package/src/lib/APITypes/TypeEditor.jsx +46 -0
  62. package/src/lib/APITypes/TypeList.jsx +180 -0
  63. package/src/lib/APITypes/index.js +1 -0
  64. package/src/lib/AddItemWizard/AddItemWizard.jsx +21 -10
  65. package/src/lib/BlankTreeMessage/BlankTreeMessage.jsx +39 -0
  66. package/src/lib/BlankTreeMessage/index.js +1 -0
  67. package/src/lib/CustomBreadcrumbs/CustomBreadcrumbs.jsx +3 -2
  68. package/src/lib/DialogTootip/DialogTooltip.jsx +67 -0
  69. package/src/lib/DialogTootip/index.js +1 -0
  70. package/src/lib/DialogTootip/styles.js +9 -0
  71. package/src/lib/Flow/connectors/DynamicConnector.jsx +179 -107
  72. package/src/lib/Flow/core/Flow.jsx +2 -0
  73. package/src/lib/Flow/core/FlowNode.jsx +2 -0
  74. package/src/lib/Flow/core/FlowViewport.jsx +41 -9
  75. package/src/lib/Flow/hooks/useNodeStyle.js +14 -0
  76. package/src/lib/Flow/layouts/CardLayout.jsx +4 -3
  77. package/src/lib/Flow/nodes/DefaultCard.jsx +6 -8
  78. package/src/lib/Flow/nodes/FlowNodeView.jsx +105 -21
  79. package/src/lib/Flow/styles.js +4 -0
  80. package/src/lib/IconSelector/IconSelector.jsx +5 -1
  81. package/src/lib/ItemSummary/ItemSummary.jsx +11 -6
  82. package/src/lib/ItemSummary/ItemsSummary.jsx +38 -26
  83. package/src/lib/NewApiBody/NewAPIBody.jsx +97 -0
  84. package/src/lib/NewApiBody/ParamView.jsx +38 -0
  85. package/src/lib/NucDialog/NucDialog.jsx +108 -0
  86. package/src/lib/NucDialog/index.js +1 -0
  87. package/src/lib/ParamTable/ParamTable.jsx +133 -0
  88. package/src/lib/ParamTable/TypeMenu.jsx +102 -0
  89. package/src/lib/ParamTable/defaults.js +47 -0
  90. package/src/lib/ParamTable/index.js +1 -0
  91. package/src/lib/ParamTable/styles.js +12 -0
  92. package/src/lib/ResourceMenu/AlertMassage.jsx +28 -0
  93. package/src/lib/ResourceMenu/DeleteResourceDialog.jsx +60 -0
  94. package/src/lib/ResourceMenu/ResourceMenu.jsx +158 -0
  95. package/src/lib/ResourceMenu/index.js +1 -0
  96. package/src/lib/ResourceMenu/styles.js +5 -0
  97. package/src/lib/Schema/Schema.jsx +204 -0
  98. package/src/lib/Schema/index.js +1 -0
  99. package/src/lib/SchemaEditor/SchemaEditor.jsx +258 -0
  100. package/src/lib/SchemaEditor/SchemaEditor.test.js +193 -0
  101. package/src/lib/SchemaEditor/SchemaPropertyEditor.jsx +135 -0
  102. package/src/lib/SchemaEditor/SchemaUtils.js +152 -0
  103. package/src/lib/SchemaEditor/index.js +1 -0
  104. package/src/lib/SparkleInput/SparkleInput.jsx +31 -28
  105. package/src/lib/TableSelectedAction/TableSelectedAction.jsx +7 -8
  106. package/src/lib/ToggleableMenu/ToggleableMenu.jsx +35 -0
  107. package/src/lib/ToggleableMenu/index.js +1 -0
  108. package/src/lib/index.js +14 -0
  109. package/src/pages/Callback.jsx +6 -8
  110. package/src/pages/ConfigError.jsx +3 -1
  111. package/src/pages/LoginPage.jsx +3 -12
  112. package/src/stories/APITree.stories.jsx +429 -0
  113. package/src/stories/FlowChart.stories.jsx +1 -1
  114. package/src/templates/ActionTemplate.js +24 -0
  115. package/src/theme/overrides/default-props.jsx +17 -11
  116. package/src/widgets/Login/CognitoLogin.jsx +165 -173
  117. package/src/widgets/Login/DemoLogin.jsx +43 -38
  118. package/src/widgets/Login/amplifyAuth.js +6 -6
  119. package/src/widgets/Login/amplifyConfig.js +3 -0
  120. package/src/widgets/LoginForm/LoginForm.jsx +8 -3
  121. package/src/widgets/SettingsDialog.jsx +206 -16
@@ -0,0 +1,152 @@
1
+ import { v4 as uuidv4 } from "uuid";
2
+
3
+ export const getTypeStyle = (type) => {
4
+ return {
5
+ fontWeight: "normal",
6
+ color: getTypeColor(type),
7
+ marginLeft: "auto",
8
+ };
9
+ };
10
+
11
+ const getTypeColor = (type) => {
12
+ switch (type) {
13
+ case "object":
14
+ return "red";
15
+ case "string":
16
+ return "green";
17
+ case "integer":
18
+ return "blue";
19
+
20
+ default:
21
+ return "black";
22
+ }
23
+ };
24
+
25
+ export const addProperty = (parentId = null, setSchemaData) => {
26
+ const addPropertyToNode = (node, parentId) => {
27
+ if (node.id === parentId) {
28
+ const propertyCount = node.properties ? node.properties.length : 0;
29
+ const newName = propertyCount === 0 ? "id" : `prop${propertyCount + 1}`;
30
+ const newType = "string";
31
+
32
+ const newProperty = {
33
+ name: newName,
34
+ type: newType,
35
+ id: uuidv4(),
36
+ };
37
+
38
+ const updatedProperties = node.properties
39
+ ? [...node.properties, newProperty]
40
+ : [newProperty];
41
+
42
+ return { ...node, properties: updatedProperties };
43
+ } else if (node.properties) {
44
+ const updatedProperties = node.properties.map((childNode) =>
45
+ addPropertyToNode(childNode, parentId)
46
+ );
47
+ return { ...node, properties: updatedProperties };
48
+ }
49
+ return node;
50
+ };
51
+
52
+ setSchemaData((currentData) => {
53
+ if (!parentId) {
54
+ const propertyCount = currentData.properties
55
+ ? currentData.properties.length
56
+ : 0;
57
+ const newName = propertyCount === 0 ? "id" : `prop${propertyCount + 1}`;
58
+ const newType = "string";
59
+
60
+ const newProperty = {
61
+ name: newName,
62
+ type: newType,
63
+ id: uuidv4(),
64
+ };
65
+
66
+ const updatedProperties = currentData.properties
67
+ ? [...currentData.properties, newProperty]
68
+ : [newProperty];
69
+
70
+ return {
71
+ ...currentData,
72
+ properties: updatedProperties,
73
+ };
74
+ } else {
75
+ return addPropertyToNode(currentData, parentId);
76
+ }
77
+ });
78
+ };
79
+
80
+ export const removeProperty = (propertyId, setSchemaData) => {
81
+ const removePropertyFromNode = (node, propertyId) => {
82
+ if (node.id === propertyId) {
83
+ return null;
84
+ }
85
+ if (node.properties) {
86
+ const updatedProperties = node.properties
87
+ .map((childNode) => removePropertyFromNode(childNode, propertyId))
88
+ .filter((childNode) => childNode !== null);
89
+
90
+ return { ...node, properties: updatedProperties };
91
+ }
92
+ return node;
93
+ };
94
+ setSchemaData((currentData) => {
95
+ const updatedProperties = currentData.properties
96
+ .map((node) => removePropertyFromNode(node, propertyId))
97
+ .filter((node) => node !== null);
98
+ const updatedData = { ...currentData, properties: updatedProperties };
99
+
100
+ return updatedData;
101
+ });
102
+ };
103
+ export const changeProperty = (propertyId, changes, setSchemaData) => {
104
+ const updateProperty = (node, propertyId, changes) => {
105
+ if (node.id === propertyId || propertyId === "1") {
106
+ const updatedNode = {
107
+ ...node,
108
+ name: changes.name,
109
+ type: changes.type,
110
+ };
111
+
112
+ if (changes.type === "object") {
113
+ if (!updatedNode.properties || updatedNode.properties.length === 0) {
114
+ updatedNode.properties = [
115
+ {
116
+ name: "id",
117
+ type: "string",
118
+ id: uuidv4(),
119
+ },
120
+ ];
121
+ }
122
+ } else if (changes.type === "array") {
123
+ if (!updatedNode.properties || updatedNode.properties.length === 0) {
124
+ updatedNode.properties = [
125
+ {
126
+ name: "item",
127
+ type: "string",
128
+ id: uuidv4(),
129
+ },
130
+ ];
131
+ } else {
132
+ updatedNode.properties = updatedNode.properties.slice(0, 1);
133
+ }
134
+ } else if (changes.type !== "object" && changes.type !== "array") {
135
+ delete updatedNode.properties;
136
+ }
137
+ return updatedNode;
138
+ }
139
+
140
+ if (node.properties) {
141
+ const updatedProperties = node.properties.map((childNode) =>
142
+ updateProperty(childNode, propertyId, changes)
143
+ );
144
+ return { ...node, properties: updatedProperties };
145
+ }
146
+ return node;
147
+ };
148
+
149
+ setSchemaData((currentData) => {
150
+ return updateProperty(currentData, propertyId, changes);
151
+ });
152
+ };
@@ -0,0 +1 @@
1
+ export { default } from "./SchemaEditor";
@@ -11,41 +11,44 @@ export default function SparkleInput({
11
11
  }) {
12
12
  return (
13
13
  <TextField
14
- inputProps={{
15
- "data-cy": prop,
16
- }}
17
14
  autoFocus
18
15
  margin="dense"
19
16
  label={prop}
20
17
  fullWidth={true}
21
18
  value={value || ""}
22
19
  onChange={onChange}
23
- InputLabelProps={{
24
- sx: { color: (theme) => theme.palette.text.primary },
25
- }}
26
- InputProps={{
27
- endAdornment: sparkle && (
28
- <InputAdornment position="end">
29
- <IconButton>
30
- <SvgIcon>
31
- <svg
32
- xmlns="http://www.w3.org/2000/svg"
33
- width="20"
34
- height="20"
35
- viewBox="0 0 20 20"
36
- >
37
- <path
38
- fill="white"
39
- d="M7.398 12.809a1.042 1.042 0 0 0 1.204-.003c.178-.13.313-.31.387-.518l.447-1.373a2.336 2.336 0 0 1 1.477-1.479l1.391-.45a1.045 1.045 0 0 0-.044-1.98l-1.375-.448a2.335 2.335 0 0 1-1.48-1.477l-.452-1.388a1.044 1.044 0 0 0-1.973.017l-.457 1.4a2.336 2.336 0 0 1-1.44 1.45l-1.39.447a1.045 1.045 0 0 0 .016 1.974l1.374.445a2.333 2.333 0 0 1 1.481 1.488l.452 1.391c.072.204.206.38.382.504m.085-7.415l.527-1.377l.44 1.377a3.331 3.331 0 0 0 2.117 2.114l1.406.53l-1.382.447a3.344 3.344 0 0 0-2.115 2.117l-.523 1.378l-.449-1.379a3.336 3.336 0 0 0-.8-1.31a3.373 3.373 0 0 0-1.312-.812l-1.378-.522l1.386-.45a3.358 3.358 0 0 0 1.29-.813a3.4 3.4 0 0 0 .793-1.3m6.052 11.457a.806.806 0 0 0 1.226-.398l.248-.762a1.09 1.09 0 0 1 .26-.42c.118-.12.262-.208.42-.26l.772-.252a.8.8 0 0 0-.023-1.52l-.764-.25a1.075 1.075 0 0 1-.68-.678l-.252-.773a.8.8 0 0 0-1.518.01l-.247.762a1.068 1.068 0 0 1-.665.679l-.773.252a.8.8 0 0 0 .008 1.518l.763.247c.16.054.304.143.422.261c.119.119.207.263.258.422l.253.774a.8.8 0 0 0 .292.388m-.913-2.793L12.443 14l.184-.064a2.11 2.11 0 0 0 1.3-1.317l.058-.178l.06.181a2.078 2.078 0 0 0 1.316 1.316l.195.063l-.18.06a2.076 2.076 0 0 0-1.317 1.32l-.059.181l-.058-.18a2.075 2.075 0 0 0-1.32-1.323"
40
- />
41
- </svg>
42
- </SvgIcon>
43
- </IconButton>
44
- </InputAdornment>
45
- ),
46
- }}
47
20
  sx={{ textTransform: "capitalize" }}
48
21
  {...others}
49
- />
22
+ slotProps={{
23
+ input: {
24
+ endAdornment: sparkle && (
25
+ <InputAdornment position="end">
26
+ <IconButton>
27
+ <SvgIcon>
28
+ <svg
29
+ xmlns="http://www.w3.org/2000/svg"
30
+ width="20"
31
+ height="20"
32
+ viewBox="0 0 20 20"
33
+ >
34
+ <path
35
+ fill="white"
36
+ d="M7.398 12.809a1.042 1.042 0 0 0 1.204-.003c.178-.13.313-.31.387-.518l.447-1.373a2.336 2.336 0 0 1 1.477-1.479l1.391-.45a1.045 1.045 0 0 0-.044-1.98l-1.375-.448a2.335 2.335 0 0 1-1.48-1.477l-.452-1.388a1.044 1.044 0 0 0-1.973.017l-.457 1.4a2.336 2.336 0 0 1-1.44 1.45l-1.39.447a1.045 1.045 0 0 0 .016 1.974l1.374.445a2.333 2.333 0 0 1 1.481 1.488l.452 1.391c.072.204.206.38.382.504m.085-7.415l.527-1.377l.44 1.377a3.331 3.331 0 0 0 2.117 2.114l1.406.53l-1.382.447a3.344 3.344 0 0 0-2.115 2.117l-.523 1.378l-.449-1.379a3.336 3.336 0 0 0-.8-1.31a3.373 3.373 0 0 0-1.312-.812l-1.378-.522l1.386-.45a3.358 3.358 0 0 0 1.29-.813a3.4 3.4 0 0 0 .793-1.3m6.052 11.457a.806.806 0 0 0 1.226-.398l.248-.762a1.09 1.09 0 0 1 .26-.42c.118-.12.262-.208.42-.26l.772-.252a.8.8 0 0 0-.023-1.52l-.764-.25a1.075 1.075 0 0 1-.68-.678l-.252-.773a.8.8 0 0 0-1.518.01l-.247.762a1.068 1.068 0 0 1-.665.679l-.773.252a.8.8 0 0 0 .008 1.518l.763.247c.16.054.304.143.422.261c.119.119.207.263.258.422l.253.774a.8.8 0 0 0 .292.388m-.913-2.793L12.443 14l.184-.064a2.11 2.11 0 0 0 1.3-1.317l.058-.178l.06.181a2.078 2.078 0 0 0 1.316 1.316l.195.063l-.18.06a2.076 2.076 0 0 0-1.317 1.32l-.059.181l-.058-.18a2.075 2.075 0 0 0-1.32-1.323"
37
+ />
38
+ </svg>
39
+ </SvgIcon>
40
+ </IconButton>
41
+ </InputAdornment>
42
+ ),
43
+ },
44
+
45
+ htmlInput: {
46
+ "data-cy": prop,
47
+ },
48
+
49
+ inputLabel: {
50
+ sx: { color: (theme) => theme.palette.text.primary },
51
+ }
52
+ }} />
50
53
  );
51
54
  }
@@ -19,8 +19,9 @@ export default function TableSelectedAction({
19
19
  return (
20
20
  <Stack
21
21
  direction="row"
22
- alignItems="center"
23
- sx={{
22
+ {...other}
23
+ sx={[{
24
+ alignItems: "center",
24
25
  pl: 1,
25
26
  pr: 2,
26
27
  top: 0,
@@ -30,19 +31,18 @@ export default function TableSelectedAction({
30
31
  height: 58,
31
32
  position: "absolute",
32
33
  bgcolor: "primary.lighter",
34
+
33
35
  ...(dense && {
34
36
  height: 38,
35
37
  }),
36
- ...sx,
37
- }}
38
- {...other}
39
- >
38
+
39
+ ...sx
40
+ }, ...(Array.isArray(other.sx) ? other.sx : [other.sx])]}>
40
41
  <Checkbox
41
42
  indeterminate={!!numSelected && numSelected < rowCount}
42
43
  checked={!!rowCount && numSelected === rowCount}
43
44
  onChange={(event) => onSelectAllRows(event.target.checked)}
44
45
  />
45
-
46
46
  <Typography
47
47
  variant="subtitle2"
48
48
  sx={{
@@ -56,7 +56,6 @@ export default function TableSelectedAction({
56
56
  >
57
57
  {numSelected} selected
58
58
  </Typography>
59
-
60
59
  {action && action}
61
60
  </Stack>
62
61
  );
@@ -0,0 +1,35 @@
1
+ import { Box, ClickAwayListener, IconButton } from "@mui/material";
2
+ import React, { useState } from "react";
3
+
4
+ function ToggleableMenu({ defaultIcon, children }) {
5
+ const [isOpen, setIsOpen] = useState(false);
6
+
7
+ const handleDefaultIconClick = (event) => {
8
+ event.stopPropagation();
9
+ setIsOpen(!isOpen);
10
+ };
11
+
12
+ const handleClose = () => {
13
+ setIsOpen(false);
14
+ };
15
+
16
+ const handleMenuItemClick = (event) => {
17
+ event.stopPropagation();
18
+ };
19
+
20
+ return (
21
+ <ClickAwayListener onClickAway={handleClose}>
22
+ <Box>
23
+ {isOpen ? (
24
+ <Box onClick={handleMenuItemClick}>{children}</Box>
25
+ ) : (
26
+ <IconButton size="small" onClick={handleDefaultIconClick}>
27
+ {defaultIcon}
28
+ </IconButton>
29
+ )}
30
+ </Box>
31
+ </ClickAwayListener>
32
+ );
33
+ }
34
+
35
+ export default ToggleableMenu;
@@ -0,0 +1 @@
1
+ export { default } from "./ToggleableMenu";
package/src/lib/index.js CHANGED
@@ -34,3 +34,17 @@ export {
34
34
  export { default as ActionNode } from "./Flow/layouts/ActionNode";
35
35
 
36
36
  export { default as InfoNode } from "./Flow/layouts/InfoNode";
37
+
38
+ export { default as APITree, compile as compileAPITree } from "./APITree";
39
+ export { default as APIDialogAction } from "./APIDialogAction";
40
+ export { default as APIParams } from "./APIParams";
41
+ export { default as APIPath } from "./APIPath";
42
+ export { default as APITypes } from "./APITypes";
43
+ export { default as BlankTreeMessage } from "./BlankTreeMessage";
44
+ export { default as DialogTooltip } from "./DialogTootip";
45
+ export { default as NucDialog } from "./NucDialog";
46
+ export { default as ParamTable } from "./ParamTable";
47
+ export { default as ResourceMenu } from "./ResourceMenu";
48
+ export { default as Schema } from "./Schema";
49
+ export { default as SchemaEditor } from "./SchemaEditor";
50
+ export { default as ToggleableMenu } from "./ToggleableMenu";
@@ -2,9 +2,9 @@ import Page from "../layouts/Page";
2
2
  import React from "react";
3
3
  import config from "../config/config";
4
4
  import oauth from "../http/oauth";
5
+ import { publish } from "@nucleoidai/react-event";
5
6
  import qs from "qs";
6
7
  import { storage } from "@nucleoidjs/webstorage";
7
- import { useContext } from "../ContextProvider/ContextProvider";
8
8
  import { useLocation } from "react-router-dom";
9
9
  import { useNavigate } from "react-router-dom";
10
10
 
@@ -15,7 +15,6 @@ function Callback() {
15
15
  const projectBar = config().template?.projectBar;
16
16
 
17
17
  const { google, github, linkedin } = appConfig;
18
- const [, dispatch] = useContext();
19
18
  const location = useLocation();
20
19
  const navigate = useNavigate();
21
20
  const hasProcessed = useRef(false);
@@ -33,7 +32,7 @@ function Callback() {
33
32
 
34
33
  if (state) {
35
34
  stateData = JSON.parse(decodeURIComponent(state));
36
- identityProvider = stateData.identityProvider;
35
+ identityProvider = stateData.identityProvider.toUpperCase();
37
36
  }
38
37
 
39
38
  if (error) {
@@ -54,9 +53,9 @@ function Callback() {
54
53
  hasProcessed.current = true;
55
54
 
56
55
  const providerConfigs = {
57
- github,
58
- linkedin,
59
- google,
56
+ GITHUB: github,
57
+ LINKEDIN: linkedin,
58
+ GOOGLE: google,
60
59
  };
61
60
 
62
61
  const providerConfig = providerConfigs[identityProvider];
@@ -91,14 +90,13 @@ function Callback() {
91
90
  .then(({ data }) => {
92
91
  const accessToken = data.accessToken;
93
92
  const refreshToken = data.refreshToken;
94
- const userInfo = data.user;
95
93
 
96
94
  storage.set("link", "accessToken", accessToken);
97
95
  storage.set("link", "refreshToken", refreshToken);
98
96
  // TODO - update provider info
99
97
  storage.set("link", "identityProvider", identityProvider);
100
98
 
101
- dispatch({ type: "LOGIN", payload: { user: userInfo } });
99
+ publish("LOGIN", { data: data });
102
100
 
103
101
  window.history.replaceState(
104
102
  {},
@@ -20,7 +20,9 @@ const ConfigErrorDialog = () => {
20
20
  return (
21
21
  <Dialog fullWidth open>
22
22
  <DialogTitle>
23
- <Stack direction="row" alignItems="center">
23
+ <Stack direction="row" sx={{
24
+ alignItems: "center"
25
+ }}>
24
26
  <Box
25
27
  component="span"
26
28
  sx={{ display: "flex", alignItems: "center", mr: 1 }}
@@ -30,20 +30,11 @@ function LoginPage() {
30
30
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
31
  }, [navigate]);
32
32
 
33
- if (credentials?.provider === "COGNITO") {
34
- return <CognitoLogin />;
35
- }
36
-
37
- if (credentials?.provider === "DEMO") {
38
- return (
39
- <Page title={`Sign in to ${name}`}>
40
- <DemoLogin />
41
- </Page>
42
- );
43
- }
44
-
45
33
  return (
46
34
  <Page title={`Sign in to ${name}`}>
35
+ {credentials?.provider === "COGNITO" && <CognitoLogin />}
36
+ {credentials?.provider === "DEMO" && <DemoLogin />}
37
+
47
38
  <LoginForm icon={template.login.icon} name={name} formColor={formColor} />
48
39
  </Page>
49
40
  );