1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 21:29:42 +02:00

github section fixed code handling

This commit is contained in:
Harvey Kandola 2016-11-12 13:50:42 -08:00
parent e7431954a0
commit deaa553205
4 changed files with 11 additions and 5 deletions

View file

@ -43,7 +43,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
pageId: page.get('id'), pageId: page.get('id'),
showMilestones: false, showMilestones: false,
showIssues: false, showIssues: false,
showCommits: false, showCommits: true,
}; };
try { try {
@ -58,14 +58,19 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
config.showCommits = metaConfig.showCommits; config.showCommits = metaConfig.showCommits;
} catch (e) {} } catch (e) {}
if (_.isUndefined(config.showCommits)) {
config.showCommits = true;
}
self.set('config', config); self.set('config', config);
self.set('config.pageId', page.get('id')); self.set('config.pageId', page.get('id'));
// On auth callback capture code // On auth callback capture code
let code = window.location.search; let code = window.location.search;
code = code.replace("?mode=edit", "");
if (is.not.undefined(code) && is.not.null(code) && is.not.empty(code) && code !== "") { if (is.not.undefined(code) && is.not.null(code) && is.not.empty(code) && code !== "") {
let tok = code.replace("?mode=edit&code=", ""); let tok = code.replace("&code=", "");
self.get('sectionService').fetch(page, "saveSecret", { "token": tok }) self.get('sectionService').fetch(page, "saveSecret", { "token": tok })
.then(function () { .then(function () {
self.send('authStage2'); self.send('authStage2');
@ -120,7 +125,6 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
$('#branch-since').datetimepicker(); $('#branch-since').datetimepicker();
this.set('initDateTimePicker', "Done"); this.set('initDateTimePicker', "Done");
} }
}, },
getOrgReposLists() { getOrgReposLists() {

View file

@ -25,7 +25,8 @@ export default Ember.Controller.extend(NotifierMixin, {
let meta = { let meta = {
documentId: this.get('model.document.id'), documentId: this.get('model.document.id'),
rawBody: "", rawBody: "",
config: "" config: "",
externaleSource: true
}; };
let model = { let model = {

View file

@ -80,7 +80,6 @@
list-style: none; list-style: none;
cursor: pointer; cursor: pointer;
padding: 20px; padding: 20px;
float: left;
@include ease-in(); @include ease-in();
&:hover { &:hover {

View file

@ -18,8 +18,10 @@
<div class="github-view"> <div class="github-view">
{{input id="show-milestone" checked=config.showMilestones type="checkbox"}} {{input id="show-milestone" checked=config.showMilestones type="checkbox"}}
<label>Show Milestones</label> <label>Show Milestones</label>
<br/>
{{input id="show-issues" checked=config.showIssues type="checkbox"}} {{input id="show-issues" checked=config.showIssues type="checkbox"}}
<label>Show Issues</label> <label>Show Issues</label>
<br/>
{{input id="show-commits" checked=config.showCommits type="checkbox" }} {{input id="show-commits" checked=config.showCommits type="checkbox" }}
<label>Show Commits</label> <label>Show Commits</label>
</div> </div>