Skip to content

Commit

Permalink
feat(editor): SAML login disables Invite button (#5922)
Browse files Browse the repository at this point in the history
  • Loading branch information
cstuncsik authored Apr 7, 2023
1 parent d40e86a commit 3fdc441
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/editor-ui/src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
"settings.users.inviteLink.copy": "Copy Invite Link",
"settings.users.inviteLink.error": "Could not retrieve invite link",
"settings.users.invite": "Invite",
"settings.users.invite.tooltip": "SAML login is activated. Users should be created in the IdP and will be provisioned in n8n on their first sign on.",
"settings.users.inviteNewUsers": "Invite new users",
"settings.users.copyInviteUrls": "You can now send the invitation links directly to your users",
"settings.users.inviteResent": "Invite resent",
Expand Down
23 changes: 16 additions & 7 deletions packages/editor-ui/src/views/SettingsUsersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
<div>
<n8n-heading size="2xlarge">{{ $locale.baseText('settings.users') }}</n8n-heading>
<div :class="$style.buttonContainer" v-if="!usersStore.showUMSetupWarning">
<n8n-button
:label="$locale.baseText('settings.users.invite')"
@click="onInvite"
size="large"
data-test-id="settings-users-invite-button"
/>
<n8n-tooltip :disabled="!ssoStore.isSamlLoginEnabled">
<template #content>
<span> {{ $locale.baseText('settings.users.invite.tooltip') }} </span>
</template>
<div>
<n8n-button
:disabled="ssoStore.isSamlLoginEnabled"
:label="$locale.baseText('settings.users.invite')"
@click="onInvite"
size="large"
data-test-id="settings-users-invite-button"
/>
</div>
</n8n-tooltip>
</div>
</div>
<div v-if="!settingsStore.isUserManagementEnabled" :class="$style.setupInfoContainer">
Expand Down Expand Up @@ -64,6 +72,7 @@ import { useSettingsStore } from '@/stores/settings';
import { useUsersStore } from '@/stores/users';
import { BaseTextKey } from '@/plugins/i18n';
import { useUsageStore } from '@/stores/usage';
import { useSSOStore } from '@/stores/sso';
export default mixins(showMessage, copyPaste).extend({
name: 'SettingsUsersView',
Expand All @@ -76,7 +85,7 @@ export default mixins(showMessage, copyPaste).extend({
}
},
computed: {
...mapStores(useSettingsStore, useUIStore, useUsersStore, useUsageStore),
...mapStores(useSettingsStore, useUIStore, useUsersStore, useUsageStore, useSSOStore),
isSharingEnabled() {
return this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Sharing);
},
Expand Down

0 comments on commit 3fdc441

Please sign in to comment.