mirror of
https://github.com/documize/community.git
synced 2025-08-09 15:35:27 +02:00
Handle errors better, improve wording
This commit is contained in:
parent
be05b21c5f
commit
e2312b9632
3 changed files with 33 additions and 21 deletions
|
@ -182,8 +182,11 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
|||
|
||||
renderSwitch(thisReport) {
|
||||
|
||||
$.datetimepicker.setLocale('en');
|
||||
$('#branch-since').datetimepicker();
|
||||
if (is.undefined(this.get('initDateTimePicker'))) {
|
||||
$.datetimepicker.setLocale('en');
|
||||
$('#branch-since').datetimepicker();
|
||||
this.set('initDateTimePicker', "Done");
|
||||
}
|
||||
|
||||
let bl = this.get('config.branchLines');
|
||||
if (is.undefined(bl) || bl === "" || bl <= 0) {
|
||||
|
|
|
@ -578,7 +578,7 @@ func (t *Provider) Refresh(configJSON, data string) string {
|
|||
|
||||
if err != nil {
|
||||
log.Error("unable to unmarshall github config", err)
|
||||
return data
|
||||
return "internal configuration error '" + err.Error() + "'"
|
||||
}
|
||||
|
||||
c.Clean()
|
||||
|
@ -637,7 +637,7 @@ func (p *Provider) Render(config, data string) string {
|
|||
|
||||
if err != nil {
|
||||
log.Error("unable to unmarshall github config", err)
|
||||
return "Documize internal github json umarshall config error: " + err.Error()
|
||||
return "Please delete and recreate this Github section."
|
||||
}
|
||||
|
||||
c.Clean()
|
||||
|
@ -682,18 +682,23 @@ func (p *Provider) Render(config, data string) string {
|
|||
err = json.Unmarshal([]byte(data), &raw)
|
||||
if err != nil {
|
||||
log.Error("unable to unmarshall github issue data", err)
|
||||
return "Documize internal github json umarshall open data error: " + err.Error()
|
||||
return "Documize internal github json umarshall open data error: " + err.Error() + "<BR>" + data
|
||||
}
|
||||
}
|
||||
payload.Issues = raw
|
||||
if len(c.Lists) > 0 {
|
||||
for _, v := range c.Lists {
|
||||
if v.Included {
|
||||
payload.ShowList = true
|
||||
break
|
||||
if strings.TrimSpace(c.IssuesText) != "" {
|
||||
payload.ShowIssueNumbers = true
|
||||
payload.DateMessage = c.IssuesText
|
||||
} else {
|
||||
if len(c.Lists) > 0 {
|
||||
for _, v := range c.Lists {
|
||||
if v.Included {
|
||||
payload.ShowList = true
|
||||
break
|
||||
}
|
||||
}
|
||||
payload.List = c.Lists
|
||||
}
|
||||
payload.List = c.Lists
|
||||
}
|
||||
|
||||
default: // to handle legacy data, this handles commits
|
||||
|
@ -702,7 +707,7 @@ func (p *Provider) Render(config, data string) string {
|
|||
|
||||
if err != nil {
|
||||
log.Error("unable to unmarshall github commit data", err)
|
||||
return "Documize internal github json umarshall data error: " + err.Error()
|
||||
return "Documize internal github json umarshall data error: " + err.Error() + "<BR>" + data
|
||||
}
|
||||
c.ReportInfo.ID = "commits_data"
|
||||
payload.BranchCommits = raw
|
||||
|
|
|
@ -20,13 +20,14 @@ import (
|
|||
)
|
||||
|
||||
type githubRender struct {
|
||||
Config githubConfig
|
||||
Repo githubRepo
|
||||
List []githubBranch
|
||||
ShowList bool
|
||||
BranchCommits []githubBranchCommits
|
||||
CommitCount int
|
||||
Issues []githubIssue
|
||||
Config githubConfig
|
||||
Repo githubRepo
|
||||
List []githubBranch
|
||||
ShowList bool
|
||||
ShowIssueNumbers bool
|
||||
BranchCommits []githubBranchCommits
|
||||
CommitCount int
|
||||
Issues []githubIssue
|
||||
//IssueNum int
|
||||
//IssueNumActivity []githubIssueActivity
|
||||
Limit int
|
||||
|
@ -76,9 +77,12 @@ var renderTemplates = map[string]string{
|
|||
<span style="background-color:#{{$label.Color}}">{{$label.Name}}</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}};
|
||||
{{if .ShowIssueNumbers}}
|
||||
issue(s) {{ .DateMessage }}.
|
||||
{{else}}
|
||||
up to {{ .Limit }} items are shown{{ .DateMessage }}.
|
||||
{{end}}
|
||||
.
|
||||
Up to {{ .Limit }} items are shown{{ .DateMessage }}.
|
||||
</p>
|
||||
<div class="github-board">
|
||||
<ul class="github-list">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue