diff --git a/frontend/components/Tag.vue b/frontend/components/Tag.vue index 7cdd771a..fbcdfdc1 100644 --- a/frontend/components/Tag.vue +++ b/frontend/components/Tag.vue @@ -20,7 +20,7 @@ import { Tag } from 'hangar-api'; import { PropType } from 'vue'; @Component -export default class DocsPage extends Vue { +export default class TagComponent extends Vue { @Prop({ type: String }) name!: string; diff --git a/frontend/components/modals/NewChannelModal.vue b/frontend/components/modals/ChannelModal.vue similarity index 81% rename from frontend/components/modals/NewChannelModal.vue rename to frontend/components/modals/ChannelModal.vue index 3e4d0895..5283833d 100644 --- a/frontend/components/modals/NewChannelModal.vue +++ b/frontend/components/modals/ChannelModal.vue @@ -4,19 +4,19 @@ - {{ $t('channel.new.title') }} + {{ edit ? $t('channel.modal.titleEdit') : $t('channel.modal.titleNew') }} - {{ $t('channel.new.color') }} + {{ $t('channel.modal.color') }} @@ -32,7 +32,7 @@ @click="toggle" > - mdi-checkbox-marked-circle + mdi-checkbox-marked-circle @@ -40,25 +40,31 @@ - + {{ $t('general.close') }} - {{ $t('general.create') }} + {{ edit ? $t('general.save') : $t('general.create') }} diff --git a/frontend/pages/_author/_slug/versions/index.vue b/frontend/pages/_author/_slug/versions/index.vue index 1728a44e..9ec46cba 100644 --- a/frontend/pages/_author/_slug/versions/index.vue +++ b/frontend/pages/_author/_slug/versions/index.vue @@ -104,15 +104,6 @@ - - diff --git a/frontend/pages/_author/_slug/versions/new.vue b/frontend/pages/_author/_slug/versions/new.vue index 5f13ec48..b243d381 100644 --- a/frontend/pages/_author/_slug/versions/new.vue +++ b/frontend/pages/_author/_slug/versions/new.vue @@ -74,14 +74,14 @@ - + - + @@ -179,12 +179,12 @@ import { HangarProjectMixin } from '~/components/mixins'; import { ProjectPermission } from '~/utils/perms'; import { NamedPermission, Platform } from '~/types/enums'; import { MarkdownEditor } from '~/components/markdown'; -import NewChannelModal from '~/components/modals/NewChannelModal.vue'; +import ChannelModal from '~/components/modals/ChannelModal.vue'; import { RootState } from '~/store'; import DependencyTable from '~/components/modals/versions/DependencyTable.vue'; @Component({ - components: { DependencyTable, NewChannelModal, MarkdownEditor }, + components: { DependencyTable, ChannelModal, MarkdownEditor }, }) @ProjectPermission(NamedPermission.CREATE_VERSION) export default class ProjectVersionsNewPage extends HangarProjectMixin { diff --git a/src/main/java/io/papermc/hangar/model/internal/versions/PendingVersion.java b/src/main/java/io/papermc/hangar/model/internal/versions/PendingVersion.java index 3f8200ee..50e5a520 100644 --- a/src/main/java/io/papermc/hangar/model/internal/versions/PendingVersion.java +++ b/src/main/java/io/papermc/hangar/model/internal/versions/PendingVersion.java @@ -36,7 +36,7 @@ public class PendingVersion { @Validate(SpEL = "@validate.optionalRegex(#root, @hangarConfig.urlRegex)", message = "general.error.invalidUrl") private final String externalUrl; @NotBlank(message = "version.new.error.channel.noName") - @Validate(SpEL = "@validate.regex(#root, @hangarConfig.channels.nameRegex)", message = "channel.new.error.invalidName") + @Validate(SpEL = "@validate.regex(#root, @hangarConfig.channels.nameRegex)", message = "channel.modal.error.invalidName") private final String channelName; @NotNull(message = "version.new.error.channel.noColor") private final Color channelColor; diff --git a/src/main/java/io/papermc/hangar/service/internal/projects/ChannelService.java b/src/main/java/io/papermc/hangar/service/internal/projects/ChannelService.java index 0c5810da..cfdb2368 100644 --- a/src/main/java/io/papermc/hangar/service/internal/projects/ChannelService.java +++ b/src/main/java/io/papermc/hangar/service/internal/projects/ChannelService.java @@ -22,20 +22,20 @@ public class ChannelService extends HangarService { public ProjectChannelTable createProjectChannel(String name, Color color, long projectId, boolean nonReviewed) { if (!config.channels.isValidChannelName(name)) { - throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.new.error.invalidName"); + throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.modal.error.invalidName"); } List existingTables = projectChannelsDAO.getProjectChannels(projectId); if (existingTables.size() >= config.projects.getMaxChannels()) { - throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.new.error.maxChannels", config.projects.getMaxChannels()); + throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.modal.error.maxChannels", config.projects.getMaxChannels()); } if (existingTables.stream().anyMatch(ch -> ch.getColor() == color)) { - throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.new.error.duplicateColor"); + throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.modal.error.duplicateColor"); } if (existingTables.stream().anyMatch(ch -> ch.getName().equalsIgnoreCase(name))) { - throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.new.error.duplicateName"); + throw new HangarApiException(HttpStatus.BAD_REQUEST, "channel.modal.error.duplicateName"); } return projectChannelsDAO.insert(new ProjectChannelTable(name, color, projectId, nonReviewed)); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c55d3db9..858e133e 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -51,9 +51,6 @@ hangar: - text: "This is a staging server for testing purposes. Data could be deleted at any time. Please use our production server at (TODO: prod url, lol) for uploading your plugins!" color: "#ff544b" - - - text: "This is an announcement. It's cool" - color: "green" sponsors: - name: Beer