Skip to content

Commit 19736aa

Browse files
committed
New config setting: how many tags per document?
1 parent 0743ae0 commit 19736aa

File tree

17 files changed

+827
-731
lines changed

17 files changed

+827
-731
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Space view.
5858

5959
## Latest version
6060

61-
[Community edition: v1.66.0](https://github.com/documize/community/releases)
61+
[Community edition: v1.67.0](https://github.com/documize/community/releases)
6262

63-
[Enterprise edition: v1.68.0](https://documize.com/downloads)
63+
[Enterprise edition: v1.69.0](https://documize.com/downloads)
6464

6565
## OS support
6666

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* community edition */
2+
3+
-- max tags per document setting
4+
ALTER TABLE organization ADD COLUMN `maxtags` INT NOT NULL DEFAULT 3 AFTER `authconfig`;
5+
6+
-- deprecations

domain/meta/endpoint.go

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (h *Handler) Meta(w http.ResponseWriter, r *http.Request) {
5454
data.AllowAnonymousAccess = org.AllowAnonymousAccess
5555
data.AuthProvider = org.AuthProvider
5656
data.AuthConfig = org.AuthConfig
57+
data.MaxTags = org.MaxTags
5758
data.Version = h.Runtime.Product.Version
5859
data.Edition = h.Runtime.Product.License.Edition
5960
data.Valid = h.Runtime.Product.License.Valid

domain/organization/mysql/store.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func (s Scope) AddOrganization(ctx domain.RequestContext, org org.Organization)
3636
org.Revised = time.Now().UTC()
3737

3838
_, err = ctx.Transaction.Exec(
39-
"INSERT INTO organization (refid, company, title, message, url, domain, email, allowanonymousaccess, serial, created, revised) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
39+
"INSERT INTO organization (refid, company, title, message, url, domain, email, allowanonymousaccess, serial, maxtags, created, revised) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
4040
org.RefID, org.Company, org.Title, org.Message, strings.ToLower(org.URL), strings.ToLower(org.Domain),
41-
strings.ToLower(org.Email), org.AllowAnonymousAccess, org.Serial, org.Created, org.Revised)
41+
strings.ToLower(org.Email), org.AllowAnonymousAccess, org.Serial, org.MaxTags, org.Created, org.Revised)
4242

4343
if err != nil {
4444
err = errors.Wrap(err, "unable to execute insert for org")
@@ -49,7 +49,7 @@ func (s Scope) AddOrganization(ctx domain.RequestContext, org org.Organization)
4949

5050
// GetOrganization returns the Organization reocrod from the organization database table with the given id.
5151
func (s Scope) GetOrganization(ctx domain.RequestContext, id string) (org org.Organization, err error) {
52-
stmt, err := s.Runtime.Db.Preparex("SELECT id, refid, company, title, message, url, domain, service as conversionendpoint, email, serial, active, allowanonymousaccess, authprovider, coalesce(authconfig,JSON_UNQUOTE('{}')) as authconfig, created, revised FROM organization WHERE refid=?")
52+
stmt, err := s.Runtime.Db.Preparex("SELECT id, refid, company, title, message, url, domain, service as conversionendpoint, email, serial, active, allowanonymousaccess, authprovider, coalesce(authconfig,JSON_UNQUOTE('{}')) as authconfig, maxtags, created, revised FROM organization WHERE refid=?")
5353
defer streamutil.Close(stmt)
5454

5555
if err != nil {
@@ -80,14 +80,14 @@ func (s Scope) GetOrganizationByDomain(subdomain string) (o org.Organization, er
8080
}
8181

8282
// match on given domain name
83-
err = s.Runtime.Db.Get(&o, "SELECT id, refid, company, title, message, url, domain, service as conversionendpoint, email, serial, active, allowanonymousaccess, authprovider, coalesce(authconfig,JSON_UNQUOTE('{}')) as authconfig, created, revised FROM organization WHERE domain=? AND active=1", subdomain)
83+
err = s.Runtime.Db.Get(&o, "SELECT id, refid, company, title, message, url, domain, service as conversionendpoint, email, serial, active, allowanonymousaccess, authprovider, coalesce(authconfig,JSON_UNQUOTE('{}')) as authconfig, maxtags, created, revised FROM organization WHERE domain=? AND active=1", subdomain)
8484
if err == nil {
8585
return
8686
}
8787
err = nil
8888

8989
// match on empty domain as last resort
90-
err = s.Runtime.Db.Get(&o, "SELECT id, refid, company, title, message, url, domain, service as conversionendpoint, email, serial, active, allowanonymousaccess, authprovider, coalesce(authconfig,JSON_UNQUOTE('{}')) as authconfig, created, revised FROM organization WHERE domain='' AND active=1")
90+
err = s.Runtime.Db.Get(&o, "SELECT id, refid, company, title, message, url, domain, service as conversionendpoint, email, serial, active, allowanonymousaccess, authprovider, coalesce(authconfig,JSON_UNQUOTE('{}')) as authconfig, maxtags, created, revised FROM organization WHERE domain='' AND active=1")
9191
if err != nil && err != sql.ErrNoRows {
9292
err = errors.Wrap(err, "unable to execute select for empty subdomain")
9393
}
@@ -99,7 +99,7 @@ func (s Scope) GetOrganizationByDomain(subdomain string) (o org.Organization, er
9999
func (s Scope) UpdateOrganization(ctx domain.RequestContext, org org.Organization) (err error) {
100100
org.Revised = time.Now().UTC()
101101

102-
_, err = ctx.Transaction.NamedExec("UPDATE organization SET title=:title, message=:message, service=:conversionendpoint, email=:email, allowanonymousaccess=:allowanonymousaccess, revised=:revised WHERE refid=:refid",
102+
_, err = ctx.Transaction.NamedExec("UPDATE organization SET title=:title, message=:message, service=:conversionendpoint, email=:email, allowanonymousaccess=:allowanonymousaccess, maxtags=:maxtags, revised=:revised WHERE refid=:refid",
103103
&org)
104104

105105
if err != nil {

edition/community.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func main() {
4141
// product details
4242
rt.Product = env.ProdInfo{}
4343
rt.Product.Major = "1"
44-
rt.Product.Minor = "66"
44+
rt.Product.Minor = "67"
4545
rt.Product.Patch = "0"
4646
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
4747
rt.Product.Edition = "Community"

0 commit comments

Comments
 (0)