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): improve design and functionality of coming soon features #4116

Merged
merged 3 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ export interface IUiState {
canDrop: boolean;
stickyPosition: null | XYPosition;
};
fakeDoorFeatures: IFakeDoor[];
}

export type ILogLevel = 'info' | 'debug' | 'warn' | 'error' | 'verbose';
Expand All @@ -966,6 +967,7 @@ export type IFakeDoor = {
infoText?: string,
actionBoxTitle: string,
actionBoxDescription: string,
actionBoxButtonLabel?: string,
linkURL: string,
uiLocations: IFakeDoorLocation[],
};
Expand Down
57 changes: 33 additions & 24 deletions packages/editor-ui/src/components/FeatureComingSoon.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
<template>
<div v-if="this.featureInfo" :class="[$style.container, 'mt-2xl']">
<div v-if="featureInfo.infoText" class="mb-l">
<n8n-info-tip theme="info" type="note">
<template>
<span v-html="$locale.baseText(featureInfo.infoText)"></span>
</template>
</n8n-info-tip>
</div>
<div :class="$style.actionBoxContainer">
<n8n-action-box
:description="$locale.baseText(featureInfo.actionBoxDescription)"
:buttonText="$locale.baseText('fakeDoor.actionBox.button.label')"
@click="openLinkPage"
>
<template #heading>
<span v-html="$locale.baseText(featureInfo.actionBoxTitle)" />
</template>
</n8n-action-box>
</div>
<div v-if="this.featureInfo" :class="[$style.container]">
<div v-if="showTitle" class="mb-2xl">
<n8n-heading size="2xlarge">
{{$locale.baseText(featureInfo.featureName)}}
</n8n-heading>
</div>
<div v-if="featureInfo.infoText" class="mb-l">
<n8n-info-tip theme="info" type="note">
<template>
<span v-html="$locale.baseText(featureInfo.infoText)"></span>
</template>
</n8n-info-tip>
</div>
<div :class="$style.actionBoxContainer">
<n8n-action-box
:description="$locale.baseText(featureInfo.actionBoxDescription)"
:buttonText="$locale.baseText(featureInfo.actionBoxButtonLabel || 'fakeDoor.actionBox.button.label')"
@click="openLinkPage"
>
<template #heading>
<span v-html="$locale.baseText(featureInfo.actionBoxTitle)"/>
</template>
</n8n-action-box>
</div>
</div>
</template>

<script lang="ts">
import { IFakeDoor } from '@/Interface';
import {IFakeDoor} from '@/Interface';
import Vue from 'vue';

