merge: Customize Sidebar/Visitor/About separately from app icon. (!632)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/632

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
dakkar 2024-10-02 14:55:20 +00:00
commit 0bd6d48c7e
15 changed files with 98 additions and 8 deletions

View file

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: piuvas and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class SidebarLogo1727027985575 {
name = 'SidebarLogo1727027985575';
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "sidebarLogoUrl" character varying(1024)`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sidebarLogoUrl"`);
}
}

View file

@ -105,6 +105,7 @@ export class MetaEntityService {
serverErrorImageUrl: instance.serverErrorImageUrl,
notFoundImageUrl: instance.notFoundImageUrl,
iconUrl: instance.iconUrl,
sidebarLogoUrl: instance.sidebarLogoUrl,
backgroundImageUrl: instance.backgroundImageUrl,
logoImageUrl: instance.logoImageUrl,
maxNoteTextLength: this.config.maxNoteLength,

View file

@ -139,6 +139,12 @@ export class MiMeta {
})
public app512IconUrl: string | null;
@Column('varchar', {
length: 1024,
nullable: true,
})
public sidebarLogoUrl: string | null;
@Column('varchar', {
length: 1024,
nullable: true,

View file

@ -110,6 +110,10 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
sidebarLogoUrl: {
type: 'string',
optional: false, nullable: true,
},
enableEmail: {
type: 'boolean',
optional: false, nullable: false,
@ -582,6 +586,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
iconUrl: instance.iconUrl,
app192IconUrl: instance.app192IconUrl,
app512IconUrl: instance.app512IconUrl,
sidebarLogoUrl: instance.sidebarLogoUrl,
backgroundImageUrl: instance.backgroundImageUrl,
logoImageUrl: instance.logoImageUrl,
defaultLightTheme: instance.defaultLightTheme,

View file

@ -55,6 +55,7 @@ export const paramDef = {
iconUrl: { type: 'string', nullable: true },
app192IconUrl: { type: 'string', nullable: true },
app512IconUrl: { type: 'string', nullable: true },
sidebarLogoUrl: { type: 'string', nullable: true },
backgroundImageUrl: { type: 'string', nullable: true },
logoImageUrl: { type: 'string', nullable: true },
name: { type: 'string', nullable: true },
@ -250,6 +251,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.app512IconUrl = ps.app512IconUrl;
}
if (ps.sidebarLogoUrl !== undefined) {
set.sidebarLogoUrl = ps.sidebarLogoUrl;
}
if (ps.serverErrorImageUrl !== undefined) {
set.serverErrorImageUrl = ps.serverErrorImageUrl;
}