Skip to content

Commit e07f19b

Browse files
authored
feat: unified floating actions with route-based help
2 parents b49747d + 0a9e1e2 commit e07f19b

File tree

14 files changed

+125
-57
lines changed

14 files changed

+125
-57
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Security.Claims;
2+
using Microsoft.AspNetCore.Identity;
3+
using Microsoft.Extensions.Options;
4+
using ThingConnect.Pulse.Server.Data;
5+
6+
namespace ThingConnect.Pulse.Server.Infrastructure;
7+
8+
/// <summary>
9+
/// Custom claims principal factory to add role claims from ApplicationUser.Role property
10+
/// </summary>
11+
public sealed class ApplicationUserClaimsPrincipalFactory : UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>
12+
{
13+
public ApplicationUserClaimsPrincipalFactory(
14+
UserManager<ApplicationUser> userManager,
15+
RoleManager<IdentityRole> roleManager,
16+
IOptions<IdentityOptions> optionsAccessor)
17+
: base(userManager, roleManager, optionsAccessor)
18+
{
19+
}
20+
21+
protected override async Task<ClaimsIdentity> GenerateClaimsAsync(ApplicationUser user)
22+
{
23+
var identity = await base.GenerateClaimsAsync(user);
24+
25+
// Add the role claim from the custom Role property
26+
if (!string.IsNullOrEmpty(user.Role))
27+
{
28+
identity.AddClaim(new Claim(ClaimTypes.Role, user.Role));
29+
}
30+
31+
return identity;
32+
}
33+
}

ThingConnect.Pulse.Server/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public static async Task Main(string[] args)
7070
options.SignIn.RequireConfirmedEmail = false;
7171
})
7272
.AddEntityFrameworkStores<PulseDbContext>()
73-
.AddDefaultTokenProviders();
73+
.AddDefaultTokenProviders()
74+
.AddClaimsPrincipalFactory<ApplicationUserClaimsPrincipalFactory>();
7475

