chore: Correct naming of annotation-related files (#10946)

This commit is contained in:
Eugene 2024-09-26 13:15:08 +02:00 committed by GitHub
parent 262693be65
commit efc5d859eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 46 additions and 31 deletions

View file

@ -71,5 +71,11 @@ module.exports = {
],
},
},
{
files: ['./test/**/*.ts', './src/**/__tests__/**/*.ts'],
rules: {
'n8n-local-rules/no-dynamic-import-template': 'off',
},
},
],
};

View file

@ -1,6 +1,6 @@
import { Delete, Get, Patch, Post, RestController, GlobalScope } from '@/decorators';
import { AnnotationTagsRequest } from '@/requests';
import { AnnotationTagService } from '@/services/annotation-tag.service';
import { AnnotationTagService } from '@/services/annotation-tag.service.ee';
@RestController('/annotation-tags')
export class AnnotationTagsController {

View file

@ -1,8 +1,8 @@
import { Column, Entity, Index, ManyToMany, OneToMany } from '@n8n/typeorm';
import { IsString, Length } from 'class-validator';
import type { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping';
import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation';
import type { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee';
import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee';
import { WithTimestampsAndStringId } from './abstract-entity';

View file

@ -1,7 +1,7 @@
import { Entity, JoinColumn, ManyToOne, PrimaryColumn } from '@n8n/typeorm';
import type { AnnotationTagEntity } from './annotation-tag-entity';
import type { ExecutionAnnotation } from './execution-annotation';
import type { AnnotationTagEntity } from './annotation-tag-entity.ee';
import type { ExecutionAnnotation } from './execution-annotation.ee';
/**
* This entity represents the junction table between the execution annotations and the tags

View file

@ -12,8 +12,8 @@ import {
} from '@n8n/typeorm';
import type { AnnotationVote } from 'n8n-workflow';
import type { AnnotationTagEntity } from './annotation-tag-entity';
import type { AnnotationTagMapping } from './annotation-tag-mapping';
import type { AnnotationTagEntity } from './annotation-tag-entity.ee';
import type { AnnotationTagMapping } from './annotation-tag-mapping.ee';
import { ExecutionEntity } from './execution-entity';
@Entity({ name: 'execution_annotations' })

View file

@ -12,7 +12,7 @@ import {
} from '@n8n/typeorm';
import { ExecutionStatus, WorkflowExecuteMode } from 'n8n-workflow';
import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation';
import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee';
import { datetimeColumnType } from './abstract-entity';
import type { ExecutionData } from './execution-data';

View file

@ -1,11 +1,11 @@
import { AnnotationTagEntity } from './annotation-tag-entity';
import { AnnotationTagMapping } from './annotation-tag-mapping';
import { AnnotationTagEntity } from './annotation-tag-entity.ee';
import { AnnotationTagMapping } from './annotation-tag-mapping.ee';
import { AuthIdentity } from './auth-identity';
import { AuthProviderSyncHistory } from './auth-provider-sync-history';
import { AuthUser } from './auth-user';
import { CredentialsEntity } from './credentials-entity';
import { EventDestinations } from './event-destinations';
import { ExecutionAnnotation } from './execution-annotation';
import { ExecutionAnnotation } from './execution-annotation.ee';
import { ExecutionData } from './execution-data';
import { ExecutionEntity } from './execution-entity';
import { ExecutionMetadata } from './execution-metadata';

View file

@ -1,7 +1,7 @@
import { DataSource, Repository } from '@n8n/typeorm';
import { Service } from 'typedi';
import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping';
import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee';
@Service()
export class AnnotationTagMappingRepository extends Repository<AnnotationTagMapping> {

View file

@ -1,7 +1,7 @@
import { DataSource, Repository } from '@n8n/typeorm';
import { Service } from 'typedi';
import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity';
import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee';
@Service()
export class AnnotationTagRepository extends Repository<AnnotationTagEntity> {

View file

@ -1,7 +1,7 @@
import { DataSource, Repository } from '@n8n/typeorm';
import { Service } from 'typedi';
import { ExecutionAnnotation } from '@/databases/entities/execution-annotation';
import { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee';
@Service()
export class ExecutionAnnotationRepository extends Repository<ExecutionAnnotation> {

View file

@ -36,9 +36,9 @@ import type {
import { Service } from 'typedi';
import config from '@/config';
import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity';
import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping';
import { ExecutionAnnotation } from '@/databases/entities/execution-annotation';
import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee';
import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee';
import { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee';
import { PostgresLiveRowsRetrievalError } from '@/errors/postgres-live-rows-retrieval.error';
import type { ExecutionSummaries } from '@/executions/execution.types';
import type {

View file

@ -21,7 +21,7 @@ import { ActiveExecutions } from '@/active-executions';
import { ConcurrencyControlService } from '@/concurrency/concurrency-control.service';
import config from '@/config';
import type { User } from '@/databases/entities/user';
import { AnnotationTagMappingRepository } from '@/databases/repositories/annotation-tag-mapping.repository';
import { AnnotationTagMappingRepository } from '@/databases/repositories/annotation-tag-mapping.repository.ee';
import { ExecutionAnnotationRepository } from '@/databases/repositories/execution-annotation.repository';
import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import type { IGetExecutionsQueryFilter } from '@/databases/repositories/execution.repository';

View file

@ -1,6 +1,6 @@
import { validate } from 'class-validator';
import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity';
import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee';
import type { CredentialsEntity } from '@/databases/entities/credentials-entity';
import type { TagEntity } from '@/databases/entities/tag-entity';
import type { User } from '@/databases/entities/user';

View file

@ -26,7 +26,7 @@ import type {
import type PCancelable from 'p-cancelable';
import type { ActiveWorkflowManager } from '@/active-workflow-manager';
import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity';
import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee';
import type { AuthProviderType } from '@/databases/entities/auth-identity';
import type { SharedCredentials } from '@/databases/entities/shared-credentials';
import type { TagEntity } from '@/databases/entities/tag-entity';

View file

@ -35,7 +35,7 @@ import type { FrontendService } from '@/services/frontend.service';
import { OrchestrationService } from '@/services/orchestration.service';
import '@/controllers/active-workflows.controller';
import '@/controllers/annotation-tags.controller';
import '@/controllers/annotation-tags.controller.ee';
import '@/controllers/auth.controller';
import '@/controllers/binary-data.controller';
import '@/controllers/curl.controller';

View file

@ -1,7 +1,7 @@
import { Service } from 'typedi';
import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity';
import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository';
import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee';
import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee';
import { validateEntity } from '@/generic-helpers';
import type { IAnnotationTagDb, IAnnotationTagWithCountDb } from '@/interfaces';

View file

@ -4,7 +4,7 @@ import Container from 'typedi';
import type { ExecutionData } from '@/databases/entities/execution-data';
import type { ExecutionEntity } from '@/databases/entities/execution-entity';
import type { WorkflowEntity } from '@/databases/entities/workflow-entity';
import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository';
import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee';
import { ExecutionDataRepository } from '@/databases/repositories/execution-data.repository';
import { ExecutionMetadataRepository } from '@/databases/repositories/execution-metadata.repository';
import { ExecutionRepository } from '@/databases/repositories/execution.repository';

View file

@ -87,9 +87,18 @@ const repositories = [
*/
export async function truncate(names: Array<(typeof repositories)[number]>) {
for (const name of names) {
const RepositoryClass: Class<Repository<object>> =
// eslint-disable-next-line n8n-local-rules/no-dynamic-import-template
(await import(`@/databases/repositories/${kebabCase(name)}.repository`))[`${name}Repository`];
let RepositoryClass: Class<Repository<object>>;
try {
RepositoryClass = (await import(`@/databases/repositories/${kebabCase(name)}.repository`))[
`${name}Repository`
];
} catch (e) {
RepositoryClass = (await import(`@/databases/repositories/${kebabCase(name)}.repository.ee`))[
`${name}Repository`
];
}
await Container.get(RepositoryClass).delete({});
}
}

View file

@ -140,7 +140,7 @@ export const setupTestServer = ({
for (const group of endpointGroups) {
switch (group) {
case 'annotationTags':
await import('@/controllers/annotation-tags.controller');
await import('@/controllers/annotation-tags.controller.ee');
break;
case 'credentials':

View file

@ -48,7 +48,7 @@ import DuplicateWorkflowDialog from '@/components/DuplicateWorkflowDialog.vue';
import ModalRoot from '@/components/ModalRoot.vue';
import PersonalizationModal from '@/components/PersonalizationModal.vue';
import WorkflowTagsManager from '@/components/TagsManager/WorkflowTagsManager.vue';
import AnnotationTagsManager from '@/components/TagsManager/AnnotationTagsManager.vue';
import AnnotationTagsManager from '@/components/TagsManager/AnnotationTagsManager.ee.vue';
import UpdatesPanel from '@/components/UpdatesPanel.vue';
import NpsSurvey from '@/components/NpsSurvey.vue';
import WorkflowLMChat from '@/components/WorkflowLMChat/WorkflowLMChat.vue';

View file

@ -15,7 +15,7 @@ import { usePostHog } from '@/stores/posthog.store';
import { useTelemetry } from '@/composables/useTelemetry';
import type { Placement } from '@floating-ui/core';
import { useDebounce } from '@/composables/useDebounce';
import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.vue';
import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.ee.vue';
export type ExecutionFilterProps = {
workflows?: Array<IWorkflowDb | IWorkflowShortResponse>;

View file

@ -2,7 +2,7 @@
import { ref, computed } from 'vue';
import type { AnnotationVote, ExecutionSummary } from 'n8n-workflow';
import { useExecutionsStore } from '@/stores/executions.store';
import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.vue';
import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.ee.vue';
import { createEventBus } from 'n8n-design-system';
import VoteButtons from '@/components/executions/workflow/VoteButtons.vue';
import { useToast } from '@/composables/useToast';