* initial telemetry setup and adjusted pull return * quicksave before merge * feat: add conflicting workflow list to pull modal * feat: update source control pull modal * fix: fix linting issue * feat: add Enter keydown event for submitting source control push modal (no-changelog) feat: add Enter keydown event for submitting source control push modal * quicksave * user workflow table for export * improve telemetry data * pull api telemetry * fix lint * Copy tweaks. * remove authorName and authorEmail and pick from user * rename owners.json to workflow_owners.json * ignore credential conflicts on pull * feat: several push/pull flow changes and design update * pull and push return same data format * fix: add One last step toast for successful pull * feat: add up to date pull toast * fix: add proper Learn more link for push and pull modals * do not await tracking being sent * fix import * fix await * add more sourcecontrolfile status * Minor copy tweak for "More info". * Minor copy tweak for "More info". * ignore variable_stub conflicts on pull * ignore whitespace differences * do not show remote workflows that are not yet created * fix telemetry * fix toast when pulling deleted wf * lint fix * refactor and make some imports dynamic * fix variable edit validation * fix telemetry response * improve telemetry * fix unintenional delete commit * fix status unknown issue * fix up to date toast * do not export active state and reapply versionid * use update instead of upsert * fix: show all workflows when clicking push to git * feat: update Up to date pull translation * fix: update read only env checks * do not update versionid of only active flag changes * feat: prevent access to new workflow and templates import when read only env * feat: send only active state and version if workflow state is not dirty * fix: Detect when only active state has changed and prevent generation a new version ID * feat: improve readonly env messages * make getPreferences public * fix telemetry issue * fix: add partial workflow update based on dirty state when changing active state * update unit tests * fix: remove unsaved changes check in readOnlyEnv * fix: disable push to git button when read onyl env * fix: update readonly toast duration * fix: fix pinning and title input in protected mode * initial commit (NOT working) * working push * cleanup and implement pull * fix getstatus * update import to new method * var and tag diffs are no conflicts * only show pull conflict for workflows * refactor and ignore faulty credentials * add sanitycheck for missing git folder * prefer fetch over pull and limit depth to 1 * back to pull... * fix setting branch on initial connect * fix test * remove clean workfolder * refactor: Remove some unnecessary code * Fixed links to docs. * fix getstatus query params * lint fix * dialog to show local and remote name on conflict * only show remote name on conflict * fix credential expression export * fix: Broken test * dont show toast on pull with empty var/tags and refactor * apply frontend changes from old branch * fix tag with same name import * fix buttons shown for non instance owners * prepare local storage key for removal * refactor: Change wording on pushing and pulling * refactor: Change menu item * test: Fix broken test * Update packages/cli/src/environments/sourceControl/types/sourceControlPushWorkFolder.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> --------- Co-authored-by: Alex Grozav <alex@grozav.com> Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
274 lines
8.1 KiB
Vue
274 lines
8.1 KiB
Vue
<template>
|
|
<div :class="$style.container">
|
|
<n8n-menu :items="sidebarMenuItems" @select="handleSelect">
|
|
<template #header>
|
|
<div :class="$style.returnButton" @click="$emit('return')" data-test-id="settings-back">
|
|
<i class="mr-xs">
|
|
<font-awesome-icon icon="arrow-left" />
|
|
</i>
|
|
<n8n-heading size="large" :bold="true">{{ $locale.baseText('settings') }}</n8n-heading>
|
|
</div>
|
|
</template>
|
|
<template #menuSuffix>
|
|
<div :class="$style.versionContainer">
|
|
<n8n-link @click="onVersionClick" size="small">
|
|
{{ $locale.baseText('settings.version') }} {{ rootStore.versionCli }}
|
|
</n8n-link>
|
|
</div>
|
|
</template>
|
|
</n8n-menu>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import { mapStores } from 'pinia';
|
|
import { ABOUT_MODAL_KEY, VERSIONS_MODAL_KEY, VIEWS } from '@/constants';
|
|
import { userHelpers } from '@/mixins/userHelpers';
|
|
import type { IFakeDoor } from '@/Interface';
|
|
import type { IMenuItem } from 'n8n-design-system';
|
|
import type { BaseTextKey } from '@/plugins/i18n';
|
|
import { useUIStore } from '@/stores/ui.store';
|
|
import { useSettingsStore } from '@/stores/settings.store';
|
|
import { useRootStore } from '@/stores/n8nRoot.store';
|
|
|
|
export default defineComponent({
|
|
name: 'SettingsSidebar',
|
|
mixins: [userHelpers],
|
|
computed: {
|
|
...mapStores(useRootStore, useSettingsStore, useUIStore),
|
|
settingsFakeDoorFeatures(): IFakeDoor[] {
|
|
return this.uiStore.getFakeDoorByLocation('settings');
|
|
},
|
|
sidebarMenuItems(): IMenuItem[] {
|
|
const menuItems: IMenuItem[] = [
|
|
{
|
|
id: 'settings-usage-and-plan',
|
|
icon: 'chart-bar',
|
|
label: this.$locale.baseText('settings.usageAndPlan.title'),
|
|
position: 'top',
|
|
available: this.canAccessUsageAndPlan(),
|
|
activateOnRouteNames: [VIEWS.USAGE],
|
|
},
|
|
{
|
|
id: 'settings-personal',
|
|
icon: 'user-circle',
|
|
label: this.$locale.baseText('settings.personal'),
|
|
position: 'top',
|
|
available: this.canAccessPersonalSettings(),
|
|
activateOnRouteNames: [VIEWS.PERSONAL_SETTINGS],
|
|
},
|
|
{
|
|
id: 'settings-users',
|
|
icon: 'user-friends',
|
|
label: this.$locale.baseText('settings.users'),
|
|
position: 'top',
|
|
available: this.canAccessUsersSettings(),
|
|
activateOnRouteNames: [VIEWS.USERS_SETTINGS],
|
|
},
|
|
{
|
|
id: 'settings-api',
|
|
icon: 'plug',
|
|
label: this.$locale.baseText('settings.n8napi'),
|
|
position: 'top',
|
|
available: this.canAccessApiSettings(),
|
|
activateOnRouteNames: [VIEWS.API_SETTINGS],
|
|
},
|
|
{
|
|
id: 'settings-audit-logs',
|
|
icon: 'clipboard-list',
|
|
label: this.$locale.baseText('settings.auditLogs.title'),
|
|
position: 'top',
|
|
available: this.canAccessAuditLogs(),
|
|
activateOnRouteNames: [VIEWS.AUDIT_LOGS],
|
|
},
|
|
{
|
|
id: 'settings-source-control',
|
|
icon: 'code-branch',
|
|
label: this.$locale.baseText('settings.sourceControl.title'),
|
|
position: 'top',
|
|
available: this.canAccessSourceControl(),
|
|
activateOnRouteNames: [VIEWS.SOURCE_CONTROL],
|
|
},
|
|
{
|
|
id: 'settings-sso',
|
|
icon: 'user-lock',
|
|
label: this.$locale.baseText('settings.sso'),
|
|
position: 'top',
|
|
available: this.canAccessSso(),
|
|
activateOnRouteNames: [VIEWS.SSO_SETTINGS],
|
|
},
|
|
{
|
|
id: 'settings-ldap',
|
|
icon: 'network-wired',
|
|
label: this.$locale.baseText('settings.ldap'),
|
|
position: 'top',
|
|
available: this.canAccessLdapSettings(),
|
|
activateOnRouteNames: [VIEWS.LDAP_SETTINGS],
|
|
},
|
|
];
|
|
|
|
for (const item of this.settingsFakeDoorFeatures) {
|
|
if (item.uiLocations.includes('settings')) {
|
|
menuItems.push({
|
|
id: item.id,
|
|
icon: item.icon || 'question',
|
|
label: this.$locale.baseText(item.featureName as BaseTextKey),
|
|
position: 'top',
|
|
available: true,
|
|
activateOnRoutePaths: [`/settings/coming-soon/${item.id}`],
|
|
});
|
|
}
|
|
}
|
|
|
|
menuItems.push({
|
|
id: 'settings-log-streaming',
|
|
icon: 'sign-in-alt',
|
|
label: this.$locale.baseText('settings.log-streaming'),
|
|
position: 'top',
|
|
available: this.canAccessLogStreamingSettings(),
|
|
activateOnRouteNames: [VIEWS.LOG_STREAMING_SETTINGS],
|
|
});
|
|
|
|
menuItems.push({
|
|
id: 'settings-community-nodes',
|
|
icon: 'cube',
|
|
label: this.$locale.baseText('settings.communityNodes'),
|
|
position: 'top',
|
|
available: this.canAccessCommunityNodes(),
|
|
activateOnRouteNames: [VIEWS.COMMUNITY_NODES],
|
|
});
|
|
|
|
return menuItems;
|
|
},
|
|
},
|
|
methods: {
|
|
canAccessPersonalSettings(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.PERSONAL_SETTINGS);
|
|
},
|
|
canAccessUsersSettings(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.USERS_SETTINGS);
|
|
},
|
|
canAccessCommunityNodes(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.COMMUNITY_NODES);
|
|
},
|
|
canAccessApiSettings(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.API_SETTINGS);
|
|
},
|
|
canAccessLdapSettings(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.LDAP_SETTINGS);
|
|
},
|
|
canAccessLogStreamingSettings(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.LOG_STREAMING_SETTINGS);
|
|
},
|
|
canAccessUsageAndPlan(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.USAGE);
|
|
},
|
|
canAccessSourceControl(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.SOURCE_CONTROL);
|
|
},
|
|
canAccessAuditLogs(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.AUDIT_LOGS);
|
|
},
|
|
canAccessSso(): boolean {
|
|
return this.canUserAccessRouteByName(VIEWS.SSO_SETTINGS);
|
|
},
|
|
onVersionClick() {
|
|
this.uiStore.openModal(ABOUT_MODAL_KEY);
|
|
},
|
|
openUpdatesPanel() {
|
|
this.uiStore.openModal(VERSIONS_MODAL_KEY);
|
|
},
|
|
async handleSelect(key: string) {
|
|
switch (key) {
|
|
case 'settings-personal':
|
|
if (this.$router.currentRoute.name !== VIEWS.PERSONAL_SETTINGS) {
|
|
await this.$router.push({ name: VIEWS.PERSONAL_SETTINGS });
|
|
}
|
|
break;
|
|
case 'settings-users':
|
|
if (this.$router.currentRoute.name !== VIEWS.USERS_SETTINGS) {
|
|
await this.$router.push({ name: VIEWS.USERS_SETTINGS });
|
|
}
|
|
break;
|
|
case 'settings-api':
|
|
if (this.$router.currentRoute.name !== VIEWS.API_SETTINGS) {
|
|
await this.$router.push({ name: VIEWS.API_SETTINGS });
|
|
}
|
|
break;
|
|
case 'settings-ldap':
|
|
if (this.$router.currentRoute.name !== VIEWS.LDAP_SETTINGS) {
|
|
void this.$router.push({ name: VIEWS.LDAP_SETTINGS });
|
|
}
|
|
break;
|
|
case 'settings-log-streaming':
|
|
if (this.$router.currentRoute.name !== VIEWS.LOG_STREAMING_SETTINGS) {
|
|
void this.$router.push({ name: VIEWS.LOG_STREAMING_SETTINGS });
|
|
}
|
|
break;
|
|
case 'users': // Fakedoor feature added via hooks when user management is disabled on cloud
|
|
case 'logging':
|
|
this.$router.push({ name: VIEWS.FAKE_DOOR, params: { featureId: key } }).catch(() => {});
|
|
break;
|
|
case 'settings-community-nodes':
|
|
if (this.$router.currentRoute.name !== VIEWS.COMMUNITY_NODES) {
|
|
await this.$router.push({ name: VIEWS.COMMUNITY_NODES });
|
|
}
|
|
break;
|
|
case 'settings-usage-and-plan':
|
|
if (this.$router.currentRoute.name !== VIEWS.USAGE) {
|
|
void this.$router.push({ name: VIEWS.USAGE });
|
|
}
|
|
break;
|
|
case 'settings-sso':
|
|
if (this.$router.currentRoute.name !== VIEWS.SSO_SETTINGS) {
|
|
void this.$router.push({ name: VIEWS.SSO_SETTINGS });
|
|
}
|
|
break;
|
|
case 'settings-source-control':
|
|
if (this.$router.currentRoute.name !== VIEWS.SOURCE_CONTROL) {
|
|
void this.$router.push({ name: VIEWS.SOURCE_CONTROL });
|
|
}
|
|
break;
|
|
case 'settings-audit-logs':
|
|
if (this.$router.currentRoute.name !== VIEWS.AUDIT_LOGS) {
|
|
void this.$router.push({ name: VIEWS.AUDIT_LOGS });
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
},
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
.container {
|
|
min-width: $sidebar-expanded-width;
|
|
height: 100%;
|
|
background-color: var(--color-background-xlight);
|
|
border-right: var(--border-base);
|
|
position: relative;
|
|
overflow: auto;
|
|
}
|
|
|
|
.returnButton {
|
|
padding: var(--spacing-s) var(--spacing-l);
|
|
cursor: pointer;
|
|
&:hover {
|
|
color: var(--color-primary);
|
|
}
|
|
}
|
|
|
|
.versionContainer {
|
|
padding: var(--spacing-xs) var(--spacing-l);
|
|
}
|
|
|
|
@media screen and (max-height: 420px) {
|
|
.versionContainer {
|
|
display: none;
|
|
}
|
|
}
|
|
</style>
|