mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-07 15:31:00 +08:00
Get max sponsors length from backenddata
This commit is contained in:
parent
e7b1a93e1b
commit
1cf9be8186
@ -54,4 +54,8 @@ public record ProjectsConfig( // TODO split into ProjectsConfig and VersionsConf
|
||||
public Validation versionName() {
|
||||
return new Validation(this.versionNameRegex(), this.maxVersionNameLen(), null);
|
||||
}
|
||||
|
||||
public Validation sponsorsContent() {
|
||||
return Validation.max(this.maxSponsorsLen());
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ public record Validations(
|
||||
Validation channels,
|
||||
Validation pageName,
|
||||
Validation pageContent,
|
||||
Validation sponsorsContent,
|
||||
int maxPageCount,
|
||||
int maxChannelCount
|
||||
) {
|
||||
@ -36,6 +37,7 @@ public record Validations(
|
||||
config.channels.channelName(),
|
||||
config.pages.pageName(),
|
||||
config.pages.pageContent(),
|
||||
config.projects.sponsorsContent(),
|
||||
config.projects.maxPages(),
|
||||
config.projects.maxChannels()
|
||||
);
|
||||
|
@ -19,6 +19,7 @@ import PlatformLogo from "~/components/logos/platforms/PlatformLogo.vue";
|
||||
import DownloadButton from "~/components/projects/DownloadButton.vue";
|
||||
import { useOpenProjectPages } from "~/composables/useOpenProjectPages";
|
||||
import ProjectPageMarkdown from "~/components/projects/ProjectPageMarkdown.vue";
|
||||
import { useBackendData } from "~/store/backendData";
|
||||
|
||||
const props = defineProps<{
|
||||
user: User;
|
||||
@ -77,7 +78,7 @@ function createPinnedVersionUrl(version: PinnedVersion): string {
|
||||
:deletable="false"
|
||||
:saveable="true"
|
||||
:cancellable="true"
|
||||
:maxlength="500"
|
||||
:maxlength="useBackendData.validations.project.sponsorsContent.max"
|
||||
:title="i18n.t('project.sponsors')"
|
||||
class="pt-0 mr-4"
|
||||
@save="saveSponsors"
|
||||
|
1
frontend/src/types/api.d.ts
vendored
1
frontend/src/types/api.d.ts
vendored
@ -56,6 +56,7 @@ declare module "hangar-api" {
|
||||
channels: Validation;
|
||||
pageName: Validation;
|
||||
pageContent: Validation;
|
||||
sponsorsContent: Validation;
|
||||
maxPageCount: number;
|
||||
maxChannelCount: number;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user