feat(editor): Add support for project icons (#12349)

This commit is contained in:
Milorad FIlipović
2024-12-27 19:00:40 +01:00
committed by GitHub
parent 7ea6c8b144
commit 9117718cc9
43 changed files with 962 additions and 76 deletions

View File

@@ -13,7 +13,7 @@ import type {
} from 'n8n-workflow';
import type { CredentialsEntity } from '@/databases/entities/credentials-entity';
import type { Project, ProjectType } from '@/databases/entities/project';
import type { Project, ProjectIcon, ProjectType } from '@/databases/entities/project';
import type { AssignableRole, GlobalRole, User } from '@/databases/entities/user';
import type { Variables } from '@/databases/entities/variables';
import type { WorkflowEntity } from '@/databases/entities/workflow-entity';
@@ -123,7 +123,7 @@ export namespace ListQuery {
}
type SlimUser = Pick<IUser, 'id' | 'email' | 'firstName' | 'lastName'>;
export type SlimProject = Pick<Project, 'id' | 'type' | 'name'>;
export type SlimProject = Pick<Project, 'id' | 'type' | 'name' | 'icon'>;
export function hasSharing(
workflows: ListQuery.Workflow.Plain[] | ListQuery.Workflow.WithSharing[],
@@ -440,6 +440,7 @@ export declare namespace ProjectRequest {
Project,
{
name: string;
icon?: ProjectIcon;
}
>;
@@ -468,6 +469,7 @@ export declare namespace ProjectRequest {
type ProjectWithRelations = {
id: string;
name: string | undefined;
icon: ProjectIcon;
type: ProjectType;
relations: ProjectRelationResponse[];
scopes: Scope[];
@@ -477,7 +479,11 @@ export declare namespace ProjectRequest {
type Update = AuthenticatedRequest<
{ projectId: string },
{},
{ name?: string; relations?: ProjectRelationPayload[] }
{
name?: string;
relations?: ProjectRelationPayload[];
icon?: { type: 'icon' | 'emoji'; value: string };
}
>;
type Delete = AuthenticatedRequest<{ projectId: string }, {}, {}, { transferId?: string }>;
}