From 8e8df6d6116bb22f372bf4b50511860cacb0e2e0 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Tue, 3 Jan 2023 16:09:11 +0200 Subject: [PATCH] feat(editor): Add SSO fakedoor feature (#5076) * feat: add sso fakedoor feature * fix: update SSO fakeDoor location * fix: remove unused code --- packages/editor-ui/src/Interface.ts | 6 +++++- packages/editor-ui/src/constants.ts | 1 + .../editor-ui/src/plugins/i18n/locales/en.json | 4 ++++ packages/editor-ui/src/stores/ui.ts | 9 +++++++++ .../editor-ui/src/views/SettingsUsersView.vue | 15 ++++++++++++--- 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 110225c228..fe0c09dac9 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -1187,7 +1187,11 @@ export type IFakeDoor = { uiLocations: IFakeDoorLocation[]; }; -export type IFakeDoorLocation = 'settings' | 'credentialsModal' | 'workflowShareModal'; +export type IFakeDoorLocation = + | 'settings' + | 'settings/users' + | 'credentialsModal' + | 'workflowShareModal'; export type INodeFilterType = 'Regular' | 'Trigger' | 'All'; diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index 46e21a0749..ba31785586 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -329,6 +329,7 @@ export enum VIEWS { export enum FAKE_DOOR_FEATURES { ENVIRONMENTS = 'environments', LOGGING = 'logging', + SSO = 'sso', } export const ONBOARDING_PROMPT_TIMEBOX = 14; diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index 148efb4289..a9a57e7353 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -503,6 +503,10 @@ "fakeDoor.settings.environments.actionBox.title": "We’re working on environments (as a paid feature)", "fakeDoor.settings.environments.actionBox.title.cloud": "We’re working on this", "fakeDoor.settings.environments.actionBox.description": "If you'd like to be the first to hear when it's ready, join the list.", + "fakeDoor.settings.sso.name": "Single Sign-On", + "fakeDoor.settings.sso.actionBox.title": "We’re working on this (as a paid feature)", + "fakeDoor.settings.sso.actionBox.title.cloud": "We’re working on this", + "fakeDoor.settings.sso.actionBox.description": "SSO will offer a secured and convenient way to access n8n using your existing credentials (Google, Github, Keycloak…)", "fakeDoor.settings.logging.name": "Logging", "fakeDoor.settings.logging.infoText": "You can already write logs to a file or the console using environment variables. More info", "fakeDoor.settings.logging.actionBox.title": "We're working on advanced logging (as a paid feature)", diff --git a/packages/editor-ui/src/stores/ui.ts b/packages/editor-ui/src/stores/ui.ts index 15d929d505..5885188ae1 100644 --- a/packages/editor-ui/src/stores/ui.ts +++ b/packages/editor-ui/src/stores/ui.ts @@ -145,6 +145,15 @@ export const useUIStore = defineStore(STORES.UI, { linkURL: 'https://n8n-community.typeform.com/to/l7QOrERN#f=logging', uiLocations: ['settings'], }, + { + id: FAKE_DOOR_FEATURES.SSO, + featureName: 'fakeDoor.settings.sso.name', + icon: 'key', + actionBoxTitle: 'fakeDoor.settings.sso.actionBox.title', + actionBoxDescription: 'fakeDoor.settings.sso.actionBox.description', + linkURL: 'https://n8n-community.typeform.com/to/l7QOrERN#f=sso', + uiLocations: ['settings/users'], + }, ], draggable: { isDragging: false, diff --git a/packages/editor-ui/src/views/SettingsUsersView.vue b/packages/editor-ui/src/views/SettingsUsersView.vue index 9ee3119c51..022d9387f2 100644 --- a/packages/editor-ui/src/views/SettingsUsersView.vue +++ b/packages/editor-ui/src/views/SettingsUsersView.vue @@ -49,6 +49,12 @@ @reinvite="onReinvite" /> + @@ -56,7 +62,8 @@ import { EnterpriseEditionFeature, INVITE_USER_MODAL_KEY, VIEWS } from '@/constants'; import PageAlert from '../components/PageAlert.vue'; -import { IUser } from '@/Interface'; +import FeatureComingSoon from '@/components/FeatureComingSoon.vue'; +import { IFakeDoor, IUser } from '@/Interface'; import mixins from 'vue-typed-mixins'; import { showMessage } from '@/mixins/showMessage'; import { mapStores } from 'pinia'; @@ -68,6 +75,7 @@ export default mixins(showMessage).extend({ name: 'SettingsUsersView', components: { PageAlert, + FeatureComingSoon, }, async mounted() { if (!this.usersStore.showUMSetupWarning) { @@ -79,6 +87,9 @@ export default mixins(showMessage).extend({ isSharingEnabled() { return this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Sharing); }, + fakeDoorFeatures(): IFakeDoor[] { + return this.uiStore.getFakeDoorByLocation('settings/users'); + }, }, methods: { redirectToSetup() { @@ -126,8 +137,6 @@ export default mixins(showMessage).extend({ } .usersContainer { - padding-bottom: 100px; - > * { margin-bottom: var(--spacing-2xs); }