mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Add default author name and email to source control settings (#6543)
This commit is contained in:
parent
8b76e98085
commit
e1a02c7625
|
@ -1,24 +1,31 @@
|
|||
import { computed, reactive } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { EnterpriseEditionFeature } from '@/constants';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useSettingsStore, useRootStore, useUsersStore } from '@/stores';
|
||||
import * as vcApi from '@/api/sourceControl';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
import type { SourceControlPreferences } from '@/Interface';
|
||||
|
||||
export const useSourceControlStore = defineStore('sourceControl', () => {
|
||||
const rootStore = useRootStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const usersStore = useUsersStore();
|
||||
|
||||
const isEnterpriseSourceControlEnabled = computed(() =>
|
||||
settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.SourceControl),
|
||||
);
|
||||
const defaultAuthor = computed(() => {
|
||||
const user = usersStore.currentUser;
|
||||
return {
|
||||
name: user?.fullName ?? `${user?.firstName} ${user?.lastName}`.trim(),
|
||||
email: user?.email ?? '',
|
||||
};
|
||||
});
|
||||
|
||||
const preferences = reactive<SourceControlPreferences>({
|
||||
branchName: '',
|
||||
branches: [],
|
||||
authorName: '',
|
||||
authorEmail: '',
|
||||
authorName: defaultAuthor.value.name,
|
||||
authorEmail: defaultAuthor.value.email,
|
||||
repositoryUrl: '',
|
||||
branchReadOnly: false,
|
||||
branchColor: '#5296D6',
|
||||
|
|
Loading…
Reference in a new issue