@syngrisi/syngrisi 2.2.1
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/.nvmrc +1 -0
- package/LICENSE.md +9 -0
- package/README.md +139 -0
- package/config.js +17 -0
- package/dist/config.js +16 -0
- package/dist/src/server/models/index.js +508 -0
- package/dist/src/server/models/plugins/index.js +4 -0
- package/dist/src/server/models/plugins/paginate.plugin.js +76 -0
- package/dist/src/server/models/plugins/paginateDistinct.plugin.js +76 -0
- package/dist/src/server/models/plugins/toJSON.plugin.js +39 -0
- package/dist/src/server/schemas/createCheck.shema.js +17 -0
- package/dist/src/server/schemas/getBaseline.shema.js +12 -0
- package/dist/src/server/utils/paramsGuard.js +18 -0
- package/dist/src/tasks/backup.js +68 -0
- package/dist/src/tasks/lib/common.js +14 -0
- package/dist/src/tasks/lib/utils.js +14 -0
- package/dist/src/tasks/migrations/2.0.migration.js +86 -0
- package/dist/src/tasks/migrations/2.0.migration_mql.js +57 -0
- package/dist/src/tasks/reindex.js +28 -0
- package/dist/src/tasks/restore.js +86 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docker-compose.yml +70 -0
- package/mvc/views/react/admin/index.html +22 -0
- package/mvc/views/react/assets/LogicalGroup.95929360.js +15993 -0
- package/mvc/views/react/assets/PasswordInput.8a73fdd2.js +299 -0
- package/mvc/views/react/assets/admin.94703bdc.js +14448 -0
- package/mvc/views/react/assets/auth.748478ef.js +673 -0
- package/mvc/views/react/assets/bg_2_0_dark_L2.3a31edc0.png +0 -0
- package/mvc/views/react/assets/favicon.bf5828d5.svg +7 -0
- package/mvc/views/react/assets/index.a5606313.css +23 -0
- package/mvc/views/react/assets/roboto-v30-latin-100.0f303f31.woff2 +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-100.34e9582c.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-500.9ce7f3ac.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-500.b0195382.woff2 +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-700.e0fd57c0.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-700.f5aebdfe.woff2 +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-regular.f2abf7fb.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-regular.f6734f81.woff2 +0 -0
- package/mvc/views/react/assets/root.136e0ea3.js +25451 -0
- package/mvc/views/react/assets/use-form.57ebe175.js +24472 -0
- package/mvc/views/react/assets/use-form.ecb4391b.css +36 -0
- package/mvc/views/react/auth/index.html +22 -0
- package/mvc/views/react/index.html +19 -0
- package/mvc/views/react/index2/index.html +21 -0
- package/package.json +144 -0
- package/server.js +166 -0
- package/src/server/controllers/app.controller.js +21 -0
- package/src/server/controllers/auth.controller.js +156 -0
- package/src/server/controllers/baseline.controller.js +24 -0
- package/src/server/controllers/check.controller.js +56 -0
- package/src/server/controllers/client.controller.js +173 -0
- package/src/server/controllers/index.js +12 -0
- package/src/server/controllers/logs.controller.js +30 -0
- package/src/server/controllers/runs.controller.js +25 -0
- package/src/server/controllers/settings.controller.js +23 -0
- package/src/server/controllers/snapshots.controller.js +17 -0
- package/src/server/controllers/suite.controller.js +24 -0
- package/src/server/controllers/tasks.controller.js +47 -0
- package/src/server/controllers/test.controller.js +70 -0
- package/src/server/controllers/users.controller.js +79 -0
- package/src/server/data/custom_devices.json +8 -0
- package/src/server/data/devices.json +773 -0
- package/src/server/data/get_devices.sh +2 -0
- package/src/server/lib/AppSettings.js +56 -0
- package/src/server/lib/admin.json +9 -0
- package/src/server/lib/comparator.js +147 -0
- package/src/server/lib/compareImagesNode.js +60 -0
- package/src/server/lib/dbItems.js +215 -0
- package/src/server/lib/ensureLogin/ensureLoggedIn.js +223 -0
- package/src/server/lib/ensureLogin/ensureLoggedOut.js +44 -0
- package/src/server/lib/getElementsByPixPositionsFromDump.js +72 -0
- package/src/server/lib/guest.json +9 -0
- package/src/server/lib/initialAppSettings.json +18 -0
- package/src/server/lib/logger.js +95 -0
- package/src/server/lib/onStart.js +53 -0
- package/src/server/lib/parseDiff.js.bak +72 -0
- package/src/server/lib/testAdmin.json +9 -0
- package/src/server/lib/testUsers.json +41 -0
- package/src/server/middlewares/authorization.js +50 -0
- package/src/server/middlewares/disableCors.js +19 -0
- package/src/server/models/index.js +534 -0
- package/src/server/models/plugins/index.js +3 -0
- package/src/server/models/plugins/paginate.plugin.js +83 -0
- package/src/server/models/plugins/paginateDistinct.plugin.js +80 -0
- package/src/server/models/plugins/toJSON.plugin.js +44 -0
- package/src/server/routes/ui/admin.js +20 -0
- package/src/server/routes/ui/auth.js +15 -0
- package/src/server/routes/ui/index.js +19 -0
- package/src/server/routes/v1/app.route.js +9 -0
- package/src/server/routes/v1/auth.route.js +12 -0
- package/src/server/routes/v1/baselines.route.js +14 -0
- package/src/server/routes/v1/checks.route.js +25 -0
- package/src/server/routes/v1/client.route.js +39 -0
- package/src/server/routes/v1/index.js +82 -0
- package/src/server/routes/v1/logs.route.js +16 -0
- package/src/server/routes/v1/runs.route.js +15 -0
- package/src/server/routes/v1/settings.route.js +23 -0
- package/src/server/routes/v1/snapshots.route.js +11 -0
- package/src/server/routes/v1/suites.route.js +15 -0
- package/src/server/routes/v1/tasks.route.js +59 -0
- package/src/server/routes/v1/test.route.js +20 -0
- package/src/server/routes/v1/test_distinct.route.js +14 -0
- package/src/server/routes/v1/users.route.js +36 -0
- package/src/server/schemas/createCheck.shema.ts +17 -0
- package/src/server/schemas/getBaseline.shema.ts +12 -0
- package/src/server/services/app.service.js +23 -0
- package/src/server/services/check.service.js +178 -0
- package/src/server/services/client.service.js +648 -0
- package/src/server/services/generic.service.js +51 -0
- package/src/server/services/index.js +12 -0
- package/src/server/services/logs.service.js +38 -0
- package/src/server/services/run.service.js +40 -0
- package/src/server/services/suite.service.js +39 -0
- package/src/server/services/tasks.service.js +536 -0
- package/src/server/services/test.service.js +72 -0
- package/src/server/services/user.service.js +128 -0
- package/src/server/utils/ApiError.js +14 -0
- package/src/server/utils/catchAsync.js +8 -0
- package/src/server/utils/check.js +58 -0
- package/src/server/utils/dateToISO8601.js +2 -0
- package/src/server/utils/deserializeIfJSON.js +9 -0
- package/src/server/utils/formatISOToDateTime.js +6 -0
- package/src/server/utils/index.js +10 -0
- package/src/server/utils/isJSON.js +6 -0
- package/src/server/utils/paramsGuard.ts +15 -0
- package/src/server/utils/pick.js +15 -0
- package/src/server/utils/prettyCheckParams.js +13 -0
- package/src/server/utils/snapshots.js +73 -0
- package/src/server/utils/subDays.js +7 -0
- package/src/server/utils/tests.js +36 -0
- package/src/server/utils/utils.js +146 -0
- package/src/tasks/backup.js.bak +84 -0
- package/src/tasks/backup.ts +53 -0
- package/src/tasks/lib/common.js +24 -0
- package/src/tasks/lib/utils.js +15 -0
- package/src/tasks/migrations/2.0.migration.js +86 -0
- package/src/tasks/migrations/2.0.migration.ts +95 -0
- package/src/tasks/migrations/2.0.migration_mql.js +63 -0
- package/src/tasks/reindex.js +36 -0
- package/src/tasks/restore.js.bak +100 -0
- package/src/tasks/restore.ts +75 -0
- package/src/ui-app/.eslintrc.json +119 -0
- package/src/ui-app/README.md +15 -0
- package/src/ui-app/admin/AdminLayout.tsx +38 -0
- package/src/ui-app/admin/App.tsx +108 -0
- package/src/ui-app/admin/AppContext.ts +3 -0
- package/src/ui-app/admin/components/Header/AdminHeader.tsx +148 -0
- package/src/ui-app/admin/components/Logs/AdminLogs.tsx +142 -0
- package/src/ui-app/admin/components/Logs/RefreshActionIcon.tsx +60 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTable.tsx +81 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableFilter.tsx +170 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableHeads.tsx +50 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableRows.tsx +207 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableSettings.tsx +95 -0
- package/src/ui-app/admin/components/Logs/Table/InfinityScrollSkeleton.tsx +77 -0
- package/src/ui-app/admin/components/Logs/Table/InfinityScrollSkeletonFIller.tsx +57 -0
- package/src/ui-app/admin/components/Logs/Table/PagesCountAffix.tsx +61 -0
- package/src/ui-app/admin/components/Logs/Table/adminLogsCreateStyle.tsx +36 -0
- package/src/ui-app/admin/components/Logs/Table/adminLogsTableColumns.ts +52 -0
- package/src/ui-app/admin/components/Logs/UnfoldActionIcon.tsx +39 -0
- package/src/ui-app/admin/components/Navbar/AdminNavbar.tsx +50 -0
- package/src/ui-app/admin/components/Navbar/NavbarLinksGroup.tsx +104 -0
- package/src/ui-app/admin/components/Settings/AdminSettings.tsx +51 -0
- package/src/ui-app/admin/components/Settings/Forms/Boolean.tsx +59 -0
- package/src/ui-app/admin/components/Settings/Forms/FormWrapper.tsx +45 -0
- package/src/ui-app/admin/components/Settings/Forms/index.tsx +5 -0
- package/src/ui-app/admin/components/Settings/Forms/interfaces.tsx +17 -0
- package/src/ui-app/admin/components/Tasks/Task.tsx +138 -0
- package/src/ui-app/admin/components/Tasks/TaskWrapper.tsx +11 -0
- package/src/ui-app/admin/components/Tasks/tasksList.ts +59 -0
- package/src/ui-app/admin/components/Users/AdminUsers.tsx +182 -0
- package/src/ui-app/admin/components/Users/UserAddForm.tsx +137 -0
- package/src/ui-app/admin/components/Users/UserForm.tsx +196 -0
- package/src/ui-app/admin/hooks/useParams.tsx +18 -0
- package/src/ui-app/admin/index.html +17 -0
- package/src/ui-app/admin/main.tsx +24 -0
- package/src/ui-app/asserts/css/auth/index.css +23 -0
- package/src/ui-app/asserts/css/styles.css +36 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.svg +313 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.woff2 +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.svg +305 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.woff2 +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.svg +309 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.woff2 +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.svg +308 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.woff2 +0 -0
- package/src/ui-app/asserts/images/background.jpg +0 -0
- package/src/ui-app/asserts/images/bg_2_0_dark_L2.png +0 -0
- package/src/ui-app/asserts/images/favicon.svg +7 -0
- package/src/ui-app/auth/App.tsx +82 -0
- package/src/ui-app/auth/commonStyles.tsx +26 -0
- package/src/ui-app/auth/components/AuthFooter.tsx +51 -0
- package/src/ui-app/auth/components/AuthLogo.tsx +58 -0
- package/src/ui-app/auth/components/ChangePasswordForm.tsx +216 -0
- package/src/ui-app/auth/components/ChangePasswordSuccessForm.tsx +38 -0
- package/src/ui-app/auth/components/LoginForm.tsx +148 -0
- package/src/ui-app/auth/components/LogoutForm.tsx +89 -0
- package/src/ui-app/auth/components/ToggleThemeButton.tsx +41 -0
- package/src/ui-app/auth/components/change-password/Bars.tsx +45 -0
- package/src/ui-app/auth/components/change-password/PasswordRequirement.tsx +14 -0
- package/src/ui-app/auth/components/change-password/requirements.tsx +6 -0
- package/src/ui-app/auth/index.html +17 -0
- package/src/ui-app/auth/main.tsx +12 -0
- package/src/ui-app/auth/routes.tsx +26 -0
- package/src/ui-app/config.ts +15 -0
- package/src/ui-app/index.html +12 -0
- package/src/ui-app/index2/App.tsx +162 -0
- package/src/ui-app/index2/AppContext.ts +3 -0
- package/src/ui-app/index2/IndexLayout.tsx +34 -0
- package/src/ui-app/index2/components/Header/HeaderIndex.tsx +248 -0
- package/src/ui-app/index2/components/Header/QuickFilter.tsx +312 -0
- package/src/ui-app/index2/components/Navbar/Items/AcceptStatusItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/BaseItemWrapper.tsx +94 -0
- package/src/ui-app/index2/components/Navbar/Items/BrowserItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/PlatformItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/RemoveItemModalAsk.tsx +71 -0
- package/src/ui-app/index2/components/Navbar/Items/RemoveItemPopover.tsx +58 -0
- package/src/ui-app/index2/components/Navbar/Items/RemoveSuiteModalAsk.tsx +61 -0
- package/src/ui-app/index2/components/Navbar/Items/RunItem.tsx +149 -0
- package/src/ui-app/index2/components/Navbar/Items/StatusItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/SuiteItem.tsx +109 -0
- package/src/ui-app/index2/components/Navbar/Items/index.tsx +6 -0
- package/src/ui-app/index2/components/Navbar/NavbarFilter.tsx +93 -0
- package/src/ui-app/index2/components/Navbar/NavbarGroupBySelect.tsx +83 -0
- package/src/ui-app/index2/components/Navbar/NavbarIndex.tsx +247 -0
- package/src/ui-app/index2/components/Navbar/NavbarItems.tsx +38 -0
- package/src/ui-app/index2/components/Navbar/NavbarSort.tsx +105 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/RunsDummySkeleton.tsx +27 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/SimpleDummySkeleton.tsx +23 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/SkeletonWrapper.tsx +45 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/SuitesDummySkeleton.tsx +27 -0
- package/src/ui-app/index2/components/Tests/Table/AcceptTestModalAsk.tsx +68 -0
- package/src/ui-app/index2/components/Tests/Table/AcceptTestsButton.tsx +44 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/Branch.tsx +35 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/BrowserName.tsx +33 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/BrowserVersion.tsx +31 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/CellWrapper.tsx +49 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/Os.tsx +32 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/StartDate.tsx +34 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/Status.tsx +50 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/ViewPort.tsx +46 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/AcceptButton.tsx +142 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/Check.tsx +281 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/Canvas.tsx +36 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/helpers.ts +72 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/mainView.ts +495 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/sideToSideView.ts +398 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/simpleView.ts +21 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/CheckDetails.tsx +237 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Header.tsx +221 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedCheckItem.tsx +167 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedCheckSort.tsx +81 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedChecks.tsx +197 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedChecksItems.tsx +31 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedChecksSkeleton.tsx +37 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/HighlightButton.tsx +56 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/RegionsToolbar.tsx +150 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ScreenshotDetails.tsx +137 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/Toolbar.tsx +101 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ViewSegmentedControl.tsx +159 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ZoomToolbar.tsx +326 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/highlightDiff.ts +167 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/hooks/useRelatedChecks.tsx +43 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckModal.tsx +119 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/Checks.tsx +91 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/ChecksSkeleton.tsx +21 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/PreviewCheckTooltipLabel.tsx +121 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/RemoveButton.tsx +63 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/ViewPortLabel.tsx +94 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/checkSizes.ts +27 -0
- package/src/ui-app/index2/components/Tests/Table/Filter.tsx +179 -0
- package/src/ui-app/index2/components/Tests/Table/Heads.tsx +54 -0
- package/src/ui-app/index2/components/Tests/Table/InfinityScrollSkeleton.tsx +71 -0
- package/src/ui-app/index2/components/Tests/Table/PagesCountAffix.tsx +61 -0
- package/src/ui-app/index2/components/Tests/Table/RefreshActionIcon.tsx +65 -0
- package/src/ui-app/index2/components/Tests/Table/RemoveTestModalAsk.tsx +66 -0
- package/src/ui-app/index2/components/Tests/Table/RemoveTestsButton.tsx +43 -0
- package/src/ui-app/index2/components/Tests/Table/Row.tsx +128 -0
- package/src/ui-app/index2/components/Tests/Table/Rows.tsx +87 -0
- package/src/ui-app/index2/components/Tests/Table/Settings.tsx +121 -0
- package/src/ui-app/index2/components/Tests/Table/TestsTable.tsx +140 -0
- package/src/ui-app/index2/components/Tests/Table/UnfoldActionIcon.tsx +39 -0
- package/src/ui-app/index2/components/Tests/Table/tableColumns.ts +80 -0
- package/src/ui-app/index2/components/Tests/Table/testsCreateStyle.tsx +35 -0
- package/src/ui-app/index2/components/Tests/Tests.tsx +157 -0
- package/src/ui-app/index2/hooks/useIndexSubpageEffect.tsx +14 -0
- package/src/ui-app/index2/hooks/useNavbarActiveItems.tsx +66 -0
- package/src/ui-app/index2/hooks/useParams.tsx +25 -0
- package/src/ui-app/index2/index.html +17 -0
- package/src/ui-app/index2/main.tsx +33 -0
- package/src/ui-app/package-lock.json +6150 -0
- package/src/ui-app/package.json +58 -0
- package/src/ui-app/shared/components/ActionPopoverIcon.tsx +116 -0
- package/src/ui-app/shared/components/Check/AcceptedStatusIcon.tsx +51 -0
- package/src/ui-app/shared/components/Check/BrowserIcon.tsx +50 -0
- package/src/ui-app/shared/components/Check/OsIcon.tsx +73 -0
- package/src/ui-app/shared/components/Check/Status.tsx +37 -0
- package/src/ui-app/shared/components/Check/StatusIcon.tsx +66 -0
- package/src/ui-app/shared/components/Email.tsx +83 -0
- package/src/ui-app/shared/components/Header/ApiKeyModalAsk.tsx +31 -0
- package/src/ui-app/shared/components/Header/ApiKeyModalResult.tsx +89 -0
- package/src/ui-app/shared/components/Header/HeaderLogo.tsx +82 -0
- package/src/ui-app/shared/components/Header/UserInfoModal.tsx +92 -0
- package/src/ui-app/shared/components/Header/UserMenu.tsx +151 -0
- package/src/ui-app/shared/components/Password.tsx +95 -0
- package/src/ui-app/shared/components/RelativeDrawer.tsx +43 -0
- package/src/ui-app/shared/components/SafeSelect.tsx +95 -0
- package/src/ui-app/shared/components/Tests/StatusesRing.tsx +66 -0
- package/src/ui-app/shared/components/ToggleThemeButton.tsx +33 -0
- package/src/ui-app/shared/components/Users/LabelUser.tsx +60 -0
- package/src/ui-app/shared/components/errors/ErrorFallback.tsx +66 -0
- package/src/ui-app/shared/components/filter/AcceptedFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/BrowserNameFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/CommonDistinctFilter.tsx +104 -0
- package/src/ui-app/shared/components/filter/DateFilter.tsx +54 -0
- package/src/ui-app/shared/components/filter/FilterWrapper.tsx +80 -0
- package/src/ui-app/shared/components/filter/IdFilter.tsx +60 -0
- package/src/ui-app/shared/components/filter/LogLevelFilter.tsx +77 -0
- package/src/ui-app/shared/components/filter/LogicalGroup.tsx +179 -0
- package/src/ui-app/shared/components/filter/OsFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/StatusFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/StringFilter.tsx +55 -0
- package/src/ui-app/shared/components/filter/index.ts +19 -0
- package/src/ui-app/shared/components/heaserLinks.tsx +4 -0
- package/src/ui-app/shared/hooks/index.ts +3 -0
- package/src/ui-app/shared/hooks/useColorSheme.ts +22 -0
- package/src/ui-app/shared/hooks/useDistinctLogQuery.tsx +33 -0
- package/src/ui-app/shared/hooks/useDistinctQuery.tsx +37 -0
- package/src/ui-app/shared/hooks/useInfinityScroll.tsx +163 -0
- package/src/ui-app/shared/hooks/useInfinityScrollRelatedChecks.tsx +60 -0
- package/src/ui-app/shared/hooks/useNavProgressFetchEffect.tsx +17 -0
- package/src/ui-app/shared/hooks/useSubpageEffect.tsx +28 -0
- package/src/ui-app/shared/hooks/user.hooks.ts +49 -0
- package/src/ui-app/shared/interfaces/ILog.tsx +13 -0
- package/src/ui-app/shared/interfaces/IUser.tsx +13 -0
- package/src/ui-app/shared/interfaces/logQueries.tsx +31 -0
- package/src/ui-app/shared/navigation/interfaces.tsx +7 -0
- package/src/ui-app/shared/navigation/navigationData.tsx +191 -0
- package/src/ui-app/shared/services/checks.service.ts +39 -0
- package/src/ui-app/shared/services/generic.service.ts +115 -0
- package/src/ui-app/shared/services/index.ts +6 -0
- package/src/ui-app/shared/services/runs.service.ts +20 -0
- package/src/ui-app/shared/services/suites.service.ts +20 -0
- package/src/ui-app/shared/services/tests.service.ts +39 -0
- package/src/ui-app/shared/services/users.service.ts +29 -0
- package/src/ui-app/shared/utils/Logger.ts +12 -0
- package/src/ui-app/shared/utils/SearchParams.ts +17 -0
- package/src/ui-app/shared/utils/filters.tsx +14 -0
- package/src/ui-app/shared/utils/index.ts +5 -0
- package/src/ui-app/shared/utils/utils.tsx +70 -0
- package/src/ui-app/stub.html +12 -0
- package/src/ui-app/stub.tsx +58 -0
- package/src/ui-app/stubDemoColors.tsx +47 -0
- package/src/ui-app/stubDemoNav.tsx +41 -0
- package/src/ui-app/tsconfig.json +21 -0
- package/src/ui-app/tsconfig.node.json +12 -0
- package/static/A.png +0 -0
- package/static/B.png +0 -0
- package/static/affected.html +39 -0
- package/static/affected_2.html +40 -0
- package/static/data/custom_devices.json +14 -0
- package/static/grids/desktop-higher.html +72 -0
- package/static/grids/desktop-wider.html +72 -0
- package/static/grids/desktop.html +61 -0
- package/static/grids/fit-in-view.html +62 -0
- package/static/js/canvasjs.min.js.bak +957 -0
- package/static/js/chart.js.bak +92 -0
- package/static/js/jquery-3.3.1.slim.js.bak +8269 -0
- package/static/js/jquery-3.3.1.slim.min.js.bak +2 -0
- package/static/js/moment.min.js.bak +2 -0
- package/static/low_diff_0.png +0 -0
- package/static/low_diff_1.png +0 -0
- package/static/vShift.png +0 -0
- package/static/vShift_bottom.png +0 -0
- package/static/vShift_top.png +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle,indent */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { RelatedCheckItem } from './RelatedCheckItem';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
infinityQuery: any
|
|
7
|
+
relatedActiveCheckId: any
|
|
8
|
+
setRelatedActiveCheckId: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function RelatedChecksItems({ infinityQuery, relatedActiveCheckId, setRelatedActiveCheckId }: Props) {
|
|
12
|
+
return infinityQuery.data
|
|
13
|
+
? (infinityQuery.data.pages.map(
|
|
14
|
+
(page: any) => (
|
|
15
|
+
page.results.map(
|
|
16
|
+
// eslint-disable-next-line no-unused-vars
|
|
17
|
+
(item: any, index: number) => (
|
|
18
|
+
<RelatedCheckItem
|
|
19
|
+
checkData={item}
|
|
20
|
+
activeCheckId={relatedActiveCheckId}
|
|
21
|
+
setRelatedActiveCheckId={setRelatedActiveCheckId}
|
|
22
|
+
key={item._id}
|
|
23
|
+
index={index}
|
|
24
|
+
/>
|
|
25
|
+
),
|
|
26
|
+
)
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
: [];
|
|
31
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Group, Skeleton, Stack } from '@mantine/core';
|
|
3
|
+
import { useInView } from 'react-intersection-observer';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
num: number
|
|
8
|
+
infinityQuery: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function RelatedChecksSkeleton({ num, infinityQuery }: Props) {
|
|
12
|
+
const { ref, inView } = useInView();
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (inView && infinityQuery) {
|
|
16
|
+
infinityQuery.fetchNextPage();
|
|
17
|
+
}
|
|
18
|
+
}, [inView]);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Stack ref={ref}>
|
|
22
|
+
{
|
|
23
|
+
(infinityQuery === null || infinityQuery.hasNextPage)
|
|
24
|
+
&& (
|
|
25
|
+
Object.keys(new Array(num).fill('')).map(
|
|
26
|
+
(x) => (
|
|
27
|
+
<React.Fragment key={x}>
|
|
28
|
+
<Group style={{ width: '100%' }} pl="xs" pr="md">
|
|
29
|
+
<Skeleton height={120} mt="sm" width="125px" radius="sm" />
|
|
30
|
+
</Group>
|
|
31
|
+
</React.Fragment>
|
|
32
|
+
),
|
|
33
|
+
))
|
|
34
|
+
}
|
|
35
|
+
</Stack>
|
|
36
|
+
);
|
|
37
|
+
}
|
package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/HighlightButton.tsx
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ActionIcon, Group, Text, Tooltip } from '@mantine/core';
|
|
3
|
+
import { IconBulb } from '@tabler/icons';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { highlightDiff, IGroup } from './highlightDiff';
|
|
6
|
+
import { MainView } from '../Canvas/mainView';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
mainView: MainView,
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function HighlightButton({ mainView, disabled = false }: Props) {
|
|
14
|
+
const [loadHighlights, setLoadHighlights] = useState(false);
|
|
15
|
+
const [highlightsGroups, setHighlightsGroups] = useState<IGroup[] | null>(null);
|
|
16
|
+
const [imageData, setImageData] = useState(null);
|
|
17
|
+
const label = disabled
|
|
18
|
+
? (
|
|
19
|
+
<Group noWrap>
|
|
20
|
+
<Text>
|
|
21
|
+
Difference highlighting, active in diff mode when
|
|
22
|
+
the difference is less than 5%
|
|
23
|
+
</Text>
|
|
24
|
+
</Group>
|
|
25
|
+
)
|
|
26
|
+
: (
|
|
27
|
+
<Group noWrap>
|
|
28
|
+
<Text>Difference highlighting</Text>
|
|
29
|
+
</Group>
|
|
30
|
+
);
|
|
31
|
+
return (
|
|
32
|
+
<Tooltip
|
|
33
|
+
withinPortal
|
|
34
|
+
label={
|
|
35
|
+
label
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
<div>
|
|
39
|
+
<ActionIcon
|
|
40
|
+
data-check="highlight-icon"
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
loading={loadHighlights}
|
|
43
|
+
onClick={async () => {
|
|
44
|
+
setLoadHighlights(() => true);
|
|
45
|
+
const { groups, diffImageData } = await highlightDiff(mainView, highlightsGroups, imageData);
|
|
46
|
+
setImageData(() => diffImageData);
|
|
47
|
+
setHighlightsGroups(() => groups);
|
|
48
|
+
setLoadHighlights(() => false);
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<IconBulb size={24} stroke={1} />
|
|
52
|
+
</ActionIcon>
|
|
53
|
+
</div>
|
|
54
|
+
</Tooltip>
|
|
55
|
+
);
|
|
56
|
+
}
|
package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/RegionsToolbar.tsx
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* eslint-disable prefer-arrow-callback */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ActionIcon, Group, Kbd, Stack, Text, Tooltip } from '@mantine/core';
|
|
4
|
+
import { IconDeviceFloppy, IconShape, IconShapeOff } from '@tabler/icons';
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
import { useHotkeys } from '@mantine/hooks';
|
|
7
|
+
import { MainView } from '../Canvas/mainView';
|
|
8
|
+
import { log } from '../../../../../../../shared/utils/Logger';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
mainView: any
|
|
12
|
+
baselineId: string
|
|
13
|
+
view: string,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function RegionsToolbar({ mainView, baselineId, view }: Props) {
|
|
17
|
+
const [visibleRegionRemoveButton, setVisibleRegionRemoveButton] = useState(false);
|
|
18
|
+
|
|
19
|
+
const regionsSelectionEvents = () => {
|
|
20
|
+
const handler = () => {
|
|
21
|
+
const els = mainView.canvas.getActiveObjects()
|
|
22
|
+
.filter((x: any) => x.name === 'ignore_rect');
|
|
23
|
+
|
|
24
|
+
if (els.length > 0) {
|
|
25
|
+
setVisibleRegionRemoveButton(() => true);
|
|
26
|
+
} else {
|
|
27
|
+
setVisibleRegionRemoveButton(() => false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
mainView.canvas.on(
|
|
32
|
+
{
|
|
33
|
+
'selection:cleared':
|
|
34
|
+
// eslint-disable-next-line no-unused-vars
|
|
35
|
+
(e: any) => {
|
|
36
|
+
log.debug('cleared selection');
|
|
37
|
+
handler();
|
|
38
|
+
},
|
|
39
|
+
'selection:updated':
|
|
40
|
+
// eslint-disable-next-line no-unused-vars
|
|
41
|
+
(e: any) => {
|
|
42
|
+
log.debug('update selection');
|
|
43
|
+
handler();
|
|
44
|
+
},
|
|
45
|
+
'selection:created':
|
|
46
|
+
// eslint-disable-next-line no-unused-vars
|
|
47
|
+
(e: any) => {
|
|
48
|
+
log.debug('create selection');
|
|
49
|
+
handler();
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
useHotkeys([
|
|
55
|
+
['alt+S', () => {
|
|
56
|
+
MainView.sendIgnoreRegions(baselineId!, mainView.getRectData());
|
|
57
|
+
}],
|
|
58
|
+
['Delete', () => mainView.removeActiveIgnoreRegions()],
|
|
59
|
+
['Backspace', () => mainView.removeActiveIgnoreRegions()],
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
useEffect(function initView() {
|
|
63
|
+
if (mainView) {
|
|
64
|
+
regionsSelectionEvents();
|
|
65
|
+
}
|
|
66
|
+
}, [
|
|
67
|
+
mainView?.toString(),
|
|
68
|
+
]);
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<Tooltip
|
|
72
|
+
label={
|
|
73
|
+
(
|
|
74
|
+
<Group noWrap>
|
|
75
|
+
<Text>Remove selected ignore regions</Text>
|
|
76
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>Del</Kbd>
|
|
77
|
+
{' or '}
|
|
78
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>Backspace</Kbd>
|
|
79
|
+
</Group>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
<ActionIcon
|
|
84
|
+
data-check="remove-ignore-region"
|
|
85
|
+
disabled={!visibleRegionRemoveButton}
|
|
86
|
+
onClick={() => mainView.removeActiveIgnoreRegions()}
|
|
87
|
+
>
|
|
88
|
+
<IconShapeOff size={24} stroke={1} />
|
|
89
|
+
</ActionIcon>
|
|
90
|
+
</Tooltip>
|
|
91
|
+
|
|
92
|
+
<Tooltip
|
|
93
|
+
multiline
|
|
94
|
+
withinPortal
|
|
95
|
+
label={
|
|
96
|
+
(
|
|
97
|
+
<Stack spacing={4}>
|
|
98
|
+
<Group noWrap spacing={4}>
|
|
99
|
+
<Text>Add ignore region</Text>
|
|
100
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>A</Kbd>
|
|
101
|
+
</Group>
|
|
102
|
+
{
|
|
103
|
+
!baselineId && (
|
|
104
|
+
<Group noWrap spacing={4}>
|
|
105
|
+
<Text color="orange">⚠</Text>
|
|
106
|
+
<Text> First you need to accept this check</Text>
|
|
107
|
+
</Group>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
</Stack>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
>
|
|
114
|
+
<div>
|
|
115
|
+
<ActionIcon
|
|
116
|
+
data-check="add-ignore-region"
|
|
117
|
+
disabled={(view === 'slider') || !baselineId}
|
|
118
|
+
onClick={() => mainView.addIgnoreRegion({ name: 'ignore_rect', strokeWidth: 0 })}
|
|
119
|
+
>
|
|
120
|
+
<IconShape size={24} stroke={1} />
|
|
121
|
+
</ActionIcon>
|
|
122
|
+
</div>
|
|
123
|
+
</Tooltip>
|
|
124
|
+
|
|
125
|
+
<Tooltip
|
|
126
|
+
withinPortal
|
|
127
|
+
label={
|
|
128
|
+
(
|
|
129
|
+
<Group>
|
|
130
|
+
<Text>Save ignore Regions</Text>
|
|
131
|
+
<Group align="left" spacing={4} noWrap>
|
|
132
|
+
|
|
133
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>Alt</Kbd>
|
|
134
|
+
+
|
|
135
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>S</Kbd>
|
|
136
|
+
</Group>
|
|
137
|
+
</Group>
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
>
|
|
141
|
+
<ActionIcon
|
|
142
|
+
data-check="save-ignore-region"
|
|
143
|
+
onClick={() => MainView.sendIgnoreRegions(baselineId!, mainView.getRectData())}
|
|
144
|
+
>
|
|
145
|
+
<IconDeviceFloppy size={24} stroke={1} />
|
|
146
|
+
</ActionIcon>
|
|
147
|
+
</Tooltip>
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
150
|
+
}
|
package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ScreenshotDetails.tsx
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { Badge, Loader, Tooltip, Group, Text, createStyles } from '@mantine/core';
|
|
5
|
+
import * as dateFns from 'date-fns';
|
|
6
|
+
|
|
7
|
+
const useStyles = createStyles((theme) => ({
|
|
8
|
+
infoBadges: {
|
|
9
|
+
marginLeft: 8,
|
|
10
|
+
paddingLeft: 4,
|
|
11
|
+
paddingRight: 4,
|
|
12
|
+
},
|
|
13
|
+
labels: {
|
|
14
|
+
'@media (max-width: 1070px)': {
|
|
15
|
+
display: 'none',
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
mainView: any
|
|
22
|
+
view: string
|
|
23
|
+
check: any
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function ScreenshotDetails({ mainView, view, check = {} }: Props) {
|
|
27
|
+
const { classes } = useStyles();
|
|
28
|
+
|
|
29
|
+
const checkResult = check.result ? JSON.parse(check.result) : null
|
|
30
|
+
let diffPercent = checkResult.misMatchPercentage ? (checkResult.misMatchPercentage) : ''
|
|
31
|
+
diffPercent = (
|
|
32
|
+
(diffPercent === '0.00' || diffPercent === '')
|
|
33
|
+
&& (checkResult.rawMisMatchPercentage?.toString()?.length > 0)
|
|
34
|
+
) ?
|
|
35
|
+
checkResult.rawMisMatchPercentage :
|
|
36
|
+
checkResult.misMatchPercentage;
|
|
37
|
+
|
|
38
|
+
const imageSize = useMemo(() => {
|
|
39
|
+
if (view === 'slider') return null;
|
|
40
|
+
if (mainView) {
|
|
41
|
+
const image = mainView[`${view}Image`];
|
|
42
|
+
if (view === 'diff' && !mainView?.diffImage) return null;
|
|
43
|
+
return (
|
|
44
|
+
<Tooltip
|
|
45
|
+
withinPortal
|
|
46
|
+
label={`Screenshot size: ${image.width}x${image.height}, click to open the image in a new tab`}
|
|
47
|
+
>
|
|
48
|
+
<Badge color="blue" radius={'sm'} className={classes.infoBadges} data-check="image-size">
|
|
49
|
+
<a
|
|
50
|
+
href={image.getSrc()}
|
|
51
|
+
target="_blank"
|
|
52
|
+
style={{ color: 'inherit', textDecoration: 'inherit' }}
|
|
53
|
+
rel="noreferrer"
|
|
54
|
+
>
|
|
55
|
+
{`${image.width}x${image.height}`}
|
|
56
|
+
</a>
|
|
57
|
+
</Badge>
|
|
58
|
+
</Tooltip>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return (
|
|
62
|
+
<Badge color="blue" radius={'sm'} className={classes.infoBadges}>
|
|
63
|
+
<Loader size="xs" color="blue" variant="dots" />
|
|
64
|
+
</Badge>
|
|
65
|
+
);
|
|
66
|
+
}, [mainView, view]);
|
|
67
|
+
|
|
68
|
+
const actualDate = check?.actualSnapshotId?.createdDate
|
|
69
|
+
? dateFns.format(dateFns.parseISO(check?.actualSnapshotId?.createdDate), 'yyyy-MM-dd HH:mm:ss')
|
|
70
|
+
: ''
|
|
71
|
+
const baselineDate = check?.baselineId?.createdDate
|
|
72
|
+
? dateFns.format(dateFns.parseISO(check?.baselineId?.createdDate), 'yyyy-MM-dd HH:mm:ss')
|
|
73
|
+
: '';
|
|
74
|
+
|
|
75
|
+
const createdDate = view === 'actual' ? actualDate : baselineDate
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Group spacing="sm" noWrap>
|
|
79
|
+
{
|
|
80
|
+
view !== 'slider'
|
|
81
|
+
? (
|
|
82
|
+
<>
|
|
83
|
+
<Group spacing={0} noWrap>
|
|
84
|
+
<Text size="sm" lineClamp={1} className={classes.labels} title="Image size">
|
|
85
|
+
Image Size:
|
|
86
|
+
</Text>
|
|
87
|
+
<Text size="sm">
|
|
88
|
+
{imageSize}
|
|
89
|
+
</Text>
|
|
90
|
+
</Group>
|
|
91
|
+
|
|
92
|
+
<Group spacing={0} noWrap>
|
|
93
|
+
<Text lineClamp={1} className={classes.labels} size="sm">
|
|
94
|
+
Date:
|
|
95
|
+
</Text>
|
|
96
|
+
<Tooltip label={`Image Date: ${createdDate}`} withinPortal>
|
|
97
|
+
|
|
98
|
+
<Badge color="blue" radius={'sm'} className={classes.infoBadges}
|
|
99
|
+
data-check="image-date">
|
|
100
|
+
{
|
|
101
|
+
createdDate
|
|
102
|
+
}
|
|
103
|
+
</Badge>
|
|
104
|
+
</Tooltip>
|
|
105
|
+
</Group>
|
|
106
|
+
{
|
|
107
|
+
view === 'diff' && (
|
|
108
|
+
<>
|
|
109
|
+
<Group spacing={0} noWrap>
|
|
110
|
+
<Text lineClamp={1} size="sm" className={classes.labels}>
|
|
111
|
+
Difference:
|
|
112
|
+
</Text>
|
|
113
|
+
<Tooltip label={`Images difference: ${diffPercent} %`} withinPortal>
|
|
114
|
+
<Badge
|
|
115
|
+
color="blue"
|
|
116
|
+
radius={'sm'}
|
|
117
|
+
sx={{ maxWidth: 100 }}
|
|
118
|
+
data-check="diff-percent"
|
|
119
|
+
className={classes.infoBadges}>
|
|
120
|
+
{diffPercent}%
|
|
121
|
+
</Badge>
|
|
122
|
+
</Tooltip>
|
|
123
|
+
</Group>
|
|
124
|
+
</>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
</>
|
|
128
|
+
)
|
|
129
|
+
: (
|
|
130
|
+
<>
|
|
131
|
+
</>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
</Group>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* eslint-disable prefer-arrow-callback,react-hooks/exhaustive-deps */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Divider, Group } from '@mantine/core';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { ScreenshotDetails } from './ScreenshotDetails';
|
|
6
|
+
import { ZoomToolbar } from './ZoomToolbar';
|
|
7
|
+
import { MainView } from '../Canvas/mainView';
|
|
8
|
+
import { ViewSegmentedControl } from './ViewSegmentedControl';
|
|
9
|
+
import { HighlightButton } from './HighlightButton';
|
|
10
|
+
import { RegionsToolbar } from './RegionsToolbar';
|
|
11
|
+
import { AcceptButton } from '../../AcceptButton';
|
|
12
|
+
import { RemoveButton } from '../../RemoveButton';
|
|
13
|
+
import { useParams } from '../../../../../../hooks/useParams';
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
mainView: any
|
|
17
|
+
classes: any
|
|
18
|
+
curCheck: any
|
|
19
|
+
baselineId: string
|
|
20
|
+
initCheckData: any
|
|
21
|
+
checkQuery: any
|
|
22
|
+
closeHandler: any
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function Toolbar(
|
|
26
|
+
{
|
|
27
|
+
mainView,
|
|
28
|
+
classes,
|
|
29
|
+
curCheck,
|
|
30
|
+
baselineId,
|
|
31
|
+
initCheckData,
|
|
32
|
+
checkQuery,
|
|
33
|
+
closeHandler,
|
|
34
|
+
}: Props,
|
|
35
|
+
) {
|
|
36
|
+
const { query } = useParams();
|
|
37
|
+
const [view, setView] = useState('actual');
|
|
38
|
+
|
|
39
|
+
useEffect(function initView() {
|
|
40
|
+
if (mainView?.diffImage) {
|
|
41
|
+
setView(() => 'diff');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setView(() => 'actual');
|
|
45
|
+
}, [mainView?.diffImage, query.checkId]);
|
|
46
|
+
|
|
47
|
+
useEffect(function switchView() {
|
|
48
|
+
if (mainView) {
|
|
49
|
+
mainView.switchView(view);
|
|
50
|
+
}
|
|
51
|
+
}, [view]);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Group position="apart" noWrap data-check="toolbar">
|
|
55
|
+
<ScreenshotDetails mainView={mainView} check={curCheck} view={view} />
|
|
56
|
+
<Group spacing="sm" noWrap>
|
|
57
|
+
<Group
|
|
58
|
+
spacing={4}
|
|
59
|
+
className={classes.zoomButtonsWrapper}
|
|
60
|
+
position="center"
|
|
61
|
+
align="center"
|
|
62
|
+
noWrap
|
|
63
|
+
>
|
|
64
|
+
<ZoomToolbar mainView={mainView as MainView} view={view} />
|
|
65
|
+
</Group>
|
|
66
|
+
|
|
67
|
+
<Divider orientation="vertical" />
|
|
68
|
+
|
|
69
|
+
<ViewSegmentedControl view={view} setView={setView} currentCheck={curCheck} />
|
|
70
|
+
|
|
71
|
+
<Divider orientation="vertical" />
|
|
72
|
+
|
|
73
|
+
<HighlightButton
|
|
74
|
+
mainView={mainView as MainView}
|
|
75
|
+
disabled={!(view === 'diff' && parseFloat(curCheck?.parsedResult?.rawMisMatchPercentage) < 5)}
|
|
76
|
+
/>
|
|
77
|
+
<Divider orientation="vertical" />
|
|
78
|
+
|
|
79
|
+
<RegionsToolbar mainView={mainView} baselineId={baselineId} view={view} />
|
|
80
|
+
|
|
81
|
+
<Divider orientation="vertical" />
|
|
82
|
+
<AcceptButton
|
|
83
|
+
check={curCheck}
|
|
84
|
+
initCheck={initCheckData}
|
|
85
|
+
checksQuery={checkQuery}
|
|
86
|
+
size={24}
|
|
87
|
+
testUpdateQuery={checkQuery}
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<RemoveButton
|
|
91
|
+
check={curCheck}
|
|
92
|
+
initCheck={initCheckData}
|
|
93
|
+
testUpdateQuery={checkQuery}
|
|
94
|
+
size={30}
|
|
95
|
+
closeHandler={closeHandler}
|
|
96
|
+
/>
|
|
97
|
+
</Group>
|
|
98
|
+
</Group>
|
|
99
|
+
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Group, Kbd, SegmentedControl, Text, Tooltip, createStyles } from '@mantine/core';
|
|
3
|
+
import { IconArrowsExchange2, IconSquareHalf, IconSquareLetterA, IconSquareLetterE } from '@tabler/icons';
|
|
4
|
+
import { useHotkeys } from '@mantine/hooks';
|
|
5
|
+
|
|
6
|
+
const useStyles = createStyles((theme) => ({
|
|
7
|
+
labelIcon: {
|
|
8
|
+
minWidth: 18,
|
|
9
|
+
},
|
|
10
|
+
labelText: {
|
|
11
|
+
[`@media (max-width: ${theme.breakpoints.lg}px)`]: {
|
|
12
|
+
display: 'none',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
view: string
|
|
19
|
+
setView: any
|
|
20
|
+
currentCheck: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function ViewSegmentedControl({ view, setView, currentCheck }: Props) {
|
|
24
|
+
const { classes } = useStyles();
|
|
25
|
+
|
|
26
|
+
useHotkeys([
|
|
27
|
+
['Digit1', () => setView('expected')],
|
|
28
|
+
['Digit2', () => setView('actual')],
|
|
29
|
+
['Digit3', () => {
|
|
30
|
+
if (currentCheck?.diffId?.filename) setView('diff');
|
|
31
|
+
}],
|
|
32
|
+
['Digit4', () => {
|
|
33
|
+
if (currentCheck?.diffId?.filename) setView('slider');
|
|
34
|
+
}],
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
const viewSegmentData = [
|
|
38
|
+
{
|
|
39
|
+
label: (
|
|
40
|
+
<Tooltip
|
|
41
|
+
withinPortal
|
|
42
|
+
label={
|
|
43
|
+
(
|
|
44
|
+
<Group noWrap>
|
|
45
|
+
<Text>Switch to Expected View</Text>
|
|
46
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>1</Kbd>
|
|
47
|
+
</Group>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
>
|
|
51
|
+
<Group position="left" spacing={4} noWrap data-check="expected-view">
|
|
52
|
+
<IconSquareLetterE stroke={1} className={classes.labelIcon} />
|
|
53
|
+
<Text lineClamp={1} className={classes.labelText}>
|
|
54
|
+
Expected
|
|
55
|
+
</Text>
|
|
56
|
+
</Group>
|
|
57
|
+
</Tooltip>
|
|
58
|
+
),
|
|
59
|
+
value: 'expected',
|
|
60
|
+
disabled: currentCheck?.status[0] === 'new',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: (
|
|
64
|
+
<Tooltip
|
|
65
|
+
withinPortal
|
|
66
|
+
label={
|
|
67
|
+
(
|
|
68
|
+
<Group noWrap>
|
|
69
|
+
<Text>Switch to Actual View</Text>
|
|
70
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>2</Kbd>
|
|
71
|
+
</Group>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
<Group position="left" spacing={4} noWrap data-check="actual-view">
|
|
76
|
+
<IconSquareLetterA stroke={1} className={classes.labelIcon} />
|
|
77
|
+
<Text lineClamp={1} className={classes.labelText}>
|
|
78
|
+
Actual
|
|
79
|
+
</Text>
|
|
80
|
+
</Group>
|
|
81
|
+
</Tooltip>
|
|
82
|
+
),
|
|
83
|
+
value: 'actual',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label:
|
|
87
|
+
(
|
|
88
|
+
<Tooltip
|
|
89
|
+
withinPortal
|
|
90
|
+
label={
|
|
91
|
+
(
|
|
92
|
+
<Group noWrap>
|
|
93
|
+
<Text>Switch to Difference View</Text>
|
|
94
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>3</Kbd>
|
|
95
|
+
</Group>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
<Group position="left" spacing={4} noWrap data-check="diff-view">
|
|
100
|
+
<IconArrowsExchange2 stroke={1} className={classes.labelIcon} />
|
|
101
|
+
<Text lineClamp={1} className={classes.labelText}>
|
|
102
|
+
Difference
|
|
103
|
+
</Text>
|
|
104
|
+
</Group>
|
|
105
|
+
</Tooltip>
|
|
106
|
+
),
|
|
107
|
+
value: 'diff',
|
|
108
|
+
disabled: !currentCheck?.diffId?.filename,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label:
|
|
112
|
+
(
|
|
113
|
+
<Tooltip
|
|
114
|
+
withinPortal
|
|
115
|
+
label={
|
|
116
|
+
(
|
|
117
|
+
<Group noWrap>
|
|
118
|
+
<Text>Switch to Slider View</Text>
|
|
119
|
+
<Kbd sx={{ fontSize: 11, borderBottomWidth: 1 }}>4</Kbd>
|
|
120
|
+
</Group>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
>
|
|
124
|
+
<Group position="left" spacing={4} noWrap data-check="slider-view">
|
|
125
|
+
<IconSquareHalf stroke={1} className={classes.labelIcon} />
|
|
126
|
+
<Text lineClamp={1} className={classes.labelText}>
|
|
127
|
+
Slider
|
|
128
|
+
</Text>
|
|
129
|
+
</Group>
|
|
130
|
+
</Tooltip>
|
|
131
|
+
),
|
|
132
|
+
value: 'slider',
|
|
133
|
+
disabled: !currentCheck?.diffId?.filename,
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<SegmentedControl
|
|
139
|
+
data-check="view-segment"
|
|
140
|
+
sx={{ minWidth: 0, minHeight: 0 }}
|
|
141
|
+
styles={
|
|
142
|
+
{
|
|
143
|
+
label: {
|
|
144
|
+
minWidth: 0,
|
|
145
|
+
minHeight: 0,
|
|
146
|
+
// overflow: 'hidden',
|
|
147
|
+
fontSize: 'calc(0.1em + 0.55vw)',
|
|
148
|
+
maxWidth: '7vw',
|
|
149
|
+
textOverflow: 'ellipsis',
|
|
150
|
+
whiteSpace: 'nowrap',
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
value={view}
|
|
155
|
+
onChange={setView}
|
|
156
|
+
data={viewSegmentData}
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
159
|
+
}
|