Skip to content

Commit 47bb9d7

Browse files
Merge pull request #164 from documize/jira-connector
Jira connector
2 parents 0c5ec43 + 58fc03f commit 47bb9d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+11339
-732
lines changed

Gopkg.lock

+111-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+4
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,7 @@
9696
[[constraint]]
9797
name = "github.com/documize/slug"
9898
version = "1.1.1"
99+
100+
[[constraint]]
101+
name = "github.com/andygrunwald/go-jira"
102+
version = "1.5.0"

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.68.1](https://github.com/documize/community/releases)
61+
[Community edition: v1.69.0](https://github.com/documize/community/releases)
6262

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

6565
## OS support
6666

domain/document/export.go

+4-4
Large diffs are not rendered by default.

domain/organization/endpoint.go

+87
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,90 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
9696

9797
response.WriteJSON(w, org)
9898
}
99+
100+
// GetInstanceSetting returns the requested organization level setting.
101+
func (h *Handler) GetInstanceSetting(w http.ResponseWriter, r *http.Request) {
102+
ctx := domain.GetRequestContext(r)
103+
104+
orgID := request.Param(r, "orgID")
105+
if orgID != ctx.OrgID || !ctx.Administrator {
106+
response.WriteForbiddenError(w)
107+
return
108+
}
109+
110+
key := request.Query(r, "key")
111+
setting, _ := h.Store.Setting.GetUser(orgID, "", key, "")
112+
if len(setting) == 0 {
113+
setting = "{}"
114+
}
115+
116+
response.WriteJSON(w, setting)
117+
}
118+
119+
// SaveInstanceSetting saves org level setting.
120+
func (h *Handler) SaveInstanceSetting(w http.ResponseWriter, r *http.Request) {
121+
method := "org.SaveInstanceSetting"
122+
ctx := domain.GetRequestContext(r)
123+
124+
orgID := request.Param(r, "orgID")
125+
if orgID != ctx.OrgID || !ctx.Administrator {
126+
response.WriteForbiddenError(w)
127+
return
128+
}
129+
130+
key := request.Query(r, "key")
131+
132+
defer streamutil.Close(r.Body)
133+
body, err := ioutil.ReadAll(r.Body)
134+
if err != nil {
135+
response.WriteServerError(w, method, err)
136+
h.Runtime.Log.Error(method, err)
137+
return
138+
}
139+
140+
config := string(body)
141+
h.Store.Setting.SetUser(orgID, "", key, config)
142+
143+
response.WriteEmpty(w)
144+
}
145+
146+
// GetGlobalSetting returns the requested organization level setting.
147+
func (h *Handler) GetGlobalSetting(w http.ResponseWriter, r *http.Request) {
148+
ctx := domain.GetRequestContext(r)
149+
150+
if !ctx.Global {
151+
response.WriteForbiddenError(w)
152+
return
153+
}
154+
155+
key := request.Query(r, "key")
156+
setting, _ := h.Store.Setting.Get(key, "")
157+
158+
response.WriteJSON(w, setting)
159+
}
160+
161+
// SaveGlobalSetting saves org level setting.
162+
func (h *Handler) SaveGlobalSetting(w http.ResponseWriter, r *http.Request) {
163+
method := "org.SaveGlobalSetting"
164+
ctx := domain.GetRequestContext(r)
165+
166+
if !ctx.Global {
167+
response.WriteForbiddenError(w)
168+
return
169+
}
170+
171+
key := request.Query(r, "key")
172+
173+
defer streamutil.Close(r.Body)
174+
body, err := ioutil.ReadAll(r.Body)
175+
if err != nil {
176+
response.WriteServerError(w, method, err)
177+
h.Runtime.Log.Error(method, err)
178+
return
179+
}
180+
181+
config := string(body)
182+
h.Store.Setting.Set(key, config)
183+
184+
response.WriteEmpty(w)
185+
}

0 commit comments

Comments
 (0)