mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 17:56:30 -05:00
Remove AuthorColor entity
It will be replaced with the Author entity, that will save the color Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
fddb7e8c8c
commit
283ec673cf
17 changed files with 7 additions and 98 deletions
|
@ -19,7 +19,6 @@ import { User } from '../../../../users/user.entity';
|
||||||
import { Note } from '../../../../notes/note.entity';
|
import { Note } from '../../../../notes/note.entity';
|
||||||
import { AuthToken } from '../../../../auth/auth-token.entity';
|
import { AuthToken } from '../../../../auth/auth-token.entity';
|
||||||
import { Identity } from '../../../../users/identity.entity';
|
import { Identity } from '../../../../users/identity.entity';
|
||||||
import { AuthorColor } from '../../../../notes/author-color.entity';
|
|
||||||
import { Authorship } from '../../../../revisions/authorship.entity';
|
import { Authorship } from '../../../../revisions/authorship.entity';
|
||||||
import { Revision } from '../../../../revisions/revision.entity';
|
import { Revision } from '../../../../revisions/revision.entity';
|
||||||
import { Tag } from '../../../../notes/tag.entity';
|
import { Tag } from '../../../../notes/tag.entity';
|
||||||
|
@ -58,8 +57,6 @@ describe('HistoryController', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Identity))
|
.overrideProvider(getRepositoryToken(Identity))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Revision))
|
.overrideProvider(getRepositoryToken(Revision))
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { getRepositoryToken } from '@nestjs/typeorm';
|
||||||
import { User } from '../../../users/user.entity';
|
import { User } from '../../../users/user.entity';
|
||||||
import { Identity } from '../../../users/identity.entity';
|
import { Identity } from '../../../users/identity.entity';
|
||||||
import { MediaModule } from '../../../media/media.module';
|
import { MediaModule } from '../../../media/media.module';
|
||||||
import { AuthorColor } from '../../../notes/author-color.entity';
|
|
||||||
import { NoteGroupPermission } from '../../../permissions/note-group-permission.entity';
|
import { NoteGroupPermission } from '../../../permissions/note-group-permission.entity';
|
||||||
import { NoteUserPermission } from '../../../permissions/note-user-permission.entity';
|
import { NoteUserPermission } from '../../../permissions/note-user-permission.entity';
|
||||||
import { Authorship } from '../../../revisions/authorship.entity';
|
import { Authorship } from '../../../revisions/authorship.entity';
|
||||||
|
@ -62,8 +61,6 @@ describe('MeController', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Group))
|
.overrideProvider(getRepositoryToken(Group))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(NoteGroupPermission))
|
.overrideProvider(getRepositoryToken(NoteGroupPermission))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(NoteUserPermission))
|
.overrideProvider(getRepositoryToken(NoteUserPermission))
|
||||||
|
|
|
@ -16,7 +16,6 @@ import externalConfigMock from '../../../config/mock/external-services.config.mo
|
||||||
import { MediaModule } from '../../../media/media.module';
|
import { MediaModule } from '../../../media/media.module';
|
||||||
import { NotesModule } from '../../../notes/notes.module';
|
import { NotesModule } from '../../../notes/notes.module';
|
||||||
import { getRepositoryToken } from '@nestjs/typeorm';
|
import { getRepositoryToken } from '@nestjs/typeorm';
|
||||||
import { AuthorColor } from '../../../notes/author-color.entity';
|
|
||||||
import { Authorship } from '../../../revisions/authorship.entity';
|
import { Authorship } from '../../../revisions/authorship.entity';
|
||||||
import { AuthToken } from '../../../auth/auth-token.entity';
|
import { AuthToken } from '../../../auth/auth-token.entity';
|
||||||
import { Identity } from '../../../users/identity.entity';
|
import { Identity } from '../../../users/identity.entity';
|
||||||
|
@ -51,8 +50,6 @@ describe('MediaController', () => {
|
||||||
],
|
],
|
||||||
controllers: [MediaController],
|
controllers: [MediaController],
|
||||||
})
|
})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthToken))
|
.overrideProvider(getRepositoryToken(AuthToken))
|
||||||
|
|
|
@ -26,7 +26,6 @@ import appConfigMock from '../../../config/mock/app.config.mock';
|
||||||
import mediaConfigMock from '../../../config/mock/media.config.mock';
|
import mediaConfigMock from '../../../config/mock/media.config.mock';
|
||||||
import { Revision } from '../../../revisions/revision.entity';
|
import { Revision } from '../../../revisions/revision.entity';
|
||||||
import { Authorship } from '../../../revisions/authorship.entity';
|
import { Authorship } from '../../../revisions/authorship.entity';
|
||||||
import { AuthorColor } from '../../../notes/author-color.entity';
|
|
||||||
import { User } from '../../../users/user.entity';
|
import { User } from '../../../users/user.entity';
|
||||||
import { AuthToken } from '../../../auth/auth-token.entity';
|
import { AuthToken } from '../../../auth/auth-token.entity';
|
||||||
import { Identity } from '../../../users/identity.entity';
|
import { Identity } from '../../../users/identity.entity';
|
||||||
|
@ -74,8 +73,7 @@ describe('NotesController', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(User))
|
.overrideProvider(getRepositoryToken(User))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthToken))
|
.overrideProvider(getRepositoryToken(AuthToken))
|
||||||
|
|
|
@ -12,7 +12,6 @@ import {
|
||||||
} from '@nestjs/typeorm';
|
} from '@nestjs/typeorm';
|
||||||
import { HistoryModule } from '../../../history/history.module';
|
import { HistoryModule } from '../../../history/history.module';
|
||||||
import { LoggerModule } from '../../../logger/logger.module';
|
import { LoggerModule } from '../../../logger/logger.module';
|
||||||
import { AuthorColor } from '../../../notes/author-color.entity';
|
|
||||||
import { Note } from '../../../notes/note.entity';
|
import { Note } from '../../../notes/note.entity';
|
||||||
import { NotesModule } from '../../../notes/notes.module';
|
import { NotesModule } from '../../../notes/notes.module';
|
||||||
import { Tag } from '../../../notes/tag.entity';
|
import { Tag } from '../../../notes/tag.entity';
|
||||||
|
@ -62,8 +61,6 @@ describe('Me Controller', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Identity))
|
.overrideProvider(getRepositoryToken(Identity))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Revision))
|
.overrideProvider(getRepositoryToken(Revision))
|
||||||
|
|
|
@ -12,7 +12,6 @@ import mediaConfigMock from '../../../config/mock/media.config.mock';
|
||||||
import { LoggerModule } from '../../../logger/logger.module';
|
import { LoggerModule } from '../../../logger/logger.module';
|
||||||
import { MediaUpload } from '../../../media/media-upload.entity';
|
import { MediaUpload } from '../../../media/media-upload.entity';
|
||||||
import { MediaModule } from '../../../media/media.module';
|
import { MediaModule } from '../../../media/media.module';
|
||||||
import { AuthorColor } from '../../../notes/author-color.entity';
|
|
||||||
import { Note } from '../../../notes/note.entity';
|
import { Note } from '../../../notes/note.entity';
|
||||||
import { NotesModule } from '../../../notes/notes.module';
|
import { NotesModule } from '../../../notes/notes.module';
|
||||||
import { Tag } from '../../../notes/tag.entity';
|
import { Tag } from '../../../notes/tag.entity';
|
||||||
|
@ -42,8 +41,6 @@ describe('Media Controller', () => {
|
||||||
NotesModule,
|
NotesModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthToken))
|
.overrideProvider(getRepositoryToken(AuthToken))
|
||||||
|
|
|
@ -11,7 +11,6 @@ import {
|
||||||
TypeOrmModule,
|
TypeOrmModule,
|
||||||
} from '@nestjs/typeorm';
|
} from '@nestjs/typeorm';
|
||||||
import { LoggerModule } from '../../../logger/logger.module';
|
import { LoggerModule } from '../../../logger/logger.module';
|
||||||
import { AuthorColor } from '../../../notes/author-color.entity';
|
|
||||||
import { Note } from '../../../notes/note.entity';
|
import { Note } from '../../../notes/note.entity';
|
||||||
import { NotesService } from '../../../notes/notes.service';
|
import { NotesService } from '../../../notes/notes.service';
|
||||||
import { Tag } from '../../../notes/tag.entity';
|
import { Tag } from '../../../notes/tag.entity';
|
||||||
|
@ -76,8 +75,6 @@ describe('Notes Controller', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(User))
|
.overrideProvider(getRepositoryToken(User))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthToken))
|
.overrideProvider(getRepositoryToken(AuthToken))
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { NotesModule } from '../notes/notes.module';
|
||||||
import { getConnectionToken, getRepositoryToken } from '@nestjs/typeorm';
|
import { getConnectionToken, getRepositoryToken } from '@nestjs/typeorm';
|
||||||
import { Identity } from '../users/identity.entity';
|
import { Identity } from '../users/identity.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { AuthorColor } from '../notes/author-color.entity';
|
|
||||||
import { Authorship } from '../revisions/authorship.entity';
|
import { Authorship } from '../revisions/authorship.entity';
|
||||||
import { HistoryEntry } from './history-entry.entity';
|
import { HistoryEntry } from './history-entry.entity';
|
||||||
import { Note } from '../notes/note.entity';
|
import { Note } from '../notes/note.entity';
|
||||||
|
@ -75,8 +74,6 @@ describe('HistoryService', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Revision))
|
.overrideProvider(getRepositoryToken(Revision))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Note))
|
.overrideProvider(getRepositoryToken(Note))
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { getRepositoryToken } from '@nestjs/typeorm';
|
import { getRepositoryToken } from '@nestjs/typeorm';
|
||||||
import mediaConfigMock from '../config/mock/media.config.mock';
|
import mediaConfigMock from '../config/mock/media.config.mock';
|
||||||
import { LoggerModule } from '../logger/logger.module';
|
import { LoggerModule } from '../logger/logger.module';
|
||||||
import { AuthorColor } from '../notes/author-color.entity';
|
|
||||||
import { Note } from '../notes/note.entity';
|
import { Note } from '../notes/note.entity';
|
||||||
import { NotesModule } from '../notes/notes.module';
|
import { NotesModule } from '../notes/notes.module';
|
||||||
import { Tag } from '../notes/tag.entity';
|
import { Tag } from '../notes/tag.entity';
|
||||||
|
@ -56,8 +55,6 @@ describe('MediaService', () => {
|
||||||
UsersModule,
|
UsersModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthToken))
|
.overrideProvider(getRepositoryToken(AuthToken))
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Column, Entity, ManyToOne } from 'typeorm';
|
|
||||||
import { User } from '../users/user.entity';
|
|
||||||
import { Note } from './note.entity';
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class AuthorColor {
|
|
||||||
@ManyToOne((_) => Note, (note) => note.authorColors, {
|
|
||||||
primary: true,
|
|
||||||
})
|
|
||||||
note: Note;
|
|
||||||
|
|
||||||
@ManyToOne((_) => User, {
|
|
||||||
primary: true,
|
|
||||||
})
|
|
||||||
user: User;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
color: string;
|
|
||||||
}
|
|
|
@ -17,7 +17,6 @@ import { NoteGroupPermission } from '../permissions/note-group-permission.entity
|
||||||
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
||||||
import { Revision } from '../revisions/revision.entity';
|
import { Revision } from '../revisions/revision.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { AuthorColor } from './author-color.entity';
|
|
||||||
import { Tag } from './tag.entity';
|
import { Tag } from './tag.entity';
|
||||||
import { HistoryEntry } from '../history/history-entry.entity';
|
import { HistoryEntry } from '../history/history-entry.entity';
|
||||||
import { MediaUpload } from '../media/media-upload.entity';
|
import { MediaUpload } from '../media/media-upload.entity';
|
||||||
|
@ -59,8 +58,6 @@ export class Note {
|
||||||
owner: User | null;
|
owner: User | null;
|
||||||
@OneToMany((_) => Revision, (revision) => revision.note, { cascade: true })
|
@OneToMany((_) => Revision, (revision) => revision.note, { cascade: true })
|
||||||
revisions: Promise<Revision[]>;
|
revisions: Promise<Revision[]>;
|
||||||
@OneToMany((_) => AuthorColor, (authorColor) => authorColor.note)
|
|
||||||
authorColors: AuthorColor[];
|
|
||||||
@OneToMany((_) => HistoryEntry, (historyEntry) => historyEntry.user)
|
@OneToMany((_) => HistoryEntry, (historyEntry) => historyEntry.user)
|
||||||
historyEntries: HistoryEntry[];
|
historyEntries: HistoryEntry[];
|
||||||
@OneToMany((_) => MediaUpload, (mediaUpload) => mediaUpload.note)
|
@OneToMany((_) => MediaUpload, (mediaUpload) => mediaUpload.note)
|
||||||
|
@ -90,7 +87,6 @@ export class Note {
|
||||||
newNote.alias = alias ?? null;
|
newNote.alias = alias ?? null;
|
||||||
newNote.viewCount = 0;
|
newNote.viewCount = 0;
|
||||||
newNote.owner = owner ?? null;
|
newNote.owner = owner ?? null;
|
||||||
newNote.authorColors = [];
|
|
||||||
newNote.userPermissions = [];
|
newNote.userPermissions = [];
|
||||||
newNote.groupPermissions = [];
|
newNote.groupPermissions = [];
|
||||||
newNote.revisions = Promise.resolve([]) as Promise<Revision[]>;
|
newNote.revisions = Promise.resolve([]) as Promise<Revision[]>;
|
||||||
|
|
|
@ -5,24 +5,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { forwardRef, Module } from '@nestjs/common';
|
import { forwardRef, Module } from '@nestjs/common';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { GroupsModule } from '../groups/groups.module';
|
||||||
import { LoggerModule } from '../logger/logger.module';
|
import { LoggerModule } from '../logger/logger.module';
|
||||||
|
import { NoteGroupPermission } from '../permissions/note-group-permission.entity';
|
||||||
|
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
||||||
import { RevisionsModule } from '../revisions/revisions.module';
|
import { RevisionsModule } from '../revisions/revisions.module';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { AuthorColor } from './author-color.entity';
|
|
||||||
import { Note } from './note.entity';
|
import { Note } from './note.entity';
|
||||||
import { NotesService } from './notes.service';
|
import { NotesService } from './notes.service';
|
||||||
import { Tag } from './tag.entity';
|
import { Tag } from './tag.entity';
|
||||||
import { NoteGroupPermission } from '../permissions/note-group-permission.entity';
|
|
||||||
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
|
||||||
import { GroupsModule } from '../groups/groups.module';
|
|
||||||
import { ConfigModule } from '@nestjs/config';
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
TypeOrmModule.forFeature([
|
TypeOrmModule.forFeature([
|
||||||
Note,
|
Note,
|
||||||
AuthorColor,
|
|
||||||
Tag,
|
Tag,
|
||||||
NoteGroupPermission,
|
NoteGroupPermission,
|
||||||
NoteUserPermission,
|
NoteUserPermission,
|
||||||
|
|
|
@ -14,7 +14,6 @@ import { AuthToken } from '../auth/auth-token.entity';
|
||||||
import { Identity } from '../users/identity.entity';
|
import { Identity } from '../users/identity.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { AuthorColor } from './author-color.entity';
|
|
||||||
import { Note } from './note.entity';
|
import { Note } from './note.entity';
|
||||||
import { NotesService } from './notes.service';
|
import { NotesService } from './notes.service';
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
|
@ -80,8 +79,6 @@ describe('NotesService', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Revision))
|
.overrideProvider(getRepositoryToken(Revision))
|
||||||
.useClass(Repository)
|
.useClass(Repository)
|
||||||
.overrideProvider(getRepositoryToken(NoteGroupPermission))
|
.overrideProvider(getRepositoryToken(NoteGroupPermission))
|
||||||
|
@ -688,13 +685,6 @@ describe('NotesService', () => {
|
||||||
note.alias = 'testAlias';
|
note.alias = 'testAlias';
|
||||||
note.title = 'testTitle';
|
note.title = 'testTitle';
|
||||||
note.description = 'testDescription';
|
note.description = 'testDescription';
|
||||||
note.authorColors = [
|
|
||||||
{
|
|
||||||
note: note,
|
|
||||||
user: user,
|
|
||||||
color: 'red',
|
|
||||||
} as AuthorColor,
|
|
||||||
];
|
|
||||||
note.owner = user;
|
note.owner = user;
|
||||||
note.userPermissions = [
|
note.userPermissions = [
|
||||||
{
|
{
|
||||||
|
@ -782,13 +772,6 @@ describe('NotesService', () => {
|
||||||
note.alias = 'testAlias';
|
note.alias = 'testAlias';
|
||||||
note.title = 'testTitle';
|
note.title = 'testTitle';
|
||||||
note.description = 'testDescription';
|
note.description = 'testDescription';
|
||||||
note.authorColors = [
|
|
||||||
{
|
|
||||||
note: note,
|
|
||||||
user: user,
|
|
||||||
color: 'red',
|
|
||||||
} as AuthorColor,
|
|
||||||
];
|
|
||||||
note.owner = user;
|
note.owner = user;
|
||||||
note.userPermissions = [
|
note.userPermissions = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,13 +60,7 @@ export class NotesService {
|
||||||
async getUserNotes(user: User): Promise<Note[]> {
|
async getUserNotes(user: User): Promise<Note[]> {
|
||||||
const notes = await this.noteRepository.find({
|
const notes = await this.noteRepository.find({
|
||||||
where: { owner: user },
|
where: { owner: user },
|
||||||
relations: [
|
relations: ['owner', 'userPermissions', 'groupPermissions', 'tags'],
|
||||||
'owner',
|
|
||||||
'userPermissions',
|
|
||||||
'groupPermissions',
|
|
||||||
'authorColors',
|
|
||||||
'tags',
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
if (notes === undefined) {
|
if (notes === undefined) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -173,7 +167,6 @@ export class NotesService {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
relations: [
|
relations: [
|
||||||
'authorColors',
|
|
||||||
'owner',
|
'owner',
|
||||||
'groupPermissions',
|
'groupPermissions',
|
||||||
'groupPermissions.group',
|
'groupPermissions.group',
|
||||||
|
@ -365,9 +358,7 @@ export class NotesService {
|
||||||
title: note.title ?? '',
|
title: note.title ?? '',
|
||||||
createTime: (await this.getFirstRevision(note)).createdAt,
|
createTime: (await this.getFirstRevision(note)).createdAt,
|
||||||
description: note.description ?? '',
|
description: note.description ?? '',
|
||||||
editedBy: note.authorColors.map(
|
editedBy: [], // TODO temporary placeholder,
|
||||||
(authorColor) => authorColor.user.userName,
|
|
||||||
),
|
|
||||||
permissions: this.toNotePermissionsDto(note),
|
permissions: this.toNotePermissionsDto(note),
|
||||||
tags: this.toTagList(note),
|
tags: this.toTagList(note),
|
||||||
updateTime: (await this.getLatestRevision(note)).createdAt,
|
updateTime: (await this.getLatestRevision(note)).createdAt,
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { getRepositoryToken } from '@nestjs/typeorm';
|
||||||
import { AuthToken } from '../auth/auth-token.entity';
|
import { AuthToken } from '../auth/auth-token.entity';
|
||||||
import { Group } from '../groups/group.entity';
|
import { Group } from '../groups/group.entity';
|
||||||
import { LoggerModule } from '../logger/logger.module';
|
import { LoggerModule } from '../logger/logger.module';
|
||||||
import { AuthorColor } from '../notes/author-color.entity';
|
|
||||||
import { Note } from '../notes/note.entity';
|
import { Note } from '../notes/note.entity';
|
||||||
import { NotesModule } from '../notes/notes.module';
|
import { NotesModule } from '../notes/notes.module';
|
||||||
import { Tag } from '../notes/tag.entity';
|
import { Tag } from '../notes/tag.entity';
|
||||||
|
@ -50,8 +49,6 @@ describe('PermissionsService', () => {
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(Revision))
|
.overrideProvider(getRepositoryToken(Revision))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(Note))
|
.overrideProvider(getRepositoryToken(Note))
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { getRepositoryToken } from '@nestjs/typeorm';
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
import { NotInDBError } from '../errors/errors';
|
import { NotInDBError } from '../errors/errors';
|
||||||
import { LoggerModule } from '../logger/logger.module';
|
import { LoggerModule } from '../logger/logger.module';
|
||||||
import { AuthorColor } from '../notes/author-color.entity';
|
|
||||||
import { Note } from '../notes/note.entity';
|
import { Note } from '../notes/note.entity';
|
||||||
import { NotesModule } from '../notes/notes.module';
|
import { NotesModule } from '../notes/notes.module';
|
||||||
import { AuthToken } from '../auth/auth-token.entity';
|
import { AuthToken } from '../auth/auth-token.entity';
|
||||||
|
@ -49,8 +48,6 @@ describe('RevisionsService', () => {
|
||||||
})
|
})
|
||||||
.overrideProvider(getRepositoryToken(Authorship))
|
.overrideProvider(getRepositoryToken(Authorship))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
||||||
.useValue({})
|
|
||||||
.overrideProvider(getRepositoryToken(User))
|
.overrideProvider(getRepositoryToken(User))
|
||||||
.useValue({})
|
.useValue({})
|
||||||
.overrideProvider(getRepositoryToken(AuthToken))
|
.overrideProvider(getRepositoryToken(AuthToken))
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { Authorship } from './revisions/authorship.entity';
|
||||||
import { NoteGroupPermission } from './permissions/note-group-permission.entity';
|
import { NoteGroupPermission } from './permissions/note-group-permission.entity';
|
||||||
import { NoteUserPermission } from './permissions/note-user-permission.entity';
|
import { NoteUserPermission } from './permissions/note-user-permission.entity';
|
||||||
import { Group } from './groups/group.entity';
|
import { Group } from './groups/group.entity';
|
||||||
import { AuthorColor } from './notes/author-color.entity';
|
|
||||||
import { HistoryEntry } from './history/history-entry.entity';
|
import { HistoryEntry } from './history/history-entry.entity';
|
||||||
import { MediaUpload } from './media/media-upload.entity';
|
import { MediaUpload } from './media/media-upload.entity';
|
||||||
import { Tag } from './notes/tag.entity';
|
import { Tag } from './notes/tag.entity';
|
||||||
|
@ -33,7 +32,6 @@ createConnection({
|
||||||
NoteGroupPermission,
|
NoteGroupPermission,
|
||||||
NoteUserPermission,
|
NoteUserPermission,
|
||||||
Group,
|
Group,
|
||||||
AuthorColor,
|
|
||||||
HistoryEntry,
|
HistoryEntry,
|
||||||
MediaUpload,
|
MediaUpload,
|
||||||
Tag,
|
Tag,
|
||||||
|
|
Loading…
Reference in a new issue