Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4a43f8c
add tutorials button in the navbar
wojcik91 Mar 31, 2026
4248e95
remove duplicate theme buttons
wojcik91 Mar 31, 2026
73a6b77
change naming convention
wojcik91 Mar 31, 2026
ac93f14
update json schema
wojcik91 Mar 31, 2026
187a6fe
add error log if parsing JSON fails
wojcik91 Apr 1, 2026
deaa775
Merge branch 'dev' into video_tutorials_menu
wojcik91 Apr 1, 2026
8fe2dc7
update source file validation
wojcik91 Apr 1, 2026
c64a773
update video to page mapping
wojcik91 Apr 1, 2026
8832b39
update tests
wojcik91 Apr 1, 2026
1b44229
setup tutorials modal infrastructure
wojcik91 Apr 1, 2026
522c1cf
show basic tutorials modal
wojcik91 Apr 1, 2026
25a0313
disable autoplay
wojcik91 Apr 1, 2026
50bfe32
add video icons
wojcik91 Apr 1, 2026
b97f3bd
sections styling and fold
wojcik91 Apr 1, 2026
45978ac
update video list styling & behavior
wojcik91 Apr 1, 2026
755a455
fix video section styling
wojcik91 Apr 1, 2026
357b813
adjust video corners
wojcik91 Apr 1, 2026
57d27f1
fix modal layout
wojcik91 Apr 1, 2026
71b8b7b
update readme
wojcik91 Apr 1, 2026
86a6cbc
adjust modal size to handle list scroll
wojcik91 Apr 1, 2026
35e32c6
cleanup
wojcik91 Apr 1, 2026
3b60a09
reorganize components
wojcik91 Apr 1, 2026
9a413ee
restore widget naming
wojcik91 Apr 1, 2026
2ff267a
move modal state
wojcik91 Apr 2, 2026
1282dbc
use a better key
wojcik91 Apr 2, 2026
7f1444c
improve parametrized route handling
wojcik91 Apr 2, 2026
d1c4c93
clear selection on modal close
wojcik91 Apr 2, 2026
42e750c
Merge branch 'dev' into video_tutorials_menu
wojcik91 Apr 2, 2026
15271e7
update ui submodule
wojcik91 Apr 2, 2026
5436fb3
update genereal description in readme
wojcik91 Apr 2, 2026
d92cc15
replace custom CSS with existing variables
wojcik91 Apr 2, 2026
5b68434
simplify version resolution
wojcik91 Apr 2, 2026
c4eb289
Merge branch 'dev' into video_tutorials_menu
wojcik91 Apr 2, 2026
bab3021
minimize CSS changes
wojcik91 Apr 2, 2026
0227e19
shorten css class names
wojcik91 Apr 2, 2026
944177b
adjust naming
wojcik91 Apr 2, 2026
c27345b
remove unnecessary comments
wojcik91 Apr 2, 2026
04421d8
formatting
wojcik91 Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions web/messages/en/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@
"acl_rule_error_permissions_required": "Configure at least one allowed user, group, or network device.",
"acl_rule_error_manual_destination_required": "Manual destination settings are enabled. Provide a value or enable Any.",
"cmp_video_support_launcher": "Video support",
"cmp_video_support_list_label": "Video tutorials",
"cmp_video_support_overlay_error": "Video unavailable",
"cmp_video_support_overlay_watch_on_youtube": "Watch on YouTube:",
"cmp_video_support_list_label": "Video support",
"cmp_video_tutorials_overlay_error": "Video unavailable",
"cmp_video_tutorials_overlay_watch_on_youtube": "Watch on YouTube:",
"cmp_nav_item_tutorials": "Tutorials",
"cmp_video_tutorials_modal_title": "Video tutorials",
"cmp_video_tutorials_modal_search_placeholder": "Search",
"cmp_video_tutorials_modal_go_to": "Go to {page}",
"cmp_video_tutorials_modal_learn_more": "Learn more in Documentation",
"cmp_helper_overview_period_select": "",
"cmp_helper_search": ""
}
4 changes: 3 additions & 1 deletion web/src/routes/_authorized/_default.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createFileRoute, Outlet } from '@tanstack/react-router';
import { Navigation } from '../../shared/components/Navigation/Navigation';
import { VideoSupportWidget } from '../../shared/video-support/VideoSupportWidget';
import { VideoSupportWidget } from '../../shared/video-tutorials/VideoSupportWidget';
import { VideoTutorialsModal } from '../../shared/video-tutorials/VideoTutorialsModal';

