mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
* introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * Survey new options (#2300) * split up options * fix quotes * remove unused import * add user created workflow event (#2301) * simplify env vars * fix versionCli on FE * update personalization env * fix event User opened Credentials panel * fix select modal spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * improve telemetry process exit * fix merge * improve n8n stop events Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Co-authored-by: Mutasem <mutdmour@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
144 lines
3.2 KiB
JavaScript
144 lines
3.2 KiB
JavaScript
import N8nSelect from './Select.vue';
|
|
import N8nOption from '../N8nOption';
|
|
import N8nIcon from '../N8nIcon';
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
export default {
|
|
title: 'Atoms/Select',
|
|
component: N8nSelect,
|
|
argTypes: {
|
|
disabled: {
|
|
control: {
|
|
type: 'boolean',
|
|
},
|
|
},
|
|
size: {
|
|
control: {
|
|
type: 'select',
|
|
options: ['large', 'medium', 'small', 'mini'],
|
|
},
|
|
},
|
|
loading: {
|
|
control: {
|
|
type: 'boolean',
|
|
},
|
|
},
|
|
filterable: {
|
|
control: {
|
|
type: 'boolean',
|
|
},
|
|
},
|
|
defaultFirstOption: {
|
|
control: {
|
|
type: 'boolean',
|
|
},
|
|
},
|
|
},
|
|
parameters: {
|
|
backgrounds: { default: '--color-background-light' },
|
|
},
|
|
};
|
|
|
|
const methods = {
|
|
onInput: action('input'),
|
|
onChange: action('change'),
|
|
};
|
|
|
|
const Template = (args, { argTypes }) => ({
|
|
props: Object.keys(argTypes),
|
|
components: {
|
|
N8nSelect,
|
|
N8nOption,
|
|
N8nIcon,
|
|
},
|
|
template: '<n8n-select v-bind="$props" v-model="val" @input="onInput" @change="onChange"><n8n-option value="1">op1</n8n-option><n8n-option value="2">op2</n8n-option></n8n-select>',
|
|
data() {
|
|
return {
|
|
val: '',
|
|
};
|
|
},
|
|
methods,
|
|
});
|
|
|
|
export const Input = Template.bind({});
|
|
|
|
export const Filterable = Template.bind({});
|
|
Filterable.args = {
|
|
filterable: true,
|
|
defaultFirstOption: true,
|
|
};
|
|
|
|
const selects = ['large', 'medium', 'small', 'mini'].map((size) => `<n8n-select v-bind="$props" v-model="val" @input="onInput" @change="onChange" size="${size}"><n8n-option value="1">op1</n8n-option><n8n-option value="2">op2</n8n-option></n8n-select>`).join('');
|
|
|
|
const ManyTemplate = (args, { argTypes }) => ({
|
|
props: Object.keys(argTypes),
|
|
components: {
|
|
N8nSelect,
|
|
N8nOption,
|
|
N8nIcon,
|
|
},
|
|
template: `<div class="multi-container">${selects}</div>`,
|
|
methods,
|
|
data() {
|
|
return {
|
|
val: '',
|
|
};
|
|
},
|
|
});
|
|
|
|
export const Sizes = ManyTemplate.bind({});
|
|
Sizes.args = {
|
|
type: 'text',
|
|
label: 'text input:',
|
|
placeholder: 'placeholder...',
|
|
};
|
|
|
|
const selectsWithIcon = ['xlarge', 'large', 'medium', 'small', 'mini'].map((size) => `<n8n-select v-bind="$props" v-model="val" @input="onInput" size="${size}"><n8n-icon icon="search" slot="prefix" /><n8n-option value="1">op1</n8n-option><n8n-option value="2">op2</n8n-option></n8n-select>`).join('');
|
|
|
|
const ManyTemplateWithIcon = (args, { argTypes }) => ({
|
|
props: Object.keys(argTypes),
|
|
components: {
|
|
N8nSelect,
|
|
N8nOption,
|
|
N8nIcon,
|
|
},
|
|
template: `<div class="multi-container">${selectsWithIcon}</div>`,
|
|
methods,
|
|
data() {
|
|
return {
|
|
val: '',
|
|
};
|
|
},
|
|
});
|
|
|
|
export const WithIcon = ManyTemplateWithIcon.bind({});
|
|
WithIcon.args = {
|
|
type: 'text',
|
|
label: 'text input:',
|
|
placeholder: 'placeholder...',
|
|
};
|
|
|
|
|
|
const LimitedWidthTemplate = (args, { argTypes }) => ({
|
|
props: Object.keys(argTypes),
|
|
components: {
|
|
N8nSelect,
|
|
N8nOption,
|
|
N8nIcon,
|
|
},
|
|
template: '<div style="width:100px;"><n8n-select v-bind="$props" v-model="val" @input="onInput" @change="onChange"><n8n-option value="1" label="opt1 11 1111" /><n8n-option value="2" label="opt2 test very long ipsum"/></n8n-select></div>',
|
|
data() {
|
|
return {
|
|
val: '',
|
|
};
|
|
},
|
|
methods,
|
|
});
|
|
|
|
export const LimitedWidth = LimitedWidthTemplate.bind({});
|
|
LimitedWidth.args = {
|
|
type: 'text',
|
|
label: 'text input:',
|
|
placeholder: 'placeholder...',
|
|
};
|