diff --git a/app/app/components/section/trello/type-editor.js b/app/app/components/section/trello/type-editor.js index e0cac549..87a6470d 100644 --- a/app/app/components/section/trello/type-editor.js +++ b/app/app/components/section/trello/type-editor.js @@ -207,7 +207,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, self.get('sectionService').fetch(page, "boards", self.get('config')) .then(function (boards) { self.set('busy', false); - boards.unshift({ id: null, name: "--None--", backgroundColor: "white" }); // add the non-selection to the front + boards.unshift({ id: null, namePath: "< do not show >", backgroundColor: "white" }); // add the non-selection to the front self.set('config.boards', boards); // save the boards in the config too self.set('boards', boards); self.getBoardLists(); diff --git a/app/app/templates/components/section/trello/type-editor.hbs b/app/app/templates/components/section/trello/type-editor.hbs index 5eb38373..f772b9ca 100644 --- a/app/app/templates/components/section/trello/type-editor.hbs +++ b/app/app/templates/components/section/trello/type-editor.hbs @@ -51,7 +51,7 @@
Select board
- {{ui-select id="boards-dropdown" content=boards action=(action 'onBoardChange') optionValuePath="id" optionLabelPath="name" selection=config.board}} + {{ui-select id="boards-dropdown" content=boards action=(action 'onBoardChange') optionValuePath="id" optionLabelPath="namePath" selection=config.board}}
{{#if config.board.id}}
diff --git a/core/section/trello/activitytranslation.go b/core/section/trello/activitytranslation.go new file mode 100644 index 00000000..133ee089 --- /dev/null +++ b/core/section/trello/activitytranslation.go @@ -0,0 +1,17 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +package trello + +var activityTranslation = map[string]string{ + "comment card": "comment on card", // TODO, this just to prove the method + "update board": "", // TODO, this just to test the delete functionality +} diff --git a/core/section/trello/model.go b/core/section/trello/model.go index c583d442..5d4da504 100644 --- a/core/section/trello/model.go +++ b/core/section/trello/model.go @@ -184,6 +184,7 @@ type trelloBoard struct { Purple string `json:"purple"` } `json:"labelNames"` Included bool `json:"included"` // indicates whether we display this board + NamePath string `json:"namePath"` // the "team / board" form } type trelloBoardBackground struct { diff --git a/core/section/trello/trello.go b/core/section/trello/trello.go index 5dc86502..23ed12b3 100644 --- a/core/section/trello/trello.go +++ b/core/section/trello/trello.go @@ -19,6 +19,7 @@ import ( "io/ioutil" "net/http" "sort" + "strings" "time" "unicode" @@ -335,6 +336,7 @@ func getBoards(config *trelloConfig) (boards []trelloBoard, err error) { if !b.Closed && len(b.OrganizationID) > 0 { if o, e := getOrg(config, b.OrganizationID); e == nil { b.OrgName = o.Name + b.NamePath = o.Name + " / " + b.Name } else { log.Error("failed to get organisation infomation", e) } @@ -585,7 +587,7 @@ func buildPayloadAnalysis(config *trelloConfig, render *trelloRender) { if _, exists := labels[lab.Name]; !exists { labels[lab.Name] = labT{color: lab.Color, boards: make(map[string]trelloBoard)} } - labels[lab.Name].boards[brd.Board.URL+"::"+brd.Board.Name] = brd.Board + labels[lab.Name].boards[brd.Board.URL+" / "+brd.Board.Name] = brd.Board } // process member stats @@ -612,7 +614,13 @@ func buildPayloadAnalysis(config *trelloConfig, render *trelloRender) { englishType += string(c) } } - render.Boards[brdIdx].ActionSummary[englishType]++ + englishType = strings.Replace(englishType, "organization", "team", -1) + if newTxt, found := activityTranslation[englishType]; found { + englishType = newTxt + } + if len(englishType) > 0 { + render.Boards[brdIdx].ActionSummary[englishType]++ + } } }