Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(editor): updated n8n-menu component #4290

Merged
merged 49 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
aee8912
refactor(editor): N8N-4540 Main navigation layout rework (#4060)
MiloradFilipovic Sep 15, 2022
3b15c76
✨ Moved 'Workflows' menu to node view header. Added new dropdown com…
MiloradFilipovic Sep 15, 2022
4cc564a
💄 Updating disabled states in new WF menu
MiloradFilipovic Sep 15, 2022
0150e04
💄 Initial stab at new sidebar styling
MiloradFilipovic Sep 15, 2022
1a99621
✨ Finished main navigation restyling
MiloradFilipovic Sep 16, 2022
815161d
Merge branch 'master' into feature-main-nav-redesign
MiloradFilipovic Sep 16, 2022
82dd101
Merge branch 'feature-main-nav-redesign' into N8N-4542-main-sidebar-n…
MiloradFilipovic Sep 16, 2022
cd3db90
✨ Updating `zoomToFit` and centering logic
MiloradFilipovic Sep 19, 2022
5073fca
Merge branch 'master' into feature-main-nav-redesign
MiloradFilipovic Sep 19, 2022
8f0ff1b
Merge branch 'N8N-4542-main-sidebar-new-style' into feature-main-nav-…
MiloradFilipovic Sep 19, 2022
2d80d1d
✨ Adding updates menu item to settings sidebar
MiloradFilipovic Sep 19, 2022
e80827e
💄 Adding updates item to the settings sidebar and final touches on ma…
MiloradFilipovic Sep 19, 2022
c2fbb31
💄 Removing old code & refactoring
MiloradFilipovic Sep 19, 2022
ca3364c
Merge branch 'master' into feature-main-nav-redesign
MiloradFilipovic Sep 19, 2022
a5ebb32
💄 Minor CSS tweaks
MiloradFilipovic Sep 20, 2022
31da5bc
💄 Opening credentials modal on sidebar menu item click. Minor CSS upd…
MiloradFilipovic Sep 20, 2022
3b8e182
💄 Updating sidebar expand/collapse animation
MiloradFilipovic Sep 20, 2022
ade2165
💄 Few more refinements of sidebar animation
MiloradFilipovic Sep 20, 2022
2391ab2
👌 Addressing code review comments
MiloradFilipovic Sep 20, 2022
985d842
✨ Moved ActionDropdown component to design system
MiloradFilipovic Sep 21, 2022
66670f1
Merge branch 'master' into feature-main-nav-redesign
MiloradFilipovic Sep 21, 2022
7f9604b
👌 Fixing bugs reported during code review and testing
MiloradFilipovic Sep 21, 2022
7eb31bf
👌 Addressing design review comments for the new sidebar
MiloradFilipovic Sep 21, 2022
01c8763
Merge branch 'master' into feature-main-nav-redesign
MiloradFilipovic Sep 21, 2022
98cfbef
✔️ Updating `N8nActionDropdown` component tests
MiloradFilipovic Sep 21, 2022
2862b21
✨ Remembering scroll position when going back to templates list
MiloradFilipovic Sep 22, 2022
9e2ec6b
✨ Updating zoomToFit logic to account for footer content
MiloradFilipovic Sep 22, 2022
bbef42d
👌 Addressing latest sidebar review comments
MiloradFilipovic Sep 22, 2022
682a163
Merge branch 'master' into feature-main-nav-redesign
MiloradFilipovic Sep 23, 2022
18a7d0a
✨ New `n8n-menu-item` component
MiloradFilipovic Sep 23, 2022
a6a79c2
✨ Implemented new `n8n-menu` design system component, updated menu it…
MiloradFilipovic Sep 23, 2022
3e1c0f7
Minor update to n8n-menu storybook entry
MiloradFilipovic Sep 23, 2022
5c0d252
Merge branch 'master' into N8N-4736-n8n-menu-rework
MiloradFilipovic Oct 7, 2022
15661dd
💄 Updating collapsed sub-menu style. Fixing vue error on hover.
MiloradFilipovic Oct 7, 2022
00fdc66
⚡ Changing IMenuItem from interface to type
MiloradFilipovic Oct 7, 2022
7f49165
✨ Added new n8n-menu component to editor main sidebar
MiloradFilipovic Oct 7, 2022
abfc669
⚡ Finished main sidebar
MiloradFilipovic Oct 7, 2022
5ce75ab
⚡ Added new menus to setttings and credentials view
MiloradFilipovic Oct 7, 2022
8442022
✨ Implemented tab and router modes for n8n-menu
MiloradFilipovic Oct 8, 2022
d5595fc
✨ Implemented credentials menus using new n8n-menu component
MiloradFilipovic Oct 8, 2022
0f55dac
Merge branch 'master' into N8N-4736-n8n-menu-rework
MiloradFilipovic Oct 8, 2022
c68efa9
💄 Finishing main and settings sidebar details, updating design system…
MiloradFilipovic Oct 8, 2022
fca8cf5
💄 Adding injected items support to main sidebar, handling navigation …
MiloradFilipovic Oct 8, 2022
4f80432
✔️ Fixing linting errors
MiloradFilipovic Oct 8, 2022
f122d46
✔️ Addressing typescript errors in design system components
MiloradFilipovic Oct 9, 2022
56aaf1f
⚡ Using design-system types in editor UI
MiloradFilipovic Oct 9, 2022
e0a0f02
💄 Add support for custom icon size in menu items
MiloradFilipovic Oct 9, 2022
b9b75e6
👌 Addressing code review and design review feedback
MiloradFilipovic Oct 10, 2022
bbf563f
💄 Minor updates
MiloradFilipovic Oct 10, 2022
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
46 changes: 0 additions & 46 deletions packages/design-system/src/components/N8nMenu/Menu.stories.js

This file was deleted.

160 changes: 160 additions & 0 deletions packages/design-system/src/components/N8nMenu/Menu.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import N8nMenu from './Menu.vue';
import N8nIcon from '../N8nIcon';
import N8nText from '../N8nText';
import { StoryFn } from '@storybook/vue';
import { action } from '@storybook/addon-actions';

export default {
title: 'Atoms/Menu',
component: N8nMenu,
argTypes: {
},
};

const methods = {
onSelect: action('select'),
};

const template: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nMenu,
},
template: `
<div style="height: 90vh; width: 200px">
<n8n-menu v-bind="$props" @select="onSelect"></n8n-menu>
</div>
`,
methods,
});