export const Route = createFileRoute('/_authorized/_default')({
component: RouteComponent,
Expand All @@ -12,6 +13,7 @@ function RouteComponent() {
<Outlet />
<Navigation />
<VideoSupportWidget />
<VideoTutorialsModal />
</>
);
}
45 changes: 9 additions & 36 deletions web/src/shared/components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@ import { NavLogo } from './assets/NavLogo';
import './style.scss';
import { useQuery } from '@tanstack/react-query';
import { Link, type LinkProps } from '@tanstack/react-router';
import clsx from 'clsx';
import { type LicenseInfo, LicenseTier, type LicenseTierValue } from '../../api/types';
import { externalLink } from '../../constants';
import { Fold } from '../../defguard-ui/components/Fold/Fold';
import { TooltipContent } from '../../defguard-ui/providers/tooltip/TooltipContent';
import { TooltipProvider } from '../../defguard-ui/providers/tooltip/TooltipContext';
import { TooltipTrigger } from '../../defguard-ui/providers/tooltip/TooltipTrigger';
import { isPresent } from '../../defguard-ui/utils/isPresent';
import { useTheme } from '../../hooks/theme/useTheme';
import {
getAliasesCountQueryOptions,
getDestinationsCountQueryOptions,
getLicenseInfoQueryOptions,
getRulesCountQueryOptions,
videoTutorialsQueryOptions,
} from '../../query';
import { canUseBusinessFeature } from '../../utils/license';
import { NavTutorialsButton } from '../../video-tutorials/components/widget/NavTutorialsButton/NavTutorialsButton';

interface NavGroupProps {
id: string;
Expand Down Expand Up @@ -196,6 +195,8 @@ export const Navigation = () => {
enabled: isAdmin,
});

const { data: videoTutorialsData } = useQuery(videoTutorialsQueryOptions);

const navigationGroups = useMemo(() => {
const pendingCounts = {
rules: rulesCount?.pending,
Expand Down Expand Up @@ -234,7 +235,11 @@ export const Navigation = () => {
))}
</div>
<div className="bottom">
<NavControls />
{videoTutorialsData && (
<div className="nav-group">
<NavTutorialsButton />
</div>
Comment thread
wojcik91 marked this conversation as resolved.
)}
</div>
</div>
);
Expand Down Expand Up @@ -314,35 +319,3 @@ const NavItem = ({
</Link>
);
};

const NavControls = () => {
const { changeTheme, theme } = useTheme();

return (
<div className="nav-controls">
<IconButton
className={clsx({
active: theme === 'light',
})}
icon="light-theme"
onClick={() => {
changeTheme('light');
}}
/>
<IconButton
className={clsx({
active: theme === 'dark',
})}
icon="dark-theme"
onClick={() => {
changeTheme('dark');
}}
/>
<div className="right">
<a rel="noopener noreferrer" target="_blank" href={externalLink.defguard.docs}>
<IconButton icon="help" />
</a>
</div>
</div>
);
};
19 changes: 4 additions & 15 deletions web/src/shared/components/Navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
width: 100%;
margin-top: auto;
box-sizing: border-box;
padding: var(--spacing-md);
padding: var(--spacing-sm) var(--spacing-lg);
display: flex;
flex-flow: row nowrap;
align-items: center;
Expand All @@ -58,6 +58,7 @@

.navigation .nav-group {
user-select: none;
width: 100%;

& > .track {
display: flex;
Expand Down Expand Up @@ -103,6 +104,8 @@
width: 100%;
user-select: none;
border-radius: var(--radius-md);
border: none;
cursor: pointer;

@include animate(color, background-color);

Expand Down Expand Up @@ -135,17 +138,3 @@
row-gap: var(--spacing-xxs);
}
}

.navigation .nav-controls {
display: flex;
flex-flow: row nowrap;
column-gap: var(--spacing-md);
flex-basis: 100%;

.right {
display: flex;
flex-flow: row nowrap;
column-gap: var(--spacing-md);
margin-left: auto;
}
}
20 changes: 15 additions & 5 deletions web/src/shared/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import api from './api/api';
import { AclDeploymentState, type UserProfile } from './api/types';
import { updateServiceApi, updateServiceClient } from './api/update-service';
import { resourceDisplayMap } from './utils/resourceById';
import { parseVideoSupport, videoSupportPath } from './video-support/data';
import { parseVideoTutorials, videoTutorialsPath } from './video-tutorials/data';

export const getExternalProviderQueryOptions = queryOptions({
queryFn: api.openIdProvider.getOpenIdProvider,
Expand Down Expand Up @@ -117,10 +117,20 @@ export const clientArtifactsQueryOptions = queryOptions({
refetchOnReconnect: true,
});

export const videoSupportQueryOptions = queryOptions({
queryKey: ['update-service', 'video-support'],
queryFn: () => updateServiceClient.get<unknown>(videoSupportPath),
select: (resp) => parseVideoSupport(resp.data),
export const videoTutorialsQueryOptions = queryOptions({
queryKey: ['update-service', 'video-tutorials'],
queryFn: () => updateServiceClient.get<unknown>(videoTutorialsPath),
select: (resp) => {
try {
return parseVideoTutorials(resp.data);
} catch (err) {
console.error(
'[video-tutorials] Fetched successfully but failed to parse response:',
err,
);
throw err;
}
},
// Mappings are version-tied and won't meaningfully change within a session.
staleTime: Infinity,
// Silent failure: if the fetch or parse fails, the widget simply won't appear.
Expand Down
191 changes: 0 additions & 191 deletions web/src/shared/video-support/README.md

This file was deleted.

Loading
Loading