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:
@@ -37,10 +37,20 @@ export function isEmailSetUp(): boolean {
|
||||
}
|
||||
|
||||
export function isUserManagementEnabled(): boolean {
|
||||
return (
|
||||
!config.getEnv('userManagement.disabled') ||
|
||||
config.getEnv('userManagement.isInstanceOwnerSetUp')
|
||||
);
|
||||
// This can be simplified but readability is more important here
|
||||
|
||||
if (config.getEnv('userManagement.isInstanceOwnerSetUp')) {
|
||||
// Short circuit - if owner is set up, UM cannot be disabled.
|
||||
// Users must reset their instance in order to do so.
|
||||
return true;
|
||||
}
|
||||
|
||||
// UM is disabled for desktop by default
|
||||
if (config.getEnv('deployment.type').startsWith('desktop_')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return config.getEnv('userManagement.disabled') ? false : true;
|
||||
}
|
||||
|
||||
export function isSharingEnabled(): boolean {
|
||||
@@ -51,13 +61,6 @@ export function isSharingEnabled(): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export function isUserManagementDisabled(): boolean {
|
||||
return (
|
||||
config.getEnv('userManagement.disabled') &&
|
||||
!config.getEnv('userManagement.isInstanceOwnerSetUp')
|
||||
);
|
||||
}
|
||||
|
||||
export async function getRoleId(scope: Role['scope'], name: Role['name']): Promise<Role['id']> {
|
||||
return Db.collections.Role.findOneOrFail({
|
||||
select: ['id'],
|
||||
|
||||
Reference in New Issue
Block a user