1
0
mirror of https://git.boykissers.com/pawkey/pawkey-sk.git synced 2025-12-20 04:04:16 +00:00

feat: long instance descriptions (#5)

This commit is contained in:
Leafus
2025-05-19 16:34:16 +00:00
committed by Bluey Heeler
parent a2757f235f
commit 400354237c
6 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/** @type {import('typeorm').MigrationInterface} */
export class AddLongdescriptionToMeta1744316999807 {
name = 'AddLongdescriptionToMeta1744316999807'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "longDescription" character varying(4096)`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "longDescription"`);
}
}

View File

@@ -75,6 +75,7 @@ export class MetaEntityService {
shortName: instance.shortName, shortName: instance.shortName,
uri: this.config.url, uri: this.config.url,
description: instance.description, description: instance.description,
longDescription: instance.longDescription,
langs: instance.langs, langs: instance.langs,
tosUrl: instance.termsOfServiceUrl, tosUrl: instance.termsOfServiceUrl,
repositoryUrl: instance.repositoryUrl, repositoryUrl: instance.repositoryUrl,

View File

@@ -211,6 +211,12 @@ export class MiMeta {
}) })
public registrationWord: string | null; public registrationWord: string | null;
@Column('varchar', {
length: 5128,
nullable: true,
})
public longDescription: string | null;
@Column('varchar', { @Column('varchar', {
length: 1024, length: 1024,
nullable: true, nullable: true,

View File

@@ -497,6 +497,10 @@ export const meta = {
type: 'string', type: 'string',
optional: false, nullable: true, optional: false, nullable: true,
}, },
longDescription: {
type: 'string',
optional: false, nullable: true,
},
disableRegistration: { disableRegistration: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false, optional: false, nullable: false,
@@ -654,6 +658,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
shortName: instance.shortName, shortName: instance.shortName,
uri: this.config.url, uri: this.config.url,
description: instance.description, description: instance.description,
longDescription: instance.longDescription,
langs: instance.langs, langs: instance.langs,
tosUrl: instance.termsOfServiceUrl, tosUrl: instance.termsOfServiceUrl,
repositoryUrl: instance.repositoryUrl, repositoryUrl: instance.repositoryUrl,

View File

@@ -67,6 +67,7 @@ export const paramDef = {
name: { type: 'string', nullable: true }, name: { type: 'string', nullable: true },
shortName: { type: 'string', nullable: true }, shortName: { type: 'string', nullable: true },
description: { type: 'string', nullable: true }, description: { type: 'string', nullable: true },
longDescription: { type:'string', nullable: true },
defaultLightTheme: { type: 'string', nullable: true }, defaultLightTheme: { type: 'string', nullable: true },
defaultDarkTheme: { type: 'string', nullable: true }, defaultDarkTheme: { type: 'string', nullable: true },
defaultLike: { type: 'string' }, defaultLike: { type: 'string' },
@@ -331,6 +332,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.description = ps.description; set.description = ps.description;
} }
if (ps.longDescription !== undefined) {
set.longDescription = ps.longDescription;
}
if (ps.defaultLightTheme !== undefined) { if (ps.defaultLightTheme !== undefined) {
set.defaultLightTheme = ps.defaultLightTheme; set.defaultLightTheme = ps.defaultLightTheme;
} }

View File

@@ -28,6 +28,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.instanceDescription }}<span v-if="infoForm.modifiedStates.description" class="_modified">{{ i18n.ts.modified }}</span></template> <template #label>{{ i18n.ts.instanceDescription }}<span v-if="infoForm.modifiedStates.description" class="_modified">{{ i18n.ts.modified }}</span></template>
</MkTextarea> </MkTextarea>
<MkTextarea v-model="infoForm.state.longDescription">
<template #label>Long instance description<span v-if="infoForm.modifiedStates.longDescription" class="_modified">{{ i18n.ts.modified }}</span></template>
</MkTextarea>
<FormSplit :minWidth="300"> <FormSplit :minWidth="300">
<MkInput v-model="infoForm.state.maintainerName"> <MkInput v-model="infoForm.state.maintainerName">
<template #label>{{ i18n.ts.maintainerName }}<span v-if="infoForm.modifiedStates.maintainerName" class="_modified">{{ i18n.ts.modified }}</span></template> <template #label>{{ i18n.ts.maintainerName }}<span v-if="infoForm.modifiedStates.maintainerName" class="_modified">{{ i18n.ts.modified }}</span></template>
@@ -318,6 +322,7 @@ const infoForm = useForm({
name: meta.name ?? '', name: meta.name ?? '',
shortName: meta.shortName ?? '', shortName: meta.shortName ?? '',
description: meta.description ?? '', description: meta.description ?? '',
longDescription: meta.longDescription ?? '',
maintainerName: meta.maintainerName ?? '', maintainerName: meta.maintainerName ?? '',
maintainerEmail: meta.maintainerEmail ?? '', maintainerEmail: meta.maintainerEmail ?? '',
tosUrl: meta.tosUrl ?? '', tosUrl: meta.tosUrl ?? '',
@@ -331,6 +336,7 @@ const infoForm = useForm({
name: state.name, name: state.name,
shortName: state.shortName === '' ? null : state.shortName, shortName: state.shortName === '' ? null : state.shortName,
description: state.description, description: state.description,
longDescription: state.longDescription,
maintainerName: state.maintainerName, maintainerName: state.maintainerName,
maintainerEmail: state.maintainerEmail, maintainerEmail: state.maintainerEmail,
tosUrl: state.tosUrl, tosUrl: state.tosUrl,