feat: Change desktop UM experience (#5312)

* refactor: Hide prompt for desktop

* feat: add email field to personalization modal

* fix: update survey interfaces

* chore: enable personalization survey email key display condition

* feat: add users page upsell for desktop client

* feat: disable UM on desktop where possible

* refactor: Have a single function to decide whether UM is enabled

* feat: update community nodes upsell link

---------

Co-authored-by: Alex Grozav <alex@grozav.com>
Co-authored-by: krynble <omar@n8n.io>
Co-authored-by: freyamade <freya@n8n.io>
This commit is contained in:
Omar Ajoue
2023-02-08 10:42:22 +01:00
committed by GitHub
parent d8865aa917
commit 5e3e70b83b
19 changed files with 177 additions and 64 deletions

View File

@@ -207,6 +207,15 @@ export const useUIStore = defineStore(STORES.UI, {
},
},
},
users: {
settings: {
unavailable: {
title: `contextual.users.settings.unavailable.title${contextKey}`,
description: `contextual.users.settings.unavailable.description${contextKey}`,
button: `contextual.users.settings.unavailable.button${contextKey}`,
},
},
},
};
},
getLastSelectedNode(): INodeUi | null {

View File

@@ -19,11 +19,12 @@ import {
validatePasswordToken,
validateSignupToken,
} from '@/api/users';
import { EnterpriseEditionFeature, PERSONALIZATION_MODAL_KEY, STORES } from '@/constants';
import {
import { PERSONALIZATION_MODAL_KEY, STORES } from '@/constants';
import type {
ICredentialsResponse,
IInviteResponse,
IPersonalizationLatestVersion,
IRole,
IUser,
IUserResponse,
IUsersState,
@@ -41,6 +42,9 @@ const isDefaultUser = (user: IUserResponse | null) =>
const isPendingUser = (user: IUserResponse | null) => Boolean(user && user.isPending);
const isInstanceOwner = (user: IUserResponse | null) =>
Boolean(user?.globalRole?.name === ROLE.Owner);
export const useUsersStore = defineStore(STORES.USERS, {
state: (): IUsersState => ({
currentUserId: null,
@@ -56,6 +60,9 @@ export const useUsersStore = defineStore(STORES.USERS, {
isDefaultUser(): boolean {
return isDefaultUser(this.currentUser);
},
isInstanceOwner(): boolean {
return isInstanceOwner(this.currentUser);
},
getUserById(state) {
return (userId: string): IUser | null => state.users[userId];
},