diff --git a/packages/editor-ui/src/components/SettingsSidebar.vue b/packages/editor-ui/src/components/SettingsSidebar.vue index 6a7c1e03c3..620f3e5e9a 100644 --- a/packages/editor-ui/src/components/SettingsSidebar.vue +++ b/packages/editor-ui/src/components/SettingsSidebar.vue @@ -83,14 +83,7 @@ export default defineComponent({ available: this.canAccessExternalSecrets(), route: { to: { name: VIEWS.EXTERNAL_SECRETS_SETTINGS } }, }, - { - id: 'settings-audit-logs', - icon: 'clipboard-list', - label: this.$locale.baseText('settings.auditLogs.title'), - position: 'top', - available: this.canAccessAuditLogs(), - route: { to: { name: VIEWS.AUDIT_LOGS } }, - }, + { id: 'settings-source-control', icon: 'code-branch', @@ -189,9 +182,6 @@ export default defineComponent({ canAccessSourceControl(): boolean { return this.canUserAccessRouteByName(VIEWS.SOURCE_CONTROL); }, - canAccessAuditLogs(): boolean { - return this.canUserAccessRouteByName(VIEWS.AUDIT_LOGS); - }, canAccessSso(): boolean { return this.canUserAccessRouteByName(VIEWS.SSO_SETTINGS); }, diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index c8d119f14f..44dbab412b 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -466,7 +466,6 @@ export const enum VIEWS { EXTERNAL_SECRETS_SETTINGS = 'ExternalSecretsSettings', SAML_ONBOARDING = 'SamlOnboarding', SOURCE_CONTROL = 'SourceControl', - AUDIT_LOGS = 'AuditLogs', MFA_VIEW = 'MfaView', WORKFLOW_HISTORY = 'WorkflowHistory', WORKER_VIEW = 'WorkerView', diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index 49e0223cbd..ad5d7e0ade 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -1783,10 +1783,6 @@ "settings.sourceControl.error.not.connected.title": "Environments have not been enabled", "settings.sourceControl.error.not.connected.message": "Please head over to environment settings to connect a git repository first to activate this functionality.", "showMessage.cancel": "@:_reusableBaseText.cancel", - "settings.auditLogs.title": "Audit Logs", - "settings.auditLogs.actionBox.title": "Available on the Enterprise plan", - "settings.auditLogs.actionBox.description": "Upgrade to see the audit logs of your n8n instance.", - "settings.auditLogs.actionBox.buttonText": "See plans", "showMessage.ok": "OK", "showMessage.showDetails": "Show Details", "startupError": "Error connecting to n8n", diff --git a/packages/editor-ui/src/router.ts b/packages/editor-ui/src/router.ts index 356ab3f57a..4cde71960f 100644 --- a/packages/editor-ui/src/router.ts +++ b/packages/editor-ui/src/router.ts @@ -1,5 +1,3 @@ -import { useStorage } from '@/composables/useStorage'; - import type { NavigationGuardNext, RouteLocation, @@ -59,7 +57,6 @@ const SignoutView = async () => await import('@/views/SignoutView.vue'); const SamlOnboarding = async () => await import('@/views/SamlOnboarding.vue'); const SettingsSourceControl = async () => await import('./views/SettingsSourceControl.vue'); const SettingsExternalSecrets = async () => await import('./views/SettingsExternalSecrets.vue'); -const SettingsAuditLogs = async () => await import('./views/SettingsAuditLogs.vue'); const WorkerView = async () => await import('./views/WorkerView.vue'); const WorkflowHistory = async () => await import('@/views/WorkflowHistory.vue'); const WorkflowOnboardingView = async () => await import('@/views/WorkflowOnboardingView.vue'); @@ -712,32 +709,6 @@ export const routes = [ }, }, }, - { - path: 'audit-logs', - name: VIEWS.AUDIT_LOGS, - components: { - settingsView: SettingsAuditLogs, - }, - meta: { - middleware: ['authenticated', 'rbac', 'custom'], - middlewareOptions: { - custom: () => { - return !!useStorage('audit-logs').value; - }, - rbac: { - scope: 'auditLogs:manage', - }, - }, - telemetry: { - pageCategory: 'settings', - getProperties(route: RouteLocation) { - return { - feature: 'audit-logs', - }; - }, - }, - }, - }, ], }, { diff --git a/packages/editor-ui/src/views/SettingsAuditLogs.vue b/packages/editor-ui/src/views/SettingsAuditLogs.vue deleted file mode 100644 index 35664c0286..0000000000 --- a/packages/editor-ui/src/views/SettingsAuditLogs.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - diff --git a/packages/editor-ui/src/views/__tests__/SettingsAuditLogs.test.ts b/packages/editor-ui/src/views/__tests__/SettingsAuditLogs.test.ts deleted file mode 100644 index 2199fa79c5..0000000000 --- a/packages/editor-ui/src/views/__tests__/SettingsAuditLogs.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { vi } from 'vitest'; -import { createPinia, setActivePinia } from 'pinia'; -import { useAuditLogsStore } from '@/stores/auditLogs.store'; -import { useSettingsStore } from '@/stores/settings.store'; -import SettingsAuditLogs from '@/views/SettingsAuditLogs.vue'; -import { createComponentRenderer } from '@/__tests__/render'; -import { EnterpriseEditionFeature } from '@/constants'; -import { nextTick } from 'vue'; -import { setupServer } from '@/__tests__/server'; - -let pinia: ReturnType; -let settingsStore: ReturnType; -let auditLogsStore: ReturnType; -let server: ReturnType; - -const renderComponent = createComponentRenderer(SettingsAuditLogs); - -describe('SettingsAuditLogs', () => { - beforeAll(() => { - server = setupServer(); - }); - - beforeEach(async () => { - pinia = createPinia(); - setActivePinia(pinia); - settingsStore = useSettingsStore(); - auditLogsStore = useAuditLogsStore(); - - await settingsStore.getSettings(); - }); - - afterEach(() => { - vi.clearAllMocks(); - }); - - afterAll(() => { - server.shutdown(); - }); - - it('should render paywall state when there is no license', async () => { - settingsStore.settings.enterprise[EnterpriseEditionFeature.AuditLogs] = false; - await nextTick(); - - const { getByTestId, queryByTestId } = renderComponent({ pinia }); - - expect(queryByTestId('audit-logs-content-licensed')).not.toBeInTheDocument(); - expect(getByTestId('audit-logs-content-unlicensed')).toBeInTheDocument(); - }); - - it('should render licensed content', async () => { - settingsStore.settings.enterprise[EnterpriseEditionFeature.AuditLogs] = true; - await nextTick(); - - const { getByTestId, queryByTestId } = renderComponent({ pinia }); - - expect(getByTestId('audit-logs-content-licensed')).toBeInTheDocument(); - expect(queryByTestId('audit-logs-content-unlicensed')).not.toBeInTheDocument(); - }); -});