Skip to content

Commit

Permalink
- cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-silakov committed Mar 5, 2023
1 parent 63e141f commit 68fa104
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 180 deletions.
4 changes: 2 additions & 2 deletions mvc/views/react/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<link rel="icon" href="/assets/favicon.bf5828d5.svg">
<title>Syngrisi</title>
<script type="module" crossorigin src="/assets/admin.83044a0d.js"></script>
<script type="module" crossorigin src="/assets/admin.dd1e14c8.js"></script>
<link rel="modulepreload" crossorigin href="/assets/use-form.bba2ce1c.js">
<link rel="modulepreload" crossorigin href="/assets/LogicalGroup.6bc7ad94.js">
<link rel="modulepreload" crossorigin href="/assets/LogicalGroup.3c060879.js">
<link rel="modulepreload" crossorigin href="/assets/PasswordInput.bcd5b37b.js">
<link rel="stylesheet" href="/assets/use-form.ecb4391b.css">
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15404,7 +15404,6 @@ function useDistinctLogQuery({
}
function LogLevelFilter({
label,
groupRules,
updateGroupRules,
id
}) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { bD as transitions$1, r as react, U as useUncontrolled, a$ as useIsomorphicEffect, O as useId, b as jsx, c as createStyles, K as useComponentDefaultProps, B as Box, j as jsxs, aW as UnstyledButton, aF as getDefaultZIndex, b0 as useInputProps, ay as useDidUpdate, W as Input, aS as useMergedRef, aE as packSx, aG as createPolymorphicComponent, d as useMantineTheme, a0 as Fragment, V as ActionIcon, a6 as Transition, P as Paper, aD as OptionalPortal, T as Text, a_ as Overlay, bE as assignRef, bF as getSystemStyles, bG as MANTINE_SIZES, aR as isElement, b1 as keyframes, aH as _extends, R as extractSystemStyles, a5 as React, J as sizes$8, q as TextInput, G as Group, bH as InputsGroup, bI as InlineInput, A as Anchor, a4 as Loader, bJ as CheckboxIcon, bK as GROUP_POSITIONS, s as Checkbox, bL as SYSTEM_PROPS, h as Button, C as Center, aX as CheckIcon, e as Container, L as LoadingOverlay, bg as Portal, i as Progress, Y as Stack, S as Switch, g as Title, a2 as Tooltip, aT as clsx, bM as DEFAULT_THEME, bN as MANTINE_COLORS, M as MantineProvider, F as ColorSchemeProvider, bO as useMantineColorScheme, bP as GlobalStyles, bQ as NormalizeCSS, bR as filterProps, bS as useCss, bT as useEmotionCache, bU as defaultMantineEmotionCache, bV as createCache, $ as Dge, bi as useLocation, bW as Link, bX as Dqe, bY as ya, bs as N9, bx as CMe, p as useForm, X as queryString, l as log, bZ as useParams$1, m as dj, n as lAe, b_ as tMe, b$ as wQ, bv as Qa, u as useQuery, bq as Iqe, Z as Epe, ab as Ol, ac as ua, ad as RX, a8 as rze, a7 as Xfe, y as useLocalStorage, as as Y, a9 as zV, au as Routes, av as Route, Q as QueryClient, f as useDocumentTitle, at as useNavigate, E as QueryClientProvider, H as createRoot, I as BrowserRouter } from "./use-form.bba2ce1c.js";
import { a9 as createSafeContext, aa as createScopedKeydownHandler, z as Collapse, ab as CloseButton, ac as HorizontalSection, ad as Section, ae as VerticalSection, af as DefaultItem$2, ag as groupOptions, ah as SelectPopover, ai as SelectScrollArea, aj as SelectItems, ak as noop$1, P as Popover, A as Affix, al as useFocusTrap, am as useScrollLock, an as useFocusReturn, ao as GroupedTransition, ap as createEventHandler, a as useDisclosure, aq as useDelayedHover, ar as _objectWithoutPropertiesLoose, as as useScrollIntoView, at as getSelectRightSectionProps, i as useOs, au as useElementSize, D as Divider, N as Navbar, H as Header, a0 as AppShell, av as Avatar, r as Badge, B as Breadcrumbs, E as Burger, y as Card, aw as CardSection, f as Chip, C as CopyButton, F as FocusTrap, ax as Highlight, I as Image, K as Kbd, L as List, ay as Mark, az as Menu, M as Modal, aA as Notification, R as RingProgress, d as ScrollArea, Q as SegmentedControl, aB as Select, aC as ChevronIcon$1, k as Skeleton, V as Table, T as ThemeIcon, aD as Global, aE as AppContext, n as getNavigationItem, aF as stopNavigationProgress, aG as resetNavigationProgress, l as links, g as HeaderLogo, o as openSpotlight, U as UserMenu, j as useMutation, h as SafeSelect, t as ActionPopoverIcon, s as successMsg, e as errorMsg, G as GenericService, v as UserHooks, $ as useNavProgressFetchEffect, m as useInView, p as useToggle, u as useQueryParams, S as StringParam, J as JsonParam, W as useInputState, X as RelativeDrawer, Y as LogicalGroup, Z as uuid, q as useInfinityScroll, a1 as ReactQueryDevtools, a2 as useColorScheme, a3 as navigationData, a4 as SpotlightProvider, a5 as NotificationsProvider, a6 as NavigationProgress, a7 as QueryParamProvider, a8 as ReactRouter6Adapter } from "./LogicalGroup.6bc7ad94.js";
import { a9 as createSafeContext, aa as createScopedKeydownHandler, z as Collapse, ab as CloseButton, ac as HorizontalSection, ad as Section, ae as VerticalSection, af as DefaultItem$2, ag as groupOptions, ah as SelectPopover, ai as SelectScrollArea, aj as SelectItems, ak as noop$1, P as Popover, A as Affix, al as useFocusTrap, am as useScrollLock, an as useFocusReturn, ao as GroupedTransition, ap as createEventHandler, a as useDisclosure, aq as useDelayedHover, ar as _objectWithoutPropertiesLoose, as as useScrollIntoView, at as getSelectRightSectionProps, i as useOs, au as useElementSize, D as Divider, N as Navbar, H as Header, a0 as AppShell, av as Avatar, r as Badge, B as Breadcrumbs, E as Burger, y as Card, aw as CardSection, f as Chip, C as CopyButton, F as FocusTrap, ax as Highlight, I as Image, K as Kbd, L as List, ay as Mark, az as Menu, M as Modal, aA as Notification, R as RingProgress, d as ScrollArea, Q as SegmentedControl, aB as Select, aC as ChevronIcon$1, k as Skeleton, V as Table, T as ThemeIcon, aD as Global, aE as AppContext, n as getNavigationItem, aF as stopNavigationProgress, aG as resetNavigationProgress, l as links, g as HeaderLogo, o as openSpotlight, U as UserMenu, j as useMutation, h as SafeSelect, t as ActionPopoverIcon, s as successMsg, e as errorMsg, G as GenericService, v as UserHooks, $ as useNavProgressFetchEffect, m as useInView, p as useToggle, u as useQueryParams, S as StringParam, J as JsonParam, W as useInputState, X as RelativeDrawer, Y as LogicalGroup, Z as uuid, q as useInfinityScroll, a1 as ReactQueryDevtools, a2 as useColorScheme, a3 as navigationData, a4 as SpotlightProvider, a5 as NotificationsProvider, a6 as NavigationProgress, a7 as QueryParamProvider, a8 as ReactRouter6Adapter } from "./LogicalGroup.3c060879.js";
import { P as PasswordInput } from "./PasswordInput.bcd5b37b.js";
function getSafeId(uid, errorMessage) {
return (value) => {
Expand Down Expand Up @@ -12242,7 +12242,6 @@ const useStyles$4 = createStyles((theme) => ({
}
}));
function AdminHeader() {
useDisclosure(false);
const {
classes
} = useStyles$4();
Expand Down Expand Up @@ -13437,48 +13436,45 @@ function AdminSettings() {
}
const RefreshActionIcon = ({
newestItemsQuery,
firstPageQuery,
infinityQuery
firstPageQuery
}) => {
var _a, _b, _c, _d, _e, _f;
const theme = useMantineTheme();
const newestItems = ((_a = newestItemsQuery == null ? void 0 : newestItemsQuery.data) == null ? void 0 : _a.results.length) > 50 ? "50+" : (_b = newestItemsQuery == null ? void 0 : newestItemsQuery.data) == null ? void 0 : _b.results.length;
const pluralCharset = newestItems > 1 ? "s" : "";
return /* @__PURE__ */ jsx(Fragment, {
children: /* @__PURE__ */ jsxs(ActionIcon, {
color: theme.colorScheme === "dark" ? "green.8" : "green.6",
"data-test": "table-refresh-icon",
variant: "subtle",
onClick: () => firstPageQuery.refetch(),
children: [/* @__PURE__ */ jsx(Epe, {
size: 24,
stroke: 1
}), ((_d = (_c = newestItemsQuery == null ? void 0 : newestItemsQuery.data) == null ? void 0 : _c.results) == null ? void 0 : _d.length) !== void 0 && ((_f = (_e = newestItemsQuery == null ? void 0 : newestItemsQuery.data) == null ? void 0 : _e.results) == null ? void 0 : _f.length) > 0 && /* @__PURE__ */ jsx(Badge, {
component: "div",
title: ` You have ${newestItems} new item${pluralCharset}, refresh the page to see them`,
pl: 4,
pr: 4,
pt: 6,
pb: 6,
color: "red",
variant: "filled",
radius: "xl",
"data-test": "table-refresh-icon-badge",
sx: {
fontSize: "12px",
position: "absolute",
bottom: 11,
left: 14,
lineHeight: "16px",
fontWeight: 400,
fontFamily: '"Roboto","Arial",sans-serif',
border: `2px`,
borderStyle: "solid",
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : "white"
},
children: newestItems
})]
})
return /* @__PURE__ */ jsxs(ActionIcon, {
color: theme.colorScheme === "dark" ? "green.8" : "green.6",
"data-test": "table-refresh-icon",
variant: "subtle",
onClick: () => firstPageQuery.refetch(),
children: [/* @__PURE__ */ jsx(Epe, {
size: 24,
stroke: 1
}), ((_d = (_c = newestItemsQuery == null ? void 0 : newestItemsQuery.data) == null ? void 0 : _c.results) == null ? void 0 : _d.length) !== void 0 && ((_f = (_e = newestItemsQuery == null ? void 0 : newestItemsQuery.data) == null ? void 0 : _e.results) == null ? void 0 : _f.length) > 0 && /* @__PURE__ */ jsx(Badge, {
component: "div",
title: ` You have ${newestItems} new item${pluralCharset}, refresh the page to see them`,
pl: 4,
pr: 4,
pt: 6,
pb: 6,
color: "red",
variant: "filled",
radius: "xl",
"data-test": "table-refresh-icon-badge",
sx: {
fontSize: "12px",
position: "absolute",
bottom: 11,
left: 14,
lineHeight: "16px",
fontWeight: 400,
fontFamily: '"Roboto","Arial",sans-serif',
border: `2px`,
borderStyle: "solid",
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : "white"
},
children: newestItems
})]
});
};
const adminLogsTableColumns = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
return value;
};
import { r as react, X as queryString, b as jsx, j as jsxs, P as Paper, g as Title, Y as Stack, T as Text, G as Group, h as Button, Z as Epe, k as ky, a as config, u as useQuery, d as useMantineTheme, q as TextInput, V as ActionIcon, n as lAe, _ as Pj, c as createStyles, y as useLocalStorage, e as Container, $ as Dge, a0 as Fragment, a1 as useQueryClient, l as log, a2 as Tooltip, a3 as CK, a4 as Loader, a5 as React, a6 as Transition, a7 as Xfe, a8 as rze, f as useDocumentTitle, A as Anchor, a9 as zV, aa as ea, ab as Ol, ac as ua, ad as RX, ae as rWe, af as UZ, s as Checkbox, ag as getAugmentedNamespace, D as useHotkeys, ah as lDe, ai as dDe, aj as Pbe, ak as Cbe, al as pi, am as Lbe, an as zb, ao as IMe, ap as DMe, aq as qF, L as LoadingOverlay, ar as LHe, B as Box, o as useSearchParams, as as Y, Q as QueryClient, at as useNavigate, t as GCe, v as Nie, E as QueryClientProvider, F as ColorSchemeProvider, M as MantineProvider, au as Routes, av as Route, H as createRoot, I as BrowserRouter } from "./use-form.bba2ce1c.js";
import { _ as _inheritsLoose, C as CopyButton, u as useQueryParams, S as StringParam, J as JsonParam, G as GenericService, e as errorMsg, a as useDisclosure, b as useClickOutside, c as escapeRegExp, P as Popover, d as ScrollArea, f as Chip, D as Divider, l as links, H as Header$1, g as HeaderLogo, h as SafeSelect, o as openSpotlight, K as Kbd, i as useOs, U as UserMenu, B as Breadcrumbs, j as useMutation, s as successMsg, M as Modal, R as RingProgress, L as List, k as Skeleton, m as useInView, F as FocusTrap, n as getNavigationItem, p as useToggle, q as useInfinityScroll, N as Navbar, r as Badge, A as Affix, t as ActionPopoverIcon, v as UserHooks, T as ThemeIcon, w as getStatusMessage, x as encodeQueryParams, I as Image$1, y as Card, z as Collapse, E as Burger, O as useInfiniteQuery, Q as SegmentedControl, V as Table, W as useInputState, X as RelativeDrawer, Y as LogicalGroup, Z as uuid, $ as useNavProgressFetchEffect, a0 as AppShell, a1 as ReactQueryDevtools, a2 as useColorScheme, a3 as navigationData, a4 as SpotlightProvider, a5 as NotificationsProvider, a6 as NavigationProgress, a7 as QueryParamProvider, a8 as ReactRouter6Adapter } from "./LogicalGroup.6bc7ad94.js";
import { _ as _inheritsLoose, C as CopyButton, u as useQueryParams, S as StringParam, J as JsonParam, G as GenericService, e as errorMsg, a as useDisclosure, b as useClickOutside, c as escapeRegExp, P as Popover, d as ScrollArea, f as Chip, D as Divider, l as links, H as Header$1, g as HeaderLogo, h as SafeSelect, o as openSpotlight, K as Kbd, i as useOs, U as UserMenu, B as Breadcrumbs, j as useMutation, s as successMsg, M as Modal, R as RingProgress, L as List, k as Skeleton, m as useInView, F as FocusTrap, n as getNavigationItem, p as useToggle, q as useInfinityScroll, N as Navbar, r as Badge, A as Affix, t as ActionPopoverIcon, v as UserHooks, T as ThemeIcon, w as getStatusMessage, x as encodeQueryParams, I as Image$1, y as Card, z as Collapse, E as Burger, O as useInfiniteQuery, Q as SegmentedControl, V as Table, W as useInputState, X as RelativeDrawer, Y as LogicalGroup, Z as uuid, $ as useNavProgressFetchEffect, a0 as AppShell, a1 as ReactQueryDevtools, a2 as useColorScheme, a3 as navigationData, a4 as SpotlightProvider, a5 as NotificationsProvider, a6 as NavigationProgress, a7 as QueryParamProvider, a8 as ReactRouter6Adapter } from "./LogicalGroup.3c060879.js";
function useDebouncedValue(value, wait, options = { leading: false }) {
const [_value, setValue] = react.exports.useState(value);
const mountedRef = react.exports.useRef(false);
Expand Down Expand Up @@ -348,7 +348,6 @@ const chipStyles = {
function QuickFilter() {
const theme = useMantineTheme();
const {
query,
setQuery
} = useParams();
const [opened, {
Expand Down Expand Up @@ -4648,7 +4647,7 @@ function UnfoldActionIcon({
})
});
}
function ChecksSkeleton(props) {
function ChecksSkeleton() {
return /* @__PURE__ */ jsxs(Group, {
children: [/* @__PURE__ */ jsxs(Stack, {
children: [/* @__PURE__ */ jsx(Skeleton, {
Expand Down
4 changes: 2 additions & 2 deletions mvc/views/react/index2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<link rel="icon" href="/assets/favicon.bf5828d5.svg">
<title>Syngrisi</title>
<script type="module" crossorigin src="/assets/root.fbf6be97.js"></script>
<script type="module" crossorigin src="/assets/root.f3928601.js"></script>
<link rel="modulepreload" crossorigin href="/assets/use-form.bba2ce1c.js">
<link rel="modulepreload" crossorigin href="/assets/LogicalGroup.6bc7ad94.js">
<link rel="modulepreload" crossorigin href="/assets/LogicalGroup.3c060879.js">
<link rel="stylesheet" href="/assets/use-form.ecb4391b.css">
</head>
<div></div>
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/check.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const get = catchAsync(async (req, res) => {
res.send(result);
});

const get_via_post = catchAsync(async (req, res) => {
const getViaPost = catchAsync(async (req, res) => {
const filter = req.body.filter ? pick(req.body, ['filter']).filter : {};
const options = req.body.options ? pick(req.body, ['options']).options : {};
const result = await genericService.get('VRSCheck', filter, options);
Expand All @@ -34,7 +34,7 @@ const remove = catchAsync(async (req, res) => {
});

module.exports = {
get_via_post,
getViaPost,
get,
accept,
remove,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/v1/checks.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ router.route('/accept/:id')
.put(ensureLoggedIn(), checksController.accept);

router.route('/get_via_post')
.post(ensureLoggedIn(), checksController.get_via_post);
.post(ensureLoggedIn(), checksController.getViaPost);

module.exports = router;
2 changes: 1 addition & 1 deletion src/services/run.service.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable valid-jsdoc */
/* eslint-disable valid-jsdoc,no-restricted-syntax,no-await-in-loop */
const mongoose = require('mongoose');

const Test = mongoose.model('VRSTest');
Expand Down
3 changes: 1 addition & 2 deletions src/services/suite.service.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable valid-jsdoc */
/* eslint-disable valid-jsdoc,no-restricted-syntax,no-await-in-loop */
const mongoose = require('mongoose');

const Test = mongoose.model('VRSTest');
Expand Down Expand Up @@ -34,7 +34,6 @@ const remove = async (id, user) => {
}
const suite = await Suite.findByIdAndRemove(id)
.exec();
console.log({ suite });
return suite;
};

Expand Down
52 changes: 1 addition & 51 deletions src/services/test.service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-restricted-syntax,no-await-in-loop */
const mongoose = require('mongoose');
const testUtil = require('../../mvc/controllers/api/utils/tests');
const checkService = require('./check.service');
Expand Down Expand Up @@ -66,57 +67,6 @@ const accept = async (id, user) => {
return { message: 'success' };
};

// /**
// * Get user by id
// * @param {ObjectId} id
// * @returns {Promise<User>}
// */
// const getUserById = async (id) => {
// return User.findById(id);
// };
//
// /**
// * Get user by email
// * @param {string} email
// * @returns {Promise<User>}
// */
// const getUserByEmail = async (email) => {
// return User.findOne({ email });
// };
//
// /**
// * Update user by id
// * @param {ObjectId} userId
// * @param {Object} updateBody
// * @returns {Promise<User>}
// */
// const updateUserById = async (userId, updateBody) => {
// const user = await getUserById(userId);
// if (!user) {
// throw new ApiError(httpStatus.NOT_FOUND, 'User not found');
// }
// if (updateBody.email && (await User.isEmailTaken(updateBody.email, userId))) {
// throw new ApiError(httpStatus.BAD_REQUEST, 'Email already taken');
// }
// Object.assign(user, updateBody);
// await user.save();
// return user;
// };
//
// /**
// * Delete user by id
// * @param {ObjectId} userId
// * @returns {Promise<User>}
// */
// const deleteUserById = async (userId) => {
// const user = await getUserById(userId);
// if (!user) {
// throw new ApiError(httpStatus.NOT_FOUND, 'User not found');
// }
// await user.remove();
// return user;
// };

module.exports = {
queryTests,
queryTestsDistinct,
Expand Down
5 changes: 1 addition & 4 deletions src/ui-app/admin/components/Header/AdminHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
Breadcrumbs,
Burger,
Container,
Group,
Header,
Expand All @@ -10,7 +9,6 @@ import {
Text,
} from '@mantine/core';
import * as React from 'react';
import { useDisclosure } from '@mantine/hooks';
import { IconSearch } from '@tabler/icons';
import { createStyles } from '@mantine/styles';
import { useContext } from 'react';
Expand Down Expand Up @@ -81,7 +79,6 @@ const useStyles = createStyles((theme) => ({
}));

export default function AdminHeader() {
const [opened, { toggle }] = useDisclosure(false);
const { classes } = useStyles();

const headerLinks = links.map((link) => (
Expand All @@ -103,7 +100,7 @@ export default function AdminHeader() {
>
<Container className={classes.inner} fluid>
<Group>
{/*<Burger opened={opened} onClick={toggle} size="sm" />*/}
{/* <Burger opened={opened} onClick={toggle} size="sm" /> */}
<HeaderLogo />
</Group>

Expand Down
Loading

0 comments on commit 68fa104

Please sign in to comment.