const templateWithHeaderAndFooter: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nMenu,
N8nIcon,
N8nText,
},
template: `
<div style="height: 90vh; width: 200px">
<n8n-menu v-bind="$props" @select="onSelect">
<template #header>
<a href="#" class="p-m hideme" style="display: block;">
<n8n-icon icon="long-arrow-alt-left"/>&nbsp;&nbsp;Back to home
</a>
</template>
<template #footer>
<div class="p-m hideme">
<n8n-icon icon="user-circle" size="xlarge"/>&nbsp;&nbsp;
<n8n-text>John Smithson</n8n-text>
</div>
</template>
</n8n-menu>
</div>
`,
methods,
});

const templateWithAllSlots: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nMenu,
N8nIcon,
N8nText,
},
template: `
<div style="height: 90vh; width: 200px">
<n8n-menu v-bind="$props" @select="onSelect">
<template #header>
<a href="#" class="p-m hideme" style="display: block;">
<n8n-icon icon="long-arrow-alt-left"/>&nbsp;&nbsp;Back to home
</a>
</template>
<template #menuPrefix>
<n8n-text class="hideme" size="small" color="text-light">Something can be added here...</n8n-text>
</template>
<template #menuSuffix>
<n8n-text class="hideme" size="small" color="text-light">...and here if needed</n8n-text>
</template>
<template #footer>
<div class="p-m hideme">
<n8n-icon icon="user-circle" size="xlarge"/>&nbsp;&nbsp;
<n8n-text>John Smithson</n8n-text>
</div>
</template>
</n8n-menu>
</div>
`,
methods,
});

const menuItems = [
{
id: 'workflows',
icon: 'network-wired',
label: 'Workflows',
position: 'top',
},
{
id: 'executions',
icon: 'tasks',
label: 'Executions',
position: 'top',
},
{
id: 'disabled-item',
icon: 'times',
label: 'Not Available',
available: false,
position: 'top',
},
{
id: 'website',
icon: 'globe',
label: 'Website',
type: 'link',
properties: {
href: 'https://www.n8n.io',
newWindow: true,
},
position: 'bottom',
},
{
id: 'help',
icon: 'question',
label: 'Help',
position: 'bottom',
children: [
{ icon: 'info', label: 'About n8n', id: 'about' },
{ icon: 'book', label: 'Documentation', id: 'docs' },
{
id: 'disabled-submenu-item',
icon: 'times',
label: 'Not Available',
available: false,
position: 'top',
},
{
id: 'quickstart',
icon: 'video',
label: 'Quickstart',
type: 'link',
properties: {
href: 'https://www.youtube.com/watch?v=RpjQTGKm-ok',
newWindow: true,
},
},
],
},
];

export const primary = template.bind({});
primary.args = {
items: menuItems,
};

export const withHeaderAndFooter = templateWithHeaderAndFooter.bind({});
withHeaderAndFooter.args = { items: menuItems };

export const withAllSlots = templateWithAllSlots.bind({});
withAllSlots.args = { items: menuItems };
Loading