7576
// Configure cookie authentication to override Identity defaults
7677
builder.Services.ConfigureApplicationCookie(options =>

marketing/content/blog-posts/category-1-getting-started/installing-thingconnect-pulse-5-minute-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Before we dive into installation, let's ensure your system meets the minimal req
4040

4141
<!-- IMAGE NEEDED: Screenshot of download page highlighting the Windows installer -->
4242

43-
1. Navigate to [pulse.thingconnect.com/download](pulse.thingconnect.com/download)
43+
1. Navigate to [pulse.thingconnect.io/download](pulse.thingconnect.io/download)
4444
2. Click "Download for Windows"
4545
3. Save the installer file (ThingConnectPulse-Setup.exe) to your Downloads folder
4646

@@ -199,9 +199,9 @@ ThingConnect Pulse's 5-minute installation means you can:
199199

200200
ThingConnect Pulse provides enterprise-grade monitoring capabilities without the enterprise price tag. Our 5-minute installation is just the beginning - you now have access to the same network visibility that manufacturing facilities pay thousands of dollars annually to achieve.
201201

202-
**Ready to start monitoring?** Download ThingConnect Pulse free at [pulse.thingconnect.com](pulse.thingconnect.com) and join hundreds of manufacturing facilities who've eliminated network-related production delays.
202+
**Ready to start monitoring?** Download ThingConnect Pulse free at [pulse.thingconnect.io](pulse.thingconnect.io) and join hundreds of manufacturing facilities who've eliminated network-related production delays.
203203

204-
**Questions about installation or setup?** Our manufacturing network monitoring experts are here to help. Contact us at [support@thingconnect.com](mailto:support@thingconnect.com) or join our community forum for peer-to-peer assistance.
204+
**Questions about installation or setup?** Our manufacturing network monitoring experts are here to help. Contact us at [support@thingconnect.io](mailto:support@thingconnect.io) or join our community forum for peer-to-peer assistance.
205205

206206
---
207207

marketing/content/blog-posts/category-1-getting-started/migrating-from-prtg-complete-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Before beginning your migration, take time to audit your current PRTG deployment
111111

112112
### Install ThingConnect Pulse:
113113

114-
1. **Download** from [pulse.thingconnect.com](pulse.thingconnect.com)
114+
1. **Download** from [pulse.thingconnect.io](pulse.thingconnect.io)
115115
2. **Install** using administrator privileges
116116
3. **Access dashboard** at http://localhost:8080
117117
4. **Complete initial configuration** wizard

thingconnect.pulse.client/src/components/config/ConfigurationVersions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function ConfigurationVersions({ refreshTrigger }: ConfigurationVersionsP
2020
setIsLoading(true);
2121
setError(null);
2222
const data = await configurationService.getVersions();
23+
// Sort by applied timestamp descending (most recent first)
2324
const sortedVersions = data.sort(
2425
(a, b) => new Date(b.appliedTs).getTime() - new Date(a.appliedTs).getTime()
2526
);

thingconnect.pulse.client/src/components/layout/AppShell.tsx

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { Outlet } from 'react-router-dom';
2-
import { Box, Flex, useBreakpointValue, IconButton } from '@chakra-ui/react';
2+
import { Box, Flex, useBreakpointValue } from '@chakra-ui/react';
33
import { useState } from 'react';
44
import { Navigation } from './Navigation';
55
import { Footer } from './Footer';
6-
import { Moon, Sun } from 'lucide-react';
7-
import { useColorMode } from '../ui/color-mode';
6+
import { FloatingActions } from './FloatingActions';
87

98
export function AppShell() {
109
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
1110
const sidebarWidth = useBreakpointValue({ base: '100%', md: '250px' });
1211
const isMobile = useBreakpointValue({ base: true, md: false });
13-
const { colorMode, toggleColorMode } = useColorMode();
1412

1513
const toggleSidebar = () => {
1614
setIsSidebarOpen(!isSidebarOpen);
@@ -65,20 +63,8 @@ export function AppShell() {
6563
{/* Footer */}
6664
<Footer />
6765

68-
{/* Floating Toggle Button */}
69-
<IconButton
70-
data-testid='theme-toggle'
71-
aria-label='Toggle color mode'
72-
variant='ghost'
73-
size='sm'
74-
position='fixed'
75-
top='16px'
76-
right='16px'
77-
zIndex={1100}
78-
onClick={toggleColorMode}
79-
>
80-
{colorMode === 'light' ? <Moon size={18} /> : <Sun size={18} />}
81-
</IconButton>
66+
{/* Floating Actions (Theme Toggle + Help Button) */}
67+
<FloatingActions />
8268
</Flex>
8369
);
8470
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { HStack, IconButton } from '@chakra-ui/react';
2+
import { Moon, Sun, HelpCircle } from 'lucide-react';
3+
import { useLocation } from 'react-router-dom';
4+
import { useColorMode } from '../ui/color-mode';
5+
import { Tooltip } from '../ui/tooltip';
6+
7+
// Route-to-help URL mapping
8+
const ROUTE_HELP_URLS: Record<string, string> = {
9+
'/': 'https://docs.thingconnect.io/pulse/user-guide/dashboard',
10+
'/configuration': 'https://docs.thingconnect.io/pulse/user-guide/configuration',
11+
'/history': 'https://docs.thingconnect.io/pulse/user-guide/viewing-history',
12+
'/settings': 'https://docs.thingconnect.io/pulse/user-guide/settings',
13+
'/about': 'https://docs.thingconnect.io/pulse/about',
14+
};
15+
16+
export function FloatingActions() {
17+
const { colorMode, toggleColorMode } = useColorMode();
18+
const location = useLocation();
19+
20+
const helpUrl = ROUTE_HELP_URLS[location.pathname];
21+
22+
const handleHelpClick = () => {
23+
if (helpUrl) {
24+
window.open(helpUrl, '_blank', 'noopener,noreferrer');
25+
}
26+
};
27+
28+
return (
29+
<HStack
30+
position="fixed"
31+
top="16px"
32+
right="16px"
33+
zIndex={1100}
34+
gap={1}
35+
data-testid="floating-actions"
36+
>
37+
{/* Help Button - only show if help URL exists for current route */}
38+
{helpUrl && (
39+
<Tooltip content="View Help">
40+
<IconButton
41+
data-testid="help-button"
42+
aria-label="View Help"
43+
variant="ghost"
44+
size="sm"
45+
onClick={handleHelpClick}
46+
_hover={{ bg: 'blue.50', _dark: { bg: 'blue.900' } }}
47+
>
48+
<HelpCircle size={18} />
49+
</IconButton>
50+
</Tooltip>
51+
)}
52+
53+
{/* Theme Toggle */}
54+
<Tooltip content="Toggle color mode">
55+
<IconButton
56+
data-testid="theme-toggle"
57+
aria-label="Toggle color mode"
58+
variant="ghost"
59+
size="sm"
60+
onClick={toggleColorMode}
61+
_hover={{ bg: 'gray.50', _dark: { bg: 'gray.800' } }}
62+
>
63+
{colorMode === 'light' ? <Moon size={18} /> : <Sun size={18} />}
64+
</IconButton>
65+
</Tooltip>
66+
</HStack>
67+
);
68+
}

thingconnect.pulse.client/src/components/layout/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function Footer() {
2424
<Text></Text>
2525
<Link
2626
data-testid='thingconnect-link'
27-
href='https://thingconnect.com'
27+
href='https://thingconnect.io'
2828
target='_blank'
2929
rel='noopener noreferrer'
3030
color='blue.600'

thingconnect.pulse.client/src/components/layout/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Box, VStack, Text, Icon, Image, HStack, Badge, Button } from '@chakra-u
22
import { Link as RouterLink, useLocation } from 'react-router-dom';
33
import { Wifi, Activity, LogOut } from 'lucide-react';
44
import thingConnectIcon from '@/assets/ThingConnectPulseLogo.svg';
5-
import { Clock, Wrench, Settings, Info, Dashboard } from '@/icons';
5+
import { Clock, Wrench, Settings, Info, Dashboard, Help } from '@/icons';
66
import { useAuth } from '@/features/auth/context/AuthContext';
77
interface NavigationProps {
88
onItemClick?: () => void;

thingconnect.pulse.client/src/pages/About.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,14 @@ export default function About() {
302302
</Text>
303303
<HStack gap={4} justify='center'>
304304
<Link
305-
href='https://thingconnect.com'
305+
href='https://thingconnect.io'
306306
target='_blank'
307307
rel='noopener noreferrer'
308308
_hover={{ textDecoration: 'none' }}
309309
>
310310
<Button size='sm' variant='outline'>
311311
<ExternalLink size={14} />
312-
Visit ThingConnect.com
312+
Visit ThingConnect.io
313313
</Button>
314314
</Link>
315315
</HStack>

0 commit comments

Comments
 (0)