export default Vue.extend({
Expand All @@ -32,6 +37,10 @@ export default Vue.extend({
type: String,
required: true,
},
showTitle: {
type: Boolean,
default: false,
},
},
computed: {
userId(): string {
Expand All @@ -50,15 +59,15 @@ export default Vue.extend({
methods: {
openLinkPage() {
window.open(`${this.featureInfo.linkURL}&u=${this.instanceId}#${this.userId}&v=${this.versionCli}`, '_blank');
this.$telemetry.track('user clicked feature waiting list button', { feature: this.featureId });
this.$telemetry.track('user clicked feature waiting list button', {feature: this.featureId});
},
},
});
</script>

<style lang="scss" module>
.actionBoxContainer {
text-align: center;
}
.actionBoxContainer {
text-align: center;
}
</style>

69 changes: 35 additions & 34 deletions packages/editor-ui/src/modules/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,36 @@ const module: Module<IUiState, IRootState> = {
canDrop: false,
stickyPosition: null,
},
fakeDoorFeatures: [
{
id: FAKE_DOOR_FEATURES.ENVIRONMENTS,
featureName: 'fakeDoor.settings.environments.name',
icon: 'server',
infoText: 'fakeDoor.settings.environments.infoText',
actionBoxTitle: `fakeDoor.settings.environments.actionBox.title`,
actionBoxDescription: 'fakeDoor.settings.environments.actionBox.description',
linkURL: `https://n8n-community.typeform.com/to/l7QOrERN#f=environments`,
uiLocations: ['settings'],
},
{
id: FAKE_DOOR_FEATURES.LOGGING,
featureName: 'fakeDoor.settings.logging.name',
icon: 'sign-in-alt',
infoText: 'fakeDoor.settings.logging.infoText',
actionBoxTitle: `fakeDoor.settings.logging.actionBox.title`,
actionBoxDescription: 'fakeDoor.settings.logging.actionBox.description',
linkURL: `https://n8n-community.typeform.com/to/l7QOrERN#f=logging`,
uiLocations: ['settings'],
},
{
id: FAKE_DOOR_FEATURES.SHARING,
featureName: 'fakeDoor.credentialEdit.sharing.name',
actionBoxTitle: 'fakeDoor.credentialEdit.sharing.actionBox.title',
actionBoxDescription: 'fakeDoor.credentialEdit.sharing.actionBox.description',
linkURL: 'https://n8n-community.typeform.com/to/l7QOrERN#f=sharing',
uiLocations: ['credentialsModal'],
},
],
},
getters: {
areExpressionsDisabled(state: IUiState) {
Expand Down Expand Up @@ -161,40 +191,8 @@ const module: Module<IUiState, IRootState> = {
outputPanelDisplayMode: (state: IUiState) => state.ndv.output.displayMode,
outputPanelEditMode: (state: IUiState): IUiState['ndv']['output']['editMode'] => state.ndv.output.editMode,
mainPanelPosition: (state: IUiState) => state.mainPanelPosition,
getFakeDoorFeatures: (state: IUiState, getters, rootState, rootGetters): IFakeDoor[] => {
const isCloudDeployment = rootGetters['settings/isCloudDeployment'];
const cloudQueryParams = isCloudDeployment ? '&edition=cloud' : '';

return [
{
id: FAKE_DOOR_FEATURES.ENVIRONMENTS,
featureName: 'fakeDoor.settings.environments.name',
icon: 'server',
infoText: 'fakeDoor.settings.environments.infoText',
actionBoxTitle: `fakeDoor.settings.environments.actionBox.title${isCloudDeployment ? '.cloud' : ''}`,
actionBoxDescription: 'fakeDoor.settings.environments.actionBox.description',
linkURL: `https://n8n-community.typeform.com/to/l7QOrERN#f=environments${cloudQueryParams}`,
uiLocations: ['settings'],
},
{
id: FAKE_DOOR_FEATURES.LOGGING,
featureName: 'fakeDoor.settings.logging.name',
icon: 'sign-in-alt',
infoText: isCloudDeployment ? '' : 'fakeDoor.settings.logging.infoText',
actionBoxTitle: `fakeDoor.settings.logging.actionBox.title${isCloudDeployment ? '.cloud' : ''}`,
actionBoxDescription: 'fakeDoor.settings.logging.actionBox.description',
linkURL: `https://n8n-community.typeform.com/to/l7QOrERN#f=logging${cloudQueryParams}`,
uiLocations: ['settings'],
},
{
id: FAKE_DOOR_FEATURES.SHARING,
featureName: 'fakeDoor.credentialEdit.sharing.name',
actionBoxTitle: 'fakeDoor.credentialEdit.sharing.actionBox.title',
actionBoxDescription: 'fakeDoor.credentialEdit.sharing.actionBox.description',
linkURL: 'https://n8n-community.typeform.com/to/l7QOrERN#f=sharing',
uiLocations: ['credentialsModal'],
},
];
getFakeDoorFeatures: (state: IUiState): IFakeDoor[] => {
return state.fakeDoorFeatures;
},
getFakeDoorByLocation: (state: IUiState, getters) => (location: IFakeDoorLocation) => {
return getters.getFakeDoorFeatures.filter((fakeDoor: IFakeDoor) => fakeDoor.uiLocations.includes(location));
Expand All @@ -215,6 +213,9 @@ const module: Module<IUiState, IRootState> = {
const { name, mode } = params;
Vue.set(state.modals[name], 'mode', mode);
},
setFakeDoorFeatures: (state: IUiState, payload: IFakeDoor[]) => {
state.fakeDoorFeatures = payload;
},
setActiveId: (state: IUiState, params: {name: string, id: string}) => {
const { name, id } = params;
Vue.set(state.modals[name], 'activeId', id);
Expand Down
7 changes: 7 additions & 0 deletions packages/editor-ui/src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@
"fakeDoor.credentialEdit.sharing.name": "Sharing",
"fakeDoor.credentialEdit.sharing.actionBox.title": "Sharing is only available on <a href=\"https://n8n.io/cloud/\" target=\"_blank\">n8n Cloud</a> right now",
"fakeDoor.credentialEdit.sharing.actionBox.description": "If you'd like to be the first to hear when it's ready, join the list",
"fakeDoor.credentialEdit.sharing.actionBox.title.cloud.upgrade": "Upgrade to add users",
"fakeDoor.credentialEdit.sharing.actionBox.description.cloud.upgrade": "Power and Pro plan users can create multiple user accounts and share credentials. (Sharing workflows is coming soon)",
"fakeDoor.credentialEdit.sharing.actionBox.button.cloud.upgrade": "Upgrade",
"fakeDoor.settings.environments.name": "Environments",
"fakeDoor.settings.environments.infoText": "Environments allow you to use different settings and credentials in a workflow when you're building it vs when it's running in production",
"fakeDoor.settings.environments.actionBox.title": "We’re working on adding it to this edition of n8n (as a paid feature). If you’d like to be the first to hear when it’s ready, join the list.",
Expand All @@ -310,6 +313,10 @@
"fakeDoor.settings.logging.actionBox.title": "We're working on advanced logging (as a paid feature)",
"fakeDoor.settings.logging.actionBox.title.cloud": "We're working on advanced logging",
"fakeDoor.settings.logging.actionBox.description": "This also includes audit logging. If you'd like to be the first to hear when it's ready, join the list.",
"fakeDoor.settings.users.name": "Users",
"fakeDoor.settings.users.actionBox.title": "Upgrade to add users",
"fakeDoor.settings.users.actionBox.description": "Power and Pro plan users can create multiple user accounts and share credentials. (Sharing workflows is coming soon)",
"fakeDoor.settings.users.actionBox.button": "Upgrade",
"fakeDoor.actionBox.button.label": "Join the list",
"fixedCollectionParameter.choose": "Choose...",
"fixedCollectionParameter.currentlyNoItemsExist": "Currently no items exist",
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/views/SettingsFakeDoorView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ $locale.baseText(`fakeDoor.settings.${featureId}.name`) }}
</n8n-heading>
</div>
<FeatureComingSoon :featureId="featureId"></FeatureComingSoon>
<FeatureComingSoon :featureId="featureId" showTitle />
</SettingsView>
</template>

Expand Down