Skip to content

Commit

Permalink
Merge branch 'main' of github.com:UKHomeOffice/drt-react into DRTII-1…
Browse files Browse the repository at this point in the history
…557-min-staff
  • Loading branch information
Nilesh Gupta committed Sep 25, 2024
2 parents d40922e + 4af0e47 commit fcf278b
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 141 deletions.
129 changes: 62 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@drt/drt-react-components",
"version": "1.3.0",
"version": "1.5.1",
"description": "React components for DRT applications",
"main": "dist/cjs/bundle.js",
"module": "dist/esm/bundle.js",
Expand Down
111 changes: 61 additions & 50 deletions src/components/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,71 @@ const meta: Meta<typeof HeaderComponent> = {
component: HeaderComponent,
};

const HeaderArgs = {
userRoles: [
'manage-users',
'download-manager',
'health-checks:edit',
],
portMenuItems: [
{ label: 'National Dashboard', link: '/national-pressure' },
{ label: 'CWL (Cardiff)', link: '/cwi' }
],
adminMenuItems: [
{ label: 'Home', link: '/', roles: []},
{ label: 'Access requests', link: '/access-requests', roles: ['manage-users']},
{ label: 'Alert notices', link: '/alerts', roles: ['manage-users']},
{ label: 'Drop-in sessions', link: '/drop-in-sessions', roles: ['manage-users']},
{ label: 'Download Manager', link: '/download', roles: ['download-manager']},
{ label: 'Export Config', link: '/export-config', roles: ['manage-users']},
{ label: 'Feature guides', link: '/feature-guides', roles: ['manage-users']},
{ label: 'Health checks', link: '/health-checks', roles: ['health-checks:edit']},
{ label: 'Health check pauses', link: '/health-check-pauses', roles: ['health-checks:edit']},
{ label: 'Feedback', link: '/user-feedback', roles: ['manage-users']},
{ label: 'Users', link: '/users', roles: ['manage-users']},
],
leftMenuItems: [
{
label: 'Port config',
link: '/port-config',
icon: 'Settings',
},
{
label: 'Feed',
link: '/feed',
icon: 'Equalizer',
}
],
rightMenuItems: [
{
label: "What's new",
link: '/whats-new',
icon: 'Article',
},
{
label: 'Training',
link: '/training',
icon: 'MenuBook',
}
],
maxWidth: 'none',
initialSelectedPortMenuItem: '',
routingFunction: (string: string) => console.log(string),
logoutLink: () => {},
}

export default meta;
type Story = StoryObj<typeof HeaderComponent>;

export const Header: Story = {
export const FullWidthHeader: Story = {
args: HeaderArgs,
parameters: {},
};

export const ConstrainedWidthHeader: Story = {
args: {
userRoles: [
'manage-users',
'download-manager',
'health-checks:edit',
],
portMenuItems: [
{ label: 'National Dashboard', link: '/national-pressure' },
{ label: 'CWL (Cardiff)', link: '/cwi' }
],
adminMenuItems: [
{ label: 'Home', link: '/', roles: []},
{ label: 'Access requests', link: '/access-requests', roles: ['manage-users']},
{ label: 'Alert notices', link: '/alerts', roles: ['manage-users']},
{ label: 'Drop-in sessions', link: '/drop-in-sessions', roles: ['manage-users']},
{ label: 'Download Manager', link: '/download', roles: ['download-manager']},
{ label: 'Export Config', link: '/export-config', roles: ['manage-users']},
{ label: 'Feature guides', link: '/feature-guides', roles: ['manage-users']},
{ label: 'Health checks', link: '/health-checks', roles: ['health-checks:edit']},
{ label: 'Health check pauses', link: '/health-check-pauses', roles: ['health-checks:edit']},
{ label: 'Feedback', link: '/user-feedback', roles: ['manage-users']},
{ label: 'Users', link: '/users', roles: ['manage-users']},
],
leftMenuItems: [
{
label: 'Port config',
link: '/port-config',
icon: 'Settings',
},
{
label: 'Feed',
link: '/feed',
icon: 'Equalizer',
}
],
rightMenuItems: [
{
label: "What's new",
link: '/whats-new',
icon: 'Article',
},
{
label: 'Training',
link: '/training',
icon: 'MenuBook',
}
],
initialSelectedPortMenuItem: '',
routingFunction: (string) => console.log(string),
logoutLink: () => {},
...HeaderArgs,
maxWidth: '1280px',
},
parameters: {},
};
Loading

0 comments on commit fcf278b

Please sign in to comment.