mirror of
https://github.com/documize/community.git
synced 2025-07-22 14:49:42 +02:00
Add --None-- option to edit page
This commit is contained in:
parent
d655f1b42f
commit
8867b27152
3 changed files with 61 additions and 49 deletions
|
@ -117,6 +117,9 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
this.set('config.board', boards.findBy('id', board.id));
|
this.set('config.board', boards.findBy('id', board.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is.null(board.id) || is.undefined(board.id)) {
|
||||||
|
self.set('busy', false);
|
||||||
|
} else {
|
||||||
this.get('sectionService').fetch(page, "lists", self.get('config'))
|
this.get('sectionService').fetch(page, "lists", self.get('config'))
|
||||||
.then(function (lists) {
|
.then(function (lists) {
|
||||||
let savedLists = self.get('config.lists');
|
let savedLists = self.get('config.lists');
|
||||||
|
@ -141,6 +144,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.showNotification("Unable to fetch board lists");
|
self.showNotification("Unable to fetch board lists");
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -203,8 +207,9 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.get('sectionService').fetch(page, "boards", self.get('config'))
|
self.get('sectionService').fetch(page, "boards", self.get('config'))
|
||||||
.then(function (boards) {
|
.then(function (boards) {
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('boards', boards);
|
boards.unshift({ id: null, name: "--None--", backgroundColor: "white" }); // add the non-selection to the front
|
||||||
self.set('config.boards', boards); // save the boards in the config too
|
self.set('config.boards', boards); // save the boards in the config too
|
||||||
|
self.set('boards', boards);
|
||||||
self.getBoardLists();
|
self.getBoardLists();
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) { //jshint ignore: line
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
<div class="tip">All boards are selectd by default</div>
|
<div class="tip">All boards are selectd by default</div>
|
||||||
<div class="github-board">
|
<div class="github-board">
|
||||||
{{#each config.boards as |board|}}
|
{{#each config.boards as |board|}}
|
||||||
|
{{#if board.id}}
|
||||||
<div class="github-list" {{action 'onBoardCheckbox' board.id}}>
|
<div class="github-list" {{action 'onBoardCheckbox' board.id}}>
|
||||||
{{#if board.included}}
|
{{#if board.included}}
|
||||||
<i class="material-icons widget-checkbox checkbox-gray github-list-checkbox">check_box</i>
|
<i class="material-icons widget-checkbox checkbox-gray github-list-checkbox">check_box</i>
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<span style="background-color: {{board.prefs.backgroundColor}}">{{board.name}}</span>
|
<span style="background-color: {{board.prefs.backgroundColor}}">{{board.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<div class="clearfix" />
|
<div class="clearfix" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,6 +48,7 @@
|
||||||
<div class="tip">Select board</div>
|
<div class="tip">Select board</div>
|
||||||
{{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="name" selection=config.board}}
|
||||||
</div>
|
</div>
|
||||||
|
{{#if config.board.id}}
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>Lists</label>
|
<label>Lists</label>
|
||||||
<div class="tip">Select lists to include</div>
|
<div class="tip">Select lists to include</div>
|
||||||
|
@ -64,6 +67,7 @@
|
||||||
<div class="clearfix" />
|
<div class="clearfix" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -224,7 +224,7 @@ func (*Provider) Refresh(ctx *provider.Context, config, data string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, board := range c.Boards {
|
for _, board := range c.Boards {
|
||||||
if board.Included {
|
if board.Included && board.ID != "" {
|
||||||
var payload = trelloRenderBoard{}
|
var payload = trelloRenderBoard{}
|
||||||
|
|
||||||
c.Board = board
|
c.Board = board
|
||||||
|
@ -315,6 +315,9 @@ func getBoards(config trelloConfig) (boards []trelloBoard, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getLists(config trelloConfig) (lists []trelloList, err error) {
|
func getLists(config trelloConfig) (lists []trelloList, err error) {
|
||||||
|
if config.Board.ID == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
uri := fmt.Sprintf("https://api.trello.com/1/boards/%s/lists/open?key=%s&token=%s", config.Board.ID, config.AppKey, config.Token)
|
uri := fmt.Sprintf("https://api.trello.com/1/boards/%s/lists/open?key=%s&token=%s", config.Board.ID, config.AppKey, config.Token)
|
||||||
req, err := http.NewRequest("GET", uri, nil)
|
req, err := http.NewRequest("GET", uri, nil)
|
||||||
log.IfErr(err)
|
log.IfErr(err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue