@evenicanpm/admin-integrate 1.1.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 (79) hide show
  1. package/README.md +29 -0
  2. package/documents/ProcessExecution/fragments.ts +16 -0
  3. package/documents/ProcessExecution/list.ts +31 -0
  4. package/package.json +19 -0
  5. package/src/api/dashboard/queries/get-process-executions.query.ts +48 -0
  6. package/src/api/dashboard/queries/get-process-executions.server.ts +11 -0
  7. package/src/api/dashboard/queries/index.ts +1 -0
  8. package/src/auth/.keep +0 -0
  9. package/src/auth/types/.keep +0 -0
  10. package/src/components/breadcrumbs/breadcrumbs.tsx +42 -0
  11. package/src/components/breadcrumbs/index.ts +2 -0
  12. package/src/components/button/index.ts +1 -0
  13. package/src/components/button/outlined-icon-button.tsx +47 -0
  14. package/src/components/core/index.ts +1 -0
  15. package/src/components/core/loading.tsx +15 -0
  16. package/src/components/dashboard-list/dashboard-list-row.tsx +145 -0
  17. package/src/components/dashboard-list/dashboard-list.tsx +157 -0
  18. package/src/components/dashboard-list/index.ts +1 -0
  19. package/src/components/data-table/index.ts +3 -0
  20. package/src/components/data-table/table-header.tsx +109 -0
  21. package/src/components/data-table/table-pagination.tsx +36 -0
  22. package/src/components/data-table/table-row.tsx +27 -0
  23. package/src/components/data-table/table-skeleton.tsx +45 -0
  24. package/src/components/execution/execution-filter.ts +30 -0
  25. package/src/components/execution/execution-status-icon.tsx +30 -0
  26. package/src/components/execution/execution-tag.tsx +100 -0
  27. package/src/components/execution/index.ts +2 -0
  28. package/src/components/footer/footer.tsx +55 -0
  29. package/src/components/footer/index.ts +1 -0
  30. package/src/components/header/dashboard-list-header.tsx +88 -0
  31. package/src/components/header/execution-details-header.tsx +154 -0
  32. package/src/components/header/header.tsx +42 -0
  33. package/src/components/header/index.ts +3 -0
  34. package/src/components/icons/up-down.tsx +21 -0
  35. package/src/components/integration-view/edges/default-edge.tsx +23 -0
  36. package/src/components/integration-view/elk-layout-options.ts +39 -0
  37. package/src/components/integration-view/elk-types.ts +19 -0
  38. package/src/components/integration-view/flow-types.tsx +16 -0
  39. package/src/components/integration-view/index.ts +1 -0
  40. package/src/components/integration-view/integration-view.tsx +159 -0
  41. package/src/components/integration-view/nodes/connection-node.tsx +10 -0
  42. package/src/components/integration-view/nodes/entry-node.tsx +10 -0
  43. package/src/components/integration-view/nodes/group-node.tsx +10 -0
  44. package/src/components/integration-view/nodes/task-node.tsx +17 -0
  45. package/src/components/integration-view/temp-data/initialElements.ts +238 -0
  46. package/src/components/integration-view/types.ts +12 -0
  47. package/src/components/layouts/index.ts +2 -0
  48. package/src/components/layouts/main-layout.tsx +28 -0
  49. package/src/components/layouts/root-container.tsx +43 -0
  50. package/src/components/link-cards/index.ts +1 -0
  51. package/src/components/link-cards/link-card.tsx +36 -0
  52. package/src/components/link-cards/styles.ts +29 -0
  53. package/src/components/list-filter/date-filter.tsx +55 -0
  54. package/src/components/list-filter/date-range-filter.tsx +101 -0
  55. package/src/components/list-filter/index.ts +6 -0
  56. package/src/components/list-filter/list-filter-types.ts +70 -0
  57. package/src/components/list-filter/list-filter.tsx +409 -0
  58. package/src/components/list-filter/multi-select-filter.tsx +117 -0
  59. package/src/components/list-filter/select-filter.tsx +82 -0
  60. package/src/hooks/use-breadcrumbs.ts +45 -0
  61. package/src/hooks/use-timestamp.tsx +25 -0
  62. package/src/lib/.keep +0 -0
  63. package/src/pages/dashboard/dashboard-link-cards.tsx +122 -0
  64. package/src/pages/dashboard/dashboard-list-sections.tsx +149 -0
  65. package/src/pages/dashboard/dashboard.tsx +14 -0
  66. package/src/pages/dashboard/index.ts +1 -0
  67. package/src/pages/execution-details/execution-details.tsx +43 -0
  68. package/src/pages/execution-details/index.ts +1 -0
  69. package/src/pages/executions/executions-list/executions-list-row.tsx +142 -0
  70. package/src/pages/executions/executions-list/executions-list-table.tsx +78 -0
  71. package/src/pages/executions/executions-list/executions-list.tsx +265 -0
  72. package/src/pages/executions/executions-list/index.ts +1 -0
  73. package/src/pages/executions/executions.tsx +98 -0
  74. package/src/pages/executions/index.ts +1 -0
  75. package/src/pages/integrations/index.ts +1 -0
  76. package/src/pages/integrations/integrations.tsx +39 -0
  77. package/src/pages/scheduler/index.ts +1 -0
  78. package/src/pages/scheduler/scheduler.tsx +39 -0
  79. package/tsconfig.json +28 -0
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+
3
+ import { Theme, useTheme } from "@mui/material";
4
+ import { Container, Box, Stack } from "@mui/material";
5
+ import { SxProps, Breakpoint } from "@mui/system";
6
+
7
+ import { IntegrateFooter } from "@evenicanpm/admin-integrate/components/footer";
8
+
9
+ interface Props {
10
+ maxWidth?: false | Breakpoint;
11
+ children: React.ReactNode;
12
+ sx?: SxProps;
13
+ }
14
+
15
+ export default function RootContainer(props: Props) {
16
+ const theme = useTheme();
17
+ const styles = getStyles(theme);
18
+
19
+ const defaultMaxWidth = "xl";
20
+
21
+ return (
22
+ <Container
23
+ maxWidth={props.maxWidth !== undefined ? props.maxWidth : defaultMaxWidth}
24
+ sx={props.sx}
25
+ >
26
+ <Box sx={styles.root}>
27
+ <Stack spacing={2}>{props.children}</Stack>
28
+ <IntegrateFooter />
29
+ </Box>
30
+ </Container>
31
+ );
32
+ }
33
+
34
+ const getStyles = (theme: Theme) => {
35
+ return {
36
+ root: {
37
+ margin: theme.spacing(3, 4),
38
+ display: "flex",
39
+ flexDirection: "column",
40
+ minHeight: `calc(100vh - ${theme.spacing(20)})`,
41
+ },
42
+ };
43
+ };
@@ -0,0 +1 @@
1
+ export { default } from "./link-card";
@@ -0,0 +1,36 @@
1
+ // STYLED COMPONENTS
2
+ import { BodyText, TitleText, Wrapper } from "./styles";
3
+ import React from "react";
4
+ import { redirect, RedirectType } from "next/navigation";
5
+ import { Box, CardActionArea } from "@mui/material";
6
+
7
+ // ============================================================
8
+ type Props = {
9
+ title: string;
10
+ description?: string;
11
+ url?: string;
12
+ children?: React.ReactNode;
13
+ };
14
+ // ============================================================
15
+ export default function LinkCard({ title, description, url, children }: Props) {
16
+ const handleRedirect = () => {
17
+ if (url) {
18
+ redirect(url, RedirectType.push);
19
+ }
20
+ };
21
+
22
+ return (
23
+ <Box sx={{ height: "100%" }}>
24
+ <CardActionArea onClick={handleRedirect} sx={{ height: "100%" }}>
25
+ <Wrapper>
26
+ {/* Add the icon as a child */}
27
+ {children}
28
+ <TitleText variant="h5" sx={{ textAlign: "center" }}>
29
+ {title}
30
+ </TitleText>
31
+ <BodyText variant="body1">{description}</BodyText>
32
+ </Wrapper>
33
+ </CardActionArea>
34
+ </Box>
35
+ );
36
+ }
@@ -0,0 +1,29 @@
1
+ "use client";
2
+
3
+ import styled from "@mui/material/styles/styled";
4
+ import { Card, Typography } from "@mui/material";
5
+
6
+ // STYLED COMPONENTS
7
+ export const Wrapper = styled(Card)(({ theme }) => ({
8
+ display: "flex",
9
+ height: "100%",
10
+ flexDirection: "column",
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ border: `1px solid ${theme.palette.grey[300]}`,
14
+ borderRadius: theme.shape.borderRadius,
15
+ paddingLeft: theme.spacing(4),
16
+ paddingRight: theme.spacing(4),
17
+ paddingTop: theme.spacing(3),
18
+ paddingBottom: theme.spacing(3),
19
+ backgroundColor: theme.palette.common.white,
20
+ }));
21
+
22
+ export const TitleText = styled(Typography)({
23
+ textAlign: "center",
24
+ });
25
+
26
+ export const BodyText = styled(Typography)(({ theme }) => ({
27
+ color: theme.palette.grey[600],
28
+ textAlign: "center",
29
+ }));
@@ -0,0 +1,55 @@
1
+ import { Typography, Theme, useTheme, FormControl } from "@mui/material";
2
+ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
3
+ import React, { useState } from "react";
4
+ import { DateFilter, FilterProps } from "./list-filter-types";
5
+ import { useTranslations } from "next-intl";
6
+
7
+ const DateFilterComponent: React.FC<FilterProps<DateFilter>> = ({
8
+ filter,
9
+ onSet,
10
+ onError,
11
+ current,
12
+ }) => {
13
+ const theme = useTheme();
14
+ const styles = getStyles(theme);
15
+ const t = useTranslations("Integrate.Filter");
16
+
17
+ const [value, setValue] = useState(current);
18
+ const [error, setError] = useState<string | null>(null);
19
+
20
+ const updateValue = (date: null | Date | string) => {
21
+ const newValue =
22
+ typeof date !== "string" && !isNaN(date?.getTime())
23
+ ? date.toISOString()
24
+ : null;
25
+
26
+ setValue(newValue);
27
+ onSet(newValue);
28
+ };
29
+
30
+ const updateError = (error: string | null) => {
31
+ setError(error ? t("invalidDate") : null);
32
+ onError(!!error);
33
+ };
34
+
35
+ return (
36
+ <FormControl>
37
+ <Typography>{filter.label}</Typography>
38
+ <DatePicker
39
+ value={value && new Date(value as string)}
40
+ onChange={updateValue}
41
+ onError={updateError}
42
+ slotProps={{
43
+ field: { clearable: true },
44
+ textField: {
45
+ helperText: error,
46
+ },
47
+ }}
48
+ />
49
+ </FormControl>
50
+ );
51
+ };
52
+
53
+ const getStyles = (theme: Theme) => ({});
54
+
55
+ export default DateFilterComponent;
@@ -0,0 +1,101 @@
1
+ import { Box, Typography, Theme, useTheme, FormControl } from "@mui/material";
2
+ import { useTranslations } from "next-intl";
3
+
4
+ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
5
+ import React, { useState } from "react";
6
+ import { DateRangeFilter, FilterProps } from "./list-filter-types";
7
+
8
+ const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
9
+ filter,
10
+ onSet,
11
+ onError,
12
+ current,
13
+ }) => {
14
+ const t = useTranslations("Integrate.Filter");
15
+ const theme = useTheme();
16
+ const styles = getStyles(theme);
17
+
18
+ const [value, setValue] = useState(current);
19
+ const [error, setError] = useState<{ start?: string; end?: string } | null>(
20
+ null,
21
+ );
22
+
23
+ const updateValue = (part: "start" | "end", date: null | Date | string) => {
24
+ const dateValue =
25
+ typeof date !== "string" && !isNaN(date?.getTime())
26
+ ? date.toISOString()
27
+ : null;
28
+
29
+ let dateRangeValue = {
30
+ start: null,
31
+ end: null,
32
+ ...value,
33
+ [part]: dateValue,
34
+ };
35
+
36
+ if (!dateRangeValue.start && !dateRangeValue.end) dateRangeValue = null;
37
+
38
+ setValue(dateRangeValue);
39
+ onSet(dateRangeValue);
40
+ };
41
+
42
+ const updateError = (part: "start" | "end", newError: string | null) => {
43
+ let errorValue = {
44
+ start: null,
45
+ end: null,
46
+ ...(error ? error : {}),
47
+ [part]: newError ? t("invalidDate") : null,
48
+ };
49
+
50
+ if (!errorValue.start && !errorValue.end) errorValue = null;
51
+
52
+ setError(errorValue);
53
+ onError(!!errorValue);
54
+ };
55
+
56
+ return (
57
+ <FormControl>
58
+ <Typography>{filter.label}</Typography>
59
+ <Box sx={styles.dateRange}>
60
+ <DatePicker
61
+ value={value?.start ? new Date(value.start) : null}
62
+ label={t("dateStartLabel")}
63
+ onChange={(v) => updateValue("start", v)}
64
+ onError={(e) => updateError("start", e)}
65
+ slotProps={{
66
+ field: { clearable: true },
67
+ textField: {
68
+ helperText: error?.start || "",
69
+ },
70
+ }}
71
+ maxDate={(value?.end && new Date(value.end)) || ""}
72
+ />
73
+ <DatePicker
74
+ value={value?.end ? new Date(value.end) : null}
75
+ label={t("dateEndLabel")}
76
+ onChange={(v) => updateValue("end", v)}
77
+ onError={(e) => updateError("end", e)}
78
+ slotProps={{
79
+ field: { clearable: true },
80
+ textField: {
81
+ helperText: error?.end || "",
82
+ },
83
+ }}
84
+ minDate={(value?.start && new Date(value.start)) || ""}
85
+ />
86
+ </Box>
87
+ </FormControl>
88
+ );
89
+ };
90
+
91
+ const getStyles = (theme: Theme) => ({
92
+ dateRange: {
93
+ display: "flex",
94
+ width: "100%",
95
+ columnGap: theme.spacing(2),
96
+ marginTop: theme.spacing(1),
97
+ "& > *": { flex: "1" },
98
+ },
99
+ });
100
+
101
+ export default DateRangeFilterComponent;
@@ -0,0 +1,6 @@
1
+ export { default as DateFilter } from "./date-filter";
2
+ export { default as DateRangeFilter } from "./date-range-filter";
3
+ export { default as ListFilter } from "./list-filter";
4
+ export { default as MultiSelectFilterComponent } from "./multi-select-filter";
5
+ export { default as SelectFilterComponent } from "./select-filter";
6
+ export * from "./list-filter-types";
@@ -0,0 +1,70 @@
1
+ export interface FilterOption {
2
+ id: number | string;
3
+ value: string;
4
+ }
5
+
6
+ interface FilterBase {
7
+ label: string;
8
+ sort?: number;
9
+ }
10
+
11
+ export interface DateFilter extends FilterBase {
12
+ type: "date";
13
+ value: string | null;
14
+ }
15
+
16
+ export interface DateRangeFilter extends FilterBase {
17
+ type: "dateRange";
18
+ value: { start: string | null; end: string | null } | null;
19
+ }
20
+
21
+ export interface SelectFilter extends FilterBase {
22
+ type: "select";
23
+ value: [FilterOption] | null;
24
+ options: FilterOption[];
25
+ }
26
+
27
+ export interface MultiSelectFilter extends FilterBase {
28
+ type: "multiSelect";
29
+ value: FilterOption[] | null;
30
+ options: FilterOption[];
31
+ }
32
+
33
+ export interface Filters {
34
+ [filterName: string]:
35
+ | DateFilter
36
+ | DateRangeFilter
37
+ | SelectFilter
38
+ | MultiSelectFilter;
39
+ }
40
+
41
+ export type FilterResult<FilterShape extends Filters> = {
42
+ [Property in keyof FilterShape]: FilterShape[Property]["value"];
43
+ };
44
+
45
+ export interface ListFilterOutput<FilterShape extends Filters> {
46
+ filters: FilterResult<FilterShape>;
47
+ search: string | null;
48
+ itemsPerPage: number | null;
49
+ }
50
+
51
+ export interface FilterConfig {
52
+ pagination:
53
+ | {
54
+ pageOptions?: number[];
55
+ pageDefault?: number;
56
+ }
57
+ | false;
58
+ search?:
59
+ | {
60
+ label?: string;
61
+ }
62
+ | false;
63
+ }
64
+
65
+ export interface FilterProps<Filter extends { value: unknown }> {
66
+ filter: Filter;
67
+ onSet: (value: Filter["value"]) => void;
68
+ onError: (error: boolean) => void;
69
+ current: Filter["value"];
70
+ }