Improve Page
* ページをピン留めできるように * デッキでカラム内でページを見れるように
This commit is contained in:
@ -40,6 +40,11 @@ export class Page {
|
||||
@Column('boolean')
|
||||
public alignCenter: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false
|
||||
})
|
||||
public hideTitleWhenPinned: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 32,
|
||||
})
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm';
|
||||
import { id } from '../id';
|
||||
import { User } from './user';
|
||||
import { Page } from './page';
|
||||
|
||||
@Entity()
|
||||
export class UserProfile {
|
||||
@ -118,6 +119,18 @@ export class UserProfile {
|
||||
})
|
||||
public carefulBot: boolean;
|
||||
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
})
|
||||
public pinnedPageId: Page['id'] | null;
|
||||
|
||||
@OneToOne(type => Page, {
|
||||
onDelete: 'SET NULL'
|
||||
})
|
||||
@JoinColumn()
|
||||
public pinnedPage: Page | null;
|
||||
|
||||
//#region Linking
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
|
@ -71,6 +71,7 @@ export class PageRepository extends Repository<Page> {
|
||||
title: page.title,
|
||||
name: page.name,
|
||||
summary: page.summary,
|
||||
hideTitleWhenPinned: page.hideTitleWhenPinned,
|
||||
alignCenter: page.alignCenter,
|
||||
font: page.font,
|
||||
eyeCatchingImageId: page.eyeCatchingImageId,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import $ from 'cafy';
|
||||
import { EntityRepository, Repository, In } from 'typeorm';
|
||||
import { User, ILocalUser, IRemoteUser } from '../entities/user';
|
||||
import { Emojis, Notes, NoteUnreads, FollowRequests, Notifications, MessagingMessages, UserNotePinings, Followings, Blockings, Mutings, UserProfiles, UserSecurityKeys, UserGroupJoinings } from '..';
|
||||
import { Emojis, Notes, NoteUnreads, FollowRequests, Notifications, MessagingMessages, UserNotePinings, Followings, Blockings, Mutings, UserProfiles, UserSecurityKeys, UserGroupJoinings, Pages } from '..';
|
||||
import { ensure } from '../../prelude/ensure';
|
||||
import config from '../../config';
|
||||
import { SchemaType } from '../../misc/schema';
|
||||
@ -155,6 +155,8 @@ export class UserRepository extends Repository<User> {
|
||||
pinnedNotes: Notes.packMany(pins.map(pin => pin.noteId), meId, {
|
||||
detail: true
|
||||
}),
|
||||
pinnedPageId: profile!.pinnedPageId,
|
||||
pinnedPage: profile!.pinnedPageId ? Pages.pack(profile!.pinnedPageId, meId) : null,
|
||||
twoFactorEnabled: profile!.twoFactorEnabled,
|
||||
usePasswordLessLogin: profile!.usePasswordLessLogin,
|
||||
securityKeys: profile!.twoFactorEnabled
|
||||
|
Reference in New Issue
Block a user