Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 01c3013b95 | |||
| fd41da0eb6 | |||
| 527b69555a |
@@ -4,7 +4,7 @@
|
||||
<name>MokoGitea</name>
|
||||
<org>MokoConsulting</org>
|
||||
<description>Moko fork of Gitea - adding project board REST API endpoints and custom enhancements</description>
|
||||
<version>06.18.00</version>
|
||||
<version>06.19.00</version>
|
||||
<version-prefix>v1.26.1+MOKO</version-prefix>
|
||||
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
||||
</identity>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: mokoplatform.Automation
|
||||
# VERSION: 06.18.00
|
||||
# VERSION: 06.19.00
|
||||
# BRIEF: Auto-create feature branch when an issue is opened
|
||||
|
||||
name: "Universal: Issue Branch"
|
||||
|
||||
+2
-2
@@ -1,6 +1,8 @@
|
||||
# Changelog
|
||||
## [Unreleased]
|
||||
|
||||
## [06.19.00] --- 2026-06-19
|
||||
|
||||
## [06.18.00] --- 2026-06-19
|
||||
|
||||
## [06.17.00] --- 2026-06-18
|
||||
@@ -8,5 +10,3 @@
|
||||
## [06.17.00] --- 2026-06-18
|
||||
|
||||
## [06.16.00] --- 2026-06-18
|
||||
|
||||
## [06.15.00] --- 2026-06-18
|
||||
|
||||
@@ -434,6 +434,7 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(354, "Add org wiki settings to user table", v1_27.AddOrgWikiSettings),
|
||||
newMigration(355, "Migrate update server metadata to repo manifest", v1_27.MigrateUpdateServerFieldsToManifest),
|
||||
newMigration(356, "Rename package_type to extension_type in repo manifest", v1_27.RenamePackageTypeToExtensionType),
|
||||
newMigration(357, "Drop display_name from repo manifest and update stream config", v1_27.DropDisplayNameColumns),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package v1_27
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
||||
// DropDisplayNameColumns removes the display_name column from repo_manifest
|
||||
// and update_stream_config. Display name is now computed from extension_type + name.
|
||||
func DropDisplayNameColumns(x *xorm.Engine) error {
|
||||
if _, err := x.Exec("ALTER TABLE repo_manifest DROP COLUMN IF EXISTS display_name"); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := x.Exec("ALTER TABLE update_stream_config DROP COLUMN IF EXISTS display_name")
|
||||
return err
|
||||
}
|
||||
@@ -39,7 +39,6 @@ type RepoMetadata struct {
|
||||
ElementName string `xorm:"TEXT 'element_name'"` // full element name override, e.g. "pkg_mokowaas" (auto-constructed if empty)
|
||||
|
||||
// distribution metadata (used by update server feed generation)
|
||||
DisplayName string `xorm:"TEXT 'display_name'"` // human-readable name for update feeds, e.g. "Package - MokoWaaS"
|
||||
Maintainer string `xorm:"TEXT 'maintainer'"` // maintainer/author name
|
||||
MaintainerURL string `xorm:"TEXT 'maintainer_url'"` // maintainer website
|
||||
InfoURL string `xorm:"TEXT 'info_url'"` // extension info/product page URL
|
||||
@@ -115,6 +114,20 @@ func (m *RepoMetadata) ElementNameMismatch() bool {
|
||||
return auto != "" && m.ElementName != auto
|
||||
}
|
||||
|
||||
// DerivedDisplayName computes the display name from ExtensionType and Name.
|
||||
// Format: "Package - MokoSuiteBackup" (titlecased type + repo name).
|
||||
// Falls back to just the Name if ExtensionType is empty.
|
||||
func (m *RepoMetadata) DerivedDisplayName() string {
|
||||
if m.Name == "" {
|
||||
return ""
|
||||
}
|
||||
if m.ExtensionType == "" {
|
||||
return m.Name
|
||||
}
|
||||
title := strings.ToUpper(m.ExtensionType[:1]) + m.ExtensionType[1:]
|
||||
return title + " - " + m.Name
|
||||
}
|
||||
|
||||
// GetRepoMetadata returns the metadata for a repo, or nil if none exists.
|
||||
func GetRepoMetadata(ctx context.Context, repoID int64) (*RepoMetadata, error) {
|
||||
m := new(RepoMetadata)
|
||||
|
||||
@@ -33,7 +33,6 @@ type UpdateStreamConfig struct {
|
||||
KeyPrefix string `xorm:"VARCHAR(20) 'key_prefix'"` // org-specific license key prefix (e.g. "ACME")
|
||||
// Extension metadata — used in update feed generation.
|
||||
ExtensionName string `xorm:"TEXT 'extension_name'"` // element identifier (e.g. pkg_mokowaas, com_mokowaas)
|
||||
DisplayName string `xorm:"TEXT 'display_name'"` // human-readable name (e.g. "Package - MokoWaaS")
|
||||
Description string `xorm:"TEXT"` // short description for update feeds
|
||||
ExtensionType string `xorm:"VARCHAR(50) 'extension_type'"` // component, module, plugin, package, template, library
|
||||
Maintainer string `xorm:"TEXT"` // maintainer/author name
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
repo_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/repo"
|
||||
updateserver_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/updateserver"
|
||||
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/structs"
|
||||
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/timeutil"
|
||||
@@ -21,6 +22,11 @@ func GetLicenseSettings(ctx *context.APIContext) {
|
||||
ctx.JSON(http.StatusOK, &structs.LicenseSettings{})
|
||||
return
|
||||
}
|
||||
// Compute display_name from repo metadata
|
||||
var displayName string
|
||||
if meta, err := repo_model.GetRepoMetadata(ctx, ctx.Repo.Repository.ID); err == nil && meta != nil {
|
||||
displayName = meta.DerivedDisplayName()
|
||||
}
|
||||
ctx.JSON(http.StatusOK, &structs.LicenseSettings{
|
||||
LicensingEnabled: cfg.LicensingEnabled,
|
||||
RequireKey: cfg.RequireKey,
|
||||
@@ -28,7 +34,7 @@ func GetLicenseSettings(ctx *context.APIContext) {
|
||||
Platform: cfg.Platform,
|
||||
SupportURL: cfg.SupportURL,
|
||||
ExtensionName: cfg.ExtensionName,
|
||||
DisplayName: cfg.DisplayName,
|
||||
DisplayName: displayName,
|
||||
ExtensionType: cfg.ExtensionType,
|
||||
Maintainer: cfg.Maintainer,
|
||||
MaintainerURL: cfg.MaintainerURL,
|
||||
@@ -51,7 +57,6 @@ func UpdateLicenseSettings(ctx *context.APIContext) {
|
||||
Platform: form.Platform,
|
||||
SupportURL: form.SupportURL,
|
||||
ExtensionName: form.ExtensionName,
|
||||
DisplayName: form.DisplayName,
|
||||
ExtensionType: form.ExtensionType,
|
||||
Maintainer: form.Maintainer,
|
||||
MaintainerURL: form.MaintainerURL,
|
||||
|
||||
@@ -23,7 +23,7 @@ type apiMetadata struct {
|
||||
Platform string `json:"platform"`
|
||||
StandardsVersion string `json:"standards_version"`
|
||||
StandardsSource string `json:"standards_source"`
|
||||
DisplayName string `json:"display_name"`
|
||||
DisplayName string `json:"display_name"` // read-only, computed from extension_type + name
|
||||
Maintainer string `json:"maintainer"`
|
||||
MaintainerURL string `json:"maintainer_url"`
|
||||
InfoURL string `json:"info_url"`
|
||||
@@ -72,7 +72,7 @@ func GetRepoMetadata(ctx *context.APIContext) {
|
||||
Platform: m.Platform,
|
||||
StandardsVersion: m.StandardsVersion,
|
||||
StandardsSource: m.StandardsSource,
|
||||
DisplayName: m.DisplayName,
|
||||
DisplayName: m.DerivedDisplayName(),
|
||||
Maintainer: m.Maintainer,
|
||||
MaintainerURL: m.MaintainerURL,
|
||||
InfoURL: m.InfoURL,
|
||||
@@ -115,7 +115,6 @@ func UpdateRepoMetadata(ctx *context.APIContext) {
|
||||
Platform: req.Platform,
|
||||
StandardsVersion: req.StandardsVersion,
|
||||
StandardsSource: req.StandardsSource,
|
||||
DisplayName: req.DisplayName,
|
||||
Maintainer: req.Maintainer,
|
||||
MaintainerURL: req.MaintainerURL,
|
||||
InfoURL: req.InfoURL,
|
||||
@@ -143,7 +142,7 @@ func UpdateRepoMetadata(ctx *context.APIContext) {
|
||||
Platform: m.Platform,
|
||||
StandardsVersion: m.StandardsVersion,
|
||||
StandardsSource: m.StandardsSource,
|
||||
DisplayName: m.DisplayName,
|
||||
DisplayName: m.DerivedDisplayName(),
|
||||
Maintainer: m.Maintainer,
|
||||
MaintainerURL: m.MaintainerURL,
|
||||
InfoURL: m.InfoURL,
|
||||
|
||||
@@ -50,7 +50,6 @@ func SettingsUpdateStreamsPost(ctx *context.Context) {
|
||||
SupportURL: ctx.FormString("support_url"),
|
||||
KeyPrefix: strings.ToUpper(strings.TrimSpace(ctx.FormString("key_prefix"))),
|
||||
ExtensionName: ctx.FormString("extension_name"),
|
||||
DisplayName: ctx.FormString("display_name"),
|
||||
Description: ctx.FormString("feed_description"),
|
||||
ExtensionType: ctx.FormString("extension_type"),
|
||||
Maintainer: ctx.FormString("maintainer"),
|
||||
|
||||
@@ -120,7 +120,6 @@ func saveMetadata(ctx *context.Context) {
|
||||
manifest.ElementName = existing.ElementName
|
||||
manifest.StandardsVersion = existing.StandardsVersion
|
||||
manifest.StandardsSource = existing.StandardsSource
|
||||
manifest.DisplayName = existing.DisplayName
|
||||
manifest.Maintainer = existing.Maintainer
|
||||
manifest.MaintainerURL = existing.MaintainerURL
|
||||
manifest.Language = existing.Language
|
||||
|
||||
@@ -696,7 +696,6 @@ func handleSettingsPostAdvanced(ctx *context.Context) {
|
||||
DownloadGating: form.DownloadGating,
|
||||
SupportURL: form.SupportURL,
|
||||
ExtensionName: form.ExtensionName,
|
||||
DisplayName: form.DisplayName,
|
||||
ExtensionType: form.ExtensionType,
|
||||
TargetVersion: form.TargetVersion,
|
||||
Maintainer: form.Maintainer,
|
||||
|
||||
@@ -139,7 +139,6 @@ type RepoSettingForm struct {
|
||||
DownloadGating string
|
||||
SupportURL string
|
||||
ExtensionName string
|
||||
DisplayName string
|
||||
ExtensionType string
|
||||
TargetVersion string
|
||||
Maintainer string
|
||||
|
||||
@@ -198,8 +198,8 @@ func resolveExtensionMetadata(ctx context.Context, repo *repo_model.Repository,
|
||||
if manifest.ExtensionType != "" {
|
||||
m.ExtType = manifest.ExtensionType
|
||||
}
|
||||
if manifest.DisplayName != "" {
|
||||
m.DisplayName = manifest.DisplayName
|
||||
if dn := manifest.DerivedDisplayName(); dn != "" {
|
||||
m.DisplayName = dn
|
||||
}
|
||||
if manifest.TargetVersion != "" {
|
||||
m.TargetVersion = manifest.TargetVersion
|
||||
|
||||
@@ -86,11 +86,6 @@
|
||||
<input name="extension_name" value="{{.StreamConfig.ExtensionName}}" placeholder="pkg_mokowaas">
|
||||
<p class="help">{{ctx.Locale.Tr "org.settings.extension_name_help"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "org.settings.display_name"}}</label>
|
||||
<input name="display_name" value="{{.StreamConfig.DisplayName}}" placeholder="Package - MokoWaaS">
|
||||
<p class="help">{{ctx.Locale.Tr "org.settings.display_name_help"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
|
||||
@@ -67,11 +67,6 @@
|
||||
<input name="extension_name" value="{{if .RepoUpdateConfig}}{{.RepoUpdateConfig.ExtensionName}}{{end}}" placeholder="pkg_myextension">
|
||||
<p class="help">{{ctx.Locale.Tr "org.settings.extension_name_help"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "org.settings.display_name"}}</label>
|
||||
<input name="display_name" value="{{if .RepoUpdateConfig}}{{.RepoUpdateConfig.DisplayName}}{{end}}" placeholder="Package - My Extension">
|
||||
<p class="help">{{ctx.Locale.Tr "org.settings.display_name_help"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
|
||||
Reference in New Issue
Block a user